You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/mscs/adjusting-world-server-properties/forge.md
+48-20Lines changed: 48 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,7 +100,34 @@ is the name of your world.
100
100
## Forge 1.17.1 and later
101
101
Please note that forge for Minecraft 1.17.1 will be used in the examples. If you named the server directory `forge-1.17.1` in the first step with the `mkdir` command, the installer should install a bash script to `/opt/mscs/server/forge-1.17.1` and a bunch of library files in `/opt/mscs/server/forge-1.17.1/libraries/`.
102
102
103
-
In the `/opt/mscs/server/forge-1.17.1 directory`, edit `run.sh`.
103
+
There's an automatic and a manual way to apply the fixes needed for these versions.
104
+
105
+
### Automatic
106
+
107
+
**In the `/opt/mscs/server/forge-1.17.1` directory**, execute these commands:
108
+
109
+
```bash
110
+
sed -i "\|@[^\"]|s|@|@$(pwd)/|" run.sh
111
+
sed -i "s|\"\$@|--nogui &|g" run.sh
112
+
sed -i "s|libraries|$(pwd)/libraries|g" libraries/net/minecraftforge/forge/*/unix_args.txt
113
+
```
114
+
115
+
<details>
116
+
<summary>Explanation of the sed commands</summary>
117
+
118
+
`sed -i "\|@[^\"]|s|@|@$(pwd)/|" run.sh`: This matches all occurences of `@` that aren't followed by `"` and adds the current directory followed by a / to it (or rather, replaces the `@` with an `@` followed by the current directory).
119
+
120
+
`sed -i "s|\"\$@|--nogui &|g" run.sh`: This adds `--nogui ` in front of `"$@`, with `&` being the matched pattern.
121
+
122
+
`sed -i "s|libraries|$(pwd)/libraries|g" libraries/net/minecraftforge/forge/*/unix_args.txt`: This adds the current path to all occurences of the word libraries in the unix_args.txt file. Because the directory contains the forge version (for example `1.17.1-37.1.1`), `*` is used as a wildcard.
123
+
124
+
</details>
125
+
<br>
126
+
Continue below at <ahref="#end-manual"><strong>You may also want...</strong></a>
127
+
128
+
### Manual
129
+
130
+
In the `/opt/mscs/server/forge-1.17.1` directory, edit `run.sh`.
104
131
105
132
(GNU nano is an easy to use command-line text editor if you plan to edit the file from the terminal. Install it with `sudo apt install nano` if you are using a Debian based distro. In the following instructions, to edit a file with GNU nano, replace `editor` with `nano`.)
106
133
@@ -122,6 +149,25 @@ The `@user_jvm_args.txt` and the `@libraries/net/minecraftforge/forge/1.17.1-37.
Now the `unix_args.txt` file mentioned in `run.sh` needs to be edited as well to include the full directory paths. Change the directory to the one containing the `unix_args.txt` file, create a backup in case you mess up the editing, and then edit the original.
153
+
154
+
```bash
155
+
cd /opt/mscs/server/forge-1.17.1/libraries/net/minecraftforge/forge/1.17.1-37.1.1/
156
+
cp unix_args.txt unix_args_backup.txt
157
+
editor unix_args.txt
158
+
```
159
+
160
+
Every path that includes `libraries/[...]` has to be replaced with their full directory path: `/opt/mscs/server/forge-1.17.1/libraries/[...]`. If your editor of choice is GNU nano, this can be done by pressing `<Ctrl-\>`, typing `libraries` and pressing enter, then typing the full path name. In this case it would be `/opt/mscs/server/forge-1.17.1/libraries`, then press enter, then press `<a>` to replace all.
161
+
162
+
If you mess this up, you can always delete the `unix_args.txt` file and make another one using the backup, and start editing again.
163
+
164
+
```bash
165
+
rm unix_args.txt
166
+
cp unix_args_backup.txt unix_args.txt
167
+
editor unix_args.txt
168
+
```
169
+
<aid="end-manual"></a>
170
+
125
171
You may also want to increase the initial RAM and possibly even the maximum RAM. To do this, edit the `user_jvm_args.txt` file.
126
172
127
173
```bash
@@ -143,24 +189,6 @@ Now add all the java arguments you wish. For example, to allocate a minimum of 4
143
189
-Xms4G -Xmx6G
144
190
```
145
191
146
-
Now the `unix_args.txt` file mentioned in `run.sh` needs to be edited as well to include the full directory paths. Change the directory to the one containing the `unix_args.txt` file, create a backup in case you mess up the editing, and then edit the original.
147
-
148
-
```bash
149
-
cd /opt/mscs/server/forge-1.17.1/libraries/net/minecraftforge/forge/1.17.1-37.1.1/
150
-
cp unix_args.txt unix_args_backup.txt
151
-
editor unix_args.txt
152
-
```
153
-
154
-
Every path that includes `libraries/[...]` has to be replaced with their full directory path: `/opt/mscs/server/forge-1.17.1/libraries/[...]`. If your editor of choice is GNU nano, this can be done by pressing `<Ctrl-\>`, typing `libraries` and pressing enter, then typing the full path name. In this case it would be `/opt/mscs/server/forge-1.17.1/libraries`, then press enter, then press `<a>` to replace all.
155
-
156
-
If you mess this up, you can always delete the `unix_args.txt` file and make another one using the backup, and start editing again.
0 commit comments