- Fix aim the water item
- Fix Exception in onDisable
This commit is contained in:
@@ -199,7 +199,7 @@ public class Core {
|
|||||||
* Makes a player stand up
|
* Makes a player stand up
|
||||||
* @param P The player to end the sitting of
|
* @param P The player to end the sitting of
|
||||||
*/
|
*/
|
||||||
public static void endSitting(Player P) {
|
public static void endSitting(Player P, boolean noRemove) {
|
||||||
try {
|
try {
|
||||||
if (getMainClass().sittingPlayer.containsKey(P)) {
|
if (getMainClass().sittingPlayer.containsKey(P)) {
|
||||||
MaterialData md = getMainClass().sittingBlocks.get(P).getState().getData();
|
MaterialData md = getMainClass().sittingBlocks.get(P).getState().getData();
|
||||||
@@ -209,13 +209,17 @@ public class Core {
|
|||||||
Entity a = (Entity) getMainClass().sittingPlayer.get(P);
|
Entity a = (Entity) getMainClass().sittingPlayer.get(P);
|
||||||
P.teleport(loc);
|
P.teleport(loc);
|
||||||
a.remove();
|
a.remove();
|
||||||
|
if (!noRemove) {
|
||||||
getMainClass().sittingPlayer.remove(P);
|
getMainClass().sittingPlayer.remove(P);
|
||||||
|
}
|
||||||
getMainClass().sittingBlocks.remove(P);
|
getMainClass().sittingBlocks.remove(P);
|
||||||
} else {
|
} else {
|
||||||
Location loc = getMainClass().sittingPlayer.get(P).getLocation();
|
Location loc = getMainClass().sittingPlayer.get(P).getLocation();
|
||||||
P.teleport(loc);
|
P.teleport(loc);
|
||||||
getMainClass().sittingPlayer.get(P).remove();
|
getMainClass().sittingPlayer.get(P).remove();
|
||||||
|
if (!noRemove) {
|
||||||
getMainClass().sittingPlayer.remove(P);
|
getMainClass().sittingPlayer.remove(P);
|
||||||
|
}
|
||||||
getMainClass().sittingBlocks.remove(P);
|
getMainClass().sittingBlocks.remove(P);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -224,6 +228,10 @@ public class Core {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void endSitting(Player P) {
|
||||||
|
endSitting(P, false);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to check if a given string can be converted into an integer
|
* Method to check if a given string can be converted into an integer
|
||||||
* @param s The string to check
|
* @param s The string to check
|
||||||
|
|||||||
@@ -105,8 +105,9 @@ public class AnuraCore extends JavaPlugin {
|
|||||||
features.reset();
|
features.reset();
|
||||||
level.update();
|
level.update();
|
||||||
for (Player P : this.sittingPlayer.keySet()) {
|
for (Player P : this.sittingPlayer.keySet()) {
|
||||||
Core.endSitting(P);
|
Core.endSitting(P, true);
|
||||||
}
|
}
|
||||||
|
sittingPlayer.clear();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Errors.reportException(e);
|
Errors.reportException(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ public class Setup {
|
|||||||
Inventories.putIntoInventory("MINIGAMES", 1, Inventories.buildItems(Material.WHEAT, "inv_lobby_farmfight", ChatColor.YELLOW));
|
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", 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", 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 {
|
} 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", 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));
|
Inventories.putIntoInventory("MINIGAMES", 3, Inventories.buildItems(Material.WHEAT, "inv_lobby_farmfight", ChatColor.YELLOW));
|
||||||
|
|||||||
Reference in New Issue
Block a user