#Preventing Items from Being Placed in Chests and Barrels – Best Methods?
11 messages · Page 1 of 1 (latest)
check how shulkers do it
i have check it uses the canBeNested method which would work but only does this check in bundles and shulkerboxes
which is good but i would like a global check for every inventory slot
maybe use a mixin to edit the canBeNested method to include the rest?
Yeah i got it working after some testing. I changed the Slot class i dont really like this method currently because my current code would apply to ALL slots which is a bit overkill.
Changing the canBeNested method would not work I think because the ChestEntityBlock (also does not work for the barrel block) do not implement that method.
I will try to look at other ideas any other suggestions are very welcome. I am still new to modding but i do have allot of programming experience so technical or advanced ideas are also welcome
If this is a server-side mod this is gonna get funky
but if this is a client side (or both and the client mod require the server mod)
that you can just make inventory moves when opening a chess or barrel menu
check canbeNested
Its both client and server