Explorar el Código

Merge pull request #28 from RedstoneFuture/Features/AddKeepInventoryOption

Adding keepInventory option
Daniel hace 2 años
padre
commit
524cdd7cd3

+ 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_respawn") private GameRespawnConfiguration respawn = new GameRespawnConfiguration();
     @SerializedName("do_tile_drops") private boolean doTileDrops = false;
+    @SerializedName("keep_inventory") private boolean keepInventory = false;
     @SerializedName("max_height") private int maxHeight = 170;
     @SerializedName("death_height") private int deathHeight = 65;
     @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));
             Bukkit.getWorlds().add(world);
             world.setGameRuleValue("doTileDrops", String.valueOf(game.getArena().isDoTileDrops()));
+            world.setGameRuleValue("keepInventory", String.valueOf(game.getArena().isKeepInventory()));
         }
     }