Skip to content

Commit

Permalink
Add "invincible" as a synonym of "invulnerable" in related syntaxes. (#…
Browse files Browse the repository at this point in the history
…6393)

* Update EffInvulnerability.java

* other syntaxes

* Update src/main/java/ch/njol/skript/effects/EffInvulnerability.java

Co-authored-by: Ayham Al Ali <20037329+AyhamAl-Ali@users.noreply.github.com>

---------

Co-authored-by: Ayham Al Ali <20037329+AyhamAl-Ali@users.noreply.github.com>
  • Loading branch information
sovdeeth and AyhamAl-Ali authored Feb 17, 2024
1 parent f4d273e commit 336c63c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
public class CondIsInvulnerable extends PropertyCondition<Entity> {

static {
register(CondIsInvulnerable.class, PropertyType.BE, "invulnerable", "entities");
register(CondIsInvulnerable.class, PropertyType.BE, "(invulnerable|invincible)", "entities");
}

@Override
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/ch/njol/skript/effects/EffInvulnerability.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public class EffInvulnerability extends Effect {

static {
Skript.registerEffect(EffInvulnerability.class,
"make %entities% invulnerable",
"make %entities% (not invulnerable|vulnerable)");
"make %entities% (invulnerable|invincible)",
"make %entities% (not (invulnerable|invincible)|vulnerable|vincible)");
}

@SuppressWarnings("null")
Expand All @@ -57,15 +57,15 @@ public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelaye
}

@Override
protected void execute(Event e) {
for (Entity entity : entities.getArray(e)) {
protected void execute(Event event) {
for (Entity entity : entities.getArray(event)) {
entity.setInvulnerable(invulnerable);
}
}

@Override
public String toString(@Nullable Event e, boolean debug) {
return "make " + entities.toString(e, debug) + (invulnerable ? " invulnerable" : " not invulnerable");
public String toString(@Nullable Event event, boolean debug) {
return "make " + entities.toString(event, debug) + (invulnerable ? " invulnerable" : " not invulnerable");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
public class ExprNoDamageTicks extends SimplePropertyExpression<LivingEntity, Long> {

static {
register(ExprNoDamageTicks.class, Long.class, "(invulnerability|no damage) tick[s]", "livingentities");
register(ExprNoDamageTicks.class, Long.class, "(invulnerability|invincibility|no damage) tick[s]", "livingentities");
}

@Override
Expand Down

0 comments on commit 336c63c

Please sign in to comment.