From a8895a30fcb8be37975ef5eae712a62ff5e86818 Mon Sep 17 00:00:00 2001 From: kaenganxt Date: Fri, 2 Jan 2015 13:21:32 +0100 Subject: [PATCH] - Fix aim the water item - Fix Exception in onDisable --- src/de/anura/core/API/Core.java | 14 +++++++++++--- src/de/anura/core/AnuraCore.java | 3 ++- src/de/anura/core/Setup.java | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/de/anura/core/API/Core.java b/src/de/anura/core/API/Core.java index 033f354..d242b6d 100644 --- a/src/de/anura/core/API/Core.java +++ b/src/de/anura/core/API/Core.java @@ -199,7 +199,7 @@ public class Core { * Makes a player stand up * @param P The player to end the sitting of */ - public static void endSitting(Player P) { + public static void endSitting(Player P, boolean noRemove) { try { if (getMainClass().sittingPlayer.containsKey(P)) { MaterialData md = getMainClass().sittingBlocks.get(P).getState().getData(); @@ -209,13 +209,17 @@ public class Core { Entity a = (Entity) getMainClass().sittingPlayer.get(P); P.teleport(loc); a.remove(); - getMainClass().sittingPlayer.remove(P); + if (!noRemove) { + getMainClass().sittingPlayer.remove(P); + } getMainClass().sittingBlocks.remove(P); } else { Location loc = getMainClass().sittingPlayer.get(P).getLocation(); P.teleport(loc); getMainClass().sittingPlayer.get(P).remove(); - getMainClass().sittingPlayer.remove(P); + if (!noRemove) { + getMainClass().sittingPlayer.remove(P); + } getMainClass().sittingBlocks.remove(P); } } @@ -223,6 +227,10 @@ public class Core { Errors.reportException(e); } } + + public static void endSitting(Player P) { + endSitting(P, false); + } /** * Method to check if a given string can be converted into an integer diff --git a/src/de/anura/core/AnuraCore.java b/src/de/anura/core/AnuraCore.java index c98fd6c..1e823c1 100644 --- a/src/de/anura/core/AnuraCore.java +++ b/src/de/anura/core/AnuraCore.java @@ -105,8 +105,9 @@ public class AnuraCore extends JavaPlugin { features.reset(); level.update(); for (Player P : this.sittingPlayer.keySet()) { - Core.endSitting(P); + Core.endSitting(P, true); } + sittingPlayer.clear(); } catch (Throwable e) { Errors.reportException(e); } diff --git a/src/de/anura/core/Setup.java b/src/de/anura/core/Setup.java index db24d7b..e1b9bdc 100644 --- a/src/de/anura/core/Setup.java +++ b/src/de/anura/core/Setup.java @@ -229,7 +229,7 @@ public class Setup { Inventories.putIntoInventory("MINIGAMES", 1, Inventories.buildItems(Material.WHEAT, "inv_lobby_farmfight", ChatColor.YELLOW)); Inventories.putIntoInventory("MINIGAMES", 2, Inventories.buildItems(Material.FIREWORK, "inv_lobby_rocketmatch", ChatColor.DARK_AQUA)); Inventories.putIntoInventory("MINIGAMES", 4, Inventories.buildItems(Material.EXP_BOTTLE, "inv_lobby_xpbattle", ChatColor.GREEN)); - Inventories.putIntoInventory("MINIGAMES", 5, Inventories.buildItems(Material.WATER_BUCKET, "inv_lobby_swim", ChatColor.DARK_AQUA)); + Inventories.putIntoInventory("MINIGAMES", 5, Inventories.buildItems(Material.POTION, "inv_lobby_pool", ChatColor.DARK_AQUA)); } else { Inventories.putIntoInventory("MINIGAMES", 0, Inventories.buildItems(Material.BOW, "inv_lobby_smash", ChatColor.GREEN, ChatColor.BLUE, "smash_description_1", "smash_description_2", "smash_description_3", "smash_description_4", "smash_description_5", "smash_description_6")); Inventories.putIntoInventory("MINIGAMES", 3, Inventories.buildItems(Material.WHEAT, "inv_lobby_farmfight", ChatColor.YELLOW));