Schema parts catalyst#5050
Conversation
… previews, clean up size for terminal and emi schema
| public static Function<MultiblockMachineDefinition, IBlockPattern> getPattern() { | ||
| return (definition) -> { | ||
| PatternPredicate wallPredicate = getValidFloorBlocks().or(states(getCasingState(), getGlassState())); | ||
| PatternPredicate wallPredicate = states(getCasingState(), getGlassState()).or(getValidFloorBlocks()); |
There was a problem hiding this comment.
getValidFloorBlocks() shouldn't even exist IMO, just make plastcrete part of the cleanroom floors tag
screret
left a comment
There was a problem hiding this comment.
You didn't implement the input/output stuff for REI or JEI, why?
|
|
||
| public MultiblockInfoEmiWrapper(MultiblockMachineDefinition definition) { | ||
| super(definition.getId(), () -> new MultiblockPreviewWidget(definition, null)); | ||
| super(definition.getId(), () -> new MultiblockPreviewWidget(definition, null, 200, 180)); |
There was a problem hiding this comment.
Why is this slightly shorter than the terminal's viewer?
There was a problem hiding this comment.
Because emi doesn't take into account the header to determine the max size so it was going off the main panel
| sliceRepeats.put(i, blockPattern.getSlices()[i].getMinRepeats()); | ||
| } | ||
| structureHelper = AbstractStructureHelper.blockPattern(sliceRepeats); | ||
| } else if (pattern instanceof ExpandablePattern expandablePattern) { |
There was a problem hiding this comment.
Why is ExpandablePattern still a 90% copypaste of BlockPattern with minor changes to the iteration logic and not a subclass?
Honestly, thinking abt it, expandable should be the only option that exists and "normal" patterns simply only allow expanding in one direction
There was a problem hiding this comment.
Idts, repeatable patterns allow stuff like "A(BC)*D" e.g. "ABCBCBCD" but that doesn't work in more than 1 dimension. They should be 2 seperate classes with seperate logics/viewers/etc
There was a problem hiding this comment.
also out of scope for this PR
There was a problem hiding this comment.
What? Expandable patterns allow for expansion in all 6 axis, where al block only allows in the relative direction the dev defines in the multi definition
|
|
||
| private final MultiblockMachineDefinition definition; | ||
| private SlotWidget slotWidget; | ||
| private final List<EmiStack> outputBlocks = new ArrayList<>(); |
There was a problem hiding this comment.
Rename this to containedBlocks; they aren't actually outputs, after all.
| resultStructure.values().stream() | ||
| .map(BlockInfo::getBlockState) | ||
| .collect(Collectors.toSet()) | ||
| .forEach(block -> outputBlocks.add(EmiStack.of(block.getBlock()))); |
There was a problem hiding this comment.
The pattern's blocks should be INPUTS in the multiblock's "recipe". IMO only the controller should be classified as an output.
There was a problem hiding this comment.
agreed, either this or we make all blocks both inputs and outputs so they're "most visible", I could take eitehr
There was a problem hiding this comment.
IMO they should be specifically inputs so (for example) creating AE2 patterns for "a multiblock" will be easy
Mui doesn't even work with jei and rei atm |
|
well, you should still implement it so it won't be forgotten when jei/rei is supported |
| .forEach(userDimensions::add); | ||
| structureHelper = AbstractStructureHelper.expandable(userDimensions); | ||
| } | ||
| if (structureHelper != null) { |
There was a problem hiding this comment.
do we care about letting other mods impl subclasses of IBlockPattern? if so, how would we do stuff like this? (might be a discussion for later since that's relevant to other call sites than this one as well)
| resultStructure.values().stream() | ||
| .map(BlockInfo::getBlockState) | ||
| .collect(Collectors.toSet()) | ||
| .forEach(block -> outputBlocks.add(EmiStack.of(block.getBlock()))); |
There was a problem hiding this comment.
agreed, either this or we make all blocks both inputs and outputs so they're "most visible", I could take eitehr
What
Fix schema widget offset when in emi and terminal
Add all parts of a multi to its input and output list
attempt to rotate the camera properly in the terminal so it faces the multi center
Implementation Details
see above
AI Usage
Outcome
cleaner emi and terminal usage
How Was This Tested
ingame