RFTools

RFTools

74M Downloads

onPlayerInteractEvent in ForgeEventHandlers blocking adv integration.

nhave opened this issue ยท 3 comments

commented

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.

commented

Thank you, now ill be able to use my omniwrench as a smart wrench too.

commented

Sorry for slow reply but I will fix this next release

commented

Went through the code today and saw that line 159 still uses the SmartWrenchItem, is this somthing you could change to the SmartWrench interface?

https://github.com/McJty/RFTools/blob/1ed0311a31faac50c4f69e8438e424a6d74f644f/src/main/java/mcjty/rftools/ForgeEventHandlers.java#L159

Edit: Found a way to bypass it.