your current location:首页 > news>Server Replay Minecraft

Server Replay Minecraft

2024-12-15 01:09:54|Myriagame |source:minecraft skins

Overview

This is a replay module that only takes effect on the server. It allows you to record multiple online players or a certain block at the same time on the server, and then generate a recording file that can be used by the client replay module for rendering to renderingEssence

Why choose the server?

Compared with the client's Replay Mod, it has many benefits to recording on the server:

Can record a fixed block:

You can specify the exact block size (not affected by the server vision);

The blocks of these records can be uninstalled without affecting the return.

The block will not flash in the process of uninstallation and loading;

These blocks will not be loaded by the recorder (unlike PCRC, it will manually load the block);

The recording can skip the time when the block is uninstalled;

*Here refers to the recorder that will not manually load those blocks that should have been uninstalled (the record will be performed only when the block is loaded), and the loading and uninstallation of the block will not affect the record.—— Translator Note*

Can record players:

Players do not need to install the replay module*(including this module and client video back to the MOD. —— Translator Note*);

You can record multiple machines at one time;

Recording can be automatically carried out by setting items.

Recording behavior can be opened by the administrator at any time.(Or other people with permissions)

But there are still some shortcomings and known issues:

Some things will not be recorded, such as the BOSS column;

To preview the recording playback, you must download the recording file from the server;

Recording the content of the player may not be consistent with the recording content of the client Replay Mod;

Module compatibility issues.Modules may conflict with other modules that have modified networks. If you encounter any compatibility problems, please submit a GitHub Issue.

usage

This module requires Fabric Loader, Fabric API and Fabric Language Kotlin.

There are two methods to record on the server: you can set the module to follow and record the player from the perspective of the player; or, you can record a fixed block.

Start quickly

This part of the document will briefly guide you to build the foundation, and also contain some important information.

Player

To record the player on the server, you can run

/Replay Start Players  

For example:

/Replay Start Players Senseiwells/Replay Start Players@A/Replay Start Players @a [Gamemode = Survival] 

Players' recording will be bound to the player and records at the server -side vision.

If the player exits the server or the server stop, the recording will be stopped and saved automatically.

At the same time, if you want to stop recording manually, you can run:

/Replay Stop Players  

This instruction can also stop recording and cancel preservation, for example:

/Replay Stop Players Senseiwells/Replay Stop Players@R/Replay Stop Players Senseiwells False 

After this recording, it will be stored in the UUID directory of the folder specified by "Player_Recording_path".

By default, it will be preserved in ./recordings/players/< uuid>/date-nd-time>.mcpr.

This file can then be placed under the ./replay_recordings folder of the client and open it with a client video back module.

Important notice

If you want to record the carpet's dummy, you need to open the "fix_carpet_bot_view_distance" in the settings, otherwise there will be only the distance between the two blocks around the dummy will be recorded.Block

Important reminder:

For the specified area of ​​the module, the Minecraft client does not render the most edge blocks.So to record a visible block, you must add a block (when you are elected) on the edge, such as recording a visible area from -5, -5 to 5, 56 Recording.

To record the blocks in a area of ​​the server, you can run:

/Replay Start Chunks From   to   in named 

For example:

/Replay Start Chunks from -5 -5 to 5 5 in Minecraft: Overworld Named MyChunkRecordIn/Replay Start Chunks from 54 67 TO 109 124/Replay Start Chunks from 30 30 to 60 60 inMinecraft: The_nether 

At the same time, you can specify a block and the radius around it for recording:

/Replay Start Chunks Around   Radius  in  named 

For example:

/Replay Start Chunks Around 0 0 Radius 5/Replay Start Chunks Art 67 12 RADIUS 16 in Minecraft Named Perim Eter Recorder 

Block recording will be fixed and cannot be moved, and they will record specified blocks.It should be noted that when the recording starts, these specified blocks will be loaded (and generated under necessary).But after that, the recorder will not manually load these blocks.

At the same time, if you want to stop recording manually, you can run:

/Replay Stop Chunks From   to   in named 

This instruction can also stop recording and cancel preservation, for example:

/Replay Stop Chunks From 0 0 5 5 in Minecraft: Overworld False/Replay Stop Chunks FROM 54 67 TO 109 124 
Save in "player_recording_path"Under the name of the block recording of the folder.

By default, it will be preserved in ./recordings/chunks//date-nd-time>.mcpr.

This file can then be placed under the ./replay_recordings folder of the client and open it with the client Replay Mod.

instruction

