Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Commit

Permalink
CHANGELOG.md
Browse files Browse the repository at this point in the history
- Switched to `put` in `Struct`.
  • Loading branch information
melontini committed Jul 16, 2024
1 parent 2219e8d commit eae7e07
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ User Changes:
//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.
Expand All @@ -22,4 +21,18 @@ User Changes:
```
this_entity.getHandSlots[0].getItem == Item('chest')
```
* `Biome` and `DimensionType` are available dynamic registry shortcuts.
* `Biome` and `DimensionType` are available dynamic registry shortcuts.

Dev Changes:

There's a handful new experimental APIs, which allow you to extend the expression system.

* Exposed `Object getValue()` and `Result convert(Object o)` in Expression.Result.
* Exposed `Expression variable(String variable, Object value)` in Expression.
* Exposed `ProxyMap` and `ObjectConverter`.
* Exposed `CustomFields`. One of the more interesting APIs. Allows adding new 'virtual' fields to reflective expression objects.
```java
static {
CustomFields.addVirtualField(Entity.class, "nbt", NbtPredicate::entityToNbt);
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public void invalidate(String key) {
@Synchronized
public void addAccessor(String key, Function<Object, Object> accessor) {
if (this.accessors == null) this.accessors = new Object2ReferenceOpenHashMap<>();
this.accessors.putIfAbsent(key, accessor);
this.accessors.put(key, accessor);

if (this.consumers == null) return;
for (Struct consumer : consumers) {
Expand Down

0 comments on commit eae7e07

Please sign in to comment.