
72.2K
11
Список изменений
What's New:
User Changes:
- Added
?.and?null safe operators.?.Used on structures. Same as., but returns null if there's no such field in structure.?Used with anything that can be null. Returns the right operand if left is null or left if not.
These operators allow you to quickly check for nulls in your expressions. Let's image a situation like this:
You have a variable struct.x which might not exist and maybe null. Before, you'd have to write something like this:
if(structContainsKey(struct, 'x') && struct.x != null, struct.x, valueElse())'
Now this can be shortened to: struct?.x ? valueElse(). Do note that ? has a very low precedence, so in ambiguous cases you'll have to wrap it in parentheses. e.g. 23 + struct?.x ? 23 -> 23 + (struct?.x ? 23).
- Java
Optionals are now unwrapped in expressions. - Minecraft
Identifiers are now converted to strings in expressions. - Gson elements can now be used in expressions.
Dev Changes:
- Fixed
equalson CustomDataAccessors. - Added
LootContextas an argument for theCustomFields#addVirtualFieldfunction.
Other Changes:
- Updated mEvalEx to fix expression inlining.
Метаданные
Канал релиза
Beta
Номер версии
0.8.0-1.20.4-build.21
Загрузчики
Fabric
Версии игры
1.20.4
Загрузок
151
Дата публикации
1 г. назад