Posted February 28, 201312 yr Hi everyone! I'm constructing kinda strange entity container block, which contains one other item/block (like pipe or wire) for each of its sides. What I wanna is to make my container simulate like it's one of its contained items. Example: I'm putting glass cable into my container's west slot, then put regular glass wire adjacent to it, and when glass wire block looks up for the neighbour wire blocks, my container pretends to be glass wire and the two happily connect. Per my investigation on MC code, there's always World.getBlockTileEntity that returns exact raw entity for the provided coordinate, without any notion of requester's identity. So my crazy idea seems to be impossible to implement. But I'm pretty new to Minecraft modding and might be mistaken. Thanks
February 28, 201312 yr eh, if I'm correct it could be done using ASM library - adding a hook to the getBlockTileEntity (you have to be a core mod in order to be able to do that), then you could find out who's called that method (more here or here). but the perfomance cost wouldn't be small and it is quite extreme and messy solution. I don't recommend this, but it is imho doable... mnn.getNativeLang() != English If I helped you please click on the "thank you" button.
February 28, 201312 yr Author I don't think it would be a good idea for me to use instrumentation and like, as i highly doubt that other people would be grateful for such a hack Anyway, many thanks for confirming my suspicions. [EDIT] At least, TileEntity retrieval can be hooked by wrapping getChunkBlockTileEntity via instrumentation. Still requires ASM toolset and a coremod, though can partially solve issue with posing one entity as other one.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.