Note: For all instructions, players must have a level 4 OP permissions, or if you have a permissions module (such as luckperms, players can use these instructions when having permissions nodes replay.commands.replay.

/replay enable 

Allow the module to automatically record the player in accordance with the given rules (for details for [matching rules] (#matching rules) part)).

/Replay Disable 

Forbidden modules to automatically record players, which will stop all current player recording and block recording.

/Replay Start Players 

Manually turn on the recording of a given player.

/Replay Start Chunks From   to   in named 

Manually turn on the recording of the given block range; if the dimension is not specified, the dimension of the player who initiated the instruction will be used; the name determines the preservation path of the recording file.

/Replay Start Chunks Around   Radius  in  name 

This instruction is similar to the previous instruction; but you can specify the area within the radius around the given block.

/Replay Stop Players  

If you manually stop recording a given player, you can selectively set whether the recording is saved, and it will be preserved by default.

/Replay Stop Chunks From   to   in named 

Manually stops recording of a given block range.If the dimension is not specified, the dimension where the player initiated instructions is located.You can selectively set whether the recording is saved, and it will be preserved by default.

/Replay Stop Chunks name  

This instruction is similar to the previous instruction; but you can rely on the name to select the specified block range.

/Replay Stop [chunks | players] all 

Manually stop recording all blocks or players.You can selectively set whether the recording is saved, and it will be preserved by default.

/Replay Status 

Get a status information, including whether the recording is permitted, and the current list of all players and blocks. They have been recorded, and their file size.

/replay recoad 

Contain the configuration file of the replay module.

Configuration item

After you start the server, a new file will be generated in ./config/serverreplay/config.json. By default, it is like this:

 {"enable": false, "world_name": "world", "server_name": "server", "chunk_recording_path": "./recordings/chunks", "player_recording_path":"./recordings/players", "max_file_size": "0GB", "RESTART_AFTER_MAX_FILE_SIZE": false, "max_duration": "0s", "RESTART_AFTER_MAX_DURATION": FALSE, "" recover_unsaved_replays ": true," Include_compressed_in_Status ": True," fixed_daylight_cycle": -1," pause_unloaded_chunks ": false," pause_notify_players ": true," notify_admins_of_status ": true," fix_carpet_view_distance ": FALSE , "IGNORE_SOUND_PACKETS": False, "Ignore_light_packets": true, "Ignore_Chat_packets": false, "Ignore_scoreboard_packets": False, "Optimize_explove_packets": true, "Optimize_entity_packets": false, "record_voice_chat": false, "Player_predicate": {"Typ" E ":" None "}," chunks ": []} 
ConfigDescript" Enabled "By default, the recording function is disabled.

You can turn on it by modifying config.json and then run /Replay Reload , or run /Replay [enable | disable] "world_name" the world name presented in the recording file."Server_name" The server name presented in the recording file."Player_recording_path" recorded the preservation path recorded by the player."chunk_recording_path" block recording the storage path."max_file_size" The maximum file size of the recording file is allowed, which should be a digital+unit, such as: 5.2MB.If the recording reaches this limit, the recorder will stop.This is just a similar value, so the real file will be slightly larger.If you do not limit it, set this option to 0.It should be noted that when the maximum file size is set too large, this may affect the server operation.In order to check whether a file exceeds the size (> 5GB), the file must be compressed, and this process may consume more performance.You can run through

/Replay Status 

Come to check the time to check the next file.

"RESTRT_AFTER_MAX_FILE_SIZE" If the recording reaches the largest file size set, the recording will automatically start a new recording file."max_duration"

Set the maximum length of recording, the recording will be stopped when the specified maximum length is reached. This should be a number+unit at that time (you can also have multiple units), such as 4H 45M 2.1S.Set this option to 0 to not limit the recording duration.

Note: If a recorder is suspended, the recording time will not increase.

"RESTRT_AFTER_MAX_Duration" If the max_duration is set and the recording reaches the maximum length, the recording will automatically restart and create a new recording file."Recover_unsaved_replays" attempts to restore unbearable recording. For example, your server collapses and stops before the recording stops or is successful.This cannot guarantee that the recording must not be damaged, but it will try to save the information that is still available."Include_compressed_in_Status" contains compressed recording files in /Replay Status . For longer recording, this may lead to an increase in the time required for display status information.So you can disable this option."fixed_daylight_cycle" If you don't want a constant day and night cycle for a long time, this will repair the sunlight cycle in the recording.This option should be set to one day in a tick, such as 6000 (half a day).To disable this repair, set the option value to -1."pause_unloaded_chunks"

If the block within a certain range is being recorded and the area is uninstalled. When this option is set to True, the recording will be suspended until the block is re -loaded.

If this option is set to FALSE, the block will still be recorded, just like they are loaded.(Refers to the blockage of the block in the background when they are uninstalled, not the time to uninstall the block directly.

"pause_notify_players" If pause_unload_chunks is enabled and this option is also enabled, all online players will be reminded when the recording block area is suspended or recovered."Notify_admins_of_Status" When it is enabled, this will notify the administrator's time to record the beginning, ending and preservation of success, and any errors that occur."fix_carpet_bot_view_distance" If you want to record the carpet dummy, you need to enable this option to set the dummy as the server as the server vision.Otherwise, only the distance between the two blocks around the dummy will be recorded."IGNORE_SOUND_PACKETS" ignores the sound network data packet.If you are recording delayed photography for a large area, you will hardly want to record any sound, because this will occupy extremely huge storage space."IGNORE_LIGHT_PACKETS" ignores the light network data packet.Light is calculated on the client and server at the same time, so most of the light packages are superfluous."IGNORE_CHAT_PACKETS" If the chat content is unnecessary in your recording, stop the recording of the chat package (from the server and other players)."IGNORE_SCOREBOARD_PACKETS" stops recording the scorebar bag (for example, if you have a scoring board that displays mining, then this score board and player's score will not be recorded)."Optimize_explove_packets". This greatly reduces the file size by sending explosive particles and sounds by sending explosive particles and sounds."Optimize_entity_packets" This reduces the file size by calculating some physical logic by allowing the client to calculate some physical logic, such as ejaculation and TNT.This may cause some inconsistencies, but this can almost be ignored."Record_voice_chat" If the Simple Voice Chat module is installed, this option allows support for voice chat.When viewing the recording, you must have installed the Replay Voice Chat module."Player_predicate" player automatically records the rules, please refer to the matching of the matching rules."Chunks" When the server starts, the block list of automatic recording should be performed.See the block part for details.Block settings

You can define the block area where the server starts when the server starts or you enable the serverreplay.

The definition of each block must include: "Name", "Dimension", "FROM_X", "TO_X", "From_Z", and "TO_Z".For example:

 {// ... "chunks": [{"name": "my chunks", "Dimension": "Minecraft: Overworld", "From_x": -5, "From_z ": -5," to_x ": 5," to_z ": 5}, {" name ":" My Nether Chunks "," Dimension ":" Minecraft: The_Nether "," From_X ": 100," From_Z ":50, "to_x": 90, "to_z": 60} // ...]} 
matching rules settings

In fact, this thing should be called "assertion".

You can define a matching rule, which will determine the player to be automatically recorded on the server.You can set this rule by specify whether a player has a specific UUID, name, in a specific team, or whether it is an administrator.

The most basic option is to record all players. In this case, you can use:

 {// ... "player_predicate": {"type": "all"}} 

If you want to only record players with a specific name or UUID, you can use:

 {// ... "Player_predicate": {"type": "has_name", "name": ["senseiwells", "foBar"]} 
 {// ... "Player_predicate": {"type": "have_uuid", "uuids": [41048400-886d-497D97-9b63afa ", "71266dbd-db0a-484A-B859-3F35590D7A9 "," 47D072CA-D7A2-467C-9B60-DE501907E91D "," 0E324E7F-E78E-4777-B508A65B1EB "," 7D9E24C2-9D0F- 479F-81C7-27389624EBB2 "]}} 
If you just want to record the administrator:

 {// ... "player_predicate": {"type": "has_op", "level": 4}} 

If you just want to record the players in a specific team, this option can support players to be joined or removed in the game, so you can only join the team, and then let them log in again (from the Move to record the player-Translator's Note).

 {// ... "Player_predicate": {"type": "in_team", "Teams": ["red", "blue", "spctator"]}} 
You can also use negative rules, use Not and then connect with or and.For example, if you want to record non -administrators and players who are not the names of the player, or players in the Red Team:

 {// ... "Player_predicate": {"type": "and", "Predicates": [{"type": "not", "predicate": {"" "Type ":" has_op "," level ": 4}}, {" type ":" not "," predicate ": {" type ":" or "," predicates ": [{" type ":" has_name ""Names": ["senseiwells"]}, {

"Type": "in_team", "Teams": ["red"]}}}}}

Automatically record.You can use IS_FAKE conditions to implement:

 {// ... "Player_predicate": {"type": "not", "Predicate": {"type": "is_fake"}}} 

Developer

If you want players more control when you are recorded, you can access this method in your module.

To access the API in your project, you can add the following content to your build.gradle.kts:

 repositories {maven {url = uri ("https://jitpack.io")}} DependenCies {// for the most rencent version USE The Latest Commit Hash Modimplementation ("COM.github.senseiwells: serverreplay: 281e9e0ec0 ")} 

Here is the most basic example:

 Class Examplemod: Modinitializer {Override Fun Oninitialize () {ServerplayConnevents.join.register {Connection, _, _ ---> Val Player = Connection.player if (! PlayerRecorders.has (player)) {If (player.Level (). Dimension () == level.end) {valrder = playerRolders.create (player) recreder.trystart (log = true) }} Else {value = playerRolders.get (player)!! Existing.getCompressetRecordingsize (). ThenAccept {size-> Println ("Replay is $ size bytes"))