mirror of
https://github.com/RonanPlugins/BetterRTP.git
synced 2025-08-17 09:05:47 +00:00
2.14.0 - Release
no delay title added and fixed messages disabling factionsuuid support added
This commit is contained in:
parent
ffd5d3e921
commit
e8ba929b04
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>me.SuperRonanCraft</groupId>
|
||||
<artifactId>BetterRTP</artifactId>
|
||||
<version>2.13.2</version>
|
||||
<version>2.14.0</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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());
|
||||
|
@ -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();
|
||||
|
@ -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))
|
||||
|
@ -10,12 +10,13 @@ import java.util.HashMap;
|
||||
|
||||
public class RTPTitles {
|
||||
|
||||
boolean enabled = false;
|
||||
private final HashMap<RTP_TITLE_TYPE, RTP_TITLE> 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;
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -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'
|
||||
|
@ -39,7 +39,7 @@ Help:
|
||||
Biome: ' &7- &e/%command% biome <生物群系1, 生物群系2...> &7- 在这些指定的群系中随机传送。'
|
||||
# Edit: ' &7- &e/%command% edit <default/world> [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'
|
||||
|
@ -39,7 +39,7 @@ Help:
|
||||
Biome: ' &7- &e/%command% biome <生態域1, 生態域2...> &7- 在這些指定的生態域中隨機傳送。'
|
||||
# Edit: ' &7- &e/%command% edit <default/world> [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'
|
||||
|
@ -38,7 +38,7 @@ Help:
|
||||
Biome: ' &7- &e/%command% biome <biome1, biome2...> &7- Random teleport in deze biome'
|
||||
# Edit: ' &7- &e/%command% edit <default/world> [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 <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'
|
||||
|
@ -39,7 +39,7 @@ Help:
|
||||
Biome: ' &7- &e/%command% biome <biome1, biome2...> &7- Randomly teleport withing these biomes'
|
||||
Edit: ' &7- &e/%command% edit <default/world> [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 <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'
|
||||
|
@ -39,7 +39,7 @@ Help:
|
||||
# Biome: ' &7- &e/%command% biome <biome1, biome2...> &7- Randomly teleport withing these biomes'
|
||||
# Edit: ' &7- &e/%command% edit <default/world> [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 <joueur> [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'
|
||||
|
@ -39,7 +39,7 @@ Help:
|
||||
Biome: ' &7- &e/%command% biome <biome1, biome2...> &7- Randomly teleport withing these biomes'
|
||||
# Edit: ' &7- &e/%command% edit <default/world> [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 <player> [world] &7- 他のプレイヤーをランダムテレポート'
|
||||
Reload: ' &7- &e/%command% reload &7- プラグインをリロード'
|
||||
# Settings: ' &7- &e/%command% settings &7- Pull up a gui and edit some settings'
|
||||
|
@ -39,7 +39,7 @@ Help:
|
||||
# Biome: ' &7- &e/%command% biome <biome1, biome2...> &7- Randomly teleport withing these biomes'
|
||||
# Edit: ' &7- &e/%command% edit <default/world> [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'
|
||||
|
@ -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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user