Suggestion: Addon development: interface IHasGui compatibility with Entities

  • I have used IHasGui for my addon. It is a very user-friendly interface, that make gui handling much easier. But i have noticed, that IHasGui is not applicable for Entities. Digging in IC2 source i learned, that code checks object, that launch gui, and it should be item or tileentity. I hope, that with minor code changes it can be applied to entities as well. Can you do it, please?

  • Yes, i know how use it:



    It means making switch-case for every gui i made. GregoriusT, you mean making IHasGui interface applicable for entities is too much work?

    • Official Post

    Why don't you just use the GuiHandler to open the GUI for the Interface yourself? Also instead of sending a GUI ID you could just make it dependant on the found Entity. I personally don't even use the GUI ID anymore for my own Blocks, and let the Block itself decide which Client GUI to open depending on the Coords (TileEntity).


    And in general even though it might be more Efficient in some cases (and inefficient in rare other cases), I would not use any of the IC² Networking Code for my own Stuff.


    Not to mention that Interfaces can work on everything per definition of Java.