Browse Source

Adding keepInventory option

RedstoneFuture 3 years ago
parent
commit
d5ed7844b9

+ 1 - 0
missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/Arena.java

@@ -43,6 +43,7 @@ public class Arena {
     @SerializedName("game_spawn") private GameSpawnConfiguration spawn = new GameSpawnConfiguration();
     @SerializedName("game_spawn") private GameSpawnConfiguration spawn = new GameSpawnConfiguration();
     @SerializedName("game_respawn") private GameRespawnConfiguration respawn = new GameRespawnConfiguration();
     @SerializedName("game_respawn") private GameRespawnConfiguration respawn = new GameRespawnConfiguration();
     @SerializedName("do_tile_drops") private boolean doTileDrops = false;
     @SerializedName("do_tile_drops") private boolean doTileDrops = false;
+    @SerializedName("keep_inventory") private boolean keepInventory = false;
     @SerializedName("max_height") private int maxHeight = 170;
     @SerializedName("max_height") private int maxHeight = 170;
     @SerializedName("death_height") private int deathHeight = 65;
     @SerializedName("death_height") private int deathHeight = 65;
     @SerializedName("max_spectators") private int maxSpectators = -1;
     @SerializedName("max_spectators") private int maxSpectators = -1;

+ 1 - 0
missilewars-plugin/src/main/java/de/butzlabben/missilewars/wrapper/abstracts/GameWorld.java

@@ -135,6 +135,7 @@ public class GameWorld {
             World world = Bukkit.createWorld(new WorldCreator(worldName));
             World world = Bukkit.createWorld(new WorldCreator(worldName));
             Bukkit.getWorlds().add(world);
             Bukkit.getWorlds().add(world);
             world.setGameRuleValue("doTileDrops", String.valueOf(game.getArena().isDoTileDrops()));
             world.setGameRuleValue("doTileDrops", String.valueOf(game.getArena().isDoTileDrops()));
+            world.setGameRuleValue("keepInventory", String.valueOf(game.getArena().isKeepInventory()));
         }
         }
     }
     }