diff --git a/.gitignore b/.gitignore index 8f9bae9..266fe06 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ target/ /rsx-server-core/world/ /rsx-server-core/accounts*.txt /rsx-server-core/*.txt +/world/ # jars are build products; the third-party ones we redistribute are un-ignored *.jar diff --git a/rsx-server-core/src/main/java/net/rustnotmc/server/ServerMain.java b/rsx-server-core/src/main/java/net/rustnotmc/server/ServerMain.java index 97035ab..63778b9 100644 --- a/rsx-server-core/src/main/java/net/rustnotmc/server/ServerMain.java +++ b/rsx-server-core/src/main/java/net/rustnotmc/server/ServerMain.java @@ -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()); } diff --git a/world/hitboxes.json b/world/hitboxes.json deleted file mode 100644 index db2254f..0000000 --- a/world/hitboxes.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "models": { - "player": [ - { "name": "head", "part": "head", "min": [-0.3, 1.4, -0.3], "max": [0.3, 1.8, 0.3] }, - { "name": "body", "part": "body", "min": [-0.3, 0.4, -0.3], "max": [0.3, 1.4, 0.3] }, - { "name": "legs", "part": "legs", "min": [-0.3, 0.0, -0.3], "max": [0.3, 0.4, 0.3] } - ], - "ore_stone": [ - { "name": "ore", "min": [-0.45, 0.0, -0.45], "max": [0.45, 0.6, 0.45] } - ], - "ore_metal": [ - { "name": "ore", "min": [-0.45, 0.0, -0.45], "max": [0.45, 0.6, 0.45] } - ], - "ore_sulfur": [ - { "name": "ore", "min": [-0.45, 0.0, -0.45], "max": [0.45, 0.6, 0.45] } - ], - "barrel_blue": [ - { "name": "barrel", "min": [-0.35, 0.0, -0.35], "max": [0.35, 0.95, 0.35] } - ], - "barrel_red": [ - { "name": "barrel", "min": [-0.35, 0.0, -0.35], "max": [0.35, 0.95, 0.35] } - ], - "barrel_white": [ - { "name": "barrel", "min": [-0.35, 0.0, -0.35], "max": [0.35, 0.95, 0.35] } - ], - "crate": [ - { "name": "crate", "min": [-0.45, 0.0, -0.45], "max": [0.45, 0.5, 0.45] } - ], - "food_crate": [ - { "name": "crate", "min": [-0.45, 0.0, -0.45], "max": [0.45, 0.5, 0.45] } - ] - } -}