Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "invincible" as a synonym of "invulnerable" in related syntaxes. #6393

Merged
merged 5 commits into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)");
sovdeeth marked this conversation as resolved.
Show resolved Hide resolved
}

@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
Loading