Список изменений
【中文更新日志】
2.7 版本更新 - 表达式解析器大幅增强:
- 新增数学常数支持:现在可以直接在表达式中使用
e(自然常数)和pi(圆周率),例如sin(pi/2)或e^x。 - 新增一元负号支持:现在可以书写
-x^2、-sin(x)等表达式,解析器会正确处理负号。 - 新增实用数学函数:
floor(向下取整)、ceil(向上取整)、round(四舍五入)、trunc(截断小数)、mod(取模,例如mod(x, 3))、min(最小值,例如min(x, 5))、max(最大值,例如max(x, -1))。 - 新增随机数函数:
Ran#生成 0~1 之间的随机小数,RanInt(min, max)生成指定范围内的随机整数! - 重要修复:修复了使用含参函数(如
sin、sqrt、log等)时,若参数数量填写不正确(例如未填写参数或填写了多余参数)会导致游戏崩溃并损坏存档的严重问题。现在解析器会正确校验参数数量,表达式不合规时会给出清晰提示而不会引发崩溃。 - 表达式解析器更加强大且安全可靠,为函数图像和附魔轨迹带来更多的创作可能性。
【English Changelog】
Version 2.7 - Expression parser major enhancement:
- Added mathematical constants: now you can use
e(Euler's number) andpidirectly in expressions, e.g.sin(pi/2)ore^x. - Added unary minus support: now you can write expressions like
-x^2or-sin(x)– the parser handles negative signs correctly. - Added practical math functions:
floor(round down),ceil(round up),round(round to nearest),trunc(truncate decimals),mod(modulo, e.g.mod(x, 3)),min(minimum, e.g.min(x, 5)),max(maximum, e.g.max(x, -1)). - Added random number functions:
Ran#generates a random decimal between 0 and 1,RanInt(min, max)generates a random integer within the specified range! - Critical fix: Fixed a severe bug where using parameterized functions (such as
sin,sqrt,log, etc.) with incorrect argument counts (e.g., missing parameters or extra parameters) would crash the game and corrupt the save. The parser now properly validates argument counts and provides clear feedback for malformed expressions instead of crashing. - The expression parser is now more powerful, robust, and safer, unlocking even more creative possibilities for function graphs and enchantment trajectories.
Файлы
function_math-2.7-neoforge-1.21.1.jar(74.60 KiB)
ОсновнойМетаданные
Канал релиза
Beta
Номер версии
2.7
Загрузчики
NeoForge
Версии игры
1.21.1
Загрузок
15
Дата публикации
09.07.2026

