Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ade2c78bfd | ||
|
|
dcfeec98ed | ||
|
|
84d3df2321 | ||
|
|
e9198ef980 |
@@ -448,6 +448,23 @@ public final class PlayerExpansion extends PlaceholderExpansion implements Confi
|
||||
case "is_inside_vehicle":
|
||||
return bool(p.isInsideVehicle());
|
||||
}
|
||||
|
||||
if (identifier.startsWith("has_potion_effect_")) {
|
||||
final PotionEffectType potion = PotionEffectType.getByName(identifier.replace("has_potion_effect_", ""));
|
||||
return bool(potion != null && p.hasPotionEffect(potion));
|
||||
}
|
||||
|
||||
if (identifier.startsWith("potion_effect_level_")) {
|
||||
final PotionEffectType potion = PotionEffectType.getByName(identifier.replace("potion_effect_level_", ""));
|
||||
|
||||
if (potion == null || !p.hasPotionEffect(potion)) {
|
||||
return "0";
|
||||
}
|
||||
|
||||
//noinspection DataFlowIssue
|
||||
return String.valueOf(p.getPotionEffect(potion).getAmplifier());
|
||||
}
|
||||
|
||||
// return null for unknown placeholders
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user