From 36a98d5e41f2f6fc6381916bd8d9b0c15547ccf1 Mon Sep 17 00:00:00 2001 From: Chiss Date: Tue, 3 Dec 2013 21:31:02 +1100 Subject: [PATCH] UHC changes --- .../game/arcade/game/games/uhc/UHC.java | 55 +++++++------------ 1 file changed, 19 insertions(+), 36 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/uhc/UHC.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/uhc/UHC.java index 0993488fb..6607ca371 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/uhc/UHC.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/uhc/UHC.java @@ -166,7 +166,7 @@ public class UHC extends TeamGame //Set Portal Blocks for (int i=0 ; i<_portalBlock.size() ; i++) { - if (i<6) + if (i<9) _portalBlock.get(i).getBlock().setTypeIdAndData(Material.ENDER_PORTAL_FRAME.getId(), (byte)4, true); else _portalBlock.get(i).getBlock().setTypeIdAndData(Material.ENDER_PORTAL_FRAME.getId(), (byte)0, true); @@ -290,7 +290,7 @@ public class UHC extends TeamGame if (from.getX() >= WorldData.MaxX) from.setX(WorldData.MaxX - 1); if (from.getX() < WorldData.MinX) from.setX(WorldData.MinX + 1); if (from.getZ() >= WorldData.MaxZ) from.setZ(WorldData.MaxZ - 1); - if (from.getZ() < WorldData.MaxZ) from.setZ(WorldData.MinZ + 1); + if (from.getZ() < WorldData.MinZ) from.setZ(WorldData.MinZ + 1); event.setTo(event.getFrom()); @@ -303,46 +303,24 @@ public class UHC extends TeamGame if (event.GetState() != GameState.Recruit) return; + long time = System.currentTimeMillis(); + this.WorldData.MinX = -_borders; this.WorldData.MaxX = _borders; this.WorldData.MinZ = -_borders; this.WorldData.MaxZ = _borders; - - int min = -(_borders/16 + 1); - int max = _borders/16; - - for (int x=min ; x<=max ; x++) - { - WorldBoundaryRed(WorldData.World.getChunkAt(x, max)); - WorldBoundaryRed(WorldData.World.getChunkAt(x, min)); - } - - for (int z=min ; z<=max ; z++) - { - WorldBoundaryRed(WorldData.World.getChunkAt(max, z)); - WorldBoundaryRed(WorldData.World.getChunkAt(min, z)); - } - } - - public void WorldBoundaryRed(Chunk chunk) - { - Block block; - for (int x=0 ; x<16 ; x++) - for (int z=0 ; z<16 ; z++) - for (int y=0 ; y<256 ; y++) + + for (int y=0 ; y<128 ; y++) + for (int x=-_borders ; x<_borders ; x++) + for (int z=-_borders ; z<_borders ; z++) { - block = chunk.getBlock(x, y, z); - - if ( - block.getX() < WorldData.MaxX && - block.getX() >= WorldData.MinX && - block.getZ() < WorldData.MaxZ && - block.getZ() >= WorldData.MinZ) - continue; - - if (block.getTypeId() != 0 || block.getY() <= 128) - MapUtil.QuickChangeBlockAt(block.getLocation(), 159, (byte)14); + if (x == -_borders || x == _borders-1 || z == -_borders || z == _borders-1) + { + MapUtil.QuickChangeBlockAt(WorldData.World, x, y, z , 159, (byte)14); + } } + + System.out.println("Time: " + UtilTime.MakeStr(System.currentTimeMillis() - time)); } @EventHandler @@ -765,6 +743,7 @@ public class UHC extends TeamGame return; } + /* //Owner Bypass if (Manager.GetClients().Get(event.getPlayer()).GetRank().Has(Rank.OWNER)) return; @@ -772,6 +751,7 @@ public class UHC extends TeamGame //Disallow event.setResult(PlayerLoginEvent.Result.KICK_OTHER); event.disallow(PlayerLoginEvent.Result.KICK_OTHER, ChatColor.YELLOW + "You cannot join this UHC."); + */ } private void CraftRecipes() @@ -1240,6 +1220,9 @@ public class UHC extends TeamGame if (_lastDragonDamager == null) return; + + if (!(event.getEntity() instanceof EnderDragon)) + return; AnnounceEnd(_lastDragonDamager); _ended = true;