Package ch.njol.skript.bukkitutil
Class BukkitUtils
java.lang.Object
ch.njol.skript.bukkitutil.BukkitUtils
Utility class with methods pertaining to Bukkit API
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.inventory.EquipmentSlot
getEquipmentSlotFromIndex
(int slotIndex) Get theEquipmentSlot
represented by the inventory slot indexstatic Integer
getEquipmentSlotIndex
(org.bukkit.inventory.EquipmentSlot equipmentSlot) Get the inventory slot index of theEquipmentSlot
static @Nullable org.bukkit.Registry
<org.bukkit.potion.PotionEffectType> Get an instance of thePotionEffectType
Registry
static boolean
registryExists
(String registry) Check if a registry exists
-
Constructor Details
-
BukkitUtils
public BukkitUtils()
-
-
Method Details
-
registryExists
Check if a registry exists- Parameters:
registry
- Registry to check for (Fully qualified name of registry)- Returns:
- True if registry exists else false
-
getPotionEffectTypeRegistry
@Nullable public static @Nullable org.bukkit.Registry<org.bukkit.potion.PotionEffectType> getPotionEffectTypeRegistry()Get an instance of thePotionEffectType
Registry
Paper/Bukkit have 2 different names for the same registry.
- Returns:
- PotionEffectType Registry
-
getEquipmentSlotIndex
Get the inventory slot index of theEquipmentSlot
- Parameters:
equipmentSlot
- The equipment slot to get the index of- Returns:
- The equipment slot index of the provided slot, otherwise null if invalid
-
getEquipmentSlotFromIndex
public static org.bukkit.inventory.EquipmentSlot getEquipmentSlotFromIndex(int slotIndex) Get theEquipmentSlot
represented by the inventory slot index- Parameters:
slotIndex
- The index of the equipment slot- Returns:
- The equipment slot the provided slot index, otherwise null if invalid
-