your current location:首页 > news>Function Compiler Minecraft

Function Compiler Minecraft

2024-12-12 09:20:26|Myriagame |source:minecraft skins

Function Compiler

Note: The module is in the early stage of development and is not recommended to use it outside the development environment.

The module allows the server to compile the function in the packet into the Java bytecode when loading, thereby improving performance, because the compiled code can run all content at one time, rather than running commands one by one.In order to improve performance, the module will not comply with MaxCommandChainLength game rules, otherwise the compiled code will need to check the number of commands to run, which may be slow.

Use

Put MOD with all dependencies on the Fabric server, MOD will automatically try to optimize all supporting functions and commands.

If you encounter any collapse, please report on the problem tracker and temporarily close the MOD until the problem is solved.

Supportive command

Of course, the module cannot support all commands, so it will only generate code for functions that only contain support commands. At present, it will not compile functions with macro.

It cannot compile macros, because any value can be explained in any way, and it is difficult to use what is known when compiling.

The following shows the changes in the support commands of each version.

0.1.0-Alpha.1 New increase:

 Execute Asexecute if EntityExecute if scorexecute runfunction Players Operation = Scoreboard Players Operation+= Scoreboard Players Operation-= Scoreboard Players Operation*= Scoreboard Players RemoveScore PlayersReset

0.1.0-Alpha.2 New increase:

 Execute Unless EntityExecute Unless ScoreScoreboard Players Operation/= Scoreboard Players Operation%= Scoreboard Players Operation  Scoreboard Players Operation> <

0.1.0-Alpha.4:

 Execute at 

0.1.0-Alpha.5:

 Execute positive  Note: It also supports the selector parameter scores.

0.1.0-Alpha.6:

 Execute Alignymode Note: It also supports the selection of the selected parameter Gamemode, Team, Type.

0.1.0-Alpha.7:

 Attribute   Base Setexecute Store Result ScoreScoreboard Players Get 
0.2.0-Alpha.3:

 Scoreboard Players Reset also supports the selector X_Rotation, Y_Rotation.

Supporting selector

Not all selectors are supported. At present, they only support the selector UUID, player name, @E, @a, @S; support the selection venue parameter gamemode, Limit, TAG, Team, Type, Scores.

As the module is updated, the supported commands and selectors may increase, and the list here is for reference only.

Working principle

The working principle of the module is to use the Java class loader to generate the bytecode of the function and load them at runtime. If you have a willingness, you can view the source file here.