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
No known key found for this signature in database
GPG Key ID: BBEF14F97DA52474

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,7 +176,7 @@ public abstract class Engine implements Active, Listener, Runnable
}
// -------------------------------------------- //
// UTIL
// IS FAKE
// -------------------------------------------- //
public static final PredicateStartsWithIgnoreCase STARTING_WITH_FAKE = PredicateStartsWithIgnoreCase.get("fake");
@ -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;
}
}
}