scripts.conditions.world.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Pouvoir Show documentation
Show all versions of Pouvoir Show documentation
Bukkit Script Engine Plugin.
//@Condition()
Coerce = static("Coerce");
key = "world";
names = ["要求世界: (?.*)", "需要不是世界: (?.*)"];
function parameters(matcher, text) {
const world = matcher.group("world");
const isIn = !matcher.pattern().toString().contains("不");
return mapOf({ world: world, status: isIn });
}
function condition(entity, map) {
if (entity == null) return true;
const world = map.get("world");
const isIn = map.get("status");
return (
(isIn && entity.location.world.name.equalsIgnoreCase(world)) ||
(!isIn && !entity.location.world.name.equalsIgnoreCase(world))
);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy