Calcinator Crash
McyD opened this issue ยท 10 comments
Mytown author stated it was due to:
"I don't know what mod is causing that, but some tile entity isn't extending isUseableByPlayer, which MyTown expects to be there. If you can figure out what TE is being right clicked when that happens, I can bring it up with the mod author and see why its happening."
This is pretty much his fault. isUseableByPlayer is implemented in the superclass of EE3's tiles. He should check if any of the superclasses of the tile has this method. I'm not too familiar enough with ASM, but with Reflection it's as easy as changing getDeclaredMethod() to getMethod().
@Dynious is correct - because all of the EE3 TileEntity's extend off of a common TileEntity class (TileEE) it appears that these classes are not implementing the method (even though the super class is).
MyTown modders just need to check if the TileEntity has a super class, and if it does, does that class implement isUseableByPlayer
Actually, MyTown doesn't use ASM or Reflection to call that method. I retrieve the TileEntity from PlayerInteractEvent, check if its is an IInventory, if it is, its cast to IInventory and the isUseableByPlayer function is called. I can change it to use Reflection easily enough.
Well actually it is part of IInventory, but you've added it to the base TileEntity class that doesn't implement IInventory. One would assume Java handles this correctly, but it seems like it isn't.
Ah, I stand corrected. This is what I get for looking into this on my work machine.
I'll make some changes tonight unless @Dynious beats me to it