Add a bunch of debug to ItemUsable
This commit is contained in:
parent
a216a82515
commit
530e7c116b
@ -115,23 +115,35 @@ public abstract class ItemUsable extends Item implements IThrown
|
||||
@EventHandler
|
||||
public void Throw(PlayerInteractEvent event)
|
||||
{
|
||||
Bukkit.broadcastMessage("Throwing an ItemUsable (" + _itemName + ")");
|
||||
|
||||
if (_throwAction == null)
|
||||
Bukkit.broadcastMessage("Action is null");
|
||||
return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (((CraftPlayer)player).getHandle().spectating)
|
||||
Bukkit.broadcastMessage("Player is spectating");
|
||||
return;
|
||||
|
||||
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;
|
||||
|
||||
if (!UtilEvent.isAction(event, _throwAction))
|
||||
Bukkit.broadcastMessage("Throw action is not an action");
|
||||
return;
|
||||
|
||||
if (UtilBlock.usable(event.getClickedBlock()))
|
||||
Bukkit.broadcastMessage("Clicked block is not usable");
|
||||
return;
|
||||
|
||||
Bukkit.broadcastMessage("Use is valid, now checking trigger/cooldown");
|
||||
event.setCancelled(true);
|
||||
|
||||
//Check Allowed
|
||||
@ -139,9 +151,11 @@ public abstract class ItemUsable extends Item implements IThrown
|
||||
Bukkit.getServer().getPluginManager().callEvent(trigger);
|
||||
|
||||
if (trigger.IsCancelled())
|
||||
Bukkit.broadcastMessage("Trigger was cancelled");
|
||||
return;
|
||||
|
||||
if (!EnergyRecharge(player, GetName(), _throwEnergy, _throwDelay))
|
||||
Bukkit.broadcastMessage("On cooldown");
|
||||
return;
|
||||
|
||||
if (_throwStock)
|
||||
|
Loading…
Reference in New Issue
Block a user