fix(ChestContainer): Fix chest containers not recognizing some chest like containers#280
Conversation
beanbag44
left a comment
There was a problem hiding this comment.
Im not sure what this solves. Although it makes it possible to create a ChestContainer object for at least most external block entity containers in the game, the class is still called ChestContainer so the name would be misleading, and the ContainerManager still functions the same way, only creating instances for chests
c0683e2 to
d4a40de
Compare
|
I renamed ChestContainer to LootableContainer. This should now include all containers that can be looted. |
…ntainers # Conflicts: # src/main/kotlin/com/lambda/interaction/material/container/containers/LootableContainer.kt
| is ChestBlockEntity -> { | ||
| // ToDo: Handle double chests and single chests | ||
| if (handler.type != ScreenHandlerType.GENERIC_9X6) return@listen | ||
| is LootableContainerBlockEntity -> { |
There was a problem hiding this comment.
you removed the todo for handling double chests but this does not fix the double chest issue. This is part of my worry about merging all external containers aside from ender chests into one. It removes flexibility for unique containers. Also, there will likely be cases where the type of container needs to be known. I think we should just stick to separate types.
There was a problem hiding this comment.
Double chests could be fixed by combining both inventories into one container location. I have done that with my stash movers before. I think if you need a more specific container type, you can always extend this one.
There was a problem hiding this comment.
I agree that there should be a base open class for containers, but this class isnt suited towards that. It takes a blockPos in the constructor, which wouldnt apply well for double chests as they consist of two positions. The class also isnt open, and its a data class which cant be inherited from, etc
Lootable containers should include pretty much all containers in the game we would want to take items out of