Enchanting Tweaks

Enchanting Tweaks

27.1k Downloads

Incompatibility with Disenchanter

Impelon opened this issue ยท 0 comments

commented

The OpenCustomGUI handler for enchanting tables conflicts with Disenchanter as discovered in Impelon/Disenchanter/issues/64.

The problem is that the disenchanting table uses a tile entity that extends TileEntityEnchantmentTable to get all the animation code without needing to copy it.
However Enchanting Tweaks thus believes the table is an enchanting table and falsely tries to replace the GUI:

if (tileentity instanceof TileEntityEnchantmentTable)
{
if (Main.iscsb_ench_tableLoaded)
{
playerIn.openGui(Main.instance, ModGUIHandler.ID_ENCHANTMENT_WITH_LAPIS, worldIn, pos.getX(), pos.getY(), pos.getZ());
event.setCanceled(true);
}
else if (!playerIn.isSneaking())
{
playerIn.openGui(Main.instance, ModGUIHandler.ID_ENCHANTMENT, worldIn, pos.getX(), pos.getY(), pos.getZ());
event.setCanceled(true);
}
}

I would suggest checking for equality of TileEntityEnchantmentTable instead of using instanceof in this specific case, or introducing a configurable list of tileentities that will not get their GUI replaced, even if they extend TileEntityEnchantmentTable.