diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/Challenge.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/Challenge.java index fd9c670bd..8ee87a09c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/Challenge.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/Challenge.java @@ -169,7 +169,9 @@ public abstract class Challenge implements Listener if (alive <= Settings.getMaxCompletedCount()) { for (Player player : players) + { setCompleted(player); + } return true; } @@ -236,12 +238,9 @@ public abstract class Challenge implements Listener int alive = Host.getPlayersWithRemainingLives(); int lives = loseLife(player); - if (lives <= 0) + if (lives <= 0 && alive <= 3) { - if (alive <= 3) - { - Host.getWinners().add(player); - } + Host.getWinners().add(player); } if (lives <= 0 && alive > 2) @@ -281,9 +280,9 @@ public abstract class Challenge implements Listener { if (Data.hasAnyoneCompleted() && !Data.isCompleted(player)) { - int lives = loseLife(player); + int lives = Host.lives(player); - if (lives > 0) + if (lives > 1) { setLost(player); } @@ -535,39 +534,71 @@ public abstract class Challenge implements Listener } } - @SuppressWarnings("deprecation") protected Block generateGrass(Block block) + { + return generateGrass(block, false); + } + + protected Block generateGrass(Block block, boolean bushes) { if (UtilMath.r(4) == 0) { if (UtilMath.r(8) == 0) { - Material flower = Material.YELLOW_FLOWER; - byte data = 0; - - if (UtilMath.random.nextBoolean()) - { - flower = Material.RED_ROSE; - - if (UtilMath.random.nextBoolean()) - { - data = (byte) (UtilMath.r(7) + 1); - } - } - - block.setType(flower); - block.setData(data); + makeFlower(block); } else { - block.setType(Material.LONG_GRASS); - block.setData((byte) 1); + makeGrass(block, bushes); } } return block; } + @SuppressWarnings("deprecation") + private void makeFlower(Block block) + { + Material flower = Material.YELLOW_FLOWER; + byte data = 0; + + if (UtilMath.random.nextBoolean()) + { + flower = Material.RED_ROSE; + + if (UtilMath.random.nextBoolean()) + { + data = (byte) (UtilMath.r(7) + 1); + } + } + + block.setType(flower); + block.setData(data); + } + + @SuppressWarnings("deprecation") + private void makeGrass(Block block, boolean bushes) + { + if (bushes && UtilMath.r(3) == 0) + { + Block above = block.getRelative(BlockFace.UP); + byte plantData = (byte) UtilMath.r(5); + + block.setType(Material.DOUBLE_PLANT); + block.setData(plantData); + + above.setType(Material.DOUBLE_PLANT); + above.setData((byte) 8); + + addBlock(above); + } + else + { + block.setType(Material.LONG_GRASS); + block.setData((byte) 1); + } + } + public boolean isChallengeValid() { return Host.IsLive() && Host.getSettings().isChallengeStarted(); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/ChallengeData.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/ChallengeData.java index 0e6eddeba..3a280e269 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/ChallengeData.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/challenge/ChallengeData.java @@ -2,6 +2,7 @@ package nautilus.game.arcade.game.games.mineware.challenge; import java.util.ArrayList; import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.List; import java.util.Set; @@ -19,7 +20,7 @@ public class ChallengeData { private List _spawns = new ArrayList<>(); private Set _invisible = new HashSet<>(); - private Set _modifiedBlocks = new HashSet<>(); + private Set _modifiedBlocks = new LinkedHashSet<>(); private Set _completed = new HashSet<>(); private Set _lost = new HashSet<>();