Misc cleanup

This commit is contained in:
Luck
2018-07-29 17:12:05 -07:00
Unverified
parent 952e41ad3d
commit b1ab465991
15 changed files with 91 additions and 49 deletions
@@ -56,7 +56,7 @@ public class AssignmentExpression {
this.expression = generateExpression(expression);
}
public boolean parse(PermissionHolder holder, Tristate tristate) throws IllegalArgumentException {
public boolean eval(PermissionHolder holder, Tristate tristate) throws IllegalArgumentException {
ScriptEngine engine = Scripting.getScriptEngine();
if (engine == null) {
throw new NullPointerException("script engine");
@@ -54,7 +54,7 @@ public class AssignmentRule {
public boolean apply(User user) {
if (this.hasTrueExpression != null) {
try {
boolean b = this.hasTrueExpression.parse(user, Tristate.TRUE);
boolean b = this.hasTrueExpression.eval(user, Tristate.TRUE);
if (!b) {
// The holder does not meet this requirement
return false;
@@ -68,7 +68,7 @@ public class AssignmentRule {
if (this.hasFalseExpression != null) {
try {
boolean b = this.hasFalseExpression.parse(user, Tristate.FALSE);
boolean b = this.hasFalseExpression.eval(user, Tristate.FALSE);
if (!b) {
// The holder does not meet this requirement
return false;
@@ -82,7 +82,7 @@ public class AssignmentRule {
if (this.lacksExpression != null) {
try {
boolean b = this.lacksExpression.parse(user, Tristate.UNDEFINED);
boolean b = this.lacksExpression.eval(user, Tristate.UNDEFINED);
if (!b) {
// The holder does not meet this requirement
return false;
@@ -63,7 +63,9 @@ public enum Message {
EMPTY("{}", true),
PLAYER_ONLINE("&aOnline", false),
PLAYER_OFFLINE("&cOffline", false),
LOADING_ERROR("&cPermissions data could not be loaded. Please try again later.", true),
LOADING_DATABASE_ERROR("&cA database error occurred whilst loading permissions data. Please try again later.", true),
LOADING_STATE_ERROR("&cPermissions data for your user was not loaded during the pre-login stage - unable to continue. Please try again later.", true),
LOADING_SETUP_ERROR("&cAn unexpected error occurred whilst setting up your permissions data. Please try again later.", true),
OP_DISABLED("&bThe vanilla OP system is disabled on this server.", false),
OP_DISABLED_SPONGE("&2Please note that Server Operator status has no effect on Sponge permission checks when a permission plugin is installed. Please edit user data directly.", true),