-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No. Why? Should've added this earlier.
- Loading branch information
Showing
4 changed files
with
21 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
### What's New: | ||
|
||
* Added entity parameter to `cmd:explode`. The entity will be marked as the "creator" of the explosion and other entities will redirect their anger to the entity if affected by the explosion. | ||
* Added fire parameter to `cmd:explode`. Creates fire, if true. | ||
* Fixed `double` casts converting numbers to scientific notation. | ||
* `long` and `int` casts no longer actually convert to their types, instead they truncate the trailing zeros. | ||
* Added `hasContext` function to expressions. Allows checking if loot context has the required parameter: `if(hasContext("tool"), "Hi", "Bye")` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/java/me/melontini/commander/impl/util/functions/HasContextFunction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package me.melontini.commander.impl.util.functions; | ||
|
||
import com.ezylang.evalex.EvaluationException; | ||
import com.ezylang.evalex.Expression; | ||
import com.ezylang.evalex.data.EvaluationValue; | ||
import com.ezylang.evalex.functions.AbstractFunction; | ||
import com.ezylang.evalex.functions.FunctionParameter; | ||
import com.ezylang.evalex.parser.Token; | ||
|
||
@FunctionParameter(name = "key") | ||
public class HasContextFunction extends AbstractFunction { | ||
@Override | ||
public EvaluationValue evaluate(Expression expression, Token functionToken, EvaluationValue... par) throws EvaluationException { | ||
return expression.convertValue(expression.getDataAccessor().getData(par[0].getStringValue()) != null); | ||
} | ||
} |