Class BukkitCompatibility

java.lang.Object
eu.cloudnetservice.modules.npc.impl.platform.bukkit.BukkitCompatibility

@Internal public final class BukkitCompatibility extends Object
Utility to ensure compatibility with a variety of minecraft versions.
Since:
4.0
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • GET_INTERACTION_HAND

      private static final CheckedFunction1<org.bukkit.event.player.PlayerInteractEntityEvent, org.bukkit.inventory.EquipmentSlot> GET_INTERACTION_HAND
  • Constructor Details

    • BukkitCompatibility

      private BukkitCompatibility()
  • Method Details

    • usedHand

      @NonNull public static @NonNull org.bukkit.inventory.EquipmentSlot usedHand(@NonNull @NonNull org.bukkit.event.player.PlayerInteractEntityEvent event)
      Resolves the hand that triggered the given interact event. Returns EquipmentSlot.HAND in case the hand method doesn't exist or the hand couldn't be resolved.
      Parameters:
      event - the event to get the used hand from.
      Returns:
      the equipment slot of the hand that triggered the given event.
      Throws:
      NullPointerException - if the given interact event is null.