diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/SkyWars.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/SkyWars.java index e36900ff3..a14fa9d35 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/SkyWars.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/SkyWars.java @@ -291,6 +291,7 @@ public class SkyWars extends SoloGame loc.getBlock().setTypeIdAndData(Material.CHEST.getId(), (byte) UtilMath.r(4), true); _middleChests.add(loc.getBlock()); + _worldBlocks.add(loc.getBlock()); } } @@ -325,6 +326,7 @@ public class SkyWars extends SoloGame _spawnChests.add(chest.getBlock()); chest.getBlock().setTypeIdAndData(Material.CHEST.getId(), (byte) UtilMath.r(4), true); + _worldBlocks.add(chest.getBlock()); } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/WinWithoutOpeningChestStatTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/WinWithoutOpeningChestStatTracker.java index 5edf4036b..83ef50364 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/WinWithoutOpeningChestStatTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/WinWithoutOpeningChestStatTracker.java @@ -9,9 +9,11 @@ import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.game.Game; import nautilus.game.arcade.game.games.skywars.events.PlayerOpenChestEvent; +import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; +import org.bukkit.event.block.BlockBreakEvent; public class WinWithoutOpeningChestStatTracker extends StatTracker { @@ -34,6 +36,13 @@ public class WinWithoutOpeningChestStatTracker extends StatTracker } + @EventHandler + public void onBreakChest(BlockBreakEvent event) + { + if (event.getBlock().getType() == Material.CHEST) + _openChest.add(event.getPlayer().getUniqueId()); + } + @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) public void onGameStateChange(GameStateChangeEvent event) {