MassiveCore - Skip Off Hand Interact Test 1

This commit is contained in:
Olof Larsson
2016-06-06 21:00:21 +02:00
parent 0af84a6193
commit 2d8f10eb00

View File

@@ -8,6 +8,8 @@ import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockMultiPlaceEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.scheduler.BukkitTask;
import com.massivecraft.massivecore.collections.MassiveSet;
@@ -174,9 +176,9 @@ public abstract class Engine implements Active, Listener, Runnable
}
// -------------------------------------------- //
// UTIL
// IS FAKE
// -------------------------------------------- //
public static final PredicateStartsWithIgnoreCase STARTING_WITH_FAKE = PredicateStartsWithIgnoreCase.get("fake");
public static boolean isFake(Event event)
{
@@ -191,4 +193,20 @@ public abstract class Engine implements Active, Listener, Runnable
}
}
// -------------------------------------------- //
// IS OFF HAND
// -------------------------------------------- //
public static boolean isOffHand(PlayerInteractEntityEvent event)
{
try
{
return event.getHand() == org.bukkit.inventory.EquipmentSlot.OFF_HAND;
}
catch (Throwable t)
{
return false;
}
}
}