|
1 | | -# Preprocessor Example Mod |
| 1 | +# ServerFlashback |
2 | 2 |
|
3 | 3 | **English** | [简体中文](README-CN.md) |
4 | 4 |
|
5 | | -Example mod for [Fallen_Breath](https://github.com/Fallen-Breath)' |
6 | | -s [implementation](https://github.com/Fallen-Breath/preprocessor) of [ReplayMod](https://github.com/ReplayMod)' |
7 | | -s [preprocessor](https://github.com/ReplayMod/preprocessor). |
8 | | - |
9 | | -## Disclaimer |
10 | | - |
11 | | -If you are new to fabric modding, this template is not for you. Please learn to |
12 | | -use [Fabric Example Mod](https://github.com/FabricMC/fabric-example-mod) instead. |
13 | | - |
14 | | -## Features |
15 | | - |
16 | | -This repository provides some unique features that no other preprocessor template repositories provide, including: |
17 | | - |
18 | | -- Automatic Gradle subproject creation and linking (majorly implemented by @Jog_Ming ) |
19 | | -- GitHub Actions matrix publishing and cache refresh (majorly implemented by @XRain66 ) |
20 | | - |
21 | | -## Setup |
22 | | - |
23 | | -To set up the project, you will need to change the following fields in specified files: |
24 | | - |
25 | | -- `group` and `id` (corresponding to `maven_group` and `archives_base_name` in conventional fabric mods) in |
26 | | - `gradle.properties` |
27 | | -- The directory and file names in `src/main` |
28 | | -- The `name`, `description`, `authors`, `contact`, and `entrypoints` field in `fabric.mod.json` |
29 | | -- The `package` field in `<modid>.mixins.json` |
30 | | - |
31 | | -This template defaults to Minecraft version 1.17.1. To change that, simply rename the folder in `versions` and change |
32 | | -the contents of `versions/mainProject` to the version of desire, and sync Gradle. |
33 | | - |
34 | | -To add support for a new version, do: |
35 | | - |
36 | | -- Create a new folder in `versions` named to be the version you want to add |
37 | | -- Create a txt file in `versions` named `mapping-<old version>-<new version>.txt` |
38 | | - - This file is required, but could be left blank. It could also feature the translations of classes between the old |
39 | | - version and the new version. |
40 | | - - For example, in 1.17.1, the class responsible for spawning phantoms is `net.minecraft.world.gen.PhantomSpawner` |
41 | | - - However, in 1.20.1, it was renamed (moved) to `net.minecraft.world.spawner.PhantomSpawner`. |
42 | | - - To allow this translation to happen automatically, write the entry |
43 | | - `net.minecraft.world.gen.PhantomSpawner net.minecraft.world.spawner.PhantomSpawner` in |
44 | | - `versions/mapping-1.17.1-1.20.1.txt`. |
45 | | - - Each translation entry should occupy one line. |
46 | | -- If you want to add support for more than two versions, make sure that the mapping files are chained together from |
47 | | - older versions to newer versions |
48 | | - - For example, if you want to support three versions, 1.17.1, 1.20.1 and 1.21.1, the mapping files should be |
49 | | - `versions/mapping-1.17.1-1.20.1.txt` and `versions/mapping-1.20.1-1.21.1.txt` |
50 | | -- After adding the mapping txt files, sync Gradle. |
51 | | -- If you want to focus development on a version other than 1.17.1, modify the file `versions/mainProject`, and sync |
52 | | - Gradle |
53 | | -- In each of the version folders, create a `gradle.properties` file and a `<modid>.accesswidener` file. |
54 | | - - In `gradle.properties`, specify the fabric loader and the yarn mapping versions to be used. Refer to the examples |
55 | | - given in `versions/1.17.1/gradle.properties` if unsure |
56 | | - - `<modid>.accesswidener` is necessary but could have no entries (must declare `accessWidener v2 named` at the very |
57 | | - start of the file though) |
58 | | - |
59 | | -To add a mod as dependency, more changes had to be made: |
60 | | - |
61 | | -- Declare the mod repository in `common.gradle`. |
62 | | -- Go to `fabric.mod.json` and make space to insert the dependency declarations. |
63 | | - - Find the `"depends"` key and insert the dependency declaration like this: |
64 | | - `"depends": { ..., "carpet": ">=$carpet_version", ... }` |
65 | | -- In every version folder's `gradle.properties` file, create entries to store the dependency's version information. You |
66 | | - will likely need two entries for each dependency, one for the full version string to be used in dependency |
67 | | - declaration (such as `carpet_full_version=1.17.1-1.4.57+v220119`), and another for the simplified version string to be |
68 | | - used in `fabric.mod.json` (such as `carpet_version=1.4.57`) |
69 | | -- In the `dependencies` section of `common.gradle`, insert the respective `modImplementation` or `include` |
70 | | - declarations. (i.e. `modImplementation "carpet:fabric-carpet:$carpet_full_version"`) |
71 | | -- In the `processResources` section of `common.gradle`, find the line starting with `filesMatching('fabric.mod.json')`, |
72 | | - and insert a key-value pair like this: |
73 | | - `filesMatching('fabric.mod.json') { expand ..., carpet_version: carpet_version, ... }` |
74 | | - |
75 | | -If you want the GitHub `release` action to automatically publish to Modrinth, make sure to set the environment variable |
76 | | -`MODRINTH_ID` and secret `MODRINTH_TOKEN`. If you have mod dependencies, declare them in `.github/workflows/release.yml` |
77 | | -in the `dependencies` field. Refer to [mc-publish](https://github.com/Kira-NT/mc-publish) for declaration syntax. |
78 | | - |
79 | | -For more information on preprocessor, including its exact usage, purpose, and mechanics, refer |
80 | | -to [ReplayMod's repository](https://github.com/ReplayMod/preprocessor). |
81 | | - |
82 | | -For more information on changes made by Fallen_Breath, refer |
83 | | -to [his repository](https://github.com/Fallen-Breath/preprocessor). |
| 5 | +Server-side Fabric mod that records Minecraft replays in FlashBack's native format. Supports area-based recording with extended chunk range beyond the server's loaded chunks. Output files are directly compatible with the [FlashBack](https://github.com/Flashback-MC/Flashback) client mod for playback. |
| 6 | + |
| 7 | +## Supported Versions |
| 8 | + |
| 9 | +- Minecraft 1.17.1 |
| 10 | +- Minecraft 1.21.4 |
| 11 | + |
| 12 | +## Requirements |
| 13 | + |
| 14 | +- Fabric Loader |
| 15 | +- Fabric API |
| 16 | +- Server-side only (no client installation required for recording) |
| 17 | + |
| 18 | +## Installation |
| 19 | + |
| 20 | +1. Download the build for your Minecraft version from [Releases](https://github.com/Trirrin/ServerFlashback/releases) |
| 21 | +2. Place the JAR in your server's `mods` folder |
| 22 | +3. Restart the server |
| 23 | + |
| 24 | +## Commands |
| 25 | + |
| 26 | +All commands require OP level 2: |
| 27 | + |
| 28 | +| Command | Description | |
| 29 | +|---------|-------------| |
| 30 | +| `/serverflashback start <pos> <radius> [name]` | Start recording at block position with given radius (16–4096 blocks) | |
| 31 | +| `/serverflashback stop [name]` | Stop recording. Omit name to stop the only active recording | |
| 32 | +| `/serverflashback pause [name]` | Pause recording | |
| 33 | +| `/serverflashback resume [name]` | Resume paused recording | |
| 34 | +| `/serverflashback list` | List active recordings | |
| 35 | +| `/serverflashback mark <name> [description]` | Add a marker to the current recording (run as player) | |
| 36 | + |
| 37 | +## Output |
| 38 | + |
| 39 | +Replay files (`.zip`) are saved to `<server_root>/serverflashback/replays/`. Open them with the FlashBack client mod for playback. |
| 40 | + |
| 41 | +## Build |
| 42 | + |
| 43 | +```bash |
| 44 | +./gradlew :1.21.4:build # Build for MC 1.21.4 |
| 45 | +./gradlew :1.17.1:build --no-parallel # Build for MC 1.17.1 |
| 46 | +./gradlew :1.21.4:compileJava # Compile only (faster) |
| 47 | +``` |
84 | 48 |
|
85 | 49 | ## License |
86 | 50 |
|
87 | | -This template is available under the GPL-3.0 license. |
| 51 | +GPL-3.0 |
0 commit comments