diff --git a/bukkit-utils/src/main/java/dk/lockfuglsang/minecraft/file/FileUtil.java b/bukkit-utils/src/main/java/dk/lockfuglsang/minecraft/file/FileUtil.java
index 2602a027..74ec29f5 100644
--- a/bukkit-utils/src/main/java/dk/lockfuglsang/minecraft/file/FileUtil.java
+++ b/bukkit-utils/src/main/java/dk/lockfuglsang/minecraft/file/FileUtil.java
@@ -103,6 +103,14 @@ public static String getBasename(String file) {
}
return file;
}
+
+ public static String getExtension(String fileName) {
+ if (fileName != null && !fileName.isEmpty()) {
+ return fileName.substring(getBasename(fileName).length());
+ }
+ return "";
+ }
+
private static File getDataFolder() {
return dataFolder != null ? dataFolder : new File(".");
}
diff --git a/pom.xml b/pom.xml
index 890e33be..d48ab6af 100644
--- a/pom.xml
+++ b/pom.xml
@@ -95,6 +95,11 @@
titlemananager-repo
http://repo.puha.io/nexus/content/repositories/releases/
+
+ mvdw-software
+ MVdW Public Repositories
+ http://repo.mvdw-software.be/content/groups/public/
+
uSkyBlock-mvn-repo
diff --git a/uSkyBlock-Core/pom.xml b/uSkyBlock-Core/pom.xml
index 483ef829..24253a70 100644
--- a/uSkyBlock-Core/pom.xml
+++ b/uSkyBlock-Core/pom.xml
@@ -475,6 +475,11 @@
TitleManager
1.5.11
+
+ be.maximvdw
+ MVdWPlaceholderAPI
+ 1.0.1-SNAPSHOT
+
diff --git a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/command/island/BanCommand.java b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/command/island/BanCommand.java
index b38718d0..4d48608f 100644
--- a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/command/island/BanCommand.java
+++ b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/command/island/BanCommand.java
@@ -37,7 +37,7 @@ protected boolean doExecute(String alias, Player player, PlayerInfo pi, IslandIn
}
if (!island.isBanned(name)) {
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(name);
- if (offlinePlayer.isOnline() && hasPermission(offlinePlayer.getPlayer(), "usb.island.ban.exempt")) {
+ if (offlinePlayer.isOnline() && hasPermission(offlinePlayer.getPlayer(), "usb.exempt.ban")) {
offlinePlayer.getPlayer().sendMessage(I18nUtil.tr("\u00a74{0} tried to ban you from their island!", player.getName()));
player.sendMessage(I18nUtil.tr("\u00a74{0} is exempt from being banned.", name));
return true;
diff --git a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/command/island/KickCommand.java b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/command/island/KickCommand.java
index b81e7f31..a3354876 100644
--- a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/command/island/KickCommand.java
+++ b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/command/island/KickCommand.java
@@ -58,7 +58,7 @@ protected boolean doExecute(String alias, final Player player, PlayerInfo pi, fi
&& (plugin.locationIsOnIsland(player, onlineTargetPlayer.getLocation())
|| plugin.locationIsOnNetherIsland(player, onlineTargetPlayer.getLocation()))
) {
- if (hasPermission(onlineTargetPlayer, "usb.party.kick.exempt")) {
+ if (hasPermission(onlineTargetPlayer, "usb.exempt.kick")) {
onlineTargetPlayer.sendMessage(I18nUtil.tr("\u00a74{0} tried to kick you from their island!", player.getName()));
player.sendMessage(I18nUtil.tr("\u00a74{0} is exempt from being kicked.", targetPlayerName));
return true;
diff --git a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/event/PlayerEvents.java b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/event/PlayerEvents.java
index 50f377c4..d2117eb3 100644
--- a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/event/PlayerEvents.java
+++ b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/event/PlayerEvents.java
@@ -1,6 +1,5 @@
package us.talabrek.ultimateskyblock.event;
-import dk.lockfuglsang.minecraft.po.I18nUtil;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
@@ -18,55 +17,37 @@
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.FoodLevelChangeEvent;
-import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.event.player.PlayerInteractEvent;
-import org.bukkit.event.player.PlayerJoinEvent;
-import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.projectiles.ProjectileSource;
import us.talabrek.ultimateskyblock.Settings;
-import us.talabrek.ultimateskyblock.api.IslandRank;
-import us.talabrek.ultimateskyblock.handler.VaultHandler;
import us.talabrek.ultimateskyblock.handler.WorldGuardHandler;
import us.talabrek.ultimateskyblock.island.IslandInfo;
import us.talabrek.ultimateskyblock.player.Perk;
import us.talabrek.ultimateskyblock.player.PlayerInfo;
import us.talabrek.ultimateskyblock.uSkyBlock;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
-import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.UUID;
import java.util.WeakHashMap;
-import java.util.logging.Logger;
-import java.util.regex.Pattern;
import static dk.lockfuglsang.minecraft.perm.PermissionUtil.hasPermission;
import static dk.lockfuglsang.minecraft.po.I18nUtil.tr;
public class PlayerEvents implements Listener {
private static final String CN = PlayerEvents.class.getName();
- private static final Logger log = Logger.getLogger(CN);
private static final Set FIRE_TRAP = new HashSet<>(
Arrays.asList(EntityDamageEvent.DamageCause.LAVA, EntityDamageEvent.DamageCause.FIRE, EntityDamageEvent.DamageCause.FIRE_TICK));
private static final Random RANDOM = new Random();
private static final int OBSIDIAN_SPAM = 10000; // Max once every 10 seconds.
- private static final List LEVEL_PLACEHOLDER = Arrays.asList("{uskyblock_island_level}", "{usb_level}");
- private static final List RANK_PLACEHOLDER = Arrays.asList("{uskyblock_island_rank}", "{usb_rank}");
- private static final List PLACEHOLDERS = new ArrayList<>();
- static {
- PLACEHOLDERS.addAll(LEVEL_PLACEHOLDER);
- PLACEHOLDERS.addAll(RANK_PLACEHOLDER);
- }
-
private final uSkyBlock plugin;
private final boolean visitorFallProtected;
private final boolean visitorFireProtected;
@@ -261,52 +242,6 @@ public void run() {
}
}
- // We want to run LAST!
- @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
- public void onChat(AsyncPlayerChatEvent event) {
- String format = event.getFormat();
- Player player = event.getPlayer();
- if (player == null) {
- return;
- }
- if (hasPlaceholder(format)) {
- IslandRank rank = plugin.getIslandRank(player);
- String levelValue = "?";
- String rankValue = "?";
- if (rank != null) {
- levelValue = String.format("%.0f", rank.getScore());
- rankValue = String.format("%d", rank.getRank());
- } else {
- IslandInfo islandInfo = plugin.getIslandInfo(player);
- levelValue = islandInfo != null ? String.format("%.0f", islandInfo.getLevel()) : "?";
- }
- format = replaceValues(format, levelValue, rankValue);
- event.setFormat(format);
- }
- }
-
- private String replaceValues(String source, String levelValue, String rankValue) {
- String result = source;
- for (String placeholder : LEVEL_PLACEHOLDER) {
- result = result.replaceAll(Pattern.quote(placeholder), levelValue);
- }
- for (String placeholder : RANK_PLACEHOLDER) {
- result = result.replaceAll(Pattern.quote(placeholder), rankValue);
- }
- return result;
- }
-
- private boolean hasPlaceholder(String... strs) {
- for (String str : strs) {
- for (String placeholder : PLACEHOLDERS) {
- if (str.contains(placeholder)) {
- return true;
- }
- }
- }
- return false;
- }
-
@EventHandler(priority = EventPriority.LOW)
public void onLeafBreak(BlockBreakEvent event) {
if (event == null || event.isCancelled() || event.getPlayer() == null || !plugin.isSkyWorld(event.getPlayer().getWorld())) {
diff --git a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/CooldownHandler.java b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/CooldownHandler.java
index f9f67219..1f942128 100644
--- a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/CooldownHandler.java
+++ b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/CooldownHandler.java
@@ -32,7 +32,7 @@ public CooldownHandler(uSkyBlock plugin) {
* @return
*/
public int getCooldown(org.bukkit.entity.Player player, String cmd) {
- if (hasPermission(player, "usb.mod.bypasscooldowns") || hasPermission(player, "usb.exempt." + cmd + "Cooldown")) {
+ if (hasPermission(player, "usb.mod.bypasscooldowns") || hasPermission(player, "usb.exempt.cooldown." + cmd)) {
return 0;
}
Map map = cooldowns.get(player.getUniqueId());
diff --git a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/placeholder/ChatPlaceholder.java b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/placeholder/ChatPlaceholder.java
new file mode 100644
index 00000000..1a1b1149
--- /dev/null
+++ b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/placeholder/ChatPlaceholder.java
@@ -0,0 +1,33 @@
+package us.talabrek.ultimateskyblock.handler.placeholder;
+
+import org.bukkit.Bukkit;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.Listener;
+import org.bukkit.event.player.AsyncPlayerChatEvent;
+import us.talabrek.ultimateskyblock.uSkyBlock;
+
+/**
+ * Our native chat-placeholder handler.
+ */
+public class ChatPlaceholder extends TextPlaceholder implements Listener {
+ @Override
+ public boolean registerPlaceholder(uSkyBlock plugin, PlaceholderReplacer replacer) {
+ Bukkit.getPluginManager().registerEvents(this, plugin);
+ return super.registerPlaceholder(plugin, replacer);
+ }
+
+ @EventHandler
+ public void onChatEvent(AsyncPlayerChatEvent e) {
+ Player player = e.getPlayer();
+ String result = replacePlaceholders(player, e.getFormat());
+ if (result != null) {
+ e.setFormat(result);
+ }
+ result = replacePlaceholders(player, e.getMessage());
+ if (result != null) {
+ e.setMessage(result);
+ }
+ }
+
+}
diff --git a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/placeholder/MVdWPlaceholderAPI.java b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/placeholder/MVdWPlaceholderAPI.java
new file mode 100644
index 00000000..6ae71923
--- /dev/null
+++ b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/placeholder/MVdWPlaceholderAPI.java
@@ -0,0 +1,35 @@
+package us.talabrek.ultimateskyblock.handler.placeholder;
+
+import be.maximvdw.placeholderapi.PlaceholderReplaceEvent;
+import org.bukkit.Bukkit;
+import us.talabrek.ultimateskyblock.uSkyBlock;
+
+/**
+ * MVdWPlaceholder proxy
+ */
+public class MVdWPlaceholderAPI implements PlaceholderAPI {
+ public boolean isAvailable() {
+ // Might not be enabled yet...
+ return Bukkit.getPluginManager().getPlugin("MVdWPlaceholderAPI") != null;
+ }
+
+ @Override
+ public boolean registerPlaceholder(uSkyBlock plugin, final PlaceholderReplacer replacer) {
+ if (isAvailable()) {
+ be.maximvdw.placeholderapi.PlaceholderReplacer proxy = new be.maximvdw.placeholderapi.PlaceholderReplacer() {
+ @Override
+ public String onPlaceholderReplace(PlaceholderReplaceEvent e) {
+ if (replacer.getPlaceholders().contains(e.getPlaceholder())) {
+ return replacer.replace(e.getOfflinePlayer(), e.getPlayer(), e.getPlaceholder());
+ }
+ return null;
+ }
+ };
+ for (String placeholder : replacer.getPlaceholders()) {
+ be.maximvdw.placeholderapi.PlaceholderAPI.registerPlaceholder(plugin, placeholder, proxy);
+ }
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/placeholder/PlaceholderAPI.java b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/placeholder/PlaceholderAPI.java
new file mode 100644
index 00000000..2e2de90d
--- /dev/null
+++ b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/placeholder/PlaceholderAPI.java
@@ -0,0 +1,17 @@
+package us.talabrek.ultimateskyblock.handler.placeholder;
+
+import org.bukkit.OfflinePlayer;
+import org.bukkit.entity.Player;
+import us.talabrek.ultimateskyblock.uSkyBlock;
+
+import java.util.Set;
+
+/**
+ */
+public interface PlaceholderAPI {
+ interface PlaceholderReplacer {
+ Set getPlaceholders();
+ String replace(OfflinePlayer offlinePlayer, Player player, String placeholder);
+ }
+ boolean registerPlaceholder(uSkyBlock plugin, PlaceholderReplacer replacer);
+}
diff --git a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/placeholder/PlaceholderHandler.java b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/placeholder/PlaceholderHandler.java
new file mode 100644
index 00000000..5c2ceb6b
--- /dev/null
+++ b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/placeholder/PlaceholderHandler.java
@@ -0,0 +1,35 @@
+package us.talabrek.ultimateskyblock.handler.placeholder;
+
+import dk.lockfuglsang.minecraft.file.FileUtil;
+import us.talabrek.ultimateskyblock.uSkyBlock;
+
+public class PlaceholderHandler {
+ private static final String[] ADAPTORS = {
+ ChatPlaceholder.class.getName(),
+ ServerCommandPlaceholder.class.getName(),
+ "us.talabrek.ultimateskyblock.handler.placeholder.MVdWPlaceholder"
+ };
+
+ public static void register(uSkyBlock plugin) {
+ PlaceholderReplacerImpl placeholderReplacer = new PlaceholderReplacerImpl(plugin);
+ for (String className : ADAPTORS) {
+ String baseName = FileUtil.getExtension(className);
+ if (plugin.getConfig().getBoolean("placeholder." + baseName.toLowerCase() + ".enabled", false)) {
+ try {
+ Class> aClass = Class.forName(className);
+ Object o = aClass.newInstance();
+ if (o instanceof PlaceholderAPI) {
+ if (((PlaceholderAPI) o).registerPlaceholder(plugin, placeholderReplacer)) {
+ plugin.getLogger().info("uSkyBlock hooked into " + baseName);
+ } else {
+ plugin.getLogger().info("uSkyBlock failed to hook into " + baseName);
+ }
+ }
+ } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
+ // Ignore
+ plugin.getLogger().info("uSkyBlock failed to hook into " + baseName);
+ }
+ }
+ }
+ }
+}
diff --git a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/placeholder/PlaceholderReplacerImpl.java b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/placeholder/PlaceholderReplacerImpl.java
new file mode 100644
index 00000000..c197c436
--- /dev/null
+++ b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/placeholder/PlaceholderReplacerImpl.java
@@ -0,0 +1,194 @@
+package us.talabrek.ultimateskyblock.handler.placeholder;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import org.bukkit.OfflinePlayer;
+import org.bukkit.entity.Player;
+import us.talabrek.ultimateskyblock.api.IslandRank;
+import us.talabrek.ultimateskyblock.island.IslandInfo;
+import us.talabrek.ultimateskyblock.island.LimitLogic;
+import us.talabrek.ultimateskyblock.player.PlayerInfo;
+import us.talabrek.ultimateskyblock.uSkyBlock;
+import us.talabrek.ultimateskyblock.util.LocationUtil;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.ExecutionException;
+
+import static dk.lockfuglsang.minecraft.po.I18nUtil.pre;
+import static dk.lockfuglsang.minecraft.po.I18nUtil.tr;
+
+/**
+ * The actual replacer for placeholders
+ */
+public class PlaceholderReplacerImpl implements PlaceholderAPI.PlaceholderReplacer {
+ private static final Set PLACEHOLDERS = new HashSet<>(Arrays.asList(
+ "usb_version",
+ "usb_island_level",
+ "usb_island_rank",
+ "usb_island_leader",
+ "usb_island_golems_max",
+ "usb_island_monsters_max",
+ "usb_island_animals_max",
+ "usb_island_villagers_max",
+ "usb_island_partysize_max",
+ "usb_island_golems",
+ "usb_island_monsters",
+ "usb_island_animals",
+ "usb_island_villagers",
+ "usb_island_partysize",
+ "usb_island_biome",
+ "usb_island_bans",
+ "usb_island_members",
+ "usb_island_trustees",
+ "usb_island_location",
+ "usb_island_location_x",
+ "usb_island_location_y",
+ "usb_island_location_z",
+ "usb_island_schematic"
+ ));
+ private final uSkyBlock plugin;
+ private final LoadingCache cache;
+
+ public PlaceholderReplacerImpl(uSkyBlock plugin) {
+ this.plugin = plugin;
+ cache = CacheBuilder
+ .from(plugin.getConfig().getString("options.advanced.placeholderCache",
+ "maximumSize=200,expireAfterWrite=20s"))
+ .build(new CacheLoader() {
+ @Override
+ public String load(CacheEntry cacheEntry) throws Exception {
+ try {
+ return lookup(cacheEntry);
+ } catch (RuntimeException e) {
+ throw new ExecutionException(e.getMessage(), e);
+ }
+ }
+ });
+ }
+
+ private String lookup(CacheEntry entry) {
+ String placeholder = entry.getPlaceholder();
+ if (placeholder.startsWith("usb_island")) {
+ PlayerInfo playerInfo = plugin.getPlayerLogic().getPlayerInfo(entry.getUuid());
+ IslandInfo islandInfo = plugin.getIslandLogic().getIslandInfo(playerInfo);
+ if (playerInfo == null || islandInfo == null) {
+ return tr("N/A");
+ }
+ return lookup(islandInfo, placeholder);
+ } else if (placeholder.startsWith("usb_")) {
+ return lookup(placeholder);
+ }
+ throw new IllegalArgumentException("Unsupported placeholder " + placeholder);
+ }
+
+ private String lookup(String placeholder) {
+ switch (placeholder) {
+ case "usb_version": return plugin.getDescription().getVersion();
+ }
+ throw new IllegalArgumentException("Unsupported placeholder " + placeholder);
+ }
+
+ private String lookup(IslandInfo islandInfo, String placeholder) {
+ switch (placeholder) {
+ case "usb_island_level": return pre("{0,number,##.#}", islandInfo.getLevel());
+ case "usb_island_rank": return getRank(islandInfo);
+ case "usb_island_leader": return islandInfo.getLeader();
+ case "usb_island_golems_max": return "" + islandInfo.getMaxGolems();
+ case "usb_island_monsters_max": return "" + islandInfo.getMaxMonsters();
+ case "usb_island_animals_max": return "" + islandInfo.getMaxAnimals();
+ case "usb_island_villagers_max": return "" + islandInfo.getMaxVillagers();
+ case "usb_island_partysize_max": return "" + islandInfo.getMaxPartySize();
+ case "usb_island_golems": return "" + plugin.getLimitLogic().getCreatureCount(islandInfo).get(LimitLogic.CreatureType.GOLEM);
+ case "usb_island_monsters": return "" + plugin.getLimitLogic().getCreatureCount(islandInfo).get(LimitLogic.CreatureType.MONSTER);
+ case "usb_island_animals": return "" + plugin.getLimitLogic().getCreatureCount(islandInfo).get(LimitLogic.CreatureType.ANIMAL);
+ case "usb_island_villagers": return "" + plugin.getLimitLogic().getCreatureCount(islandInfo).get(LimitLogic.CreatureType.VILLAGER);
+ case "usb_island_partysize": return "" + islandInfo.getPartySize();
+ case "usb_island_biome": return islandInfo.getBiome();
+ case "usb_island_bans": return ""+islandInfo.getBans();
+ case "usb_island_members": return ""+islandInfo.getMembers();
+ case "usb_island_trustees": return ""+islandInfo.getTrustees();
+ case "usb_island_location": return LocationUtil.asString(islandInfo.getIslandLocation());
+ case "usb_island_location_x": return pre("{0,number,#}", islandInfo.getIslandLocation().getBlockX());
+ case "usb_island_location_y": return pre("{0,number,#}", islandInfo.getIslandLocation().getBlockY());
+ case "usb_island_location_z": return pre("{0,number,#}", islandInfo.getIslandLocation().getBlockZ());
+ case "usb_island_schematic": return islandInfo.getSchematicName();
+ }
+ throw new IllegalArgumentException("Unsupported placeholder " + placeholder);
+ }
+
+ private String getRank(IslandInfo islandInfo) {
+ IslandRank rank = plugin.getIslandLogic().getRank(islandInfo.getName());
+ if (rank != null) {
+ return pre("{0,number,#}", rank.getRank());
+ } else {
+ return tr("N/A");
+ }
+ }
+
+ @Override
+ public Set getPlaceholders() {
+ return PLACEHOLDERS;
+ }
+
+ @Override
+ public String replace(OfflinePlayer offlinePlayer, Player player, String placeholder) {
+ if (placeholder == null || !placeholder.startsWith("usb_")) {
+ return null;
+ }
+ UUID uuid = player != null ? player.getUniqueId() : null;
+ if (uuid == null && offlinePlayer != null) {
+ uuid = offlinePlayer.getUniqueId();
+ }
+ if (uuid == null) {
+ return null;
+ }
+ CacheEntry cacheKey = new CacheEntry(uuid, placeholder);
+ try {
+ return cache.get(cacheKey);
+ } catch (ExecutionException e) {
+ return null;
+ }
+ }
+
+ private static class CacheEntry {
+ private final UUID uuid;
+ private final String placeholder;
+
+ private CacheEntry(UUID uuid, String placeholder) {
+ this.uuid = uuid;
+ this.placeholder = placeholder;
+ }
+
+ public UUID getUuid() {
+ return uuid;
+ }
+
+ public String getPlaceholder() {
+ return placeholder;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ CacheEntry that = (CacheEntry) o;
+
+ if (!placeholder.equals(that.placeholder)) return false;
+ if (!uuid.equals(that.uuid)) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = uuid.hashCode();
+ result = 31 * result + placeholder.hashCode();
+ return result;
+ }
+ }
+}
diff --git a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/placeholder/ServerCommandPlaceholder.java b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/placeholder/ServerCommandPlaceholder.java
new file mode 100644
index 00000000..dfdd0ba2
--- /dev/null
+++ b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/placeholder/ServerCommandPlaceholder.java
@@ -0,0 +1,28 @@
+package us.talabrek.ultimateskyblock.handler.placeholder;
+
+import org.bukkit.Bukkit;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.Listener;
+import org.bukkit.event.server.ServerCommandEvent;
+import us.talabrek.ultimateskyblock.uSkyBlock;
+
+/**
+ * Replaces placeholders in server-commands
+ */
+public class ServerCommandPlaceholder extends TextPlaceholder implements Listener {
+ @Override
+ public boolean registerPlaceholder(uSkyBlock plugin, PlaceholderReplacer replacer) {
+ Bukkit.getPluginManager().registerEvents(this, plugin);
+ return super.registerPlaceholder(plugin, replacer);
+ }
+
+ @EventHandler
+ public void onCmd(ServerCommandEvent e) {
+ String cmd = e.getCommand();
+ String replacement = replacePlaceholders(e.getSender() instanceof Player ? (Player) e.getSender() : null, cmd);
+ if (replacement != null && !cmd.equals(replacement)) {
+ e.setCommand(cmd);
+ }
+ }
+}
diff --git a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/placeholder/TextPlaceholder.java b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/placeholder/TextPlaceholder.java
new file mode 100644
index 00000000..04ce08d7
--- /dev/null
+++ b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/handler/placeholder/TextPlaceholder.java
@@ -0,0 +1,47 @@
+package us.talabrek.ultimateskyblock.handler.placeholder;
+
+import org.bukkit.entity.Player;
+import us.talabrek.ultimateskyblock.uSkyBlock;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Created by R4zorax on 01/02/2016.
+ */
+public class TextPlaceholder implements PlaceholderAPI {
+ private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("\\{(?usb_[^}]*)\\}");
+ private uSkyBlock plugin;
+ private PlaceholderReplacer replacer;
+
+ @Override
+ public boolean registerPlaceholder(uSkyBlock plugin, PlaceholderReplacer replacer) {
+ this.plugin = plugin;
+ this.replacer = replacer;
+ return true;
+ }
+
+ protected String replacePlaceholders(Player player, String message) {
+ String result = null;
+ Matcher matcher = PLACEHOLDER_PATTERN.matcher(message);
+ if (matcher.find()) {
+ int ix = 0;
+ StringBuilder sb = new StringBuilder();
+ do {
+ sb.append(message.substring(ix, matcher.start()));
+ String replacement = replacer.replace(null, player, matcher.group("placeholder"));
+ if (replacement != null) {
+ sb.append(replacement);
+ } else {
+ sb.append(message.substring(matcher.start(), matcher.end()));
+ }
+ ix = matcher.end();
+ } while (matcher.find());
+ if (ix < message.length()) {
+ sb.append(message.substring(ix));
+ }
+ result = sb.toString();
+ }
+ return result;
+ }
+}
diff --git a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/island/IslandGenerator.java b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/island/IslandGenerator.java
index 24382f38..87e97ca1 100644
--- a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/island/IslandGenerator.java
+++ b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/island/IslandGenerator.java
@@ -28,8 +28,6 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-import static org.apache.commons.multiverse.io.FilenameUtils.getBaseName;
-
/**
* The factory for creating islands (actual blocks).
*/
@@ -64,7 +62,7 @@ public IslandGenerator(File dataFolder, FileConfiguration config) {
this.schemFiles = directorySchematics.listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
- return name != null && name.endsWith(".schematic") && !name.startsWith("uSkyBlock") && !getBaseName(name).toLowerCase().endsWith("nether");
+ return name != null && name.endsWith(".schematic") && !name.startsWith("uSkyBlock") && !FileUtil.getBasename(name).toLowerCase().endsWith("nether");
}
});
if (this.schemFiles == null) {
diff --git a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/island/LimitLogic.java b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/island/LimitLogic.java
index 1bb66bf1..6130fe64 100644
--- a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/island/LimitLogic.java
+++ b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/island/LimitLogic.java
@@ -14,6 +14,7 @@
import us.talabrek.ultimateskyblock.handler.WorldGuardHandler;
import us.talabrek.ultimateskyblock.uSkyBlock;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
@@ -40,6 +41,9 @@ public LimitLogic(uSkyBlock plugin) {
public Map getCreatureCount(IslandInfo islandInfo) {
Map mapCount = new HashMap<>();
+ for (CreatureType type : CreatureType.values()) {
+ mapCount.put(type, 0);
+ }
Location islandLocation = islandInfo.getIslandLocation();
ProtectedRegion islandRegionAt = WorldGuardHandler.getIslandRegionAt(islandLocation);
// Nether and Overworld regions are more or less equal (same x,z coords)
diff --git a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/menu/SkyBlockMenu.java b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/menu/SkyBlockMenu.java
index d2ccdd50..5db330fb 100644
--- a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/menu/SkyBlockMenu.java
+++ b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/menu/SkyBlockMenu.java
@@ -13,7 +13,6 @@
import org.bukkit.inventory.meta.SkullMeta;
import org.bukkit.scheduler.BukkitTask;
import us.talabrek.ultimateskyblock.challenge.ChallengeLogic;
-import us.talabrek.ultimateskyblock.handler.VaultHandler;
import us.talabrek.ultimateskyblock.island.IslandInfo;
import us.talabrek.ultimateskyblock.player.IslandPerk;
import us.talabrek.ultimateskyblock.player.PlayerInfo;
@@ -631,16 +630,30 @@ private Inventory createMainMenu(Player player) {
menuItem.setItemMeta(meta4);
menu.setItem(15, menuItem);
lores.clear();
- addExtraMenus(player, menu);
-
- menuItem = new ItemStack(Material.DIRT, 1, (byte)2);
- meta4 = menuItem.getItemMeta();
- meta4.setDisplayName(tr("\u00a7c\u00a7lRestart Island"));
- addLore(lores, "\u00a7f", tr("Restarts your island.\n\u00a74WARNING! \u00a7cwill remove your items and island!"));
- meta4.setLore(lores);
- menuItem.setItemMeta(meta4);
- menu.setItem(17, menuItem);
- lores.clear();
+ if (islandInfo.isLeader(player)) {
+ menuItem = new ItemStack(Material.DIRT, 1, (byte) 2);
+ meta4 = menuItem.getItemMeta();
+ meta4.setDisplayName(tr("\u00a7c\u00a7lRestart Island"));
+ addLore(lores, "\u00a7f", tr("Restarts your island.\n\u00a74WARNING! \u00a7cwill remove your items and island!"));
+ meta4.setLore(lores);
+ menuItem.setItemMeta(meta4);
+ menu.setItem(17, menuItem);
+ lores.clear();
+ } else {
+ menuItem = new ItemStack(Material.IRON_DOOR, 1);
+ meta4 = menuItem.getItemMeta();
+ meta4.setDisplayName(tr("\u00a7c\u00a7lLeave Island"));
+ addLore(lores, "\u00a7f", tr("Leaves your island.\n\u00a74WARNING! \u00a7cwill remove all your items!"));
+ addLore(lores, tr("\u00a7cClick to leave"));
+ meta4.setLore(lores);
+ menuItem.setItemMeta(meta4);
+ menu.setItem(17, menuItem);
+ lores.clear();
+ long millisLeft = plugin.getConfirmHandler().millisLeft(player, "/is leave");
+ if (millisLeft > 0) {
+ updateLeaveMenuItemTimer(player, menu, menuItem);
+ }
+ }
addExtraMenus(player, menu);
return menu;
}
@@ -704,7 +717,7 @@ public void run() {
if (inventory.getViewers().contains(p)) {
updateRestartMenu(inventory, p, plugin.getIslandGenerator().getSchemeNames());
}
- if (plugin.getConfirmHandler().millisLeft(p, "/is restart") <= 0) {
+ if (plugin.getConfirmHandler().millisLeft(p, "/is restart") <= 0 || !inventory.getViewers().contains(p)) {
if (hackySharing.length > 0 && hackySharing[0] != null) {
hackySharing[0].cancel();
}
@@ -781,8 +794,18 @@ private void onClickMainMenu(InventoryClickEvent event, ItemStack currentItem, P
p.performCommand("island lock");
p.openInventory(displayIslandGUI(p));
} else if (slotIndex == 17) {
- p.closeInventory();
- p.openInventory(createRestartGUI(p));
+ if (islandInfo.isLeader(p)) {
+ p.closeInventory();
+ p.openInventory(createRestartGUI(p));
+ } else {
+ if (plugin.getConfirmHandler().millisLeft(p, "/is leave") > 0) {
+ p.closeInventory();
+ p.performCommand("island leave");
+ } else {
+ p.performCommand("island leave");
+ updateLeaveMenuItemTimer(p, event.getInventory(), currentItem);
+ }
+ }
} else {
if (!isExtraMenuAction(p, currentItem)) {
p.closeInventory();
@@ -791,6 +814,40 @@ private void onClickMainMenu(InventoryClickEvent event, ItemStack currentItem, P
}
}
+ private void updateLeaveMenuItemTimer(final Player p, final Inventory inventory, final ItemStack currentItem) {
+ final BukkitTask[] hackySharing = new BukkitTask[1];
+ hackySharing[0] = Bukkit.getScheduler().runTaskTimer(plugin, new Runnable() {
+ @Override
+ public void run() {
+ long millisLeft = plugin.getConfirmHandler().millisLeft(p, "/is leave");
+ if (inventory.getViewers().contains(p)) {
+ updateLeaveMenuItem(inventory, currentItem, millisLeft);
+ }
+ if (millisLeft <= 0 || !inventory.getViewers().contains(p)) {
+ if (hackySharing.length > 0 && hackySharing[0] != null) {
+ hackySharing[0].cancel();
+ }
+ }
+ }
+ }, 0, TimeUtil.secondsAsTicks(1));
+ }
+
+ private void updateLeaveMenuItem(Inventory inventory, ItemStack currentItem, long millisLeft) {
+ if (currentItem == null || currentItem.getItemMeta() == null ||currentItem.getItemMeta().getLore() == null) {
+ return;
+ }
+ ItemMeta meta = currentItem.getItemMeta();
+ List lore = meta.getLore();
+ if (millisLeft >= 0) {
+ lore.set(lore.size()-1, tr("\u00a7cClick within \u00a79{0}\u00a7c to leave!", TimeUtil.millisAsString(millisLeft)));
+ } else {
+ lore.set(lore.size()-1, tr("\u00a7cClick to leave"));
+ }
+ meta.setLore(lore);
+ currentItem.setItemMeta(meta);
+ inventory.setItem(17, currentItem);
+ }
+
private Inventory createRestartGUI(Player player) {
List schemeNames = plugin.getIslandGenerator().getSchemeNames();
int menuSize = (int) Math.ceil((schemeNames.size() + 2) / 9d)*9;
diff --git a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/player/PlayerLogic.java b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/player/PlayerLogic.java
index b895891d..f425e9b5 100644
--- a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/player/PlayerLogic.java
+++ b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/player/PlayerLogic.java
@@ -138,9 +138,12 @@ public PlayerInfo getPlayerInfo(String playerName) {
if (offlinePlayer == null || offlinePlayer.getUniqueId() == null || offlinePlayer.getName() == null) {
return null;
}
- // Do not return anything if it is loading.
+ return getPlayerInfo(offlinePlayer.getUniqueId());
+ }
+
+ public PlayerInfo getPlayerInfo(UUID uuid) {
try {
- return playerCache.get(offlinePlayer.getUniqueId());
+ return playerCache.get(uuid);
} catch (ExecutionException e) {
throw new IllegalStateException(e); // Escalate - we need it in the server log
}
diff --git a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/uSkyBlock.java b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/uSkyBlock.java
index 4173bffb..185bf550 100644
--- a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/uSkyBlock.java
+++ b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/uSkyBlock.java
@@ -60,6 +60,7 @@
import us.talabrek.ultimateskyblock.handler.MultiverseInventoriesHandler;
import us.talabrek.ultimateskyblock.handler.VaultHandler;
import us.talabrek.ultimateskyblock.handler.WorldGuardHandler;
+import us.talabrek.ultimateskyblock.handler.placeholder.PlaceholderHandler;
import us.talabrek.ultimateskyblock.imports.impl.USBImporterExecutor;
import us.talabrek.ultimateskyblock.island.IslandGenerator;
import us.talabrek.ultimateskyblock.island.IslandInfo;
@@ -137,7 +138,6 @@ public class uSkyBlock extends JavaPlugin implements uSkyBlockAPI, CommandManage
private USBImporterExecutor importer;
- private static String pName = "";
private FileConfiguration lastIslandConfig;
private File lastIslandConfigFile;
@@ -227,7 +227,6 @@ public void onEnable() {
FileUtil.setAllwaysOverwrite("levelConfig.yml");
I18nUtil.setDataFolder(getDataFolder());
- uSkyBlock.pName = "[" + getDescription().getName() + "] ";
reloadConfigs();
getServer().getScheduler().runTaskLater(getInstance(), new Runnable() {
@@ -353,6 +352,7 @@ public void registerEvents() {
if (getConfig().getBoolean("tool-menu.enabled", true)) {
manager.registerEvents(new ToolMenuEvents(this), this);
}
+ PlaceholderHandler.register(this);
}
public World getWorld() {
diff --git a/uSkyBlock-Core/src/main/po/cs.po b/uSkyBlock-Core/src/main/po/cs.po
index 17b9d00f..69c68e91 100644
--- a/uSkyBlock-Core/src/main/po/cs.po
+++ b/uSkyBlock-Core/src/main/po/cs.po
@@ -1259,6 +1259,9 @@ msgid ""
"accept!"
msgstr ""
+msgid "N/A"
+msgstr ""
+
#, java-format
msgid "§d** You are entering §b{0}''s §disland."
msgstr ""
@@ -1978,12 +1981,27 @@ msgid ""
"§4WARNING! §cwill remove your items and island!"
msgstr ""
+msgid "§c§lLeave Island"
+msgstr ""
+
+msgid ""
+"Leaves your island.\n"
+"§4WARNING! §cwill remove all your items!"
+msgstr ""
+
+msgid "§cClick to leave"
+msgstr ""
+
msgid "Island Restart Menu"
msgstr ""
msgid "§eYou do not have access to that island-schematic!"
msgstr ""
+#, java-format
+msgid "§cClick within §9{0}§c to leave!"
+msgstr ""
+
msgid "§a§lReturn to the main menu"
msgstr ""
diff --git a/uSkyBlock-Core/src/main/po/da.po b/uSkyBlock-Core/src/main/po/da.po
index a496dddb..dd94cd4c 100644
--- a/uSkyBlock-Core/src/main/po/da.po
+++ b/uSkyBlock-Core/src/main/po/da.po
@@ -1303,6 +1303,9 @@ msgstr ""
"§eAt udføre §9{0}§e er §cRISIKABELT§e. Gentag kommandoen inden for §a{1}§e "
"sekunder for at fortsætte!"
+msgid "N/A"
+msgstr ""
+
#, java-format
msgid "§d** You are entering §b{0}''s §disland."
msgstr "§d** Du ankom til §b{0}'s §disland."
@@ -2184,12 +2187,27 @@ msgstr ""
"Genstarter din ø.\n"
"§4ADVARSEL! §cdette vil fjerne alle dine ting og din ø!"
+msgid "§c§lLeave Island"
+msgstr ""
+
+msgid ""
+"Leaves your island.\n"
+"§4WARNING! §cwill remove all your items!"
+msgstr ""
+
+msgid "§cClick to leave"
+msgstr ""
+
msgid "Island Restart Menu"
msgstr "Ø Genstarts Menu"
msgid "§eYou do not have access to that island-schematic!"
msgstr "§4Du har ikke adgang til den ø-type!"
+#, java-format
+msgid "§cClick within §9{0}§c to leave!"
+msgstr ""
+
msgid "§a§lReturn to the main menu"
msgstr "§a§lReturner til hovedmenuen"
diff --git a/uSkyBlock-Core/src/main/po/de.po b/uSkyBlock-Core/src/main/po/de.po
index 2ac3832b..4c8288db 100644
--- a/uSkyBlock-Core/src/main/po/de.po
+++ b/uSkyBlock-Core/src/main/po/de.po
@@ -1327,6 +1327,9 @@ msgstr ""
"§9{0}§e ist §cGefährlich§e. Wiederhole den Befehl innerhalb von §a{1}§e "
"Sekunden um zu bestätigent!"
+msgid "N/A"
+msgstr ""
+
#, java-format
msgid "§d** You are entering §b{0}''s §disland."
msgstr ""
@@ -2081,12 +2084,27 @@ msgid ""
"§4WARNING! §cwill remove your items and island!"
msgstr ""
+msgid "§c§lLeave Island"
+msgstr ""
+
+msgid ""
+"Leaves your island.\n"
+"§4WARNING! §cwill remove all your items!"
+msgstr ""
+
+msgid "§cClick to leave"
+msgstr ""
+
msgid "Island Restart Menu"
msgstr ""
msgid "§eYou do not have access to that island-schematic!"
msgstr ""
+#, java-format
+msgid "§cClick within §9{0}§c to leave!"
+msgstr ""
+
msgid "§a§lReturn to the main menu"
msgstr ""
diff --git a/uSkyBlock-Core/src/main/po/en_GB.po b/uSkyBlock-Core/src/main/po/en_GB.po
index 6688d003..217834eb 100644
--- a/uSkyBlock-Core/src/main/po/en_GB.po
+++ b/uSkyBlock-Core/src/main/po/en_GB.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
-"PO-Revision-Date: 2016-01-30 16:54+0100\n"
+"PO-Revision-Date: 2016-01-31 21:40+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: en_GB\n"
@@ -33,15 +33,15 @@ msgid "§eThis challenge requires the following:"
msgstr "§eThis challenge requires the following:"
msgid "§7and more..."
-msgstr ""
+msgstr "§9* §7and more..."
#, java-format
msgid "§f{0}x§7{1}"
-msgstr ""
+msgstr "§f{0}x§7{1}"
#, java-format
msgid "§7{0}"
-msgstr ""
+msgstr "§7{0}"
msgid "§6Item Reward: §a"
msgstr "§6Item Reward: §a"
@@ -215,7 +215,7 @@ msgstr "§4* §7Invalid challenge name! Use §a/c §7help for more information"
#, java-format
msgid "§7Complete {0} more {1} §7challenges"
-msgstr ""
+msgstr "§7Complete {0} more {1} §7challenges"
#, java-format
msgid "§7Complete {0}"
@@ -253,15 +253,15 @@ msgid "§e{0} has had all challenges reset."
msgstr "§a* §6{0} §7has had all challenges reset."
msgid "complete all challenges in the rank"
-msgstr ""
+msgstr "complete all challenges in the rank"
#, java-format
msgid "§4Challenge {0} has already been completed"
-msgstr ""
+msgstr "§4Challenge {0} has already been completed"
#, java-format
msgid "§eChallenge {0} has been completed for {1}"
-msgstr ""
+msgstr "§eChallenge {0} has been completed for {1}"
#, java-format
msgid "§4No challenge named {0} was found!"
@@ -273,7 +273,7 @@ msgstr "§4* §7No player named §6{0} §7was found!"
#, java-format
msgid "§4No rank named {0} was found!"
-msgstr ""
+msgstr "§4* §7No rank named §a{0} §7was found!"
msgid "manage islands"
msgstr "manage islands"
@@ -1149,7 +1149,7 @@ msgstr "§4* §7You are now §atrusted on §6{0}'s §7island."
#, java-format
msgid "§a{0} trusted {1} on the island"
-msgstr "§9* §6{0} §atrusted §6{1} §7on the island"
+msgstr "§6{0} §atrusted §6{1} §7on the island"
#, java-format
msgid "§eYou are no longer trusted on §4{0}'s §eisland."
@@ -1316,6 +1316,9 @@ msgstr ""
"§4* §7Doing §a{0}§7 is §4RISKY§7. Repeat the command within §4{1}§7 seconds "
"to accept!"
+msgid "N/A"
+msgstr ""
+
#, java-format
msgid "§d** You are entering §b{0}''s §disland."
msgstr "§9* §7You are entering §6{0}''s §7island."
@@ -1597,7 +1600,7 @@ msgid "{0} <{1}>"
msgstr "{0} <{1}>"
msgid "§9Player Permissions"
-msgstr ""
+msgstr "§9* §7Player Permissions"
msgid ""
"§eClick here to return to\n"
@@ -1940,13 +1943,15 @@ msgstr ""
"§e§lClick here to start!"
msgid "§aClick to create!"
-msgstr ""
+msgstr "§9* §7Click to create!"
#, java-format
msgid ""
"§cNo access!\n"
"§7({0})"
msgstr ""
+"§4& No access!\n"
+"§4* §7({0})"
msgid "§a§lJoin an Island"
msgstr "§a§lJoin an Island"
@@ -2202,28 +2207,45 @@ msgstr ""
"§e§lClick here to change."
msgid "§c§lRestart Island"
-msgstr ""
+msgstr "§c§lRestart Island"
msgid ""
"Restarts your island.\n"
"§4WARNING! §cwill remove your items and island!"
msgstr ""
+"Restarts your island.\n"
+"§4WARNING! §7will remove your items and island!"
-msgid "Island Restart Menu"
+msgid "§c§lLeave Island"
+msgstr ""
+
+msgid ""
+"Leaves your island.\n"
+"§4WARNING! §cwill remove all your items!"
+msgstr ""
+
+msgid "§cClick to leave"
msgstr ""
+msgid "Island Restart Menu"
+msgstr "Island Restart Menu"
+
msgid "§eYou do not have access to that island-schematic!"
msgstr "§4* §7You do not have access to that island-schematic!"
-msgid "§a§lReturn to the main menu"
+#, java-format
+msgid "§cClick within §9{0}§c to leave!"
msgstr ""
+msgid "§a§lReturn to the main menu"
+msgstr "§a§lReturn to the main menu"
+
#, java-format
msgid "§cClick within §9{0}§c to restart!"
-msgstr ""
+msgstr "§cClick within §9{0}§c to restart!"
msgid "§aClick to restart!"
-msgstr ""
+msgstr "§aClick to restart!"
msgid "Caps On"
msgstr "Caps On"
@@ -2287,6 +2309,8 @@ msgid ""
"§7The pixies are busy changing the biome of your island to §9{0}§7, be "
"patient."
msgstr ""
+"§a* §7The pixies are busy changing the biome of your island to §9{0}§7, be "
+"patient."
msgid "Could not create your Island. Please contact a server moderator."
msgstr "§4* §7Could not create your Island. Please contact a server moderator."
@@ -2296,35 +2320,35 @@ msgstr ""
"§9* §7Getting your island ready, please be patient, it can take a while."
msgid "§9Creating an island at your location"
-msgstr ""
+msgstr "§9* §7Creating an island at your location"
#, java-format
msgid "§9Creating an island §7{0}§9 of you"
-msgstr ""
+msgstr "§9* §7Creating an island §9{0}§7 of you"
msgid "North"
-msgstr ""
+msgstr "North"
msgid "North-East"
-msgstr ""
+msgstr "North-East"
msgid "East"
-msgstr ""
+msgstr "East"
msgid "South-East"
-msgstr ""
+msgstr "South-East"
msgid "South"
-msgstr ""
+msgstr "South"
msgid "South-West"
-msgstr ""
+msgstr "South-West"
msgid "West"
-msgstr ""
+msgstr "West"
msgid "North-West"
-msgstr ""
+msgstr "North-West"
msgid "d"
msgstr "d"
diff --git a/uSkyBlock-Core/src/main/po/es.po b/uSkyBlock-Core/src/main/po/es.po
index 5c9a92a2..2b8f606b 100644
--- a/uSkyBlock-Core/src/main/po/es.po
+++ b/uSkyBlock-Core/src/main/po/es.po
@@ -1319,6 +1319,9 @@ msgstr ""
"§eHacer §9{0}§e es §cARRIESGADO§e. ¡Repite el comando antes de §a{1}§e "
"segundos para aceptar!"
+msgid "N/A"
+msgstr ""
+
#, java-format
msgid "§d** You are entering §b{0}''s §disland."
msgstr "§d** Estás entrando en la isla de §b{0}§d."
@@ -2216,12 +2219,27 @@ msgid ""
"§4WARNING! §cwill remove your items and island!"
msgstr ""
+msgid "§c§lLeave Island"
+msgstr ""
+
+msgid ""
+"Leaves your island.\n"
+"§4WARNING! §cwill remove all your items!"
+msgstr ""
+
+msgid "§cClick to leave"
+msgstr ""
+
msgid "Island Restart Menu"
msgstr ""
msgid "§eYou do not have access to that island-schematic!"
msgstr ""
+#, java-format
+msgid "§cClick within §9{0}§c to leave!"
+msgstr ""
+
msgid "§a§lReturn to the main menu"
msgstr ""
diff --git a/uSkyBlock-Core/src/main/po/fr.po b/uSkyBlock-Core/src/main/po/fr.po
index 3553578d..6c62c6ec 100644
--- a/uSkyBlock-Core/src/main/po/fr.po
+++ b/uSkyBlock-Core/src/main/po/fr.po
@@ -1313,6 +1313,9 @@ msgstr ""
"§eFaire ceci §9{0}§e est §cDANGEREUX§e. Répeter la commande avant §a{1}§e "
"secondes pour confirmer !"
+msgid "N/A"
+msgstr ""
+
#, java-format
msgid "§d** You are entering §b{0}''s §disland."
msgstr "§d**Vous entrez sur l''île de §b{0}."
@@ -2172,12 +2175,27 @@ msgid ""
"§4WARNING! §cwill remove your items and island!"
msgstr ""
+msgid "§c§lLeave Island"
+msgstr ""
+
+msgid ""
+"Leaves your island.\n"
+"§4WARNING! §cwill remove all your items!"
+msgstr ""
+
+msgid "§cClick to leave"
+msgstr ""
+
msgid "Island Restart Menu"
msgstr ""
msgid "§eYou do not have access to that island-schematic!"
msgstr ""
+#, java-format
+msgid "§cClick within §9{0}§c to leave!"
+msgstr ""
+
msgid "§a§lReturn to the main menu"
msgstr ""
diff --git a/uSkyBlock-Core/src/main/po/keys.pot b/uSkyBlock-Core/src/main/po/keys.pot
index 4f13d4b0..391065ad 100644
--- a/uSkyBlock-Core/src/main/po/keys.pot
+++ b/uSkyBlock-Core/src/main/po/keys.pot
@@ -1255,6 +1255,9 @@ msgid ""
"accept!"
msgstr ""
+msgid "N/A"
+msgstr ""
+
#, java-format
msgid "§d** You are entering §b{0}''s §disland."
msgstr ""
@@ -1972,12 +1975,27 @@ msgid ""
"§4WARNING! §cwill remove your items and island!"
msgstr ""
+msgid "§c§lLeave Island"
+msgstr ""
+
+msgid ""
+"Leaves your island.\n"
+"§4WARNING! §cwill remove all your items!"
+msgstr ""
+
+msgid "§cClick to leave"
+msgstr ""
+
msgid "Island Restart Menu"
msgstr ""
msgid "§eYou do not have access to that island-schematic!"
msgstr ""
+#, java-format
+msgid "§cClick within §9{0}§c to leave!"
+msgstr ""
+
msgid "§a§lReturn to the main menu"
msgstr ""
diff --git a/uSkyBlock-Core/src/main/po/ko.po b/uSkyBlock-Core/src/main/po/ko.po
index 7add8367..7c5dc239 100644
--- a/uSkyBlock-Core/src/main/po/ko.po
+++ b/uSkyBlock-Core/src/main/po/ko.po
@@ -1310,6 +1310,9 @@ msgstr ""
"§e명령어 §9{0}§e 사용은 §c허벌나게 위험합니다§e. 승낙하려면 §a{1}§e초 내로 커"
"맨드를 반복하세요"
+msgid "N/A"
+msgstr ""
+
#, java-format
msgid "§d** You are entering §b{0}''s §disland."
msgstr "§d** 당신은 §b{0}의 §d섬에 입장하는 중입니다."
@@ -2193,12 +2196,27 @@ msgstr ""
"당신의 섬을 재시작 합니다.\n"
"§4경고! §c당신의 섬과 아이템이 제거됩니다!"
+msgid "§c§lLeave Island"
+msgstr ""
+
+msgid ""
+"Leaves your island.\n"
+"§4WARNING! §cwill remove all your items!"
+msgstr ""
+
+msgid "§cClick to leave"
+msgstr ""
+
msgid "Island Restart Menu"
msgstr "섬 재생성 매뉴"
msgid "§eYou do not have access to that island-schematic!"
msgstr "§e당신은 해당 island-schematic에 접근할 권한이 없습니다!"
+#, java-format
+msgid "§cClick within §9{0}§c to leave!"
+msgstr ""
+
msgid "§a§lReturn to the main menu"
msgstr "§a§l메인 메뉴로 돌아가기"
diff --git a/uSkyBlock-Core/src/main/po/nl.po b/uSkyBlock-Core/src/main/po/nl.po
index 59013f61..2ab573cf 100644
--- a/uSkyBlock-Core/src/main/po/nl.po
+++ b/uSkyBlock-Core/src/main/po/nl.po
@@ -1322,6 +1322,9 @@ msgstr ""
"§eHet commando §9{0}§e is §cRISKANT§e. Herhaal het commando in §a{1}§e "
"seconden om het te accepteren!"
+msgid "N/A"
+msgstr ""
+
#, java-format
msgid "§d** You are entering §b{0}''s §disland."
msgstr "§d** Je komt bij §b{0}''s §deiland binnen."
@@ -2222,12 +2225,27 @@ msgid ""
"§4WARNING! §cwill remove your items and island!"
msgstr ""
+msgid "§c§lLeave Island"
+msgstr ""
+
+msgid ""
+"Leaves your island.\n"
+"§4WARNING! §cwill remove all your items!"
+msgstr ""
+
+msgid "§cClick to leave"
+msgstr ""
+
msgid "Island Restart Menu"
msgstr ""
msgid "§eYou do not have access to that island-schematic!"
msgstr "§eJe hebt geen toegang to dat eiland-schematic"
+#, java-format
+msgid "§cClick within §9{0}§c to leave!"
+msgstr ""
+
msgid "§a§lReturn to the main menu"
msgstr ""
diff --git a/uSkyBlock-Core/src/main/po/pt_BR.po b/uSkyBlock-Core/src/main/po/pt_BR.po
index bbe0980f..ecf6a65c 100644
--- a/uSkyBlock-Core/src/main/po/pt_BR.po
+++ b/uSkyBlock-Core/src/main/po/pt_BR.po
@@ -1306,6 +1306,9 @@ msgstr ""
"§4CUIDADO: §aUsar{0}§ é perigoso. Repita esse comando dentro de §a{1}§e "
"segundos para confirmar!"
+msgid "N/A"
+msgstr ""
+
#, java-format
msgid "§d** You are entering §b{0}''s §disland."
msgstr "§d** Você está entrando na ilha de §b{0}."
@@ -2193,12 +2196,27 @@ msgid ""
"§4WARNING! §cwill remove your items and island!"
msgstr ""
+msgid "§c§lLeave Island"
+msgstr ""
+
+msgid ""
+"Leaves your island.\n"
+"§4WARNING! §cwill remove all your items!"
+msgstr ""
+
+msgid "§cClick to leave"
+msgstr ""
+
msgid "Island Restart Menu"
msgstr ""
msgid "§eYou do not have access to that island-schematic!"
msgstr ""
+#, java-format
+msgid "§cClick within §9{0}§c to leave!"
+msgstr ""
+
msgid "§a§lReturn to the main menu"
msgstr ""
diff --git a/uSkyBlock-Core/src/main/po/ru.po b/uSkyBlock-Core/src/main/po/ru.po
index a313f3da..f1466dac 100644
--- a/uSkyBlock-Core/src/main/po/ru.po
+++ b/uSkyBlock-Core/src/main/po/ru.po
@@ -1308,6 +1308,9 @@ msgstr ""
"§eДелать §9{0}§e §cРИСКОВАННО§e. Повторите команду через §a{1}§e сек. для "
"подтверждения!"
+msgid "N/A"
+msgstr ""
+
#, java-format
msgid "§d** You are entering §b{0}''s §disland."
msgstr ""
@@ -2177,12 +2180,27 @@ msgid ""
"§4WARNING! §cwill remove your items and island!"
msgstr ""
+msgid "§c§lLeave Island"
+msgstr ""
+
+msgid ""
+"Leaves your island.\n"
+"§4WARNING! §cwill remove all your items!"
+msgstr ""
+
+msgid "§cClick to leave"
+msgstr ""
+
msgid "Island Restart Menu"
msgstr ""
msgid "§eYou do not have access to that island-schematic!"
msgstr ""
+#, java-format
+msgid "§cClick within §9{0}§c to leave!"
+msgstr ""
+
msgid "§a§lReturn to the main menu"
msgstr ""
diff --git a/uSkyBlock-Core/src/main/po/sv.po b/uSkyBlock-Core/src/main/po/sv.po
index e2282bf2..5dae90b7 100644
--- a/uSkyBlock-Core/src/main/po/sv.po
+++ b/uSkyBlock-Core/src/main/po/sv.po
@@ -1298,6 +1298,9 @@ msgstr ""
"§eAnvändande av §9{0}§e är §cRISKFULLT§e. Repetera kommandot inom §a{1}§e "
"sekunder för att acceptera!"
+msgid "N/A"
+msgstr ""
+
#, java-format
msgid "§d** You are entering §b{0}''s §disland."
msgstr "§d** Du beträder nu §b{0}s §dSkyblock."
@@ -2183,12 +2186,27 @@ msgid ""
"§4WARNING! §cwill remove your items and island!"
msgstr ""
+msgid "§c§lLeave Island"
+msgstr ""
+
+msgid ""
+"Leaves your island.\n"
+"§4WARNING! §cwill remove all your items!"
+msgstr ""
+
+msgid "§cClick to leave"
+msgstr ""
+
msgid "Island Restart Menu"
msgstr ""
msgid "§eYou do not have access to that island-schematic!"
msgstr ""
+#, java-format
+msgid "§cClick within §9{0}§c to leave!"
+msgstr ""
+
msgid "§a§lReturn to the main menu"
msgstr ""
diff --git a/uSkyBlock-Core/src/main/po/xx_PIRATE.po b/uSkyBlock-Core/src/main/po/xx_PIRATE.po
index 1d227f4f..a81d2913 100644
--- a/uSkyBlock-Core/src/main/po/xx_PIRATE.po
+++ b/uSkyBlock-Core/src/main/po/xx_PIRATE.po
@@ -1294,6 +1294,9 @@ msgstr ""
"§eDoin'' §9{0}§e be §cRISKY§e. Repeat the command within §a{1}§e seconds to "
"accept!"
+msgid "N/A"
+msgstr ""
+
#, java-format
msgid "§d** You are entering §b{0}''s §disland."
msgstr "§d** Ye be enterin'' §b{0}''s §disland."
@@ -2187,12 +2190,27 @@ msgstr ""
"Restarts yer hideout.\n"
"§4WARNING! §cwill remove yer items an' hideout!"
+msgid "§c§lLeave Island"
+msgstr ""
+
+msgid ""
+"Leaves your island.\n"
+"§4WARNING! §cwill remove all your items!"
+msgstr ""
+
+msgid "§cClick to leave"
+msgstr ""
+
msgid "Island Restart Menu"
msgstr "Island Restart Menu"
msgid "§eYou do not have access to that island-schematic!"
msgstr "§eYe do not have access to that hideout-schematic!"
+#, java-format
+msgid "§cClick within §9{0}§c to leave!"
+msgstr ""
+
msgid "§a§lReturn to the main menu"
msgstr "§a§lReturn to the main menu"
diff --git a/uSkyBlock-Core/src/main/po/zh_CN.po b/uSkyBlock-Core/src/main/po/zh_CN.po
index f62730af..53f8cb6b 100644
--- a/uSkyBlock-Core/src/main/po/zh_CN.po
+++ b/uSkyBlock-Core/src/main/po/zh_CN.po
@@ -1270,6 +1270,9 @@ msgid ""
"accept!"
msgstr "§9{0}§e是§c危险的§e.请等待§a{1}§e秒后在这样做."
+msgid "N/A"
+msgstr ""
+
#, java-format
msgid "§d** You are entering §b{0}''s §disland."
msgstr ""
@@ -2013,12 +2016,27 @@ msgid ""
"§4WARNING! §cwill remove your items and island!"
msgstr ""
+msgid "§c§lLeave Island"
+msgstr ""
+
+msgid ""
+"Leaves your island.\n"
+"§4WARNING! §cwill remove all your items!"
+msgstr ""
+
+msgid "§cClick to leave"
+msgstr ""
+
msgid "Island Restart Menu"
msgstr ""
msgid "§eYou do not have access to that island-schematic!"
msgstr ""
+#, java-format
+msgid "§cClick within §9{0}§c to leave!"
+msgstr ""
+
msgid "§a§lReturn to the main menu"
msgstr ""