Package net.neoforged.neoforge.oldtest
Class PermissionTest
java.lang.Object
net.neoforged.neoforge.oldtest.PermissionTest
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final PermissionNode<Boolean> private static final PermissionNode<Component> private static final booleanprivate static final PermissionNode<Integer> private static final org.apache.logging.log4j.Loggerprivate static final PermissionNode<String> private static final PermissionNode<Boolean> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleancanUseCommand(CommandSourceStack src, PermissionNode<Boolean> booleanPermission, PermissionDynamicContext<?>... context) Simple utility to catch exceptions with the test commands above.voidvoid
-
Field Details
-
ENABLED
private static final boolean ENABLED- See Also:
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
boolPerm
-
stringPerm
-
intPerm
-
componentPerm
-
unregisteredPerm
-
-
Constructor Details
-
PermissionTest
public PermissionTest()
-
-
Method Details
-
registerNodes
-
registerCommands
-
canUseCommand
private static boolean canUseCommand(CommandSourceStack src, PermissionNode<Boolean> booleanPermission, PermissionDynamicContext<?>... context) Simple utility to catch exceptions with the test commands above. Without that, the expected UnregisteredPermissionNode exception, triggers further exceptions and therefore isn't visible anymore. This is only required to handle the intended error in the permission API, and should not be necessary with correct use.
-