Skip to content

Use proper deprecation warning for ExprNoDamageTicks #7890

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

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
@@ -1,6 +1,5 @@
package ch.njol.skript.expressions;

import ch.njol.skript.Skript;
import ch.njol.skript.classes.Changer.ChangeMode;
import ch.njol.skript.doc.Description;
import ch.njol.skript.doc.Examples;
Expand All @@ -15,6 +14,7 @@
import org.bukkit.entity.LivingEntity;
import org.bukkit.event.Event;
import org.jetbrains.annotations.Nullable;
import org.skriptlang.skript.lang.script.ScriptWarning;

@Name("No Damage Ticks")
@Description("The number of ticks that an entity is invulnerable to damage for.")
Expand All @@ -32,7 +32,7 @@ public class ExprNoDamageTicks extends SimplePropertyExpression<LivingEntity, Lo

@Override
public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) {
Skript.warning("This expression is deprecated. Please use 'invulnerability time' instead of 'invulnerability ticks'.");
ScriptWarning.printDeprecationWarning("This expression is deprecated. Please use 'invulnerability time' instead of 'invulnerability ticks'.");
return super.init(expressions, matchedPattern, isDelayed, parseResult);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
on script load:
suppress deprecated syntax warnings

test "no damage ticks":
spawn zombie at test-location:
set {_entity} to entity
Expand Down