Сервер кладёт файл хитбоксов рядом с миром

This commit is contained in:
sasheg dev
2026-10-21 23:12:00 +03:00
parent fbd01df884
commit cf90f71e58
3 changed files with 6 additions and 35 deletions
@@ -45,7 +45,7 @@ public final class ServerMain {
String gameMode = "survival";
String register = null;
String password = null;
Path hitboxes = worldDir.resolve("hitboxes.json");
Path hitboxes = null;
for (int i = 0; i < args.length - 1; i++) {
String flag = args[i];
@@ -81,7 +81,10 @@ public final class ServerMain {
World world = new World(seed, new ChunkStorage(worldDir));
Server server = new Server(name, motd, capacity, port, world);
server.hitboxes(new net.rustnotmc.server.hitbox.HitboxRegistry(hitboxes));
// the boxes of the models live beside the world, unless the file is
// named outright
Path boxFile = hitboxes != null ? hitboxes : worldDir.resolve("hitboxes.json");
server.hitboxes(new net.rustnotmc.server.hitbox.HitboxRegistry(boxFile));
if (!server.hitboxes().lastError().isEmpty()) {
System.out.println("[rsx] hitboxes: " + server.hitboxes().lastError());
}