From 7379b2069bb5b3fe692895330655a037cf79f97f Mon Sep 17 00:00:00 2001 From: Thanos Paravantis Date: Fri, 1 Jul 2016 12:31:41 +0300 Subject: [PATCH] Make volley pig map size and spawns dynamic --- .../challenge/type/ChallengeVolleyPig.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeVolleyPig.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeVolleyPig.java index 3d597ee76..d5b4b866d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeVolleyPig.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/type/ChallengeVolleyPig.java @@ -66,17 +66,16 @@ public class ChallengeVolleyPig extends TeamChallenge public ArrayList createSpawns() { ArrayList spawns = new ArrayList(); + int size = getArenaSize() - 1; - for (int x = -5; x <= 5; x++) + for (int x = -size; x <= 5; x++) { - for (int z = -9; z <= 9; z++) + for (int z = -size; z <= size; z++) { - if (z == 0) + if (z != 0) { - continue; + spawns.add(getCenter().add(x + 0.5, 1.1, z + 0.5)); } - - spawns.add(getCenter().add(x + 0.5, 1.1, z + 0.5)); } } @@ -86,15 +85,15 @@ public class ChallengeVolleyPig extends TeamChallenge @Override public void createMap() { - for (int x = -6; x <= 6; x++) + for (int x = -getArenaSize(); x <= 6; x++) { - for (int z = -10; z <= 10; z++) + for (int z = -getArenaSize(); z <= getArenaSize(); z++) { for (int y = 0; y <= 3; y++) { Block block = getCenter().getBlock().getRelative(x, y, z); - if (y == 0 || Math.abs(x) == 6 || Math.abs(z) == 10) + if (x == 6 || x == -getArenaSize() || y == 0 || Math.abs(z) == getArenaSize()) { setBlock(block, z == 0 ? Material.STAINED_GLASS : Material.STAINED_CLAY, (byte) (z < 0 ? 11 : z > 0 ? 14 : 0)); addBlock(block); @@ -254,8 +253,7 @@ public class ChallengeVolleyPig extends TeamChallenge 0, 0, 0, - false - ); + false); if (Recharge.Instance.use(player, "Knockback Message", 1000, false, false)) {