onPlayerInteractEvent in ForgeEventHandlers blocking adv integration.
nhave opened this issue ยท 3 comments
Hello McJty i am trying to update my omniwrench integration to 1.11.2 and your "ForgeEventHandlers" is preventing me from sneak right clicking the block protector, is it posible for you to change your function from checking if your holding the Smartwrench to check if the held item uses the interface SmartWrench instead?
at https://github.com/McJty/RFTools/blob/1.11/src/main/java/mcjty/rftools/ForgeEventHandlers.java#L159
and https://github.com/McJty/RFTools/blob/1.11/src/main/java/mcjty/rftools/ForgeEventHandlers.java#L161
if (player.isSneaking() && WrenchChecker.isAWrench(heldItem.getItem())) {
// If the block is protected we prevent sneak-wrenching it.
if (heldItem.getItem() instanceof SmartWrenchItem) {
// But if it is a smart wrench in select mode we allow it
if (SmartWrenchItem.getCurrentMode(heldItem) == SmartWrenchMode.MODE_SELECT) {
return;
}
}
World world = event.getWorld();
int x = event.getPos().getX();
int y = event.getPos().getY();
int z = event.getPos().getZ();
Collection protectors = BlockProtectors.getProtectors(world, x, y, z);
if (BlockProtectors.checkHarvestProtection(x, y, z, world, protectors)) {
event.setCanceled(true);
}
}
Thank you.
Went through the code today and saw that line 159 still uses the SmartWrenchItem, is this somthing you could change to the SmartWrench interface?
Edit: Found a way to bypass it.