Custom Machine Problems

  • Hey everyone, I'm working on a Mod as Addon to IC2. Right now everything works like it should, except two things:


    - My Machine converts certain Blocks into Void-Material. This will be used in other Machines, but that doesn't Matter now. I'm saving the Amount via NBT like the Energy, but everytime I update the Block (From working into stopping for example) it loses all Void-Material, but NOT the energy or something else. Just the Void :/
    EDIT: It also Disconnects from the IC2-Net (Energy-Cables won't connect to it anymore and it won't receive any Energy).


    - Another problem is that you're able to put any Item/Block into the Container which will transform it into Void. But it should only accept certain Items/Blocks tho.


    Files now:
    Block: http://pastebin.com/9FgyhRa2
    TileEntity: http://pastebin.com/mY6A9xE2
    Container: http://pastebin.com/62k1reZz


    I hope you can help me out since I struggle with these Problems since a week and didn't find a solution yet :/
    Thanks in advance, PreFiX

    • Official Post

    Don't replace the block in updateActivity, that's not a good option these days. It's enough to have the state in the tile entity and only call markdirty to force re-rendering.


    The alternate state's different block icon can be implemented with getIcon. There's a version of that method providing world+coordinates, which you can then use to fetch the tile entity and its active state.