more skywars fixes

This commit is contained in:
Cheese 2015-06-26 17:05:29 +10:00
parent 015ba53bbe
commit c514cacd5d
2 changed files with 11 additions and 0 deletions

View File

@ -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());
}
}
}

View File

@ -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<Game>
{
@ -34,6 +36,13 @@ public class WinWithoutOpeningChestStatTracker extends StatTracker<Game>
}
@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)
{