mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-18 14:11:40 +01:00
Fix keywords in kit commands not working (#5377)
Don't process b64 item through keyword replacer and don't replace spaces on command strings
This commit is contained in:
parent
cdd277da92
commit
fc3dabf8f5
@ -140,6 +140,13 @@ public class KeywordReplacer implements IText {
|
|||||||
|
|
||||||
for (int i = 0; i < input.getLines().size(); i++) {
|
for (int i = 0; i < input.getLines().size(); i++) {
|
||||||
String line = input.getLines().get(i);
|
String line = input.getLines().get(i);
|
||||||
|
|
||||||
|
// Skip processing b64 encoded items, they will not have keywords in them.
|
||||||
|
if (line.charAt(0) == '@') {
|
||||||
|
replaced.add(line);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
final Matcher matcher = KEYWORD.matcher(line);
|
final Matcher matcher = KEYWORD.matcher(line);
|
||||||
|
|
||||||
while (matcher.find()) {
|
while (matcher.find()) {
|
||||||
@ -375,8 +382,11 @@ public class KeywordReplacer implements IText {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.replaceSpacesWithUnderscores) {
|
if (this.replaceSpacesWithUnderscores) {
|
||||||
|
// Don't replace spaces with underscores in command nor escape underscores.
|
||||||
|
if (line.charAt(0) != '/') {
|
||||||
replacer = replacer.replace("_", "\\_").replaceAll("\\s", "_");
|
replacer = replacer.replace("_", "\\_").replaceAll("\\s", "_");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//If this is just a regular keyword, lets throw it into the cache
|
//If this is just a regular keyword, lets throw it into the cache
|
||||||
if (validKeyword.getType().equals(KeywordCachable.CACHEABLE)) {
|
if (validKeyword.getType().equals(KeywordCachable.CACHEABLE)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user