Fix bow issue with offhand items with disable interaction.

This isn't actually needed, the item should be caught by the Interact event and this causes a bug where you cannot shoot bows with any single item like a tome in your offhand that has Disable interaction even if your bow doesn't. I've used MMOItems without this section of code and ender pearls etc are still cancelled just fine. This is unneeded.
This commit is contained in:
HexedHero 2020-09-10 15:47:46 -07:00
parent 2470bce7b6
commit a7daa3091a

View File

@ -151,20 +151,6 @@ public class DisableInteractions implements Listener {
event.setCancelled(true);
}
@EventHandler
public void k(ProjectileLaunchEvent event) {
if(!(event.getEntity().getShooter() instanceof Player))
return;
Player player = (Player) event.getEntity().getShooter();
NBTItem item = NBTItem.get(player.getInventory().getItemInMainHand());
NBTItem item2 = NBTItem.get(player.getInventory().getItemInOffHand());
if(item.getBoolean("MMOITEMS_DISABLE_INTERACTION") ||
item2.getBoolean("MMOITEMS_DISABLE_INTERACTION"))
event.setCancelled(true);
}
private int firstArrow(Player player) {
// check offhand first