Add a bunch of debug to ItemUsable

This commit is contained in:
ArcticZeroo 2017-10-29 12:28:43 -04:00 committed by Alexander Meech
parent a216a82515
commit 530e7c116b

View File

@ -115,23 +115,35 @@ public abstract class ItemUsable extends Item implements IThrown
@EventHandler @EventHandler
public void Throw(PlayerInteractEvent event) public void Throw(PlayerInteractEvent event)
{ {
Bukkit.broadcastMessage("Throwing an ItemUsable (" + _itemName + ")");
if (_throwAction == null) if (_throwAction == null)
Bukkit.broadcastMessage("Action is null");
return; return;
Player player = event.getPlayer(); Player player = event.getPlayer();
if (((CraftPlayer)player).getHandle().spectating) if (((CraftPlayer)player).getHandle().spectating)
Bukkit.broadcastMessage("Player is spectating");
return; return;
if (!UtilGear.isMat(player.getItemInHand(), GetType())) if (!UtilGear.isMat(player.getItemInHand(), GetType()))
Bukkit.broadcastMessage("Wrong material type");
return;
if (!UtilItem.getDisplayName(player.getItemInHand()).equals(_itemName))
Bukkit.broadcastMessage("Wrong item name");
return; return;
if (!UtilEvent.isAction(event, _throwAction)) if (!UtilEvent.isAction(event, _throwAction))
Bukkit.broadcastMessage("Throw action is not an action");
return; return;
if (UtilBlock.usable(event.getClickedBlock())) if (UtilBlock.usable(event.getClickedBlock()))
Bukkit.broadcastMessage("Clicked block is not usable");
return; return;
Bukkit.broadcastMessage("Use is valid, now checking trigger/cooldown");
event.setCancelled(true); event.setCancelled(true);
//Check Allowed //Check Allowed
@ -139,9 +151,11 @@ public abstract class ItemUsable extends Item implements IThrown
Bukkit.getServer().getPluginManager().callEvent(trigger); Bukkit.getServer().getPluginManager().callEvent(trigger);
if (trigger.IsCancelled()) if (trigger.IsCancelled())
Bukkit.broadcastMessage("Trigger was cancelled");
return; return;
if (!EnergyRecharge(player, GetName(), _throwEnergy, _throwDelay)) if (!EnergyRecharge(player, GetName(), _throwEnergy, _throwDelay))
Bukkit.broadcastMessage("On cooldown");
return; return;
if (_throwStock) if (_throwStock)