-
Notifications
You must be signed in to change notification settings - Fork 150
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
[BUG] Multiblock Item/Fluid IO blocks don't have comparator output #1702
Comments
You are looking in the wrong place. :-) The buses and hatches are tile entities, while the IBlockState is for the block.
This delegates to the tile entity which after some caching eventually gets to this method (default implementation is 0 output):
The issue is, the buses and hatches don't override that method. For the item bus, it should be easy to implement by doing something similar to the chests: GregTech/src/main/java/gregtech/common/metatileentities/storage/MetaTileEntityChest.java Line 180 in d9e7ed4
For the fluid hatches, it would need to do something similar to the tanks: GregTech/src/main/java/gregtech/common/metatileentities/storage/MetaTileEntityTank.java Line 579 in d9e7ed4
And for the energy hatches something similar to what the abstract tiered metatileentity does with its energy container
Be careful though. This might not be as straightforward as I describe. Or maybe it should show the values from the whole multiblock and not just the single bus/hatch? |
Thank you so much for giving such a comprehensive response so quickly! I've been reinvigorated to get this working haha I see what you mean on implementation, and i think you could achieve the total output scenario by simply combining single comparator functionality on multiple blocks if you need (running something like EnderIO with redstone conduits and sensor upgrades would make that not look horrendous and be somewhat compact) but even still, a "Redstone IO Hatch" for reading specific things would be interesting too thanks again! |
Describe the bug
All forms multiblock items (Item input/Output bus, Fluid input/output hatch) don't output a comparator signal akin to other container-like blocks
Versions
Forge:
GTCE: 1.8.419
Modpack:: Omnifactory (1.2.2)
Addons:: N/A
Setup
In any world, on any server, in any scenario
Steps To Reproduce
Expected behavior
A redstone signal akin to the percentage filled the container is, you know what a comparator does
Screenshots
N/A
Additional context
In my attempts to fix this problem, I noticed (through this deobfuscated, decompiled minecraft source repo) that the comparator retrieves a block to process the methods hasComparatorInputOverride() and getComparatorInputOverride(World, BlockPos) through a world call to getBlockState(BlockPos): IBlockState. As far as i'm aware, MetaTileEntityItemBus - and any hatch that extends MetaTileEntityMultiblockPart - isn't and doesn't inherit IBlockState in any capacity, so World.getBlockState(BlockPos) doesn't return the MetaTileEntityItemBus instance to get the input bus / whatever MetaTileEntityMultiblockPart extension under gregtech.common.metatileentities.electric.multiblockpart to call the right methods
I would attempt to fix this problem myself, but I'm not experienced with modding Minecraft, so I'll leave it as a bug here, apologies if this disregards an intended format
The text was updated successfully, but these errors were encountered: