Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/remove advanced syntax #3709

Merged
merged 4 commits into from
Mar 21, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/config/SectionNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ HashMap<String, String> toMap(final String prefix, final String separator) {
/**
* @param other
* @param excluded keys and sections to exclude
* @return <tt>false</tt> iff this and the other SectionNode contain the exact same set of keys
* @return <tt>false</tt> if this and the other SectionNode contain the exact same set of keys
*/
public boolean setValues(final SectionNode other, final String... excluded) {
boolean r = false;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/lang/TriggerItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ protected TriggerItem walk(final Event e) {
/**
* @param start
* @param e
* @return false iff an exception occurred
* @return false if an exception occurred
*/
public static boolean walk(final TriggerItem start, final Event e) {
assert start != null && e != null;
Expand Down
28 changes: 1 addition & 27 deletions src/main/java/ch/njol/skript/lang/VariableString.java
Original file line number Diff line number Diff line change
Expand Up @@ -261,33 +261,7 @@ public static VariableString newInstance(final String orig, final StringMode mod
log.printErrors("Can't understand this expression: " + s.substring(c + 1, c2));
return null;
} else {
if (mode != StringMode.MESSAGE) {
string.add(expr);
} else {
final ExpressionInfo i = new ExpressionInfo(expr);
if (c2 <= s.length() - 2 && s.charAt(c2 + 1) == 's' && (c2 == s.length() - 2 || !Character.isLetter(s.charAt(c2 + 2)))) {
i.flags |= Language.F_PLURAL;
c2++; // remove the 's'
}
if (string.size() > 0 && string.get(string.size() - 1) instanceof String) {
final String last = (String) string.get(string.size() - 1);
if (c2 <= s.length() - 2 && s.charAt(c2 + 1) == '>' && last.endsWith("<")) {
i.toChatStyle = true;
string.set(string.size() - 1, last.substring(0, last.length() - 1));
c2++; // remove the '>'
} else {
final int l = last.lastIndexOf(' ', last.endsWith(" ") ? last.length() - 2 : last.length() - 1);
final String lastWord = "" + last.substring(l + 1).trim();
if (Noun.isLocalIndefiniteArticle(lastWord))
i.flags |= Language.F_INDEFINITE_ARTICLE;
else if (Noun.isLocalDefiniteArticle(lastWord))
i.flags |= Language.F_DEFINITE_ARTICLE;
if ((i.flags & (Language.F_INDEFINITE_ARTICLE | Language.F_DEFINITE_ARTICLE)) != 0)
string.set(string.size() - 1, last.substring(0, l + 1));
}
}
string.add(i);
}
string.add(expr);
}
log.printLog();
} finally {
Expand Down