-
Notifications
You must be signed in to change notification settings - Fork 95
Add structure-like support for multiblock shapes #932
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
Conversation
653ba34 to
7c90a8b
Compare
…being capable of both functionalities
|
For structures with block entity NBT requirements, if an NBT tag is not specified within the required NBT data but is present on the block entity being checked, does the check fail hard as the extra NBT must not be present, or is the extra NBT ignored? For example, if I want to require a player head with a specific texture as part of the structure (with said head being obtainable by other means), will I need to specify all parts of the profile data, or can I leave out a part and still get a match when someone builds my custom multiblock? |
|
It uses strict matching. If the NBT for a block in the file is completely omitted, then it will not check will not check against the NBT in world. If there is NBT present, it must be an exact match to the NBT in world. I have plans to add a structure wrench item to allow you to exclude specific blocks in the multiblock shape from checking NBT even if you have "Include NBT" enabled. I also have plans to allow for NBT being defined in the text boxes for the structure member block so you can specify what parts of the NBT to check against. |
|
Is it possible to specify that the block at a specific position MUST be air lest the multiblock not form? |
|
Yes, you can use the member block and set the member as air. |
# Conflicts: # docs/ADDING_MACHINES.md # src/client/java/aztech/modern_industrialization/MIClient.java # src/client/java/aztech/modern_industrialization/client/MIRenderTypes.java # src/client/java/aztech/modern_industrialization/compat/viewer/impl/MachineScreenPredicateTest.java # src/client/java/aztech/modern_industrialization/machines/gui/MachineMenuClient.java # src/client/java/aztech/modern_industrialization/machines/gui/MachineScreen.java # src/client/java/aztech/modern_industrialization/machines/models/MachineBakedModel.java # src/client/java/aztech/modern_industrialization/machines/models/MachineUnbakedModel.java # src/client/java/aztech/modern_industrialization/machines/multiblocks/MultiblockMachineBER.java # src/client/java/aztech/modern_industrialization/util/RenderHelper.java # src/generated/resources/assets/modern_industrialization/lang/en_us.json # src/main/java/aztech/modern_industrialization/api/energy/CableTier.java # src/main/java/aztech/modern_industrialization/compat/kubejs/machine/RegisterCasingsEventJS.java # src/main/java/aztech/modern_industrialization/datagen/translation/TranslationProvider.java # src/main/java/aztech/modern_industrialization/debug/DebugCommands.java # src/main/java/aztech/modern_industrialization/inventory/BackgroundRenderedSlot.java # src/main/java/aztech/modern_industrialization/machines/ComponentStorage.java # src/main/java/aztech/modern_industrialization/machines/MachineBlockEntity.java # src/main/java/aztech/modern_industrialization/machines/blockentities/hatches/EnergyHatch.java # src/main/java/aztech/modern_industrialization/machines/blockentities/multiblocks/AbstractCraftingMultiblockBlockEntity.java # src/main/java/aztech/modern_industrialization/machines/blockentities/multiblocks/AbstractElectricCraftingMultiblockBlockEntity.java # src/main/java/aztech/modern_industrialization/machines/blockentities/multiblocks/GeneratorMultiblockBlockEntity.java # src/main/java/aztech/modern_industrialization/machines/blockentities/multiblocks/LargeTankMultiblockBlockEntity.java # src/main/java/aztech/modern_industrialization/machines/blockentities/multiblocks/NuclearReactorMultiblockBlockEntity.java # src/main/java/aztech/modern_industrialization/machines/blockentities/multiblocks/SteamBoilerMultiblockBlockEntity.java # src/main/java/aztech/modern_industrialization/machines/blockentities/multiblocks/SteamCraftingMultiblockBlockEntity.java # src/main/java/aztech/modern_industrialization/machines/components/CasingComponent.java # src/main/java/aztech/modern_industrialization/machines/components/OrientationComponent.java # src/main/java/aztech/modern_industrialization/machines/gui/MachineMenuServer.java # src/main/java/aztech/modern_industrialization/machines/models/MachineCasing.java # src/main/java/aztech/modern_industrialization/machines/models/MachineCasings.java # src/main/java/aztech/modern_industrialization/machines/multiblocks/MultiblockMachineBlockEntity.java # src/main/java/aztech/modern_industrialization/machines/multiblocks/ShapeMatcher.java # src/main/java/aztech/modern_industrialization/network/machines/ChangeShapePacket.java # src/main/java/aztech/modern_industrialization/network/machines/ReiLockSlotsPacket.java # src/main/java/aztech/modern_industrialization/network/machines/SetAutoExtractPacket.java # src/main/resources/modern_industrialization.mixins.json
This is in a "somewhat done" state. It is not ready to be merged. This relies on some other pull requests, and this needs to go through some testing and extra refinement first.
My plans for things that need to be addressed:
The documentation needs to be updated to explain how to use this system. Including screenshots would be ideal
Include the block requirements for framed blocks in the recipe viewer
Include tooltip when looking at a block in the hologram that requires other blocks to go inside it (like framed blocks) / or maybe flip through the framed block without nbt and the one with
MIStructureTemplateManager is pretty messy and I am unhappy with how it works. I'm not sure what could be done about this.
ShapeTemplate may benefit from a bit of a rewrite that makes it better follow OOP standards. Right now, when I need to check if a ShapeTemplate is a structure ShapeTemplate, I have to iterate over all of the members and ensure they are StructureMembers. Quite messy :P
Here are some things that may need addressing:
This system at the moment is not used for the Large Tank and Nuclear Reactor multiblock shapes. Reason being both of these have functionality inherently linked to their shapes. No clue how this could be addressed, if at all. May be fine to just leave them as-is.
While this system is being used for the Distillation Tower, there is a config option that lets you change the max height of the tower. As a quick "fix" for this, I have added structures for the Distillation Tower up to height 15 and it only uses them based on the config. The game will crash if the height is set to anything beyond 15, because the structure can't be found. Here are some possible solutions: