mirror of
https://github.com/garbagemule/MobArena.git
synced 2025-02-18 05:21:55 +01:00
Updated Formulas (markdown)
parent
12059d4588
commit
1d57373659
@ -136,7 +136,7 @@ formulas.registerVariable("exploding-sheep", arena -> {
|
||||
formulas.registerBinaryOperator("@", 2, true, (a, b) -> b - a);
|
||||
|
||||
// Register `up` as a new unary function that adds 1 to its input.
|
||||
formulas.registerUnaryFunction("square", v -> v + 1);
|
||||
formulas.registerUnaryFunction("up", v -> v + 1);
|
||||
```
|
||||
|
||||
Note that extensions must be registered _before_ MobArena's `onEnable()` runs for the registrations to take effect. The FormulaManager is available after MobArena's `onLoad()` has executed. This means that plugins extending MobArena's Formula system should have `loadbefore: [MobArena]` in their `plugin.yml` file, and they should register extensions during their own `onEnable()` method.
|
||||
|
Loading…
Reference in New Issue
Block a user