-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework Multiblock Abilities #2420
base: master
Are you sure you want to change the base?
Conversation
0c22cbd
to
6b8c11a
Compare
b58ef1c
to
f6b840f
Compare
6bdc2d7
to
6d0fcf2
Compare
6d0fcf2
to
dff15e9
Compare
829ea5f
to
04ad422
Compare
src/main/java/gregtech/api/capability/impl/MultiblockRecipeLogic.java
Outdated
Show resolved
Hide resolved
for (IMultiblockPart multiblockPart : parts) { | ||
if (multiblockPart instanceof IMultiblockAbilityPart) { | ||
@SuppressWarnings("unchecked") | ||
IMultiblockAbilityPart<Object> abilityPart = (IMultiblockAbilityPart<Object>) multiblockPart; | ||
List<Object> abilityInstancesList = abilities.computeIfAbsent(abilityPart.getAbility(), | ||
k -> new ArrayList<>()); | ||
abilityPart.registerAbilities(abilityInstancesList); | ||
for (IMultiblockPart part : parts) { | ||
if (part instanceof IMultiblockAbilityPart abilityPart) { | ||
List<MultiblockAbility> abilityList = abilityPart.getAbilities(); | ||
for (MultiblockAbility ability : abilityList) { | ||
List abilityInstancesList = abilities.computeIfAbsent(ability, | ||
k -> new ArrayList<>()); | ||
abilityInstancesList.addAll(abilityPart.registerAbilities(ability)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens here if a single multiblock part has IMPORT_ITEMS
and IMPORT_FLUIDS
, but the multiblock only allows one of these in the structure at that position. Should the part be allowed or rejected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a method that skips adding abilities at certain positions, but should i just invalidate the multiblock instead?
3700d34
to
bfd2e2f
Compare
fd8136b
to
4ac4934
Compare
src/main/java/gregtech/api/capability/impl/MultiblockRecipeLogic.java
Outdated
Show resolved
Hide resolved
src/main/java/gregtech/api/metatileentity/multiblock/MultiblockAbility.java
Outdated
Show resolved
Hide resolved
ce00ff9
to
734585c
Compare
spotless
missed spot for checking fluids in mrl
remove warn
some javadocs
spotless
…nstead of sealed class casually rework DualEntry to not be an item handler
fix distinct fluids
7e565d2
to
73bc303
Compare
spotless
clarify existing check at set use simple name instead of class string
What
Reworks
IMultiblockAbilityPart
to allow for multiple abilities from one part.MultiblockRecipeLogic
checks if an item handler could also be a fluid handler (only for distinct mode atm)Implements a ghost circuit slot for single-tank fluid input hatches.
Implementation Details
add a class to
MultiblockAbility
's constructor so that class types can be checkedadd a new class to store instances of a
MultilbockAbility
. types are checked and an exception is thrown when the wrong type is added.a new class,
DualHandler
, is added to implement item and fluid handling capabilities. (not used for anything atm)Should multitank fluid hatches (quad/nonuple) have ghost circuits as well?
Outcome
fluid hatches are more spooky