Skip to content

Commit

Permalink
CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
melontini committed Jul 15, 2024
1 parent 23106cd commit 6e366a0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,23 @@
User Changes:

* Added `arrayFindAny` and `arrayFindFirst` functions to expressions. As the name suggests, those functions will try to find an element of an array or return `null` if the array is empty.
* Added `chain` function to expressions. This function operates on the results of the first one and allows chaining multiple function calls together like so:
```
//`it` is the result of the previous function, unless there's a lower level lamda.
chain(arrayOf(2, 3, 6), arrayMap(it, sqrt(it)), arrayFindFirst(it));
//this is the same as:
arrayFindFirst(arrayMap(arrayOf(2, 3, 6), sqrt(it)))
```
* Java `Iterable`s can now be converted to arrays.
* Added `remove` to `cmd:data`.
* Added `cmd:operate` to the `scoreboard players` command.
* Added registry access for expressions! Now you can access the game's static and dynamic content registries by using new `Registry` and `DynamicRegistry` functions.
* Why is this useful? For example, this allows you to compare item stacks based on their item type:
```
this_entity.getHandItems[0].getItem == Registry('item').chest
this_entity.getHandSlots[0].getItem == Registry('item').chest
```
* For item and block registries there is a shortcut: `Item`, `Block`.
```
this_entity.getHandItems[0].getItem == Item('chest')
this_entity.getHandSlots[0].getItem == Item('chest')
```
* `Biome` and `DimensionType` are available dynamic registry shortcuts.

0 comments on commit 6e366a0

Please sign in to comment.