Class PlayerHelper

java.lang.Object
com.pixelmonmod.pixelmon.api.util.helpers.PlayerHelper

public class PlayerHelper extends Object
  • Constructor Details

    • PlayerHelper

      public PlayerHelper()
  • Method Details

    • hasPermission

      public static boolean hasPermission(net.minecraft.server.level.ServerPlayer player, String permission)
      Checks if the player has the given permission
      Parameters:
      player - The player
      permission - The permission
      Returns:
      true if they have access to said permission
    • registerPermission

      public static net.minecraftforge.server.permission.nodes.PermissionNode<?> registerPermission(String permissionNode)
      Registers a permission node with this class
      Parameters:
      permissionNode - The node
      Returns:
      The permission
    • registerPermission

      public static net.minecraftforge.server.permission.nodes.PermissionNode<Boolean> registerPermission(String modId, String permissionNode)
      Registers a permission node with this class
      Parameters:
      modId - The mod id
      permissionNode - The node
      Returns:
      The permission
    • onRegisterNodes

      public static void onRegisterNodes(net.minecraftforge.server.permission.events.PermissionGatherEvent.Nodes event)
    • getPlayer

      public static Optional<net.minecraft.server.level.ServerPlayer> getPlayer(UUID uuid)
      Get a player entity safely from UUID.
      Parameters:
      uuid - A player UUID.
      Returns:
      Optional player entity.