diff --git a/.gitignore b/.gitignore
index f8029f6..9a259cf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,88 @@
-/target/
-/.DS_Store
-/.classpath
-/.project
+# Git
+*.orig
+!.gitignore
+/.settings/
+
+ # Windows
+Thumbs.db
+ehthumbs.db
+ehthumbs_vista.db
+*.stackdump
+[Dd]esktop.ini
+$RECYCLE.BIN/
+*.lnk
+
+ # Linux
+*~
+.fuse_hidden*
+.directory
+.Trash-*
+.nfs*
+
+ # MacOS
+.DS_Store
+.AppleDouble
+.LSOverride
+._*
+
+ # Java
+*.class
+*.log
+*.ctxt
+.mtj.tmp/
+*.jar
+*.war
+*.nar
+*.ear
+hs_err_pid*
+
+ # Maven
+target/
+pom.xml.tag
+pom.xml.releaseBackup
+pom.xml.versionsBackup
+pom.xml.next
+release.properties
+dependency-reduced-pom.xml
+buildNumber.properties
+
+ # Intellij
+*.iml
+*.java___jb_tmp___
+.idea/*
+*.ipr
+*.iws
+/out/
+.idea_modules/
+
+ # Eclipse
+*.pydevproject
+.metadata
+.gradle
+bin/
+tmp/
+*.tmp
+*.bak
+*.swp
+*~.nib
+local.properties
+.settings/
+.loadpath
+.project
+.externalToolBuilders/
+*.launch
+.cproject
+.classpath
+.buildpath
+.target
+
+ # NetBeans
+nbproject/private/
+build/
+nbbuild/
+dist/
+nbdist/
+nbactions.xml
+nb-configuration.xml
+.nb-gradle/
+
diff --git a/pom.xml b/pom.xml
index 76806ab..401981d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -8,9 +8,9 @@
warps
${revision}
- WelcomeWarpSigns
- WelcomeWarpSigns is an add-on for BentoBox, an expandable Minecraft Bukkit plugin for island-type games like ASkyBlock or AcidIsland.
- https://github.com/BentoBoxWorld/addon-welcomewarpsigns
+ Warps
+ Warps is an add-on for BentoBox, an expandable Minecraft Bukkit plugin for island-type games like ASkyBlock or AcidIsland.
+ https://github.com/BentoBoxWorld/Warps
2018
@@ -25,19 +25,19 @@
- scm:git:https://github.com/BentoBoxWorld/addon-welcomewarpsigns.git
- scm:git:git@github.com:BentoBoxWorld/addon-welcomewarpsigns.git
- https://github.com/BentoBoxWorld/addon-welcomewarpsigns
+ scm:git:https://github.com/BentoBoxWorld/Warps.git
+ scm:git:git@github.com:BentoBoxWorld/Warps.git
+ https://github.com/BentoBoxWorld/Warps
jenkins
- http://ci.codemc.org/job/BentoBoxWorld/job/addon-welcomewarpsigns
+ http://ci.codemc.org/job/BentoBoxWorld/job/Warps
GitHub
- https://github.com/BentoBoxWorld/addon-welcomewarpsigns/issues
+ https://github.com/BentoBoxWorld/Warps/issues
@@ -66,7 +66,7 @@
-LOCAL
- 1.9.1
+ 1.9.3
@@ -331,4 +331,4 @@
-
\ No newline at end of file
+
diff --git a/src/main/java/world/bentobox/warps/SignCache.java b/src/main/java/world/bentobox/warps/SignCacheItem.java
similarity index 77%
rename from src/main/java/world/bentobox/warps/SignCache.java
rename to src/main/java/world/bentobox/warps/SignCacheItem.java
index 33d0224..fb938bb 100644
--- a/src/main/java/world/bentobox/warps/SignCache.java
+++ b/src/main/java/world/bentobox/warps/SignCacheItem.java
@@ -4,19 +4,23 @@ import java.util.List;
import org.bukkit.Material;
+import com.google.gson.annotations.Expose;
+
/**
* Stores info on a warp sign
* @author tastybento
*
*/
-public class SignCache {
+public class SignCacheItem {
+ @Expose
private final List signText;
+ @Expose
private final Material type;
/**
* @param signText
* @param type
*/
- public SignCache(List signText, Material type) {
+ public SignCacheItem(List signText, Material type) {
this.signText = signText;
this.type = type;
}
diff --git a/src/main/java/world/bentobox/warps/SignCacheManager.java b/src/main/java/world/bentobox/warps/SignCacheManager.java
new file mode 100644
index 0000000..b0611f8
--- /dev/null
+++ b/src/main/java/world/bentobox/warps/SignCacheManager.java
@@ -0,0 +1,79 @@
+package world.bentobox.warps;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import org.bukkit.Bukkit;
+import org.bukkit.Material;
+import org.bukkit.World;
+
+import world.bentobox.bentobox.database.Database;
+import world.bentobox.warps.objects.SignCache;
+
+public class SignCacheManager {
+ private Map> cachedSigns = new HashMap<>();
+ private Warp addon;
+ // Database handler for level data
+ private Database handler;
+
+ public SignCacheManager(Warp addon) {
+ this.addon = addon;
+ handler = new Database<>(addon, SignCache.class);
+ // Load the sign caches
+ loadCache();
+ }
+
+ private void loadCache() {
+ handler.loadObjects().forEach(w -> {
+ World world = Bukkit.getWorld(w.getUniqueId());
+ if (world != null) {
+ cachedSigns.put(world, w.getSigns());
+ }
+ });
+ }
+
+ void saveCache() {
+ cachedSigns.forEach((w, m) -> handler.saveObject(new SignCache(w, m)));
+ }
+
+ Material getSignIcon(World world, UUID warpOwner) {
+ // Add the worlds if we haven't seen this before
+ cachedSigns.putIfAbsent(world, new HashMap<>());
+ if (cachedSigns.get(world).containsKey(warpOwner)) {
+ return cachedSigns.get(world).get(warpOwner).getType();
+ }
+ // Not in cache
+ SignCacheItem sc = addon.getWarpSignsManager().getSignInfo(world, warpOwner);
+ cachedSigns.get(world).put(warpOwner, sc);
+ return sc.getType();
+ }
+
+ /**
+ * Gets sign text and cache it
+ * @param playerUUID
+ * @return sign text in a list
+ */
+ List getSign(World world, UUID playerUUID) {
+ // Add the worlds if we haven't seen this before
+ cachedSigns.putIfAbsent(world, new HashMap<>());
+ if (cachedSigns.get(world).containsKey(playerUUID)) {
+ return cachedSigns.get(world).get(playerUUID).getSignText();
+ }
+ SignCacheItem result = addon.getWarpSignsManager().getSignInfo(world, playerUUID);
+ cachedSigns.get(world).put(playerUUID, result);
+ return result.getSignText();
+ }
+
+ /**
+ * Removes sign text from the cache
+ * @param world - world
+ * @param key - uuid of owner
+ */
+ void removeWarp(World world, UUID key) {
+ cachedSigns.putIfAbsent(world, new HashMap<>());
+ cachedSigns.get(world).remove(key);
+ }
+
+}
diff --git a/src/main/java/world/bentobox/warps/Warp.java b/src/main/java/world/bentobox/warps/Warp.java
index 225f96c..ff0a0c5 100644
--- a/src/main/java/world/bentobox/warps/Warp.java
+++ b/src/main/java/world/bentobox/warps/Warp.java
@@ -16,6 +16,7 @@ import world.bentobox.level.Level;
import world.bentobox.warps.commands.WarpCommand;
import world.bentobox.warps.commands.WarpsCommand;
import world.bentobox.warps.config.Settings;
+import world.bentobox.warps.listeners.WarpSignsListener;
/**
* Addin to BentoBox that enables welcome warp signs
@@ -147,6 +148,8 @@ public class Warp extends Addon {
// Save the warps
if (warpSignsManager != null)
warpSignsManager.saveWarpList();
+ if (warpPanelManager != null)
+ warpPanelManager.saveCache();
}
@@ -171,7 +174,7 @@ public class Warp extends Addon {
/**
* Get warp panel manager
- * @return
+ * @return Warp Panel Manager
*/
public WarpPanelManager getWarpPanelManager() {
return warpPanelManager;
diff --git a/src/main/java/world/bentobox/warps/WarpPanelManager.java b/src/main/java/world/bentobox/warps/WarpPanelManager.java
index 236551a..95984c7 100644
--- a/src/main/java/world/bentobox/warps/WarpPanelManager.java
+++ b/src/main/java/world/bentobox/warps/WarpPanelManager.java
@@ -1,9 +1,7 @@
package world.bentobox.warps;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import java.util.Random;
import java.util.UUID;
@@ -21,20 +19,19 @@ public class WarpPanelManager {
private static final int PANEL_MAX_SIZE = 52;
private Warp addon;
// This is a cache of signs
- private Map> cachedSigns = new HashMap<>();
-
-
+ private SignCacheManager signCacheManager;
public WarpPanelManager(Warp addon) {
this.addon = addon;
+ signCacheManager = new SignCacheManager(addon);
}
private PanelItem getPanelItem(World world, UUID warpOwner) {
PanelItemBuilder pib = new PanelItemBuilder()
.name(addon.getSettings().getNameFormat() + addon.getPlugin().getPlayers().getName(warpOwner))
- .description(getSign(world, warpOwner))
+ .description(signCacheManager.getSign(world, warpOwner))
.clickHandler((panel, clicker, click, slot) -> hander(world, clicker, warpOwner));
- Material icon = getSignIcon(world, warpOwner);
+ Material icon = signCacheManager.getSignIcon(world, warpOwner);
if (icon.equals(Material.PLAYER_HEAD)) {
return pib.icon(addon.getPlayers().getName(warpOwner)).build();
} else {
@@ -44,7 +41,10 @@ public class WarpPanelManager {
private boolean hander(World world, User clicker, UUID warpOwner) {
clicker.closeInventory();
- addon.getWarpSignsManager().warpPlayer(world, clicker, warpOwner);
+ String playerCommand = addon.getPlugin().getIWM().getAddon(world).map(gm -> gm.getPlayerCommand().map(c -> c.getLabel()).orElse("")).orElse("");
+ String command = addon.getSettings().getWarpCommand() + " " + addon.getPlayers().getName(warpOwner);
+ clicker.getPlayer().performCommand((playerCommand.isEmpty() ? "" : playerCommand + " ") + command);
+ //addon.getWarpSignsManager().warpPlayer(world, clicker, warpOwner);
return true;
}
@@ -56,35 +56,6 @@ public class WarpPanelManager {
.icon(Material.END_CRYSTAL).build();
}
- private Material getSignIcon(World world, UUID warpOwner) {
- // Add the worlds if we haven't seen this before
- cachedSigns.putIfAbsent(world, new HashMap<>());
- if (cachedSigns.get(world).containsKey(warpOwner)) {
- return cachedSigns.get(world).get(warpOwner).getType();
- }
- // Not in cache
- SignCache sc = addon.getWarpSignsManager().getSignInfo(world, warpOwner);
- cachedSigns.get(world).put(warpOwner, sc);
- return sc.getType();
- }
-
-
- /**
- * Gets sign text and cache it
- * @param playerUUID
- * @return sign text in a list
- */
- private List getSign(World world, UUID playerUUID) {
- // Add the worlds if we haven't seen this before
- cachedSigns.putIfAbsent(world, new HashMap<>());
- if (cachedSigns.get(world).containsKey(playerUUID)) {
- return cachedSigns.get(world).get(playerUUID).getSignText();
- }
- SignCache result = addon.getWarpSignsManager().getSignInfo(world, playerUUID);
- cachedSigns.get(world).put(playerUUID, result);
- return result.getSignText();
- }
-
/**
* Show the warp panel for the user
* @param world - world
@@ -145,11 +116,15 @@ public class WarpPanelManager {
/**
* Removes sign text from the cache
- * @param key
+ * @param world - world
+ * @param key - uuid of owner
*/
public void removeWarp(World world, UUID key) {
- cachedSigns.putIfAbsent(world, new HashMap<>());
- cachedSigns.get(world).remove(key);
+ signCacheManager.removeWarp(world, key);
+ }
+
+ public void saveCache() {
+ signCacheManager.saveCache();
}
}
diff --git a/src/main/java/world/bentobox/warps/WarpSignsManager.java b/src/main/java/world/bentobox/warps/WarpSignsManager.java
index b3adb62..9789547 100644
--- a/src/main/java/world/bentobox/warps/WarpSignsManager.java
+++ b/src/main/java/world/bentobox/warps/WarpSignsManager.java
@@ -47,6 +47,7 @@ import world.bentobox.warps.objects.WarpsData;
*/
public class WarpSignsManager {
private static final int MAX_WARPS = 600;
+ private static final String WARPS = "warps";
private BentoBox plugin;
// Map of all warps stored as player, warp sign Location
private Map> worldsWarpList;
@@ -74,7 +75,7 @@ public class WarpSignsManager {
this.addon = addon;
this.plugin = plugin;
// Set up the database handler
- // Note that these are saved by the BSkyBlock database
+ // Note that these are saved by the BentoBox database
handler = new Database<>(addon, WarpsData.class);
// Load the warps
loadWarpList();
@@ -176,11 +177,11 @@ public class WarpSignsManager {
/**
* Load the warps and check if they still exist
*/
- private void loadWarpList() {
- addon.getLogger().info("Loading warps...");
+ void loadWarpList() {
+ addon.log("Loading warps...");
worldsWarpList = new HashMap<>();
- if (handler.objectExists("warps")) {
- warpsData = handler.loadObject("warps");
+ if (handler.objectExists(WARPS)) {
+ warpsData = handler.loadObject(WARPS);
// Load into map
if (warpsData != null) {
warpsData.getWarpSigns().forEach((k,v) -> {
@@ -189,6 +190,8 @@ public class WarpSignsManager {
getWarpMap(k.getWorld()).put(v, k);
}
});
+ } else {
+ warpsData = new WarpsData();
}
}
}
@@ -263,7 +266,7 @@ public class WarpSignsManager {
* @return Sign's content and type
*/
@NonNull
- public SignCache getSignInfo(@NonNull World world, @NonNull UUID uuid) {
+ public SignCacheItem getSignInfo(@NonNull World world, @NonNull UUID uuid) {
List result = new ArrayList<>();
//get the sign info
Location signLocation = getWarp(world, uuid);
@@ -297,14 +300,14 @@ public class WarpSignsManager {
}
if (icon == null || icon.name().contains("SIGN")) {
- return new SignCache(result, Material.valueOf(sign.getType().name().replace("WALL_", "")));
+ return new SignCacheItem(result, Material.valueOf(sign.getType().name().replace("WALL_", "")));
} else {
- return new SignCache(result, icon);
+ return new SignCacheItem(result, icon);
}
} else {
addon.getWarpSignsManager().removeWarp(world, uuid);
}
- return new SignCache(Collections.emptyList(), Material.AIR);
+ return new SignCacheItem(Collections.emptyList(), Material.AIR);
}
/**
diff --git a/src/main/java/world/bentobox/warps/commands/WarpCommand.java b/src/main/java/world/bentobox/warps/commands/WarpCommand.java
index d52358c..be45106 100644
--- a/src/main/java/world/bentobox/warps/commands/WarpCommand.java
+++ b/src/main/java/world/bentobox/warps/commands/WarpCommand.java
@@ -9,6 +9,7 @@ import java.util.stream.Collectors;
import org.bukkit.World;
import world.bentobox.bentobox.api.commands.CompositeCommand;
+import world.bentobox.bentobox.api.commands.DelayedTeleportCommand;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.warps.Warp;
@@ -18,7 +19,7 @@ import world.bentobox.warps.Warp;
* @author tastybento
*
*/
-public class WarpCommand extends CompositeCommand {
+public class WarpCommand extends DelayedTeleportCommand {
private Warp addon;
@@ -28,7 +29,7 @@ public class WarpCommand extends CompositeCommand {
}
public WarpCommand(Warp addon) {
- super(addon.getSettings().getWarpCommand());
+ super(addon, addon.getSettings().getWarpCommand());
this.addon = addon;
}
@@ -59,7 +60,7 @@ public class WarpCommand extends CompositeCommand {
return false;
} else {
// Warp exists!
- addon.getWarpSignsManager().warpPlayer(world, user, foundWarp);
+ this.delayCommand(user, () -> addon.getWarpSignsManager().warpPlayer(world, user, foundWarp));
return true;
}
}
diff --git a/src/main/java/world/bentobox/warps/WarpSignsListener.java b/src/main/java/world/bentobox/warps/listeners/WarpSignsListener.java
similarity index 89%
rename from src/main/java/world/bentobox/warps/WarpSignsListener.java
rename to src/main/java/world/bentobox/warps/listeners/WarpSignsListener.java
index 2ed72a3..3def898 100644
--- a/src/main/java/world/bentobox/warps/WarpSignsListener.java
+++ b/src/main/java/world/bentobox/warps/listeners/WarpSignsListener.java
@@ -1,4 +1,4 @@
-package world.bentobox.warps;
+package world.bentobox.warps.listeners;
import java.util.Map;
import java.util.UUID;
@@ -17,8 +17,11 @@ import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.SignChangeEvent;
import world.bentobox.bentobox.BentoBox;
+import world.bentobox.bentobox.api.events.team.TeamEvent.TeamKickEvent;
+import world.bentobox.bentobox.api.events.team.TeamEvent.TeamLeaveEvent;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.bentobox.util.Util;
+import world.bentobox.warps.Warp;
import world.bentobox.warps.event.WarpRemoveEvent;
/**
@@ -41,6 +44,20 @@ public class WarpSignsListener implements Listener {
this.plugin = addon.getPlugin();
}
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onPlayerLeave(TeamLeaveEvent e) {
+ // Remove any warp signs from this game mode
+ addon.getWarpSignsManager().removeWarp(e.getIsland().getWorld(), e.getPlayerUUID());
+ User.getInstance(e.getPlayerUUID()).sendMessage("warps.deactivate");
+ }
+
+ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
+ public void onPlayerLeave(TeamKickEvent e) {
+ // Remove any warp signs from this game mode
+ addon.getWarpSignsManager().removeWarp(e.getIsland().getWorld(), e.getPlayerUUID());
+ User.getInstance(e.getPlayerUUID()).sendMessage("warps.deactivate");
+ }
+
/**
* Checks to see if a sign has been broken
* @param e - event
diff --git a/src/main/java/world/bentobox/warps/objects/SignCache.java b/src/main/java/world/bentobox/warps/objects/SignCache.java
new file mode 100644
index 0000000..042a1b2
--- /dev/null
+++ b/src/main/java/world/bentobox/warps/objects/SignCache.java
@@ -0,0 +1,54 @@
+package world.bentobox.warps.objects;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.bukkit.World;
+
+import com.google.gson.annotations.Expose;
+
+import world.bentobox.bentobox.database.objects.DataObject;
+import world.bentobox.warps.SignCacheItem;
+
+public class SignCache implements DataObject {
+
+ @Expose
+ private String uniqueId = "";
+ @Expose
+ private Map signs = new HashMap<>();
+
+ public SignCache() {
+ // Required by YAML database
+ }
+
+ public SignCache(World w, Map m) {
+ this.uniqueId = w.getName();
+ this.signs = m;
+ }
+
+ @Override
+ public String getUniqueId() {
+ return uniqueId;
+ }
+
+ @Override
+ public void setUniqueId(String uniqueId) {
+ this.uniqueId = uniqueId;
+ }
+
+ /**
+ * @return the signs
+ */
+ public Map getSigns() {
+ return signs;
+ }
+
+ /**
+ * @param signs the signs to set
+ */
+ public void setSigns(Map signs) {
+ this.signs = signs;
+ }
+
+}
diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml
index fefc8cf..a723f46 100644
--- a/src/main/resources/config.yml
+++ b/src/main/resources/config.yml
@@ -39,5 +39,5 @@ random-allowed: true
allow-in-other-worlds: false
#
# Warp and warps commands. You can change them if they clash with other addons or plugins.
-warp-command: wwarp
-warps-command: wwarps
+warp-command: warp
+warps-command: warps
diff --git a/src/main/resources/locales/cs.yml b/src/main/resources/locales/cs.yml
new file mode 100644
index 0000000..937f64e
--- /dev/null
+++ b/src/main/resources/locales/cs.yml
@@ -0,0 +1,35 @@
+###########################################################################################
+# This is a YML file. Be careful when editing. Check your edits in a YAML checker like #
+# the one at http://yaml-online-parser.appspot.com #
+# #
+# Translation by: CZghost #
+###########################################################################################
+
+warp:
+ help:
+ description: "Teleportovat se na warp ceduli hráče"
+ parameters:
+warps:
+ deactivate: "&c Stará warp cedule deaktivována!"
+ error:
+ does-not-exist: "&c Sakra! Tento warp již neexistuje!"
+ no-permission: "&c Na toto nemáš oprávnění!"
+ no-remove: "&c Nemůžeš odstranit tuto ceduli!"
+ no-warps-yet: "&c Nejsou k dispozici žádné warpy"
+ not-enough-level: "&c Úroveň tvého ostrova není dostatečně vysoká!"
+ not-on-island: "&c K tomuto musíš být na svém ostrově!"
+ not-safe: "&c Tento warp není bezpečný!"
+ your-level-is: "&c Úroveň tvého ostrova je jen [level], musí být vyšší než [required]. Spusť příkaz pro úroveň."
+ help:
+ description: "otevřít panel warpů"
+ next: "&6 Další stránka"
+ player-warped: "&2 [name] se teleportoval na tvou warp ceduli!"
+ previous: "&6 Předchozí stránka"
+ random: "&4 Náhodný warp"
+ sign-removed: "&c Warp cedule odstraněna!"
+ success: "&a Úspěch!"
+ title: "Warp cedule"
+ warpTip: "&6 Polož warp ceduli s [text] na vrchu"
+ warpToPlayersSign: "&6 Teleportuji tě na ceduli [player]"
+
+
\ No newline at end of file
diff --git a/src/main/resources/locales/hu.yml b/src/main/resources/locales/hu.yml
index cdb6be0..6c7e508 100644
--- a/src/main/resources/locales/hu.yml
+++ b/src/main/resources/locales/hu.yml
@@ -11,11 +11,11 @@ warps:
deactivate: "&cRégi teleport tábla deaktiválva!"
error:
does-not-exist: "&cAjjaj! Ez a teleport nem létezik!"
- no-permission: "&CNincs jogod ehhez!"
- no-remove: "&CNem törölheted ezt a táblát!"
- no-warps-yet: "&CJelenleg nem érhetőek el teleportok"
- not-enough-level: "&CA szigeted szintje nem elég magas!"
- not-on-island: "&CEhhez szigeten kell lenned!"
+ no-permission: "&cNincs jogod ehhez!"
+ no-remove: "&cNem törölheted ezt a táblát!"
+ no-warps-yet: "&cJelenleg nem érhetőek el teleportok"
+ not-enough-level: "&cA szigeted szintje nem elég magas!"
+ not-on-island: "&cEhhez szigeten kell lenned!"
not-safe: "&cEz a teleport nem biztonságos!"
your-level-is: "&cJelenleg a sziget szinted [level], és nagyobbnak kell lennie, mint [required]."
help:
@@ -24,8 +24,8 @@ warps:
player-warped: "&2[name] teleportált a teleport tábládhoz!"
previous: "&6Előző oldal"
random: "&4Véletlenszerű Teleport"
- sign-removed: "&CTeleport tábla törölve!"
- success: "&ASikeres!"
+ sign-removed: "&cTeleport tábla törölve!"
+ success: "&aSikeres!"
title: "Teleport Táblák"
warpTip: "&6Helyezz le egy teleport táblát a következő szöveggel [text] a tetején"
warpToPlayersSign: "&6Teleportálás [player] táblájához"
diff --git a/src/main/resources/locales/lv.yml b/src/main/resources/locales/lv.yml
index 57070e5..a5abbcb 100644
--- a/src/main/resources/locales/lv.yml
+++ b/src/main/resources/locales/lv.yml
@@ -4,25 +4,25 @@ warp:
description: pārvietoties pie spēlētāja uzaicinājuma zīmes
parameters: ""
warps:
- deactivate: "&cIepriekšējā uzaicinājumu zīme ir deaktivizēta!"
- error:
- does-not-exist: "&cAk vai! Uzaicinājuma zīme vairāk neeksistē!"
- no-permission: "&CTev nav nepieciešamās atļaujas, lai veiktu darbību!"
- no-remove: "&CTu nevari noņemt šo zīmi!"
- not-enough-level: "&CTavas salas līmenis ir pārāk zems!"
- not-on-island: "&CTev ir jāatrodas uz savas salas, lai veiktu šo darbību!"
- not-safe: "&cŠī uzaicinājuma zīme nav droša!"
- no-warps-yet: "&CNav neviena aktīva uzaicinājuma zīme."
- your-level-is: "&cTavas salas līmenis ir tikai [level], bet ir nepieciešams vismaz
- [required]. Vari mēģināt pārrēķināt savas salas līmeni."
help:
description: atver uzaicinājumu zīmju sarakstu
- next: "&6Nākošā lapa"
- player-warped: "&2[name] pārvietotojās pie tavas uzaicinājuma zīmes!"
- previous: "&6Iepriekšējā lapa"
- sign-removed: "&CUzaicinājuma zīme noņemta!"
- success: "&AVeiksmīgi!"
title: Uzaicinājuma Zīmes
- warpTip: "&6Novieto zīmi ar tekstu [text] pirmajā rindā"
- warpToPlayersSign: "&6Pārvietojās uz [player] uzaicinājuma zīmes"
- random: "&4Nejauša Zīmes Izvēle"
+ deactivate: "&c Iepriekšēja uzaicinājuma zīme deaktivizēta!"
+ error:
+ does-not-exist: "&c Oh! Šī uzaicinājuma zīme vairs neeksistē!"
+ no-permission: "&c Tev nav atļaujas veikt šo darbību!"
+ no-remove: "&c Tu nevari noņemt šo zīmi!"
+ no-warps-yet: "&c Diemžēl neviens uzaicinājums nav pieejams."
+ not-enough-level: "&c Tavs salas līmenis nav pietiekošs."
+ not-on-island: "&c Tev ir jābūt uz savas salas, lai veiktu šo darbību!"
+ not-safe: "&c Šīs uzaicinājums nav drošs!"
+ your-level-is: "&c Tavas salas līmenis ir [level], bet ir nepieciešams vismaz
+ [required]. Mēģini pārrēķināt salas līmeni."
+ next: "&6 Nākošā lapa"
+ player-warped: "&2 [name] ieradās pie uzaicinājuma zīmes!"
+ previous: "&6 Iepriekšējā lapa"
+ random: "&4 Nejaušs uzaicinājums"
+ sign-removed: "&c Uzaicinājuma zīme noņemta!"
+ success: "&a Izdevās!"
+ warpTip: "&6 Izveido zīmi ar [text] pirmajā rindā"
+ warpToPlayersSign: "&6 Pārvietojas uz [player] uzaicinājuma zīmi."
diff --git a/src/main/resources/locales/zh-CN.yml b/src/main/resources/locales/zh-CN.yml
index 88601b2..adc87c9 100644
--- a/src/main/resources/locales/zh-CN.yml
+++ b/src/main/resources/locales/zh-CN.yml
@@ -4,24 +4,24 @@ warp:
description: 传送到该玩家的传送木牌处
parameters: ""
warps:
- error:
- no-permission: "&C权限不足!"
- no-remove: "&C无权移除传送木牌!"
- not-enough-level: "&C岛屿等级不够高!"
- no-warps-yet: "&C暂无可用传送木牌"
- your-level-is: "&c岛屿当前等级 [level], 需要等级 [required]"
- does-not-exist: "&c那个传送已经不存在了!"
- not-on-island: "&C操作必须在你的岛屿上进行!"
- not-safe: "&c那个传送不安全!"
help:
description: 打开传送面板
- next: "&6下一页"
- previous: "&6上一页"
- sign-removed: "&C传送木牌已移除!"
- success: "&A成功!"
title: 传送木牌
- warpTip: "&6放置一个第一行是 [text] 的木牌以创建传送木牌"
- warpToPlayersSign: "&6正传送到 [player] 的传送木牌"
- deactivate: "&c旧传送牌已不再使用!"
- player-warped: "&2[name] 刚刚传送到了你的传送牌!"
- random: "&4随机传送"
+ deactivate: "&c 旧传送牌已停用!"
+ error:
+ does-not-exist: "&c 哦不!那个传送点已经没了!"
+ no-permission: "&c 你无权那样做!"
+ no-remove: "&c 你拿不掉那个牌子的!"
+ no-warps-yet: "&c 暂无可用传送点"
+ not-enough-level: "&c 你的岛等级不够高!"
+ not-on-island: "&c 你得在自己的岛屿上操作!"
+ not-safe: "&c 目标传送点不安全!"
+ your-level-is: "&c 你的岛现在 [level] 级,需要 [required] 级。 试试岛屿等级命令吧。"
+ next: "&6 次页"
+ player-warped: "&2 [name] 传送到了你的传送牌!"
+ previous: "&6 前页"
+ random: "&4 随机传送"
+ sign-removed: "&c 拆掉传送牌了!"
+ success: "&a 成了!"
+ warpTip: "&6 放个牌子第一行写 [text]"
+ warpToPlayersSign: "&6 正传送到 [player] 的牌子"
diff --git a/src/test/java/world/bentobox/warps/WarpPanelManagerTest.java b/src/test/java/world/bentobox/warps/WarpPanelManagerTest.java
index 3e3e584..0521627 100644
--- a/src/test/java/world/bentobox/warps/WarpPanelManagerTest.java
+++ b/src/test/java/world/bentobox/warps/WarpPanelManagerTest.java
@@ -24,6 +24,7 @@ import org.bukkit.inventory.ItemFactory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.junit.Before;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
@@ -37,6 +38,8 @@ import org.powermock.modules.junit4.PowerMockRunner;
import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.api.user.User;
+import world.bentobox.bentobox.database.AbstractDatabaseHandler;
+import world.bentobox.bentobox.database.DatabaseSetup;
import world.bentobox.bentobox.managers.PlayersManager;
import world.bentobox.warps.config.Settings;
@@ -45,7 +48,7 @@ import world.bentobox.warps.config.Settings;
*
*/
@RunWith(PowerMockRunner.class)
-@PrepareForTest({Bukkit.class})
+@PrepareForTest({Bukkit.class, DatabaseSetup.class})
public class WarpPanelManagerTest {
@Mock
@@ -63,6 +66,20 @@ public class WarpPanelManagerTest {
private UUID uuid;
@Mock
private Settings settings;
+ @Mock
+ private static AbstractDatabaseHandler