mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2024-12-23 04:47:34 +01:00
cancel projectile launch if disable interaction flag is set to true
This commit is contained in:
parent
500c3c60f9
commit
a4ccb2fa89
@ -6,6 +6,7 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.enchantment.EnchantItemEvent;
|
||||
import org.bukkit.event.entity.EntityShootBowEvent;
|
||||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||
import org.bukkit.event.inventory.CraftItemEvent;
|
||||
import org.bukkit.event.inventory.FurnaceSmeltEvent;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
@ -153,4 +154,16 @@ public class DisableInteractions implements Listener {
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void projectileLaunchCheck(ProjectileLaunchEvent event) {
|
||||
if(!(event.getEntity().getShooter() instanceof Player))
|
||||
return;
|
||||
|
||||
Player player = (Player) event.getEntity().getShooter();
|
||||
NBTItem item = NBTItem.get(player.getInventory().getItemInMainHand());
|
||||
|
||||
if(item.getBoolean("MMOITEMS_DISABLE_INTERACTION"))
|
||||
return;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user