diff --git a/pom.xml b/pom.xml index f34311c..300579b 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ me.SuperRonanCraft BetterRTP - 2.13.2 + 2.14.0 1.8 diff --git a/src/main/java/me/SuperRonanCraft/BetterRTP/player/commands/types/CmdInfo.java b/src/main/java/me/SuperRonanCraft/BetterRTP/player/commands/types/CmdInfo.java index 9808aa3..fd9ae92 100644 --- a/src/main/java/me/SuperRonanCraft/BetterRTP/player/commands/types/CmdInfo.java +++ b/src/main/java/me/SuperRonanCraft/BetterRTP/player/commands/types/CmdInfo.java @@ -122,7 +122,7 @@ public class CmdInfo implements RTPCommand, RTPCommandHelpable { else { info.add("&7- &6Disabled: " + _false); if (pl.getRTP().overriden.containsKey(w.getName())) - info.add("&7- &6Overriden: " + _true); + info.add("&7- &6Overriden: " + _true + " &7(" + pl.getRTP().overriden.get(w.getName()) + ")"); else { info.add("&7- &6WorldType: &f" + pl.getRTP().world_type.getOrDefault(w.getName(), WORLD_TYPE.NORMAL).name()); info.add("&7- &6Overriden: " + _false); diff --git a/src/main/java/me/SuperRonanCraft/BetterRTP/player/rtp/RTP.java b/src/main/java/me/SuperRonanCraft/BetterRTP/player/rtp/RTP.java index d6e88e1..e75e6dd 100644 --- a/src/main/java/me/SuperRonanCraft/BetterRTP/player/rtp/RTP.java +++ b/src/main/java/me/SuperRonanCraft/BetterRTP/player/rtp/RTP.java @@ -174,7 +174,7 @@ public class RTP { if (getPl().getSettings().delayEnabled && delay) { new RTPDelay(sendi, pWorld, delayTime, cancelOnMove, cancelOnDamage); } else { - getPl().getText().getSuccessTeleport(sendi); + teleport.beforeTeleportInstant(p); findSafeLocation(sendi, pWorld); } } diff --git a/src/main/java/me/SuperRonanCraft/BetterRTP/player/rtp/RTPDelay.java b/src/main/java/me/SuperRonanCraft/BetterRTP/player/rtp/RTPDelay.java index 5a0ab04..3a4b620 100644 --- a/src/main/java/me/SuperRonanCraft/BetterRTP/player/rtp/RTPDelay.java +++ b/src/main/java/me/SuperRonanCraft/BetterRTP/player/rtp/RTPDelay.java @@ -23,29 +23,9 @@ class RTPDelay implements Listener { delay(sendi, delay); } - @SuppressWarnings("deprecation") private void delay(CommandSender sendi, int delay) { - Main pl = Main.getInstance(); -// if (sendi.equals(pWorld.getPlayer()) && delay != 0 && getPl().getText().getTitleDelayChat()) -// getPl().getText().getDelay(sendi, String.valueOf(delay)); -// if (getPl().getText().getSoundsEnabled()) { -// Sound sound = getPl().getText().getSoundsDelay(); -// if (sound != null) -// pWorld.getPlayer().playSound(pWorld.getPlayer().getLocation(), sound, 1F, 1F); -// } -// if (getPl().getText().getTitleEnabled()) { -// String title = getPl().getText().getTitleDelay(pWorld.getPlayer().getName(), String.valueOf(delay)); -// String subTitle = getPl().getText().getSubTitleDelay(pWorld.getPlayer().getName(), String.valueOf(delay)); -// pWorld.getPlayer().sendTitle(title, subTitle); -// // int fadeIn = text.getFadeIn(); -// // int stay = text.getStay(); -// // int fadeOut = text.getFadeOut(); -// // player.sendTitle(title, subTitle, fadeIn, stay, fadeOut); -// // pWorld.getPlayer().sendTitle(title, subTitle); -// } - getPl().getRTP().getTeleport().beforeTeleport(pWorld.getPlayer(), delay); - run = Bukkit.getScheduler().scheduleSyncDelayedTask(pl, run(sendi, this), delay * 20); - //Bukkit.getScheduler().scheduleSyncRepeatingTask(pl, run(sendi, this), 0, 10); + getPl().getRTP().getTeleport().beforeTeleportDelay(pWorld.getPlayer(), delay); + run = Bukkit.getScheduler().scheduleSyncDelayedTask(Main.getInstance(), run(sendi, this), delay * 20); if (cancelOnMove || cancelOnDamage) Bukkit.getPluginManager().registerEvents(this, Main.getInstance()); } @@ -78,7 +58,6 @@ class RTPDelay implements Listener { Bukkit.getScheduler().cancelTask(run); if (!Bukkit.getScheduler().isCurrentlyRunning(run)) { HandlerList.unregisterAll(this); - //getPl().getText().getMoved(pWorld.getPlayer()); getPl().getRTP().getTeleport().cancelledTeleport(pWorld.getPlayer()); getPl().getEco().unCharge(pWorld.getPlayer(), pWorld.getPrice()); getPl().getCmd().cooldowns.remove(pWorld.getPlayer().getUniqueId()); diff --git a/src/main/java/me/SuperRonanCraft/BetterRTP/player/rtp/RTPPluginValidation.java b/src/main/java/me/SuperRonanCraft/BetterRTP/player/rtp/RTPPluginValidation.java index 5af4750..ea07619 100644 --- a/src/main/java/me/SuperRonanCraft/BetterRTP/player/rtp/RTPPluginValidation.java +++ b/src/main/java/me/SuperRonanCraft/BetterRTP/player/rtp/RTPPluginValidation.java @@ -4,13 +4,10 @@ import br.net.fabiozumbi12.RedProtect.Bukkit.RedProtect; import com.massivecraft.factions.Board; import com.massivecraft.factions.FLocation; import com.massivecraft.factions.Faction; -import com.massivecraft.factions.Factions; import com.palmergames.bukkit.towny.TownyAPI; import com.sk89q.worldedit.bukkit.BukkitAdapter; -import com.sk89q.worldguard.LocalPlayer; import com.sk89q.worldguard.WorldGuard; import com.sk89q.worldguard.protection.ApplicableRegionSet; -import com.sk89q.worldguard.protection.flags.Flags; import com.sk89q.worldguard.protection.regions.RegionContainer; import com.sk89q.worldguard.protection.regions.RegionQuery; import me.SuperRonanCraft.BetterRTP.Main; @@ -88,14 +85,13 @@ public class RTPPluginValidation { //Safe locations depending on enabled depende } // NOT TESTED 2.13.2 - // FactionsUUID v7.7.2 - // https://www.spigotmc.org/resources/redprotect.15841/ + // FactionsUUID v1.6.9.5-U0.5.16 + // https://www.spigotmc.org/resources/factionsuuid.1035/ private boolean getFactionsUUID(Location loc) { boolean result = true; if (getPl().getSettings().getsDepends().isFactionsUUID()) try { - FLocation floc = new FLocation(loc); - Faction faction = Board.getInstance().getFactionAt(floc); + Faction faction = Board.getInstance().getFactionAt(new FLocation(loc)); result = faction.isWilderness() || faction.isWarZone() || faction.isSafeZone(); } catch (Exception e) { e.printStackTrace(); diff --git a/src/main/java/me/SuperRonanCraft/BetterRTP/player/rtp/RTPTeleport.java b/src/main/java/me/SuperRonanCraft/BetterRTP/player/rtp/RTPTeleport.java index 271e108..8629234 100644 --- a/src/main/java/me/SuperRonanCraft/BetterRTP/player/rtp/RTPTeleport.java +++ b/src/main/java/me/SuperRonanCraft/BetterRTP/player/rtp/RTPTeleport.java @@ -79,7 +79,14 @@ public class RTPTeleport { sendSuccessMsg(p, p.getDisplayName(), loc, price, true, attempts); } - public void beforeTeleport(Player p, int delay) { //Only Delays should call this + public void beforeTeleportInstant(Player p) { + eSounds.playDelay(p); + eTitles.showTitle(RTPTitles.RTP_TITLE_TYPE.NODELAY, p, p.getLocation(), 0, 0); + if (eTitles.sendMsg(RTPTitles.RTP_TITLE_TYPE.NODELAY)) + getPl().getText().getSuccessTeleport(p); + } + + public void beforeTeleportDelay(Player p, int delay) { //Only Delays should call this eSounds.playDelay(p); eTitles.showTitle(RTPTitles.RTP_TITLE_TYPE.DELAY, p, p.getLocation(), 0, delay); if (eTitles.sendMsg(RTPTitles.RTP_TITLE_TYPE.DELAY)) diff --git a/src/main/java/me/SuperRonanCraft/BetterRTP/player/rtp/RTPTitles.java b/src/main/java/me/SuperRonanCraft/BetterRTP/player/rtp/RTPTitles.java index 9a943d1..b4d1635 100644 --- a/src/main/java/me/SuperRonanCraft/BetterRTP/player/rtp/RTPTitles.java +++ b/src/main/java/me/SuperRonanCraft/BetterRTP/player/rtp/RTPTitles.java @@ -10,12 +10,13 @@ import java.util.HashMap; public class RTPTitles { + boolean enabled = false; private final HashMap titles = new HashMap<>(); void load() { titles.clear(); FileBasics.FILETYPE config = FileBasics.FILETYPE.EFFECTS; - boolean enabled = config.getBoolean("Titles.Enabled"); + enabled = config.getBoolean("Titles.Enabled"); if (enabled) for (RTP_TITLE_TYPE type : RTP_TITLE_TYPE.values()) titles.put(type, new RTP_TITLE(type.path)); @@ -30,7 +31,7 @@ public class RTPTitles { } boolean sendMsg(RTP_TITLE_TYPE type) { - return titles.containsKey(type) && titles.get(type).send_message; + return titles.containsKey(type) && titles.get(type).send_message || !enabled; } private String getPlaceholders(String str, Player p, Location loc, int attempts, int delay) { @@ -53,7 +54,7 @@ public class RTPTitles { } enum RTP_TITLE_TYPE { - TELEPORT("Teleport"), DELAY("Delay"), CANCEL("Cancelled"), LOADING("Loading"); + NODELAY("NoDelay"), TELEPORT("Teleport"), DELAY("Delay"), CANCEL("Cancelled"), LOADING("Loading"); String path; RTP_TITLE_TYPE(String path) { this.path = path; diff --git a/src/main/java/me/SuperRonanCraft/BetterRTP/references/settings/SoftDepends.java b/src/main/java/me/SuperRonanCraft/BetterRTP/references/settings/SoftDepends.java index b13fb34..3a073b8 100644 --- a/src/main/java/me/SuperRonanCraft/BetterRTP/references/settings/SoftDepends.java +++ b/src/main/java/me/SuperRonanCraft/BetterRTP/references/settings/SoftDepends.java @@ -80,7 +80,7 @@ public class SoftDepends { } public void registerFactionsUUID() { - factionsUUID = respect_factionsUUID && Bukkit.getPluginManager().isPluginEnabled("RedProtect"); + factionsUUID = respect_factionsUUID && Bukkit.getPluginManager().isPluginEnabled("Factions"); if (respect_factionsUUID) debug("Respecting `FactionsUUID` was " + (factionsUUID ? "SUCCESSFULLY" : "NOT") + " registered"); } diff --git a/src/main/resources/effects.yml b/src/main/resources/effects.yml index 1aeee3b..18d886c 100644 --- a/src/main/resources/effects.yml +++ b/src/main/resources/effects.yml @@ -6,6 +6,10 @@ Sounds: Titles: Enabled: true # Enable the titles effect feature ## All support %player% %x% %y% and %z% placeholders + NoDelay: #Only triggers when there is no delay + Title: '&6Teleporting...' + Subtitle: '&8please wait' + SendMessage: true Teleport: Title: '&6Teleported!' Subtitle: '&fx=%x% y=%y% z=%z% in %attempts% attempts' diff --git a/src/main/resources/lang/chn.yml b/src/main/resources/lang/chn.yml index fcc651e..d03c474 100644 --- a/src/main/resources/lang/chn.yml +++ b/src/main/resources/lang/chn.yml @@ -39,7 +39,7 @@ Help: Biome: ' &7- &e/%command% biome <生物群系1, 生物群系2...> &7- 在这些指定的群系中随机传送。' # Edit: ' &7- &e/%command% edit [args...] &7- Edit some plugin settings' Help: ' &7- &e/%command% help &7- 打开帮助菜单。' -# Info: ' &7- &e/%command% info [arg] &7- View specific information about plugin parameters' +# Info: ' &7- &e/%command% info [world/particles/shapes/potion_effects] &7- View specific information about plugin parameters' Player: ' &7- &e/%command% player <玩家> [世界] [生物群系1,生物群系2...] &7- 指定一个玩家随机传送。' Reload: ' &7- &e/%command% reload &7- 重载插件。' # Settings: ' &7- &e/%command% settings &7- Pull up a gui and edit some settings' diff --git a/src/main/resources/lang/cht.yml b/src/main/resources/lang/cht.yml index 7732af8..8d86777 100644 --- a/src/main/resources/lang/cht.yml +++ b/src/main/resources/lang/cht.yml @@ -39,7 +39,7 @@ Help: Biome: ' &7- &e/%command% biome <生態域1, 生態域2...> &7- 在這些指定的生態域中隨機傳送。' # Edit: ' &7- &e/%command% edit [args...] &7- Edit some plugin settings' Help: ' &7- &e/%command% help &7- 打開幫助菜單。' -# Info: ' &7- &e/%command% info [arg] &7- View specific information about plugin parameters' +# Info: ' &7- &e/%command% info [world/particles/shapes/potion_effects] &7- View specific information about plugin parameters' Player: ' &7- &e/%command% player <玩家> [世界] [生態域1,生態域2...] &7- 指定一個玩家隨機傳送。' Reload: ' &7- &e/%command% reload &7- 重新讀取插件設定。' # Settings: ' &7- &e/%command% settings &7- Pull up a gui and edit some settings' diff --git a/src/main/resources/lang/du.yml b/src/main/resources/lang/du.yml index ba08fb9..3c68e27 100644 --- a/src/main/resources/lang/du.yml +++ b/src/main/resources/lang/du.yml @@ -38,7 +38,7 @@ Help: Biome: ' &7- &e/%command% biome &7- Random teleport in deze biome' # Edit: ' &7- &e/%command% edit [args...] &7- Edit some plugin settings' Help: ' &7- &e/%command% help &7- Toont help lijst.' - Info: ' &7- &e/%command% info [arg] &7- View specific information about plugin parameters' +# Info: ' &7- &e/%command% info [world/particles/shapes/potion_effects] &7- View specific information about plugin parameters' Player: ' &7- &e/%command% player [world] [biome1, biome2...] &7- Random teleport een andere speler' Reload: ' &7- &e/%command% reload &7- Herlaad de plugin' # Settings: ' &7- &e/%command% settings &7- Pull up a gui and edit some settings' diff --git a/src/main/resources/lang/en.yml b/src/main/resources/lang/en.yml index d24e2fe..02eaeb2 100644 --- a/src/main/resources/lang/en.yml +++ b/src/main/resources/lang/en.yml @@ -39,7 +39,7 @@ Help: Biome: ' &7- &e/%command% biome &7- Randomly teleport withing these biomes' Edit: ' &7- &e/%command% edit [args...] &7- Edit some plugin settings' Help: ' &7- &e/%command% help &7- Shows help list' - Info: ' &7- &e/%command% info [arg] &7- View specific information about plugin parameters' + Info: ' &7- &e/%command% info [world/particles/shapes/potion_effects] &7- View specific information about plugin parameters' Player: ' &7- &e/%command% player [world] [biome1, biome2...] &7- Randomly teleport another player' Reload: ' &7- &e/%command% reload &7- Reloads the plugin' Settings: ' &7- &e/%command% settings &7- Pull up a gui and edit some settings' diff --git a/src/main/resources/lang/fr.yml b/src/main/resources/lang/fr.yml index 165c2a2..167d110 100644 --- a/src/main/resources/lang/fr.yml +++ b/src/main/resources/lang/fr.yml @@ -39,7 +39,7 @@ Help: # Biome: ' &7- &e/%command% biome &7- Randomly teleport withing these biomes' # Edit: ' &7- &e/%command% edit [args...] &7- Edit some plugin settings' Help: ' &7- &e/%command% help &7- Affiche l''aide' -# Info: ' &7- &e/%command% info [arg] &7- View specific information about plugin parameters' +# Info: ' &7- &e/%command% info [world/particles/shapes/potion_effects] &7- View specific information about plugin parameters' Player: ' &7- &e/%command% player [monde] &7- Téléporte aléatoirement un autre joueur' Reload: ' &7- &e/%command% reload &7- Recharge le plugin!' # Settings: ' &7- &e/%command% settings &7- Pull up a gui and edit some settings' diff --git a/src/main/resources/lang/ja.yml b/src/main/resources/lang/ja.yml index 9b7ee38..f59332f 100644 --- a/src/main/resources/lang/ja.yml +++ b/src/main/resources/lang/ja.yml @@ -39,7 +39,7 @@ Help: Biome: ' &7- &e/%command% biome &7- Randomly teleport withing these biomes' # Edit: ' &7- &e/%command% edit [args...] &7- Edit some plugin settings' Help: ' &7- &e/%command% help &7- ヘルプを見る' -# Info: ' &7- &e/%command% info [arg] &7- View specific information about plugin parameters' +# Info: ' &7- &e/%command% info [world/particles/shapes/potion_effects] &7- View specific information about plugin parameters' Player: ' &7- &e/%command% player [world] &7- 他のプレイヤーをランダムテレポート' Reload: ' &7- &e/%command% reload &7- プラグインをリロード' # Settings: ' &7- &e/%command% settings &7- Pull up a gui and edit some settings' diff --git a/src/main/resources/lang/ru.yml b/src/main/resources/lang/ru.yml index 11aab20..f6f3c14 100644 --- a/src/main/resources/lang/ru.yml +++ b/src/main/resources/lang/ru.yml @@ -39,7 +39,7 @@ Help: # Biome: ' &7- &e/%command% biome &7- Randomly teleport withing these biomes' # Edit: ' &7- &e/%command% edit [args...] &7- Edit some plugin settings' Help: ' &7- &e/%command% help &7- показывает этот список' -# Info: ' &7- &e/%command% info [arg] &7- View specific information about plugin parameters' +# Info: ' &7- &e/%command% info [world/particles/shapes/potion_effects] &7- View specific information about plugin parameters' Player: ' &7- &e/%command% player <игрок> [мир] &7- случайно телепортирует игрока' Reload: ' &7- &e/%command% reload &7- перезагружает плагин' # Settings: ' &7- &e/%command% settings &7- Pull up a gui and edit some settings' diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 7ba8a27..6f47a3d 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ main: me.SuperRonanCraft.BetterRTP.Main -version: '2.13.2' +version: '2.14.0' name: BetterRTP author: SuperRonanCraft softdepend: [Vault, WorldGuard, GriefPrevention, Towny, Factions, RedProtect]