1.2.0 Update Log
About 2794 wordsAbout 9 min
Update Log
2025-02-05
1. Encryption System Update
- An encryption algorithm based on the C++ language is used to encrypt models and caches. It is implemented in a more secure way, significantly improving security.
- A new model format has been designed to carry encrypted models. Now, encrypted model files no longer directly contain JSON source files but are converted to the YSM proprietary format. Even if cracked, it is difficult to restore the model source files and they cannot be re-imported into Blockbench.
- An encrypted network protocol has been designed for model synchronization between the server and the client, improving the security of server models.
- Mod verification has been added. Any modification to the mod itself will result in it being unable to function properly.
- Since the new version of the encryption system uses C++, it cannot run on ARM architecture devices, such as most mobile phone users.
- Although the old version of encryption is no longer secure, due to the update of cache encryption and network protocol encryption, as long as the old version of the encrypted model is only placed on the server and the server owner is trustworthy, it is still secure.
- A descriptive text has been added to the header of the encrypted model file. You can view the brief information of the model by opening it with the Notepad that comes with Windows. It can also be used to distinguish between the old and new versions of encrypted models. (There may be garbled characters under the Win7 system. It is recommended to use more professional tools such as VSCode to view it.) Due to the self-verification of the new version of the encrypted model, modifying this text on the encrypted model for the second time will cause the entire model file to be unable to be loaded by YSM.
2. Performance and Security Optimization
Client
- The renderer has been rewritten, significantly increasing the frame rate and reducing the overhead of rendering additional players #21. (There may be rendering errors under Optifine. You can solve it by turning on the "Compatible Renderer" in the settings.)
- The model loading speed has been improved. Loading models for the first time no longer blocks the main thread and will not slow down the time to enter the game.
- Memory leaks have been fixed, so it won't become more laggy the longer you play #23.
- The Java's built-in serialization library is no longer used, and it is no longer affected by the Pipe Bleeding remote code execution vulnerability.
- Blocks with a scale of 0 are no longer rendered.
Server
- Limiting the bandwidth usage of YSM during model synchronization is supported. The default is 5 Mbps, which can prevent the bandwidth from being fully utilized during model synchronization and affecting the normal game.
- The memory usage during model synchronization has been reduced. Combined with the bandwidth limit, the additional memory usage can always be kept at a low level.
- Modifying the concurrency number of server model reloading is supported. If it is a server mainly based on the YSM mod, the concurrency number can be appropriately increased to reduce the time required to reload models. It is best not to be higher than the number of CPU cores.
- When renaming server models or moving models between the custom and auth directories, the entire model no longer needs to be re-synchronized to the client during reloading.
- Now, only the server can initiate model synchronization, reducing the impact of empty packet attacks #20.
- When the server deletes a certain model, the corresponding model cache will also be deleted on the client after reloading.
3. Bug and Compatibility Fixes
- The /ysm command can be executed in single-player games without cheats enabled.
- Now, repeating the
Extra
,Swing
,Hold
, andUse
animations can take effect. - Even if the player stops swinging, the playing
Swing
animation will continue to play until it is finished. So model authors can create longer attack animations. - It is compatible with Simple Planes and Immersive Planes, as well as similar mods with similar principles.
- The components of the hand animation are the actual left-hand and right-hand movements.
- The crossbow animation plays normally and no longer conflicts with the Hold animation.
- It is compatible with the rendering of SlashBlade (model authors need to provide groups named
LeftWaistLocator
andRightWaistLocator
). - It is compatible with the action rendering of the Carry On mod (a new animation file named
carryon.animation.json
has been added). - A separate
info.json
file is used to record model author information to avoid the loss of information when the model is modified by Blockbench. - The entity models of mods such as
Corpse
andTaterzens
are no longer replaced #28. - The problem of not displaying other players' original model skins in multiplayer games has been fixed. (Yes, this is a client-side problem.)
- Clients without YSM installed can join servers with YSM, and vice versa.
math.atan(value)
andmath.atan2(y,x)
cannot be used.- The numerical problems of variables such as
query.player_level
,ysm.first_person_mod_hide
, andquery.yaw_speed
have been fixed. - The compatibility issues between Molang variables related to first-person mods and Oculus have been fixed.
- The problem of the roulette animation still playing when the player is moving has been fixed.
4. Feature Updates
Miscellaneous
- Now, the model of the arrow that is shot can be customized. The model and texture file names are fixed as
arrow.json
andarrow.png
respectively, and the animation file name isarrow.animation.json
(optional). For more details, please refer to the built-in default model. - If a model fails to load during model reloading, the reason for the failure will be fed back with the result of the reloading command.
- The model switching interface can be closed by pressing the shortcut key again.
- The search box in the model switching interface can be unfocused by clicking outside the box.
- Configurations that can be synchronized to the client have been added, which can disable the model switching function.
- Now, the Hold and Swing animations can also use built-in categories starting with a colon. The built-in categories can now distinguish between swords, shovels, shields, hoes, axes, and thrown potions.
- The model can add the
free
field. After adding it, even if this model is placed in the Auth folder, it will be displayed as an unauthorized model. - The problem of button text overflow in the animation example interface has been fixed.
Animation System
- More interpolation types are supported, such as smooth and step frames.
- The priority of the Extra animation has been lowered to be lower than that of the Parallel animation.
- The Molang engine has been replaced, supporting more syntax features and more convenient debugging methods, and more Molang variables have been added.
5. Molang System Update
① Support for New Syntax Features
- String type
- Custom variables
- Null coalescing operator
- Binary conditional operator
- Aliases
- Complex expressions
- Brace Scope Delimiters
- loop cycle, continue, break (for_each is also supported, but it is not currently used)
- Structs
- Arrow Operator
② Differences from Bedrock Edition
- Uninitialized variables have a null value, which can be identified by the null coalescing operator. When participating in numerical calculations, they are treated as 0 or false.
- Structures do not support nesting.
- After the player switches models, respawns, teleports to some dimensions, exits and re-enters, and performs other similar operations, all variable storage will be cleared.
③ Commands
/ysmclient molang execute <expr>
Execute the Molang expression on the local player and output the result to the chat box.
(Only valid in single-player games)
/ysmclient molang watch add pre/post <name> <expr>
Add a Molang expression to the custom debug screen, which will be calculated and updated in real time.
pre
means to execute before the animation is updated, and post
means to execute after the animation is updated.
(Press alt + B twice to enter the custom debug screen)
/ysmclient molang watch remove <name>
/ysmclient molang watch clear
Manage the entries on the custom debug screen.
/ysm molang execute <player> <expr>
Execute Molang on the specified player; available in multiplayer games and requires administrator privileges.
(The execution result will not be output)
④ Functions and Variables
roaming
variable
Variables written in the format of v.roaming.xxx
(cannot be abbreviated as v.r.xxx
) can be restored after switching dimensions, respawning, exiting and re-entering. They can also be synchronized between players and will be written to the archive following the server's cap.
However, this variable has some limitations:
- A model can have a maximum of 16
roaming
variables. - The number of characters in the variable name cannot be greater than 16.
- The variable can only store
float
.
query.debug_output()
- Description: Output a message to the chat box, only valid in animation debug mode.
- Parameters: Any type, any number.
- Return value: null.
Example: query.debug_output('Meow', 1, 2, 3)
Chat box display: Meow123
Return: null
math.min_angle()
- Description: Calculate the equivalent angle of the specified angle within [-180, 180).
Example: math.min_angle(780)
Return: 60
query.cape_flap_amount
- Description: Gets the degree to which the cape is flapping, even if the player is not wearing a cape;
- Return value: A value between 0 - 1. 0 means completely hanging down, 1 means fully flapping.
Example: q.cape_flap_amount
Returns: 0.35
query.position()
- Description: Gets the position coordinates of the entity;
- Parameters: An integer between 0-2, referring to the X, Y, Z components respectively;
- Return value: The specified component of the player's position coordinates.
Example: q.position(1)
(Gets the Y coordinate of the player's position)
Returns: 1003.23
query.position_delta()
- Description: Gets the difference in the entity's position coordinates since the last animation update, related to frame rate;
- Parameters/Return value: An integer between 0-2, referring to the X, Y, Z components of the coordinate difference;
- Return value: The specified component of the player's position coordinate difference.
Example 1: q.position_delta(0)
(Gets the X component of the player's position difference)
Example 1 returns: -0.076
Example 2:
v.time0 > 0 && q.life_time - v.time0 > 0 ? (v.speed_x = (q.position_delta(0) - v.x0) / (q.life_time - v.time0));
v.x0 = q.position_delta(0);
v.time0 = q.life_time;
return v.speed_x;
Example 2 returns: 19.03
ysm.in_ground
- Description: Determines if the arrow is on the ground;
- Returns: Boolean value.
Example: ysm.in_ground
Returns: true
ysm.on_ground_time
- Description: Gets how long the arrow has been lying on the ground;
- Returns: Integer, in ticks.
ysm.is_spectral_arrow
- Description: Determines if the arrow is a spectral arrow;
- Returns: Boolean value.
ysm.projectile_owner
- Description: Gets the player entity that shot the arrow;
- Returns: Player entity, whose attributes can be queried using "arrow expressions".
Example: v.flame_level ?? (v.flame_level = ysm.projectile_owner->ysm.equipped_enchantment_level('Mainhand', 'minecraft:flame'))
Explanation: Writing this expression in any parallel animation keyframe of the arrow animation will get the flame enchantment level of the player's mainhand bow when the arrow is shot and store it in the v.flame_level variable. It will not execute repeatedly.
Returns: 0
ysm.delta_movement_length
- Description: Gets the displacement length of the arrow between two ticks, which can be used to determine speed;
- Returns: Numerical displacement length.
Tips: If the speed is abnormal, try installing Fast Projectile Fix.
ysm.texture_name
- Description: Gets the texture name currently used by the player;
- Return value: String type texture name, including extension;
Example 1: ysm.texture_name
Example 1 returns: 'blue.png'
Example 2: ysm.texture_name == 'blue.png'
Example 2 returns: true
ysm.mod_version()
- Description: Gets the version of the specified mod installed on the client;
- Parameters: String type mod id (note: not the mod name);
- Returns: If the mod is installed, returns the version number string; otherwise, returns null.
Example: ysm.mod_version('tac')
Returns: '0.3.10.5'
ysm.dump_mods
- Description: Outputs installed mod information to the chat box, only effective in animation debug mode;
- Returns: null
ysm.dimension_name
- Description: Gets the current dimension;
- Returns: String type dimension id.
Example: ysm.dimension_name
Returns: 'twilightforest:twilightforest'
(Twilight Forest)
ysm.biome_category
Note! This variable is only available in 1.16.5 and 1.18.2
- Description: Gets the category of the biome the player is in;
- Returns: String type biome category.
Example: ysm.biome_category == 'forest'
Returns: true
Biome Category (1.16.5) | |
---|---|
taiga | Taiga |
extreme_hills | Extreme Hills |
jungle | Jungle |
mesa | Mesa |
plains | Plains |
savanna | Savanna |
icy | Icy |
beach | Beach |
forest | Forest |
ocean | Ocean |
desert | Desert |
river | River |
swamp | Swamp |
mushroom | Mushroom Island |
nether | Nether |
the_end | The End |
ysm.weather
- Description: Gets the current weather;
- Returns: 0: Clear, 1: Rain or Snow, 2: Thunderstorm or Blizzard.
Example: ysm.weather
Returns: 1
Tips: Whether it's raining or snowing depends on the current biome and altitude, or mods like Serene Seasons;
ysm.is_open_air
- Description: Determines if the player is in an open area;
- Returns: Boolean value.
Tips: Helps determine if the player is being snowed on, whereas q.is_in_water_or_rain
cannot.
query.equipped_item_all_tags()
- Description: Determines if the player's equipped item contains all specified item tags;
- Parameter ①: String type player equipment slot, refer to Bedrock Edition Documentation, note case sensitivity;
- Parameter ②......: Any number of string type item tags;
- Returns: Boolean value.
Example: query.equipped_item_all_tags('Mainhand', 'minecraft:tools', 'minecraft:swords')
Returns: true
query.equipped_item_any_tag()
- Description: Determines if the player's equipped item contains any of the specified item tags;
- Parameter ①: String type player equipment slot, refer to Bedrock Edition Documentation, note case sensitivity;
- Parameter ②......: Any number of string type item tags;
- Returns: Boolean value.
query.is_item_name_any()
- Description: Determines if the player's equipped item id is any of the specified item ids;
- Parameters: Any number of string type item ids;
- Returns: Boolean value.
Example: q.is_item_name_any('Mainhand', 'cooked_beef')
(Cooked Beef)
Returns: true
ysm.equipped_enchantment_level()
- Description: Gets the specified enchantment level of the player's equipped item;
- Parameter ①: String type player equipment slot, refer to Bedrock Edition Documentation, note case sensitivity;
- Parameter ②: Enchantment ID, refer to Wiki;
- Return value: Integer type enchantment level. If the enchantment does not exist, returns 0.
Example: ysm.equipped_enchantment_level('Mainhand', 'minecraft:mending')
(Gets the mending enchantment level of the mainhand item)
Returns: 1
ysm.dump_equipped_item()
- Description: Outputs the player's equipped item information to the chat box, only effective in animation debug mode;
- Parameter ①: String type player equipment slot, refer to Bedrock Edition Documentation, note case sensitivity;
- Returns: null
ysm.relative_block_name()
- Description: Get the id of a block near the player;
- Parameter ①②③: The relative position coordinates of the target block centered on the player;
- Return: The block id of string type.
Example: ysm.relative_block_name(0, -1, 0)
(the block under the player's feet)
Return: 'minecraft:sand'
query.relative_block_has_all_tags()
- Description: Determine whether a block near the player contains all the specified block tags;
- Parameter ①②③: The relative position coordinates of the target block centered on the player;
- Parameter ④......: Any number of block tags of string type;
- Return: Boolean value.
Example: q.relative_block_has_all_tags(0, -0.5, 0, 'minecraft:sand', 'minecraft:enderman_holdable')
Return: true
query.relative_block_has_any_tag()
- Description: Determine whether a block near the player contains any of the specified block tags;
- Parameter ①②③: The relative position coordinates of the target block centered on the player;
- Parameter ④......: Any number of block tags of string type;
- Return: Boolean value.
ysm.dump_relative_block
- Description: Output the information of a block near the player to the chat box, only valid in the animation debug mode;
- Parameter ①②③: The relative position coordinates of the target block centered on the player;
- Return: null
ysm.effect_level()
- Description: Get the level of the potion effect attached to the player or arrow;
- Parameter ①: The potion id of string type;
- Return: The potion effect level of numeric type. If it does not exist, return 0.
Example: ysm.effect_level('minecraft:regeneration')
(Get the level of the health recovery effect attached to the target)
Return: 0
(The target does not have this effect)
ysm.dump_effects
- Description: Output the information of the potion effects attached to the player to the chat box, only valid in the animation debug mode;
- Return: null
query.biome_has_all_tags
Since there are no biome tags in version 1.16, this function is just a placeholder to maintain forward compatibility.
Only available in versions 1.18 and above.
query.biome_has_any_tags
It is also a placeholder. Only available in versions 1.18 and above.
⑤ Molang symbols available for custom arrows
(Most of them are inherited from the player and may not all be meaningful)
ysm.effect_level
ysm.texture_name
ysm.weather
ysm.dimension_name
ysm.relative_block_name
ysm.mod_version
ysm.dump_effects
ysm.dump_mods
ysm.dump_relative_block
ysm.is_passenger
ysm.is_sleep
ysm.is_sneak
ysm.biome_category
ysm.on_ground_time
ysm.in_ground
ysm.projectile_owner
ysm.delta_movement_length
ysm.is_spectral_arrow
ysm.is_open_air
q.debug_output
q.relative_block_has_all_tags
q.relative_block_has_any_tag
q.position
q.position_delta
q.actor_count
q.anim_time
q.life_time
q.moon_phase
q.time_of_day
q.time_stamp
q.body_x_rotation
q.body_y_rotation
q.yaw_speed
q.cardinal_facing_2d
q.distance_from_camera
q.equipment_count
q.eye_target_x_rotation
q.eye_target_y_rotation
q.ground_speed
q.modified_distance_moved
q.vertical_speed
q.walk_distance
q.has_rider
q.is_first_person
q.is_in_water
q.is_in_water_or_rain
q.is_on_fire
q.is_on_ground
q.is_riding
q.is_sneaking
q.is_spectator
q.is_sprinting
q.is_swimming