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

Allow past form of damage cause expression #4388

Merged
merged 2 commits into from
Nov 3, 2021
Merged
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
12 changes: 7 additions & 5 deletions src/main/java/ch/njol/skript/expressions/ExprDamageCause.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@
import ch.njol.skript.expressions.base.EventValueExpression;
import ch.njol.skript.lang.ExpressionType;

/**
* @author Peter Güttinger
*/
@Name("Damage Cause")
@Description("The <a href='../classes.html#damagecause'>damage cause</a> of a damage event. Please click on the link for more information.")
@Description("The <a href='classes.html#damagecause'>damage cause</a> of a damage event. Please click on the link for more information.")
@Examples("damage cause is lava, fire or burning")
@Since("2.0")
public class ExprDamageCause extends EventValueExpression<DamageCause> {
Expand All @@ -46,7 +43,12 @@ public class ExprDamageCause extends EventValueExpression<DamageCause> {
public ExprDamageCause() {
super(DamageCause.class);
}


@Override
public boolean setTime(int time) {
return time != 1; // allow past and present
}

@Override
public String toString(final @Nullable Event e, final boolean debug) {
return "the damage cause";
Expand Down