diff --git a/src/main/java/io/github/syst3ms/skriptparser/expressions/ExprAmount.java b/src/main/java/io/github/syst3ms/skriptparser/expressions/ExprAmount.java index a4d11c74..38ceef30 100644 --- a/src/main/java/io/github/syst3ms/skriptparser/expressions/ExprAmount.java +++ b/src/main/java/io/github/syst3ms/skriptparser/expressions/ExprAmount.java @@ -24,13 +24,13 @@ * @since ALPHA * @author Olyno, Mwexim */ -public class ExprAmount extends PropertyExpression { +public class ExprAmount extends PropertyExpression { static { Parser.getMainRegistration().addPropertyExpression( ExprAmount.class, Number.class, - "~objects", - "[1:recursive] (amount|number|size)" + "[1:recursive] (amount|number|size)", + "~objects" ); } diff --git a/src/main/java/io/github/syst3ms/skriptparser/expressions/ExprColorValues.java b/src/main/java/io/github/syst3ms/skriptparser/expressions/ExprColorValues.java index 6d61f9e2..e4ab6d87 100644 --- a/src/main/java/io/github/syst3ms/skriptparser/expressions/ExprColorValues.java +++ b/src/main/java/io/github/syst3ms/skriptparser/expressions/ExprColorValues.java @@ -19,13 +19,13 @@ * @since ALPHA * @author Mwexim */ -public class ExprColorValues extends PropertyExpression { +public class ExprColorValues extends PropertyExpression { static { Parser.getMainRegistration().addPropertyExpression( ExprColorValues.class, Object.class, - "colors", - "(0:hex[adecimal]|1:red|2:green|3:blue|4:alpha) value" + "(0:hex[adecimal]|1:red|2:green|3:blue|4:alpha) value", + "colors" ); } diff --git a/src/main/java/io/github/syst3ms/skriptparser/expressions/ExprDateTimestamp.java b/src/main/java/io/github/syst3ms/skriptparser/expressions/ExprDateTimestamp.java index 45869e59..709355d8 100644 --- a/src/main/java/io/github/syst3ms/skriptparser/expressions/ExprDateTimestamp.java +++ b/src/main/java/io/github/syst3ms/skriptparser/expressions/ExprDateTimestamp.java @@ -22,13 +22,13 @@ * @since ALPHA * @author Mwexim */ -public class ExprDateTimestamp extends PropertyExpression { +public class ExprDateTimestamp extends PropertyExpression { static { Parser.getMainRegistration().addPropertyExpression( ExprDateTimestamp.class, Number.class, - "*[date] %date%", - "[1:unix] timestamp" + "[1:unix] timestamp", + "*[date] %date%" ); } diff --git a/src/main/java/io/github/syst3ms/skriptparser/expressions/ExprLength.java b/src/main/java/io/github/syst3ms/skriptparser/expressions/ExprLength.java index 594813d3..838e81a6 100644 --- a/src/main/java/io/github/syst3ms/skriptparser/expressions/ExprLength.java +++ b/src/main/java/io/github/syst3ms/skriptparser/expressions/ExprLength.java @@ -14,13 +14,13 @@ * @since ALPHA * @author Romitou */ -public class ExprLength extends PropertyExpression { +public class ExprLength extends PropertyExpression { static { Parser.getMainRegistration().addPropertyExpression( ExprLength.class, Number.class, - "string", - "length" + "length", + "string" ); } diff --git a/src/main/java/io/github/syst3ms/skriptparser/lang/properties/PropertyExpression.java b/src/main/java/io/github/syst3ms/skriptparser/lang/properties/PropertyExpression.java index 1c0fd3b2..ba16e177 100644 --- a/src/main/java/io/github/syst3ms/skriptparser/lang/properties/PropertyExpression.java +++ b/src/main/java/io/github/syst3ms/skriptparser/lang/properties/PropertyExpression.java @@ -24,7 +24,7 @@ * @param The type of the owner of this expression. * @author Mwexim */ -public abstract class PropertyExpression implements Expression { +public abstract class PropertyExpression implements Expression { public static final String PROPERTY_IDENTIFIER = "property"; private Expression owner; @@ -111,11 +111,12 @@ public boolean isGenitive() { return genitive; } - public static String[] composePatterns(String owner, String property) { + public static String[] composePatterns(String property, String owner) { var ownerType = owner.startsWith("*") ? owner.substring(1) : "%" + owner + "%"; return new String[] { ownerType + "'[s] " + property, "[the] " + property + " of " + ownerType }; } + } diff --git a/src/main/java/io/github/syst3ms/skriptparser/registration/SkriptRegistration.java b/src/main/java/io/github/syst3ms/skriptparser/registration/SkriptRegistration.java index bfe9be51..10ae36b3 100644 --- a/src/main/java/io/github/syst3ms/skriptparser/registration/SkriptRegistration.java +++ b/src/main/java/io/github/syst3ms/skriptparser/registration/SkriptRegistration.java @@ -189,8 +189,8 @@ public , T> void addExpression(Class c, Class retu * @param the Expression's return type * @return an {@link ExpressionRegistrar} to continue the registration process */ - public , T> ExpressionRegistrar newPropertyExpression(Class c, Class returnType, String owner, String property) { - return (ExpressionRegistrar) newExpression(c, returnType, false, PropertyExpression.composePatterns(owner, property)) + public , T> ExpressionRegistrar newPropertyExpression(Class c, Class returnType, String property, String owner) { + return (ExpressionRegistrar) newExpression(c, returnType, false, PropertyExpression.composePatterns(property, owner)) .addData(PropertyExpression.PROPERTY_IDENTIFIER, property); } @@ -203,8 +203,8 @@ public , T> void addExpression(Class c, Class retu * @param the Expression * @param the Expression's return type */ - public , T> void addPropertyExpression(Class c, Class returnType, String owner, String property) { - newPropertyExpression(c, returnType, owner, property).register(); + public , T> void addPropertyExpression(Class c, Class returnType, String property, String owner) { + newPropertyExpression(c, returnType, property, owner).register(); } /** @@ -217,8 +217,8 @@ public , T> void addExpression(Class c, Class retu * @param the Expression * @param the Expression's return type */ - public , T> void addPropertyExpression(Class c, Class returnType, int priority, String owner, String property) { - newPropertyExpression(c, returnType, owner, property).setPriority(priority).register(); + public , T> void addPropertyExpression(Class c, Class returnType, int priority, String property, String owner) { + newPropertyExpression(c, returnType, property, owner).setPriority(priority).register(); } /**