diff --git a/plugin.yml b/plugin.yml index c018429d..bdf4e4f6 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,6 +1,6 @@ name: SkyBlock main: me.goodandevil.skyblock.Main -version: 22 +version: 23 api-version: 1.13 description: A unique SkyBlock plugin author: GoodAndEvil diff --git a/src/me/goodandevil/skyblock/listeners/Quit.java b/src/me/goodandevil/skyblock/listeners/Quit.java index 432eaa94..f4f14485 100644 --- a/src/me/goodandevil/skyblock/listeners/Quit.java +++ b/src/me/goodandevil/skyblock/listeners/Quit.java @@ -40,7 +40,10 @@ public class Quit implements Listener { IslandManager islandManager = plugin.getIslandManager(); PlayerData playerData = playerDataManager.getPlayerData(player); - playerData.setLastOnline(new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(new Date())); + + try { + playerData.setLastOnline(new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(new Date())); + } catch (Exception e) {} if (islandManager.hasIsland(player)) { Island island = islandManager.getIsland(playerData.getOwner()); diff --git a/src/me/goodandevil/skyblock/menus/Visit.java b/src/me/goodandevil/skyblock/menus/Visit.java index 1bcc7f09..3d57c450 100644 --- a/src/me/goodandevil/skyblock/menus/Visit.java +++ b/src/me/goodandevil/skyblock/menus/Visit.java @@ -220,7 +220,7 @@ public class Visit implements Listener { } } - inv.addItem(inv.createItem(SkullUtil.create(targetPlayerTexture[0], targetPlayerTexture[1]), configLoad.getString("Menu.Visit.Item.Island.Displayname").replace("%player", targetPlayerName), itemLore, inv.createItemLoreVariable(new String[] { "%level#" + visit.getLevel(), "%members#" + visit.getMembers(), "%votes#" + visit.getVoters().size(), "%visits#" + visit.getVisitors().size(), "%players#" + playersAtIsland, "%player_capacity#" + playerCapacity, "%action#" + voteAction }), null, null), inventorySlot); + inv.addItem(inv.createItem(SkullUtil.create(targetPlayerTexture[0], targetPlayerTexture[1]), configLoad.getString("Menu.Visit.Item.Island.Displayname").replace("%player", targetPlayerName), itemLore, inv.createItemLoreVariable(new String[] { "%level#" + visit.getLevel().getLevel(), "%members#" + visit.getMembers(), "%votes#" + visit.getVoters().size(), "%visits#" + visit.getVisitors().size(), "%players#" + playersAtIsland, "%player_capacity#" + playerCapacity, "%action#" + voteAction }), null, null), inventorySlot); } else { if (signatureEnabled) { for (String itemLoreList : configLoad.getStringList("Menu.Visit.Item.Island.Vote.Disabled.Signature.Enabled.Lore")) { @@ -242,7 +242,7 @@ public class Visit implements Listener { itemLore.addAll(configLoad.getStringList("Menu.Visit.Item.Island.Vote.Disabled.Signature.Disabled.Lore")); } - inv.addItem(inv.createItem(SkullUtil.create(targetPlayerTexture[0], targetPlayerTexture[1]), configLoad.getString("Menu.Visit.Item.Island.Displayname").replace("%player", targetPlayerName), itemLore, inv.createItemLoreVariable(new String[] { "%level#" + visit.getLevel(), "%members#" + visit.getMembers(), "%visits#" + visit.getVisitors().size(), "%players#" + playersAtIsland, "%player_capacity#" + playerCapacity }), null, null), inventorySlot); + inv.addItem(inv.createItem(SkullUtil.create(targetPlayerTexture[0], targetPlayerTexture[1]), configLoad.getString("Menu.Visit.Item.Island.Displayname").replace("%player", targetPlayerName), itemLore, inv.createItemLoreVariable(new String[] { "%level#" + visit.getLevel().getLevel(), "%members#" + visit.getMembers(), "%visits#" + visit.getVisitors().size(), "%players#" + playersAtIsland, "%player_capacity#" + playerCapacity }), null, null), inventorySlot); } } } @@ -340,9 +340,12 @@ public class Visit implements Listener { for (Location.World worldList : Location.World.values()) { if (LocationUtil.isLocationAtLocationRadius(player.getLocation(), island.getLocation(worldList, Location.Environment.Island), island.getRadius())) { visit.removeVoter(player.getUniqueId()); - player.sendMessage(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Island.Visit.Vote.Removed.Message").replace("%player", targetPlayerName))); + + player.sendMessage(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Island.Visit.Vote.Removed.Message").replace("%player", targetPlayerName))); soundManager.playSound(player, Sounds.EXPLODE.bukkitSound(), 1.0F, 1.0F); + open(player, (Visit.Type) playerData.getType(), (Visit.Sort) playerData.getSort()); + return; } } @@ -353,9 +356,12 @@ public class Visit implements Listener { for (Location.World worldList : Location.World.values()) { if (LocationUtil.isLocationAtLocationRadius(player.getLocation(), island.getLocation(worldList, Location.Environment.Island), island.getRadius())) { visit.addVoter(player.getUniqueId()); - player.sendMessage(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Island.Visit.Vote.Added.Message").replace("%player", targetPlayerName))); + + player.sendMessage(ChatColor.translateAlternateColorCodes('&', configLoad.getString("Island.Visit.Vote.Added.Message").replace("%player", targetPlayerName))); soundManager.playSound(player, Sounds.LEVEL_UP.bukkitSound(), 1.0F, 1.0F); + open(player, (Visit.Type) playerData.getType(), (Visit.Sort) playerData.getSort()); + return; } }