/
User Changes:
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.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)))
remove to cmd:data.cmd:operate to the scoreboard players command.Registry and DynamicRegistry functions.
this_entity.getHandSlots[0].getItem == Registry('item').access.chest
Item, Block.this_entity.getHandSlots[0].getItem == Item('chest')
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.
Object getValue() and Result convert(Object o) in Expression.Result.Expression eval(LootContext context, Map<String, Object> parameters) in Expression.ProxyMap, ObjectConverter and CustomDataAccessor (which is now a valid data type).CustomFields. One of the more interesting APIs. Allows adding new 'virtual' fields to reflective expression objects.
static {
CustomFields.addVirtualField(Entity.class, "nbt", NbtPredicate::entityToNbt);
}
Other Changes:
