mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-15 12:01:51 +01:00
Back to strings.
This commit is contained in:
parent
7b51b1ae43
commit
4aa253df6d
@ -7,14 +7,21 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public final class BridgeEnchant {
|
||||
|
||||
private static Enchantment DEPTH_STRIDER = null;
|
||||
|
||||
static {
|
||||
private static final Enchantment parseEnchantment(final String name) {
|
||||
try {
|
||||
DEPTH_STRIDER = Enchantment.DEPTH_STRIDER;
|
||||
} catch (Throwable t) {}
|
||||
return Enchantment.getByName(name);
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private final static Enchantment DEPTH_STRIDER = parseEnchantment("DEPTH_STRIDER");
|
||||
|
||||
/**
|
||||
*
|
||||
* @param player
|
||||
* @return Level of DEPTH_STRIDER capped at 3. Will return 0 if not available.
|
||||
*/
|
||||
public static int getDepthStriderLevel(Player player) {
|
||||
if (DEPTH_STRIDER != null) {
|
||||
final ItemStack boots = player.getInventory().getBoots();
|
||||
|
Loading…
Reference in New Issue
Block a user