Attempt to fix issue where any TNT can be used as proximity mines

This commit is contained in:
ArcticZeroo 2017-10-26 17:07:44 -04:00 committed by Alexander Meech
parent b39b9da5be
commit a216a82515

View File

@ -1,12 +1,7 @@
package mineplex.minecraft.game.classcombat.item;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.*;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser;
@ -23,7 +18,9 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerInteractEvent;
public abstract class ItemUsable extends Item implements IThrown
{
{
private String _itemName;
private ActionType _useAction;
private boolean _useStock;
private long _useDelay;
@ -48,6 +45,9 @@ public abstract class ItemUsable extends Item implements IThrown
long throwExpire, boolean throwPlayer, boolean throwBlock, boolean throwIdle, boolean throwPickup)
{
super(factory, name, desc, type, amount, canDamage, gemCost, tokenCost);
_itemName = name;
_useAction = useAction;
_throwAction = throwAction;
_useStock = useStock;
@ -76,6 +76,9 @@ public abstract class ItemUsable extends Item implements IThrown
if (!UtilGear.isMat(player.getItemInHand(), GetType()))
return;
if (!UtilItem.getDisplayName(player.getItemInHand()).equals(_itemName))
return;
if (!UtilEvent.isAction(event, _useAction))
return;