Class PlayerHelper
java.lang.Object
com.pixelmonmod.pixelmon.api.util.helpers.PlayerHelper
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<net.minecraft.server.level.ServerPlayer>
Get a player entity safely from UUID.static boolean
hasPermission
(net.minecraft.server.level.ServerPlayer player, String permission) Checks if the player has the given permissionstatic void
onRegisterNodes
(net.minecraftforge.server.permission.events.PermissionGatherEvent.Nodes event) static net.minecraftforge.server.permission.nodes.PermissionNode<?>
registerPermission
(String permissionNode) Registers a permission node with this classstatic net.minecraftforge.server.permission.nodes.PermissionNode<Boolean>
registerPermission
(String modId, String permissionNode) Registers a permission node with this class
-
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 playerpermission
- 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 idpermissionNode
- The node- Returns:
- The permission
-
onRegisterNodes
public static void onRegisterNodes(net.minecraftforge.server.permission.events.PermissionGatherEvent.Nodes event) -
getPlayer
Get a player entity safely from UUID.- Parameters:
uuid
- A player UUID.- Returns:
- Optional player entity.
-