fix advancement requiremnt
This commit is contained in:
@@ -8,7 +8,6 @@ version '3.9'
|
|||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
mavenLocal()
|
|
||||||
maven {
|
maven {
|
||||||
url 'https://hub.spigotmc.org/nexus/content/groups/public/'
|
url 'https://hub.spigotmc.org/nexus/content/groups/public/'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,16 +31,17 @@ public class AdvancementRequirement extends Requirement {
|
|||||||
Advancement adv = advancementIterator.next();
|
Advancement adv = advancementIterator.next();
|
||||||
String key = adv.getKey().getKey();
|
String key = adv.getKey().getKey();
|
||||||
Pattern pattern = Pattern.compile(string.replace("*", ".*").replace("-", ""));
|
Pattern pattern = Pattern.compile(string.replace("*", ".*").replace("-", ""));
|
||||||
boolean positive = false;
|
|
||||||
if (pattern.matcher(key).find()) {
|
if (pattern.matcher(key).find()) {
|
||||||
positive = !string.startsWith("-");
|
boolean positive = !string.startsWith("-");
|
||||||
}
|
|
||||||
|
|
||||||
AdvancementProgress progress = player.getAdvancementProgress(adv);
|
AdvancementProgress progress = player.getAdvancementProgress(adv);
|
||||||
if (progress.isDone() == positive) {
|
if (progress.isDone() == positive) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user