mirror of
https://github.com/RonanPlugins/BetterRTP.git
synced 2025-08-17 17:15:47 +00:00
added min/max y support + locations revamp
This commit is contained in:
parent
b56696cb1b
commit
a218104e56
3
pom.xml
3
pom.xml
@ -7,11 +7,12 @@
|
|||||||
<groupId>me.SuperRonanCraft</groupId>
|
<groupId>me.SuperRonanCraft</groupId>
|
||||||
<artifactId>BetterRTP</artifactId>
|
<artifactId>BetterRTP</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>3.2.4</version>
|
<version>3.3.0</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package me.SuperRonanCraft.BetterRTP.player.commands;
|
package me.SuperRonanCraft.BetterRTP.player.commands;
|
||||||
|
|
||||||
|
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -129,17 +129,19 @@ public class CmdInfo implements RTPCommand, RTPCommandHelpable {
|
|||||||
info.add("&7- &6Overriden&7: " + _false);
|
info.add("&7- &6Overriden&7: " + _false);
|
||||||
WorldPlayer _rtpworld = BetterRTP.getInstance().getRTP().getPlayerWorld(new RTPSetupInformation(w.getName(), sendi, null, personal));
|
WorldPlayer _rtpworld = BetterRTP.getInstance().getRTP().getPlayerWorld(new RTPSetupInformation(w.getName(), sendi, null, personal));
|
||||||
WorldDefault worldDefault = BetterRTP.getInstance().getRTP().defaultWorld;
|
WorldDefault worldDefault = BetterRTP.getInstance().getRTP().defaultWorld;
|
||||||
info.add("&7- &6Setup Type&7: " + _rtpworld.setup_type.name() + getInfo(_rtpworld, worldDefault, "setup"));
|
info.add("&7- &eSetup Type&7: " + _rtpworld.setup_type.name() + getInfo(_rtpworld, worldDefault, "setup"));
|
||||||
info.add("&7- &6Use World Border&7: " + (_rtpworld.getUseWorldborder() ? _true : _false));
|
info.add("&7- &6Use World Border&7: " + (_rtpworld.getUseWorldborder() ? _true : _false));
|
||||||
info.add("&7- &6World Type&7: &f" + _rtpworld.getWorldtype().name());
|
info.add("&7- &eWorld Type&7: &f" + _rtpworld.getWorldtype().name());
|
||||||
info.add("&7- &6Center X&7: &f" + _rtpworld.getCenterX() + getInfo(_rtpworld, worldDefault, "centerx"));
|
info.add("&7- &6Center X&7: &f" + _rtpworld.getCenterX() + getInfo(_rtpworld, worldDefault, "centerx"));
|
||||||
info.add("&7- &6Center Z&7: &f" + _rtpworld.getCenterZ() + getInfo(_rtpworld, worldDefault, "centerz"));
|
info.add("&7- &eCenter Z&7: &f" + _rtpworld.getCenterZ() + getInfo(_rtpworld, worldDefault, "centerz"));
|
||||||
info.add("&7- &6Max Radius&7: &f" + _rtpworld.getMaxRad() + getInfo(_rtpworld, worldDefault, "max"));
|
info.add("&7- &6Max Radius&7: &f" + _rtpworld.getMaxRadius() + getInfo(_rtpworld, worldDefault, "maxrad"));
|
||||||
info.add("&7- &6Min Radius&7: &f" + _rtpworld.getMinRad() + getInfo(_rtpworld, worldDefault, "min"));
|
info.add("&7- &eMin Radius&7: &f" + _rtpworld.getMinRadius() + getInfo(_rtpworld, worldDefault, "minrad"));
|
||||||
|
info.add("&7- &6Min Y&7: &f" + _rtpworld.getMinY());
|
||||||
|
info.add("&7- &eMax Y&7: &f" + _rtpworld.getMaxY());
|
||||||
info.add("&7- &6Price&7: &f" + _rtpworld.getPrice() + getInfo(_rtpworld, worldDefault, "price"));
|
info.add("&7- &6Price&7: &f" + _rtpworld.getPrice() + getInfo(_rtpworld, worldDefault, "price"));
|
||||||
info.add("&7- &6Biomes&7: &f" + _rtpworld.getBiomes().toString());
|
info.add("&7- &eBiomes&7: &f" + _rtpworld.getBiomes().toString());
|
||||||
info.add("&7- &6Shape&7: &f" + _rtpworld.getShape().toString() + getInfo(_rtpworld, worldDefault, "shape"));
|
info.add("&7- &6Shape&7: &f" + _rtpworld.getShape().toString() + getInfo(_rtpworld, worldDefault, "shape"));
|
||||||
info.add("&7- &6Permission Group&7: " + (_rtpworld.getConfig() != null ? "&e" + _rtpworld.getConfig().name : "&cN/A"));
|
info.add("&7- &ePermission Group&7: " + (_rtpworld.getConfig() != null ? "&e" + _rtpworld.getConfig().name : "&cN/A"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return info;
|
return info;
|
||||||
@ -152,10 +154,10 @@ public class CmdInfo implements RTPCommand, RTPCommandHelpable {
|
|||||||
return worldPlayer.getUseWorldborder() || worldPlayer.getCenterX() == worldDefault.getCenterX() ? worldPlayer.getUseWorldborder() ? " &8(worldborder)" : " &8(default)" : "";
|
return worldPlayer.getUseWorldborder() || worldPlayer.getCenterX() == worldDefault.getCenterX() ? worldPlayer.getUseWorldborder() ? " &8(worldborder)" : " &8(default)" : "";
|
||||||
case "centerz":
|
case "centerz":
|
||||||
return worldPlayer.getUseWorldborder() || worldPlayer.getCenterZ() == worldDefault.getCenterZ() ? worldPlayer.getUseWorldborder() ? " &8(worldborder)" : " &8(default)" : "";
|
return worldPlayer.getUseWorldborder() || worldPlayer.getCenterZ() == worldDefault.getCenterZ() ? worldPlayer.getUseWorldborder() ? " &8(worldborder)" : " &8(default)" : "";
|
||||||
case "max":
|
case "maxrad":
|
||||||
return worldPlayer.getUseWorldborder() || worldPlayer.getMaxRad() == worldDefault.getMaxRad() ? worldPlayer.getUseWorldborder() ? " &8(worldborder)" : " &8(default)" : "";
|
return worldPlayer.getUseWorldborder() || worldPlayer.getMaxRadius() == worldDefault.getMaxRadius() ? worldPlayer.getUseWorldborder() ? " &8(worldborder)" : " &8(default)" : "";
|
||||||
case "min":
|
case "minrad":
|
||||||
return worldPlayer.getMinRad() == worldDefault.getMinRad() ? " &8(default)" : "";
|
return worldPlayer.getMinRadius() == worldDefault.getMinRadius() ? " &8(default)" : "";
|
||||||
case "price":
|
case "price":
|
||||||
return worldPlayer.getPrice() == worldDefault.getPrice() ? " &8(default)" : "";
|
return worldPlayer.getPrice() == worldDefault.getPrice() ? " &8(default)" : "";
|
||||||
case "shape":
|
case "shape":
|
||||||
|
@ -11,6 +11,7 @@ import me.SuperRonanCraft.BetterRTP.references.rtpinfo.worlds.WorldLocations;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -27,7 +28,7 @@ public class CmdLocation implements RTPCommand, RTPCommandHelpable {
|
|||||||
public void execute(CommandSender sendi, String label, String[] args) {
|
public void execute(CommandSender sendi, String label, String[] args) {
|
||||||
if (args.length == 2) {
|
if (args.length == 2) {
|
||||||
if (sendi instanceof Player) {
|
if (sendi instanceof Player) {
|
||||||
for (String location_name : getLocations(sendi).keySet()) {
|
for (String location_name : getLocations(sendi, null).keySet()) {
|
||||||
if (location_name.equalsIgnoreCase(args[1].toLowerCase())) {
|
if (location_name.equalsIgnoreCase(args[1].toLowerCase())) {
|
||||||
Player p = (Player) sendi;
|
Player p = (Player) sendi;
|
||||||
HelperRTP.tp(p, sendi, null, null, RTP_TYPE.COMMAND, false, false, (WorldLocations) getLocations().get(location_name));
|
HelperRTP.tp(p, sendi, null, null, RTP_TYPE.COMMAND, false, false, (WorldLocations) getLocations().get(location_name));
|
||||||
@ -40,7 +41,7 @@ public class CmdLocation implements RTPCommand, RTPCommandHelpable {
|
|||||||
} else if (args.length == 3 && BetterRTP.getInstance().getPerms().getRtpOther(sendi)) {
|
} else if (args.length == 3 && BetterRTP.getInstance().getPerms().getRtpOther(sendi)) {
|
||||||
Player p = Bukkit.getPlayer(args[2]);
|
Player p = Bukkit.getPlayer(args[2]);
|
||||||
if (p != null && p.isOnline()) {
|
if (p != null && p.isOnline()) {
|
||||||
for (String location_name : getLocations(sendi).keySet()) {
|
for (String location_name : getLocations(sendi, null).keySet()) {
|
||||||
if (location_name.equalsIgnoreCase(args[1].toLowerCase())) {
|
if (location_name.equalsIgnoreCase(args[1].toLowerCase())) {
|
||||||
HelperRTP.tp(p, sendi, null, null, RTP_TYPE.COMMAND, false, false, (WorldLocations) getLocations().get(location_name));
|
HelperRTP.tp(p, sendi, null, null, RTP_TYPE.COMMAND, false, false, (WorldLocations) getLocations().get(location_name));
|
||||||
return;
|
return;
|
||||||
@ -58,7 +59,7 @@ public class CmdLocation implements RTPCommand, RTPCommandHelpable {
|
|||||||
public List<String> tabComplete(CommandSender sendi, String[] args) {
|
public List<String> tabComplete(CommandSender sendi, String[] args) {
|
||||||
List<String> list = new ArrayList<>();
|
List<String> list = new ArrayList<>();
|
||||||
if (args.length == 2) {
|
if (args.length == 2) {
|
||||||
for (String location_name : getLocations(sendi).keySet())
|
for (String location_name : getLocations(sendi, null).keySet())
|
||||||
if (location_name.toLowerCase().startsWith(args[1].toLowerCase()))
|
if (location_name.toLowerCase().startsWith(args[1].toLowerCase()))
|
||||||
list.add(location_name);
|
list.add(location_name);
|
||||||
} else if (args.length == 3 && BetterRTP.getInstance().getPerms().getRtpOther(sendi)) {
|
} else if (args.length == 3 && BetterRTP.getInstance().getPerms().getRtpOther(sendi)) {
|
||||||
@ -77,17 +78,22 @@ public class CmdLocation implements RTPCommand, RTPCommandHelpable {
|
|||||||
BetterRTP.getInstance().getText().getUsageLocation(sendi, label);
|
BetterRTP.getInstance().getText().getUsageLocation(sendi, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HashMap<String, RTPWorld> getLocations() {
|
private static HashMap<String, RTPWorld> getLocations() {
|
||||||
return BetterRTP.getInstance().getRTP().worldLocations;
|
return BetterRTP.getInstance().getRTP().worldLocations;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get locations a player has access to
|
//Get locations a player has access to
|
||||||
public static HashMap<String, RTPWorld> getLocations(CommandSender sendi) {
|
public static HashMap<String, RTPWorld> getLocations(CommandSender sendi, @Nullable String world) {
|
||||||
HashMap<String, RTPWorld> locations = new HashMap<>();
|
if (BetterRTP.getInstance().getSettings().isLocationNeedPermission()) {
|
||||||
for (Map.Entry<String, RTPWorld> location : getLocations().entrySet())
|
HashMap<String, RTPWorld> locations = new HashMap<>();
|
||||||
if (BetterRTP.getInstance().getPerms().getLocation(sendi, location.getKey()))
|
for (Map.Entry<String, RTPWorld> location : getLocations().entrySet())
|
||||||
locations.put(location.getKey(), location.getValue());
|
if (BetterRTP.getInstance().getPerms().getLocation(sendi, location.getKey())) {
|
||||||
return locations;
|
if (world == null || location.getValue().getWorld().getName().equals(world))
|
||||||
|
locations.put(location.getKey(), location.getValue());
|
||||||
|
}
|
||||||
|
return locations;
|
||||||
|
} else
|
||||||
|
return getLocations();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -4,6 +4,7 @@ import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
|||||||
import me.SuperRonanCraft.BetterRTP.player.commands.RTPCommand;
|
import me.SuperRonanCraft.BetterRTP.player.commands.RTPCommand;
|
||||||
import me.SuperRonanCraft.BetterRTP.player.rtp.RTP_TYPE;
|
import me.SuperRonanCraft.BetterRTP.player.rtp.RTP_TYPE;
|
||||||
import me.SuperRonanCraft.BetterRTP.references.helpers.HelperRTP;
|
import me.SuperRonanCraft.BetterRTP.references.helpers.HelperRTP;
|
||||||
|
import me.SuperRonanCraft.BetterRTP.references.rtpinfo.worlds.WorldLocations;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
@ -4,6 +4,7 @@ import lombok.Getter;
|
|||||||
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
||||||
import me.SuperRonanCraft.BetterRTP.references.customEvents.RTP_SettingUpEvent;
|
import me.SuperRonanCraft.BetterRTP.references.customEvents.RTP_SettingUpEvent;
|
||||||
import me.SuperRonanCraft.BetterRTP.references.file.FileBasics;
|
import me.SuperRonanCraft.BetterRTP.references.file.FileBasics;
|
||||||
|
import me.SuperRonanCraft.BetterRTP.references.helpers.HelperRTP;
|
||||||
import me.SuperRonanCraft.BetterRTP.references.rtpinfo.worlds.*;
|
import me.SuperRonanCraft.BetterRTP.references.rtpinfo.worlds.*;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
@ -58,21 +59,14 @@ public class RTP {
|
|||||||
public WorldPlayer getPlayerWorld(RTPSetupInformation setup_info) {
|
public WorldPlayer getPlayerWorld(RTPSetupInformation setup_info) {
|
||||||
WorldPlayer pWorld = new WorldPlayer(setup_info.getPlayer(), Bukkit.getWorld(setup_info.getWorld()));
|
WorldPlayer pWorld = new WorldPlayer(setup_info.getPlayer(), Bukkit.getWorld(setup_info.getWorld()));
|
||||||
|
|
||||||
//Locations
|
//Random Location
|
||||||
if (setup_info.getLocation() == null) {
|
if (setup_info.getLocation() == null && BetterRTP.getInstance().getSettings().isUseLocationIfAvailable()) {
|
||||||
List<RTPWorld> locationsList = new ArrayList<>();
|
setup_info.setLocation(HelperRTP.getRandomLocation(setup_info.getSender(), setup_info.getWorld()));
|
||||||
for (Map.Entry<String, RTPWorld> location_set : worldLocations.entrySet()) {
|
if (setup_info.getLocation() == null)
|
||||||
RTPWorld location = location_set.getValue();
|
BetterRTP.getInstance().getLogger().warning("UseLocationIfAvailable is set to `true`, but no location was found for "
|
||||||
if (location.getWorld().getName().equals(setup_info.getWorld()))
|
+ setup_info.getSender().getName() + "! Using world defaults!");
|
||||||
locationsList.add(location_set.getValue());
|
|
||||||
}
|
|
||||||
if (!locationsList.isEmpty()) {
|
|
||||||
RTPWorld location = locationsList.size() > 1 ? locationsList.get((new Random()).nextInt(locationsList.size() - 1)) : locationsList.get(0);
|
|
||||||
|
|
||||||
setup_info.setLocation((WorldLocations) location);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
//Location
|
||||||
if (setup_info.getLocation() != null) {
|
if (setup_info.getLocation() != null) {
|
||||||
String setup_name = null;
|
String setup_name = null;
|
||||||
for (Map.Entry<String, RTPWorld> location_set : worldLocations.entrySet()) {
|
for (Map.Entry<String, RTPWorld> location_set : worldLocations.entrySet()) {
|
||||||
@ -85,7 +79,6 @@ public class RTP {
|
|||||||
pWorld.setup(setup_name, setup_info.getLocation(), setup_info.getLocation().getBiomes(), setup_info.isPersonalized());
|
pWorld.setup(setup_name, setup_info.getLocation(), setup_info.getLocation().getBiomes(), setup_info.isPersonalized());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!pWorld.isSetup()) {
|
if (!pWorld.isSetup()) {
|
||||||
//Custom World
|
//Custom World
|
||||||
if (customWorlds.containsKey(setup_info.getWorld())) {
|
if (customWorlds.containsKey(setup_info.getWorld())) {
|
||||||
@ -97,7 +90,7 @@ public class RTP {
|
|||||||
pWorld.setup(null, defaultWorld, setup_info.getBiomes(), setup_info.isPersonalized());
|
pWorld.setup(null, defaultWorld, setup_info.getBiomes(), setup_info.isPersonalized());
|
||||||
}
|
}
|
||||||
//World type
|
//World type
|
||||||
WORLD_TYPE world_type; //World rtp type
|
WORLD_TYPE world_type;
|
||||||
if (this.world_type.containsKey(setup_info.getWorld()))
|
if (this.world_type.containsKey(setup_info.getWorld()))
|
||||||
world_type = this.world_type.get(setup_info.getWorld());
|
world_type = this.world_type.get(setup_info.getWorld());
|
||||||
else {
|
else {
|
||||||
|
@ -1,36 +1,61 @@
|
|||||||
package me.SuperRonanCraft.BetterRTP.player.rtp;
|
package me.SuperRonanCraft.BetterRTP.player.rtp;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import lombok.NonNull;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
||||||
|
import me.SuperRonanCraft.BetterRTP.player.commands.types.CmdLocation;
|
||||||
|
import me.SuperRonanCraft.BetterRTP.references.helpers.HelperRTP;
|
||||||
|
import me.SuperRonanCraft.BetterRTP.references.rtpinfo.worlds.RTPWorld;
|
||||||
import me.SuperRonanCraft.BetterRTP.references.rtpinfo.worlds.WorldLocations;
|
import me.SuperRonanCraft.BetterRTP.references.rtpinfo.worlds.WorldLocations;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class RTPSetupInformation {
|
public class RTPSetupInformation {
|
||||||
//Will provide information to setup an RTP attempt
|
//Will provide information to setup an RTP attempt
|
||||||
@Getter @Setter private String world;
|
@Getter @Setter private String world;
|
||||||
@Getter private final CommandSender sender;
|
@Getter @NonNull private final CommandSender sender;
|
||||||
@Getter private final Player player;
|
@Getter @Nullable private final Player player;
|
||||||
@Getter private final boolean personalized;
|
@Getter private final boolean personalized;
|
||||||
@Getter private final boolean cooldown;
|
@Getter private final boolean cooldown;
|
||||||
@Getter @Setter private List<String> biomes;
|
@Getter @Setter @Nullable private List<String> biomes;
|
||||||
@Getter @Setter private WorldLocations location;
|
@Getter @Setter @Nullable private WorldLocations location;
|
||||||
@Getter private final boolean delay;
|
@Getter private final boolean delay;
|
||||||
@Getter private final RTP_TYPE rtp_type;
|
@Getter @Nullable private final RTP_TYPE rtp_type;
|
||||||
|
|
||||||
public RTPSetupInformation(String world, CommandSender sender, Player player, boolean personalized) {
|
public RTPSetupInformation(@Nullable String world,
|
||||||
|
@NonNull CommandSender sender,
|
||||||
|
@Nullable Player player,
|
||||||
|
boolean personalized) {
|
||||||
this(world, sender, player, personalized, null, false, null, null);
|
this(world, sender, player, personalized, null, false, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public RTPSetupInformation(String world, CommandSender sender, Player player, boolean personalized, List<String> biomes,
|
public RTPSetupInformation(@Nullable String world,
|
||||||
boolean delay, RTP_TYPE rtp_type, WorldLocations location) {
|
@NonNull CommandSender sender,
|
||||||
|
@Nullable Player player,
|
||||||
|
boolean personalized,
|
||||||
|
@Nullable List<String> biomes,
|
||||||
|
boolean delay,
|
||||||
|
@Nullable RTP_TYPE rtp_type,
|
||||||
|
@Nullable WorldLocations location) {
|
||||||
this(world, sender, player, personalized, biomes, delay, rtp_type, location, true);
|
this(world, sender, player, personalized, biomes, delay, rtp_type, location, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public RTPSetupInformation(String world, CommandSender sender, Player player, boolean personalized, List<String> biomes,
|
public RTPSetupInformation(@Nullable String world,
|
||||||
boolean delay, RTP_TYPE rtp_type, WorldLocations location, boolean cooldown) {
|
@NonNull CommandSender sender,
|
||||||
|
@Nullable Player player,
|
||||||
|
boolean personalized,
|
||||||
|
@Nullable List<String> biomes,
|
||||||
|
boolean delay,
|
||||||
|
@Nullable RTP_TYPE rtp_type,
|
||||||
|
@Nullable WorldLocations location,
|
||||||
|
boolean cooldown) {
|
||||||
this.world = world;
|
this.world = world;
|
||||||
this.sender = sender;
|
this.sender = sender;
|
||||||
this.player = player;
|
this.player = player;
|
||||||
|
@ -42,7 +42,7 @@ public class RTPSounds {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void playSound(Location loc, Player p, String sound) {
|
void playSound(Location loc, Player p, String sound) {
|
||||||
if (BetterRTP.getInstance().getSettings().protocolLibSounds) {
|
if (BetterRTP.getInstance().getSettings().isProtocolLibSounds()) {
|
||||||
try {
|
try {
|
||||||
ProtocolManager pm = ProtocolLibrary.getProtocolManager();
|
ProtocolManager pm = ProtocolLibrary.getProtocolManager();
|
||||||
WrapperPlayServerNamedSoundEffect packet = new WrapperPlayServerNamedSoundEffect(pm.createPacket(PacketType.Play.Server.NAMED_SOUND_EFFECT));
|
WrapperPlayServerNamedSoundEffect packet = new WrapperPlayServerNamedSoundEffect(pm.createPacket(PacketType.Play.Server.NAMED_SOUND_EFFECT));
|
||||||
|
@ -6,11 +6,16 @@ import me.SuperRonanCraft.BetterRTP.player.rtp.RTPSetupInformation;
|
|||||||
import me.SuperRonanCraft.BetterRTP.player.rtp.RTP_TYPE;
|
import me.SuperRonanCraft.BetterRTP.player.rtp.RTP_TYPE;
|
||||||
import me.SuperRonanCraft.BetterRTP.references.rtpinfo.CooldownData;
|
import me.SuperRonanCraft.BetterRTP.references.rtpinfo.CooldownData;
|
||||||
import me.SuperRonanCraft.BetterRTP.references.rtpinfo.CooldownHandler;
|
import me.SuperRonanCraft.BetterRTP.references.rtpinfo.CooldownHandler;
|
||||||
|
import me.SuperRonanCraft.BetterRTP.references.rtpinfo.worlds.RTPWorld;
|
||||||
import me.SuperRonanCraft.BetterRTP.references.rtpinfo.worlds.WorldLocations;
|
import me.SuperRonanCraft.BetterRTP.references.rtpinfo.worlds.WorldLocations;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class HelperRTP {
|
public class HelperRTP {
|
||||||
|
|
||||||
@ -39,11 +44,6 @@ public class HelperRTP {
|
|||||||
if (getPl().getSettings().isDelayEnabled() && getPl().getSettings().getDelayTime() > 0) //Delay enabled?
|
if (getPl().getSettings().isDelayEnabled() && getPl().getSettings().getDelayTime() > 0) //Delay enabled?
|
||||||
if (!getPl().getPerms().getBypassDelay(player)) //Can bypass?
|
if (!getPl().getPerms().getBypassDelay(player)) //Can bypass?
|
||||||
delay = true;
|
delay = true;
|
||||||
//player.sendMessage("Cooldown applies: " + cooldownApplies(sendi, player));
|
|
||||||
if (getPl().getSettings().isUseLocationIfAvailable() && !CmdLocation.getLocations().isEmpty()) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
RTPSetupInformation setup_info = new RTPSetupInformation(world, sendi, player, true,
|
RTPSetupInformation setup_info = new RTPSetupInformation(world, sendi, player, true,
|
||||||
biomes, delay, rtpType, locations, !ignoreCooldown && cooldownApplies(sendi, player)); //ignore cooldown or else
|
biomes, delay, rtpType, locations, !ignoreCooldown && cooldownApplies(sendi, player)); //ignore cooldown or else
|
||||||
getPl().getRTP().start(setup_info);
|
getPl().getRTP().start(setup_info);
|
||||||
@ -107,4 +107,15 @@ public class HelperRTP {
|
|||||||
private static BetterRTP getPl() {
|
private static BetterRTP getPl() {
|
||||||
return BetterRTP.getInstance();
|
return BetterRTP.getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
public static WorldLocations getRandomLocation(CommandSender sender, String world) {
|
||||||
|
HashMap<String, RTPWorld> locations_permissible = CmdLocation.getLocations(sender, world);
|
||||||
|
if (!locations_permissible.isEmpty()) {
|
||||||
|
List<String> valuesList = new ArrayList<>(locations_permissible.keySet());
|
||||||
|
String randomIndex = valuesList.get(new Random().nextInt(valuesList.size()));
|
||||||
|
return (WorldLocations) locations_permissible.get(randomIndex);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package me.SuperRonanCraft.BetterRTP.references.rtpinfo.worlds;
|
package me.SuperRonanCraft.BetterRTP.references.rtpinfo.worlds;
|
||||||
|
|
||||||
|
import lombok.NonNull;
|
||||||
import me.SuperRonanCraft.BetterRTP.player.rtp.RTP_SHAPE;
|
import me.SuperRonanCraft.BetterRTP.player.rtp.RTP_SHAPE;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
|
||||||
@ -13,15 +14,19 @@ public interface RTPWorld {
|
|||||||
|
|
||||||
int getCenterZ();
|
int getCenterZ();
|
||||||
|
|
||||||
int getMaxRad();
|
int getMaxRadius();
|
||||||
|
|
||||||
int getMinRad();
|
int getMinRadius();
|
||||||
|
|
||||||
int getPrice();
|
int getPrice();
|
||||||
|
|
||||||
List<String> getBiomes();
|
List<String> getBiomes();
|
||||||
|
|
||||||
World getWorld();
|
@NonNull World getWorld();
|
||||||
|
|
||||||
RTP_SHAPE getShape();
|
RTP_SHAPE getShape();
|
||||||
|
|
||||||
|
int getMinY();
|
||||||
|
|
||||||
|
int getMaxY();
|
||||||
}
|
}
|
||||||
|
@ -13,9 +13,9 @@ public interface RTPWorld_Defaulted {
|
|||||||
|
|
||||||
void setCenterZ(int value);
|
void setCenterZ(int value);
|
||||||
|
|
||||||
void setMaxRad(int value);
|
void setMaxRadius(int value);
|
||||||
|
|
||||||
void setMinRad(int value);
|
void setMinRadius(int value);
|
||||||
|
|
||||||
void setPrice(int value);
|
void setPrice(int value);
|
||||||
|
|
||||||
@ -25,15 +25,21 @@ public interface RTPWorld_Defaulted {
|
|||||||
|
|
||||||
void setShape(RTP_SHAPE value);
|
void setShape(RTP_SHAPE value);
|
||||||
|
|
||||||
|
void setMinY(int value);
|
||||||
|
|
||||||
|
void setMaxY(int value);
|
||||||
|
|
||||||
default void setupDefaults() {
|
default void setupDefaults() {
|
||||||
WorldDefault worldDefault = BetterRTP.getInstance().getRTP().defaultWorld;
|
WorldDefault worldDefault = BetterRTP.getInstance().getRTP().defaultWorld;
|
||||||
setMaxRad(worldDefault.getMaxRad());
|
setMaxRadius(worldDefault.getMaxRadius());
|
||||||
setMinRad(worldDefault.getMinRad());
|
setMinRadius(worldDefault.getMinRadius());
|
||||||
setUseWorldBorder(worldDefault.getUseWorldborder());
|
setUseWorldBorder(worldDefault.getUseWorldborder());
|
||||||
setCenterX(worldDefault.getCenterX());
|
setCenterX(worldDefault.getCenterX());
|
||||||
setCenterZ(worldDefault.getCenterZ());
|
setCenterZ(worldDefault.getCenterZ());
|
||||||
setPrice(worldDefault.getPrice());
|
setPrice(worldDefault.getPrice());
|
||||||
setBiomes(worldDefault.getBiomes());
|
setBiomes(worldDefault.getBiomes());
|
||||||
setShape(worldDefault.getShape());
|
setShape(worldDefault.getShape());
|
||||||
|
setMinY(worldDefault.getMinY());
|
||||||
|
setMaxY(worldDefault.getMaxY());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import me.SuperRonanCraft.BetterRTP.references.file.FileBasics;
|
|||||||
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -13,7 +14,7 @@ import java.util.Map;
|
|||||||
public class WorldCustom implements RTPWorld, RTPWorld_Defaulted {
|
public class WorldCustom implements RTPWorld, RTPWorld_Defaulted {
|
||||||
public String world;
|
public String world;
|
||||||
private boolean useWorldborder;
|
private boolean useWorldborder;
|
||||||
private int centerX, centerZ, maxBorderRad, minBorderRad, price;
|
private int centerX, centerZ, maxBorderRad, minBorderRad, price, miny, maxy;
|
||||||
private List<String> biomes;
|
private List<String> biomes;
|
||||||
private RTP_SHAPE shape;
|
private RTP_SHAPE shape;
|
||||||
|
|
||||||
@ -54,7 +55,7 @@ public class WorldCustom implements RTPWorld, RTPWorld_Defaulted {
|
|||||||
if (maxBorderRad <= 0) {
|
if (maxBorderRad <= 0) {
|
||||||
BetterRTP.getInstance().getText().sms(Bukkit.getConsoleSender(),
|
BetterRTP.getInstance().getText().sms(Bukkit.getConsoleSender(),
|
||||||
"WARNING! Custom world '" + world + "' Maximum radius of '" + maxBorderRad + "' is not allowed! Set to default value!");
|
"WARNING! Custom world '" + world + "' Maximum radius of '" + maxBorderRad + "' is not allowed! Set to default value!");
|
||||||
maxBorderRad = BetterRTP.getInstance().getRTP().defaultWorld.getMaxRad();
|
maxBorderRad = BetterRTP.getInstance().getRTP().defaultWorld.getMaxRadius();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (test.get("MinRadius") != null) {
|
if (test.get("MinRadius") != null) {
|
||||||
@ -63,9 +64,9 @@ public class WorldCustom implements RTPWorld, RTPWorld_Defaulted {
|
|||||||
if (minBorderRad < 0 || minBorderRad >= maxBorderRad) {
|
if (minBorderRad < 0 || minBorderRad >= maxBorderRad) {
|
||||||
BetterRTP.getInstance().getText().sms(Bukkit.getConsoleSender(),
|
BetterRTP.getInstance().getText().sms(Bukkit.getConsoleSender(),
|
||||||
"WARNING! Custom world '" + world + "' Minimum radius of '" + minBorderRad + "' is not allowed! Set to default value!");
|
"WARNING! Custom world '" + world + "' Minimum radius of '" + minBorderRad + "' is not allowed! Set to default value!");
|
||||||
minBorderRad = BetterRTP.getInstance().getRTP().defaultWorld.getMinRad();
|
minBorderRad = BetterRTP.getInstance().getRTP().defaultWorld.getMinRadius();
|
||||||
if (minBorderRad >= maxBorderRad)
|
if (minBorderRad >= maxBorderRad)
|
||||||
maxBorderRad = BetterRTP.getInstance().getRTP().defaultWorld.getMaxRad();
|
maxBorderRad = BetterRTP.getInstance().getRTP().defaultWorld.getMaxRadius();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (test.get("Biomes") != null) {
|
if (test.get("Biomes") != null) {
|
||||||
@ -89,6 +90,14 @@ public class WorldCustom implements RTPWorld, RTPWorld_Defaulted {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (test.get("MinY") != null) {
|
||||||
|
if (test.get("MinY").getClass() == Integer.class)
|
||||||
|
this.miny = Integer.parseInt((test.get("MinY")).toString());
|
||||||
|
}
|
||||||
|
if (test.get("MaxY") != null) {
|
||||||
|
if (test.get("MaxY").getClass() == Integer.class)
|
||||||
|
this.maxy = Integer.parseInt((test.get("MaxY")).toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Booleans
|
//Booleans
|
||||||
@ -100,13 +109,13 @@ public class WorldCustom implements RTPWorld, RTPWorld_Defaulted {
|
|||||||
if (maxBorderRad <= 0) {
|
if (maxBorderRad <= 0) {
|
||||||
BetterRTP.getInstance().getText().sms(Bukkit.getConsoleSender(),
|
BetterRTP.getInstance().getText().sms(Bukkit.getConsoleSender(),
|
||||||
"WARNING! Custom world '" + world + "' Maximum radius of '" + maxBorderRad + "' is not allowed! Set to default value!");
|
"WARNING! Custom world '" + world + "' Maximum radius of '" + maxBorderRad + "' is not allowed! Set to default value!");
|
||||||
maxBorderRad = BetterRTP.getInstance().getRTP().defaultWorld.getMaxRad();
|
maxBorderRad = BetterRTP.getInstance().getRTP().defaultWorld.getMaxRadius();
|
||||||
}
|
}
|
||||||
//minBorderRad = config.getInt(pre + world + ".MinRadius");
|
//minBorderRad = config.getInt(pre + world + ".MinRadius");
|
||||||
if (minBorderRad <= 0 || minBorderRad >= maxBorderRad) {
|
if (minBorderRad <= 0 || minBorderRad >= maxBorderRad) {
|
||||||
BetterRTP.getInstance().getText().sms(Bukkit.getConsoleSender(),
|
BetterRTP.getInstance().getText().sms(Bukkit.getConsoleSender(),
|
||||||
"WARNING! Custom world '" + world + "' Minimum radius of '" + minBorderRad + "' is not allowed! Set to default value!");
|
"WARNING! Custom world '" + world + "' Minimum radius of '" + minBorderRad + "' is not allowed! Set to default value!");
|
||||||
minBorderRad = BetterRTP.getInstance().getRTP().defaultWorld.getMinRad();
|
minBorderRad = BetterRTP.getInstance().getRTP().defaultWorld.getMinRadius();
|
||||||
}
|
}
|
||||||
/*if (BetterRTP.getInstance().getFiles().getType(FileBasics.FILETYPE.ECO).getBoolean("Economy.Enabled"))
|
/*if (BetterRTP.getInstance().getFiles().getType(FileBasics.FILETYPE.ECO).getBoolean("Economy.Enabled"))
|
||||||
if (BetterRTP.getInstance().getFiles().getType(FileBasics.FILETYPE.ECO).getBoolean("CustomWorlds.Enabled")) {
|
if (BetterRTP.getInstance().getFiles().getType(FileBasics.FILETYPE.ECO).getBoolean("CustomWorlds.Enabled")) {
|
||||||
@ -142,12 +151,12 @@ public class WorldCustom implements RTPWorld, RTPWorld_Defaulted {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxRad() {
|
public int getMaxRadius() {
|
||||||
return maxBorderRad;
|
return maxBorderRad;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMinRad() {
|
public int getMinRadius() {
|
||||||
return minBorderRad;
|
return minBorderRad;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,6 +170,7 @@ public class WorldCustom implements RTPWorld, RTPWorld_Defaulted {
|
|||||||
return biomes;
|
return biomes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public World getWorld() {
|
public World getWorld() {
|
||||||
return Bukkit.getWorld(world);
|
return Bukkit.getWorld(world);
|
||||||
@ -171,6 +181,16 @@ public class WorldCustom implements RTPWorld, RTPWorld_Defaulted {
|
|||||||
return shape;
|
return shape;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMinY() {
|
||||||
|
return miny;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMaxY() {
|
||||||
|
return maxy;
|
||||||
|
}
|
||||||
|
|
||||||
//Setters
|
//Setters
|
||||||
@Override
|
@Override
|
||||||
public void setUseWorldBorder(boolean value) {
|
public void setUseWorldBorder(boolean value) {
|
||||||
@ -188,12 +208,12 @@ public class WorldCustom implements RTPWorld, RTPWorld_Defaulted {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setMaxRad(int value) {
|
public void setMaxRadius(int value) {
|
||||||
this.maxBorderRad = value;
|
this.maxBorderRad = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setMinRad(int value) {
|
public void setMinRadius(int value) {
|
||||||
this.minBorderRad = value;
|
this.minBorderRad = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -216,4 +236,14 @@ public class WorldCustom implements RTPWorld, RTPWorld_Defaulted {
|
|||||||
public void setShape(RTP_SHAPE value) {
|
public void setShape(RTP_SHAPE value) {
|
||||||
this.shape = value;
|
this.shape = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setMinY(int value) {
|
||||||
|
this.miny = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setMaxY(int value) {
|
||||||
|
this.maxy = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import me.SuperRonanCraft.BetterRTP.references.file.FileBasics;
|
|||||||
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -13,7 +14,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
public class WorldDefault implements RTPWorld {
|
public class WorldDefault implements RTPWorld {
|
||||||
private boolean useWorldborder;
|
private boolean useWorldborder;
|
||||||
private int CenterX, CenterZ, maxBorderRad, minBorderRad, price;
|
private int CenterX, CenterZ, maxBorderRad, minBorderRad, price, miny, maxy;
|
||||||
private List<String> Biomes;
|
private List<String> Biomes;
|
||||||
private final HashMap<String, Integer> prices = new HashMap<>();
|
private final HashMap<String, Integer> prices = new HashMap<>();
|
||||||
private RTP_SHAPE shape;
|
private RTP_SHAPE shape;
|
||||||
@ -34,14 +35,12 @@ public class WorldDefault implements RTPWorld {
|
|||||||
shape = RTP_SHAPE.SQUARE;
|
shape = RTP_SHAPE.SQUARE;
|
||||||
}
|
}
|
||||||
if (maxBorderRad <= 0) {
|
if (maxBorderRad <= 0) {
|
||||||
BetterRTP.getInstance().getText().sms(Bukkit.getConsoleSender(),
|
BetterRTP.getInstance().getLogger().warning("WARNING! Default Maximum radius of '" + maxBorderRad + "' is not allowed! Value set to '1000'");
|
||||||
"WARNING! Default Maximum radius of '" + maxBorderRad + "' is not allowed! Set to '1000'");
|
|
||||||
maxBorderRad = 1000;
|
maxBorderRad = 1000;
|
||||||
}
|
}
|
||||||
minBorderRad = config.getInt(pre + ".MinRadius");
|
minBorderRad = config.getInt(pre + ".MinRadius");
|
||||||
if (minBorderRad < 0 || minBorderRad >= maxBorderRad) {
|
if (minBorderRad < 0 || minBorderRad >= maxBorderRad) {
|
||||||
BetterRTP.getInstance().getText().sms(Bukkit.getConsoleSender(),
|
BetterRTP.getInstance().getLogger().warning("The Default MinRadius of '" + minBorderRad + "' is not allowed! Value set to '0'");
|
||||||
"WARNING! Default Minimum radius of '" + minBorderRad + "' is not allowed! Set to '0'");
|
|
||||||
minBorderRad = 0;
|
minBorderRad = 0;
|
||||||
}
|
}
|
||||||
prices.clear();
|
prices.clear();
|
||||||
@ -61,6 +60,16 @@ public class WorldDefault implements RTPWorld {
|
|||||||
price = 0;
|
price = 0;
|
||||||
//Other
|
//Other
|
||||||
this.Biomes = config.getStringList(pre + ".Biomes");
|
this.Biomes = config.getStringList(pre + ".Biomes");
|
||||||
|
this.miny = config.getInt(pre + ".MinY");
|
||||||
|
if (miny > 0) {
|
||||||
|
miny = 0;
|
||||||
|
BetterRTP.getInstance().getLogger().warning("Warning! Default MinY value is solely for 1.17+ support, and can only be negative!");
|
||||||
|
}
|
||||||
|
this.maxy = config.getInt(pre + ".MaxY");
|
||||||
|
if (maxy < 64) {
|
||||||
|
maxy = 320;
|
||||||
|
BetterRTP.getInstance().getLogger().warning("Warning! Default MaxY value is below water level (64)! Reset to default 320!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -79,12 +88,12 @@ public class WorldDefault implements RTPWorld {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxRad() {
|
public int getMaxRadius() {
|
||||||
return maxBorderRad;
|
return maxBorderRad;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMinRad() {
|
public int getMinRadius() {
|
||||||
return minBorderRad;
|
return minBorderRad;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,6 +111,7 @@ public class WorldDefault implements RTPWorld {
|
|||||||
return Biomes;
|
return Biomes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public World getWorld() {
|
public World getWorld() {
|
||||||
return null;
|
return null;
|
||||||
@ -111,4 +121,14 @@ public class WorldDefault implements RTPWorld {
|
|||||||
public RTP_SHAPE getShape() {
|
public RTP_SHAPE getShape() {
|
||||||
return shape;
|
return shape;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMinY() {
|
||||||
|
return miny;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMaxY() {
|
||||||
|
return maxy;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import me.SuperRonanCraft.BetterRTP.player.rtp.RTP_SHAPE;
|
|||||||
import me.SuperRonanCraft.BetterRTP.references.file.FileBasics;
|
import me.SuperRonanCraft.BetterRTP.references.file.FileBasics;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -12,7 +13,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
public class WorldLocations implements RTPWorld, RTPWorld_Defaulted {
|
public class WorldLocations implements RTPWorld, RTPWorld_Defaulted {
|
||||||
private boolean useWorldborder;
|
private boolean useWorldborder;
|
||||||
private int centerX, centerZ, maxBorderRad, minBorderRad, price;
|
private int centerX, centerZ, maxRad, minRad, price, miny, maxy;
|
||||||
private List<String> biomes;
|
private List<String> biomes;
|
||||||
private String world;
|
private String world;
|
||||||
private RTP_SHAPE shape;
|
private RTP_SHAPE shape;
|
||||||
@ -55,22 +56,22 @@ public class WorldLocations implements RTPWorld, RTPWorld_Defaulted {
|
|||||||
}
|
}
|
||||||
if (test.get("MaxRadius") != null) {
|
if (test.get("MaxRadius") != null) {
|
||||||
if (test.get("MaxRadius").getClass() == Integer.class)
|
if (test.get("MaxRadius").getClass() == Integer.class)
|
||||||
maxBorderRad = Integer.parseInt((test.get("MaxRadius")).toString());
|
maxRad = Integer.parseInt((test.get("MaxRadius")).toString());
|
||||||
if (maxBorderRad <= 0) {
|
if (maxRad <= 0) {
|
||||||
BetterRTP.getInstance().getText().sms(Bukkit.getConsoleSender(),
|
BetterRTP.getInstance().getText().sms(Bukkit.getConsoleSender(),
|
||||||
"WARNING! Location '" + location_name + "' Maximum radius of '" + maxBorderRad + "' is not allowed! Set to default value!");
|
"WARNING! Location '" + location_name + "' Maximum radius of '" + maxRad + "' is not allowed! Set to default value!");
|
||||||
maxBorderRad = BetterRTP.getInstance().getRTP().defaultWorld.getMaxRad();
|
maxRad = BetterRTP.getInstance().getRTP().defaultWorld.getMaxRadius();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (test.get("MinRadius") != null) {
|
if (test.get("MinRadius") != null) {
|
||||||
if (test.get("MinRadius").getClass() == Integer.class)
|
if (test.get("MinRadius").getClass() == Integer.class)
|
||||||
minBorderRad = Integer.parseInt((test.get("MinRadius")).toString());
|
minRad = Integer.parseInt((test.get("MinRadius")).toString());
|
||||||
if (minBorderRad < 0 || minBorderRad >= maxBorderRad) {
|
if (minRad < 0 || minRad >= maxRad) {
|
||||||
BetterRTP.getInstance().getText().sms(Bukkit.getConsoleSender(),
|
BetterRTP.getInstance().getText().sms(Bukkit.getConsoleSender(),
|
||||||
"WARNING! Location '" + location_name + "' Minimum radius of '" + minBorderRad + "' is not allowed! Set to default value!");
|
"WARNING! Location '" + location_name + "' Minimum radius of '" + minRad + "' is not allowed! Set to default value!");
|
||||||
minBorderRad = BetterRTP.getInstance().getRTP().defaultWorld.getMinRad();
|
minRad = BetterRTP.getInstance().getRTP().defaultWorld.getMinRadius();
|
||||||
if (minBorderRad >= maxBorderRad)
|
if (minRad >= maxRad)
|
||||||
maxBorderRad = BetterRTP.getInstance().getRTP().defaultWorld.getMaxRad();
|
maxRad = BetterRTP.getInstance().getRTP().defaultWorld.getMaxRadius();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (test.get("Biomes") != null) {
|
if (test.get("Biomes") != null) {
|
||||||
@ -103,6 +104,12 @@ public class WorldLocations implements RTPWorld, RTPWorld_Defaulted {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (test.get("MinY") != null)
|
||||||
|
if (test.get("MinY").getClass() == Integer.class)
|
||||||
|
this.miny = Integer.parseInt(test.get("MinY").toString());
|
||||||
|
if (test.get("MaxY") != null)
|
||||||
|
if (test.get("MaxY").getClass() == Integer.class)
|
||||||
|
this.maxy = Integer.parseInt(test.get("MaxY").toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -111,6 +118,7 @@ public class WorldLocations implements RTPWorld, RTPWorld_Defaulted {
|
|||||||
return world != null;
|
return world != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public World getWorld() {
|
public World getWorld() {
|
||||||
return Bukkit.getWorld(world);
|
return Bukkit.getWorld(world);
|
||||||
@ -132,13 +140,13 @@ public class WorldLocations implements RTPWorld, RTPWorld_Defaulted {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxRad() {
|
public int getMaxRadius() {
|
||||||
return maxBorderRad;
|
return maxRad;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMinRad() {
|
public int getMinRadius() {
|
||||||
return minBorderRad;
|
return minRad;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -156,6 +164,16 @@ public class WorldLocations implements RTPWorld, RTPWorld_Defaulted {
|
|||||||
return shape;
|
return shape;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMinY() {
|
||||||
|
return miny;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMaxY() {
|
||||||
|
return maxy;
|
||||||
|
}
|
||||||
|
|
||||||
//Setters
|
//Setters
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -174,13 +192,13 @@ public class WorldLocations implements RTPWorld, RTPWorld_Defaulted {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setMaxRad(int value) {
|
public void setMaxRadius(int value) {
|
||||||
this.maxBorderRad = value;
|
this.maxRad = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setMinRad(int value) {
|
public void setMinRadius(int value) {
|
||||||
this.minBorderRad = value;
|
this.minRad = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -202,4 +220,14 @@ public class WorldLocations implements RTPWorld, RTPWorld_Defaulted {
|
|||||||
public void setShape(RTP_SHAPE value) {
|
public void setShape(RTP_SHAPE value) {
|
||||||
this.shape = value;
|
this.shape = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setMinY(int value) {
|
||||||
|
this.miny = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setMaxY(int value) {
|
||||||
|
this.maxy = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
package me.SuperRonanCraft.BetterRTP.references.rtpinfo.worlds;
|
package me.SuperRonanCraft.BetterRTP.references.rtpinfo.worlds;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
import me.SuperRonanCraft.BetterRTP.player.commands.RTP_SETUP_TYPE;
|
import me.SuperRonanCraft.BetterRTP.player.commands.RTP_SETUP_TYPE;
|
||||||
import me.SuperRonanCraft.BetterRTP.player.rtp.RTPPermissionGroup;
|
import me.SuperRonanCraft.BetterRTP.player.rtp.RTPPermissionGroup;
|
||||||
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
||||||
import me.SuperRonanCraft.BetterRTP.player.rtp.RTP_SHAPE;
|
import me.SuperRonanCraft.BetterRTP.player.rtp.RTP_SHAPE;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.WorldBorder;
|
import org.bukkit.WorldBorder;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -16,9 +17,9 @@ import java.util.Random;
|
|||||||
|
|
||||||
public class WorldPlayer implements RTPWorld {
|
public class WorldPlayer implements RTPWorld {
|
||||||
private boolean useWorldborder;
|
private boolean useWorldborder;
|
||||||
private int CenterX, CenterZ, maxBorderRad, minBorderRad, price, min_y = 0;
|
private int CenterX, CenterZ, maxRad, minRad, price, min_y, max_y;
|
||||||
private List<String> Biomes;
|
private List<String> Biomes;
|
||||||
private final Player p;
|
@Getter private final Player player;
|
||||||
private final World world;
|
private final World world;
|
||||||
private WORLD_TYPE world_type;
|
private WORLD_TYPE world_type;
|
||||||
private RTPPermissionGroup.RTPPermConfiguration config = null;
|
private RTPPermissionGroup.RTPPermConfiguration config = null;
|
||||||
@ -26,17 +27,14 @@ public class WorldPlayer implements RTPWorld {
|
|||||||
public RTP_SETUP_TYPE setup_type = RTP_SETUP_TYPE.DEFAULT;
|
public RTP_SETUP_TYPE setup_type = RTP_SETUP_TYPE.DEFAULT;
|
||||||
public String setup_name;
|
public String setup_name;
|
||||||
//Economy
|
//Economy
|
||||||
public boolean eco_money_taken = false, setup = false;
|
public boolean eco_money_taken = false;
|
||||||
|
@Getter private boolean setup = false;
|
||||||
|
|
||||||
public WorldPlayer(Player p, World world) {
|
public WorldPlayer(Player p, World world) {
|
||||||
this.p = p;
|
this.player = p;
|
||||||
this.world = world;
|
this.world = world;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSetup() {
|
|
||||||
return setup;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setup(String setup_name, RTPWorld world, List<String> biomes, boolean personal) {
|
public void setup(String setup_name, RTPWorld world, List<String> biomes, boolean personal) {
|
||||||
if (world instanceof WorldLocations) {
|
if (world instanceof WorldLocations) {
|
||||||
setup_type = RTP_SETUP_TYPE.LOCATION;
|
setup_type = RTP_SETUP_TYPE.LOCATION;
|
||||||
@ -46,8 +44,8 @@ public class WorldPlayer implements RTPWorld {
|
|||||||
setUseWorldborder(world.getUseWorldborder());
|
setUseWorldborder(world.getUseWorldborder());
|
||||||
setCenterX(world.getCenterX());
|
setCenterX(world.getCenterX());
|
||||||
setCenterZ(world.getCenterZ());
|
setCenterZ(world.getCenterZ());
|
||||||
setMaxRad(world.getMaxRad());
|
setMaxRad(world.getMaxRadius());
|
||||||
setMinRad(world.getMinRad());
|
setMinRad(world.getMinRadius());
|
||||||
setShape(world.getShape());
|
setShape(world.getShape());
|
||||||
if (world instanceof WorldDefault)
|
if (world instanceof WorldDefault)
|
||||||
setPrice(((WorldDefault) world).getPrice(getWorld().getName()));
|
setPrice(((WorldDefault) world).getPrice(getWorld().getName()));
|
||||||
@ -62,27 +60,29 @@ public class WorldPlayer implements RTPWorld {
|
|||||||
if (personal)
|
if (personal)
|
||||||
setupGroup(BetterRTP.getInstance().getRTP().permConfig);
|
setupGroup(BetterRTP.getInstance().getRTP().permConfig);
|
||||||
//Make sure our borders will not cause an invalid integer
|
//Make sure our borders will not cause an invalid integer
|
||||||
if (getMaxRad() <= getMinRad()) {
|
if (getMaxRadius() <= getMinRadius()) {
|
||||||
setMinRad(BetterRTP.getInstance().getRTP().defaultWorld.getMinRad());
|
setMinRad(BetterRTP.getInstance().getRTP().defaultWorld.getMinRadius());
|
||||||
if (getMaxRad() <= getMinRad())
|
if (getMaxRadius() <= getMinRadius())
|
||||||
setMinRad(0);
|
setMinRad(0);
|
||||||
}
|
}
|
||||||
//World border protection
|
//World border protection
|
||||||
if (getUseWorldborder()) {
|
if (getUseWorldborder()) {
|
||||||
WorldBorder border = getWorld().getWorldBorder();
|
WorldBorder border = getWorld().getWorldBorder();
|
||||||
int _borderRad = (int) border.getSize() / 2;
|
int _borderRad = (int) border.getSize() / 2;
|
||||||
if (getMaxRad() > _borderRad)
|
if (getMaxRadius() > _borderRad)
|
||||||
setMaxRad(_borderRad);
|
setMaxRad(_borderRad);
|
||||||
setCenterX(border.getCenter().getBlockX());
|
setCenterX(border.getCenter().getBlockX());
|
||||||
setCenterZ(border.getCenter().getBlockZ());
|
setCenterZ(border.getCenter().getBlockZ());
|
||||||
}
|
}
|
||||||
//MinY
|
//MinY
|
||||||
|
setMinY(world.getMinY());
|
||||||
|
setMaxY(world.getMaxY());
|
||||||
//min_y = world.getWorld().getBlockAt(0, -1, 0).getType() != Material.AIR ?
|
//min_y = world.getWorld().getBlockAt(0, -1, 0).getType() != Material.AIR ?
|
||||||
setup = true;
|
setup = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupGroup(RTPPermissionGroup permConfig) {
|
private void setupGroup(RTPPermissionGroup permConfig) {
|
||||||
RTPPermissionGroup.RTPPermConfiguration config = permConfig.getGroup(p);
|
RTPPermissionGroup.RTPPermConfiguration config = permConfig.getGroup(player);
|
||||||
if (config != null) {
|
if (config != null) {
|
||||||
for (RTPPermissionGroup.RTPPermConfigurationWorld world : config.worlds) {
|
for (RTPPermissionGroup.RTPPermConfigurationWorld world : config.worlds) {
|
||||||
if (getWorld().getName().equals(world.name)) {
|
if (getWorld().getName().equals(world.name)) {
|
||||||
@ -105,24 +105,20 @@ public class WorldPlayer implements RTPWorld {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Player getPlayer() {
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean checkIsValid(Location loc) { //Will check if a previously given location is valid
|
public boolean checkIsValid(Location loc) { //Will check if a previously given location is valid
|
||||||
if (loc.getWorld() != getWorld())
|
if (loc.getWorld() != getWorld())
|
||||||
return false;
|
return false;
|
||||||
int _xLMax = getCenterX() - getMaxRad(); //I|-||
|
int _xLMax = getCenterX() - getMaxRadius(); //I|-||
|
||||||
int _xLMin = getCenterX() - getMinRad(); //|I-||
|
int _xLMin = getCenterX() - getMinRadius(); //|I-||
|
||||||
int _xRMax = getCenterX() + getMaxRad(); //||-|I
|
int _xRMax = getCenterX() + getMaxRadius(); //||-|I
|
||||||
int _xRMin = getCenterX() + getMinRad(); //||-I|
|
int _xRMin = getCenterX() + getMinRadius(); //||-I|
|
||||||
int _xLoc = loc.getBlockX();
|
int _xLoc = loc.getBlockX();
|
||||||
if (_xLoc < _xLMax || (_xLoc > _xLMin && _xLoc < _xRMin) || _xLoc > _xRMax)
|
if (_xLoc < _xLMax || (_xLoc > _xLMin && _xLoc < _xRMin) || _xLoc > _xRMax)
|
||||||
return false;
|
return false;
|
||||||
int _zLMax = getCenterZ() - getMaxRad(); //I|-||
|
int _zLMax = getCenterZ() - getMaxRadius(); //I|-||
|
||||||
int _zLMin = getCenterZ() - getMinRad(); //|I-||
|
int _zLMin = getCenterZ() - getMinRadius(); //|I-||
|
||||||
int _zRMax = getCenterZ() + getMaxRad(); //||-|I
|
int _zRMax = getCenterZ() + getMaxRadius(); //||-|I
|
||||||
int _zRMin = getCenterZ() + getMinRad(); //||-I|
|
int _zRMin = getCenterZ() + getMinRadius(); //||-I|
|
||||||
int _zLoc = loc.getBlockX();
|
int _zLoc = loc.getBlockX();
|
||||||
return _zLoc >= _zLMax && (_zLoc <= _zLMin || _zLoc >= _zRMin) && _zLoc <= _zRMax;
|
return _zLoc >= _zLMax && (_zLoc <= _zLMin || _zLoc >= _zRMin) && _zLoc <= _zRMax;
|
||||||
}
|
}
|
||||||
@ -131,9 +127,9 @@ public class WorldPlayer implements RTPWorld {
|
|||||||
Location loc;
|
Location loc;
|
||||||
switch (shape) {
|
switch (shape) {
|
||||||
case CIRCLE:
|
case CIRCLE:
|
||||||
loc = generateRound(getMaxRad(), getMinRad()); break;
|
loc = generateRound(getMaxRadius(), getMinRadius()); break;
|
||||||
default:
|
default:
|
||||||
loc = generateSquare(getMaxRad(), getMinRad()); break;
|
loc = generateSquare(getMaxRadius(), getMinRadius()); break;
|
||||||
}
|
}
|
||||||
return loc;
|
return loc;
|
||||||
}
|
}
|
||||||
@ -182,6 +178,7 @@ public class WorldPlayer implements RTPWorld {
|
|||||||
return new Location(getWorld(), x, 0, z);
|
return new Location(getWorld(), x, 0, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public World getWorld() {
|
public World getWorld() {
|
||||||
return world;
|
return world;
|
||||||
@ -203,13 +200,13 @@ public class WorldPlayer implements RTPWorld {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxRad() {
|
public int getMaxRadius() {
|
||||||
return maxBorderRad;
|
return maxRad;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMinRad() {
|
public int getMinRadius() {
|
||||||
return minBorderRad;
|
return minRad;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -241,11 +238,11 @@ public class WorldPlayer implements RTPWorld {
|
|||||||
|
|
||||||
//Modifiable
|
//Modifiable
|
||||||
private void setMaxRad(int max) {
|
private void setMaxRad(int max) {
|
||||||
maxBorderRad = max;
|
maxRad = max;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setMinRad(int min) {
|
private void setMinRad(int min) {
|
||||||
minBorderRad = min;
|
minRad = min;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setPrice(int price) {
|
private void setPrice(int price) {
|
||||||
@ -266,6 +263,14 @@ public class WorldPlayer implements RTPWorld {
|
|||||||
this.shape = shape;
|
this.shape = shape;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setMinY(int value) {
|
||||||
|
this.min_y = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxY(int value) {
|
||||||
|
this.max_y = value;
|
||||||
|
}
|
||||||
|
|
||||||
public RTPPermissionGroup.RTPPermConfiguration getConfig() {
|
public RTPPermissionGroup.RTPPermConfiguration getConfig() {
|
||||||
return this.config;
|
return this.config;
|
||||||
}
|
}
|
||||||
@ -277,4 +282,9 @@ public class WorldPlayer implements RTPWorld {
|
|||||||
public int getMinY() {
|
public int getMinY() {
|
||||||
return min_y;
|
return min_y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMaxY() {
|
||||||
|
return max_y;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ public class Settings {
|
|||||||
@Getter private boolean protocolLibSounds;
|
@Getter private boolean protocolLibSounds;
|
||||||
@Getter private boolean useLocationIfAvailable;
|
@Getter private boolean useLocationIfAvailable;
|
||||||
@Getter private boolean locationNeedPermission;
|
@Getter private boolean locationNeedPermission;
|
||||||
|
@Getter private boolean locationOnlyAllowInWorld;
|
||||||
|
|
||||||
public void load() { //Load Settings
|
public void load() { //Load Settings
|
||||||
FileBasics.FILETYPE config = FileBasics.FILETYPE.CONFIG;
|
FileBasics.FILETYPE config = FileBasics.FILETYPE.CONFIG;
|
||||||
@ -33,6 +34,7 @@ public class Settings {
|
|||||||
protocolLibSounds = FileBasics.FILETYPE.EFFECTS.getBoolean("Sounds.ProtocolLibSound");
|
protocolLibSounds = FileBasics.FILETYPE.EFFECTS.getBoolean("Sounds.ProtocolLibSound");
|
||||||
useLocationIfAvailable = FileBasics.FILETYPE.LOCATIONS.getBoolean("UseLocationIfAvailable");
|
useLocationIfAvailable = FileBasics.FILETYPE.LOCATIONS.getBoolean("UseLocationIfAvailable");
|
||||||
locationNeedPermission = FileBasics.FILETYPE.LOCATIONS.getBoolean("RequirePermission");
|
locationNeedPermission = FileBasics.FILETYPE.LOCATIONS.getBoolean("RequirePermission");
|
||||||
|
locationOnlyAllowInWorld = FileBasics.FILETYPE.LOCATIONS.getBoolean("OnlyAllowInWorld");
|
||||||
depends.load();
|
depends.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,6 +60,8 @@ Default:
|
|||||||
CenterX: 0
|
CenterX: 0
|
||||||
CenterZ: 0
|
CenterZ: 0
|
||||||
Shape: 'square'
|
Shape: 'square'
|
||||||
|
MaxY: 320
|
||||||
|
MinY: 0
|
||||||
|
|
||||||
## Blocks BetterRTP will NOT teleport onto. More Blocks at: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html #
|
## Blocks BetterRTP will NOT teleport onto. More Blocks at: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html #
|
||||||
BlacklistedBlocks:
|
BlacklistedBlocks:
|
||||||
@ -95,6 +97,8 @@ CustomWorlds:
|
|||||||
CenterZ: 0
|
CenterZ: 0
|
||||||
Price: 50
|
Price: 50
|
||||||
Shape: 'square'
|
Shape: 'square'
|
||||||
|
MaxY: 320
|
||||||
|
MinY: 0
|
||||||
- other_custom_world:
|
- other_custom_world:
|
||||||
MaxRadius: 10000
|
MaxRadius: 10000
|
||||||
MinRadius: 150
|
MinRadius: 150
|
||||||
@ -133,6 +137,8 @@ PermissionGroup: #Player requires "betterrtp.group.<world_name>" to trigger thes
|
|||||||
CenterX: 10
|
CenterX: 10
|
||||||
CenterZ: 10
|
CenterZ: 10
|
||||||
Price: 10
|
Price: 10
|
||||||
|
MaxY: 320
|
||||||
|
MinY: 0
|
||||||
- vip2: # permission: betterrtp.group.vip2
|
- vip2: # permission: betterrtp.group.vip2
|
||||||
- Build_World:
|
- Build_World:
|
||||||
MaxRadius: 25000
|
MaxRadius: 25000
|
||||||
|
@ -6,10 +6,13 @@
|
|||||||
# CenterY: 150
|
# CenterY: 150
|
||||||
# MaxRadius: 100
|
# MaxRadius: 100
|
||||||
# MinRadius: 5
|
# MinRadius: 5
|
||||||
|
# MinY: 0
|
||||||
|
# MaxY: 320
|
||||||
|
|
||||||
Enabled: false #enable the locations feature
|
Enabled: false #enable the locations feature
|
||||||
RequirePermission: false #Require players to have `betterrtp.location.<world_name>`
|
RequirePermission: false #Require players to have `betterrtp.location.<world_name>`
|
||||||
UseLocationIfAvailable: false #Will choose a location upon `/rtp` if location(s) is available in the world
|
UseLocationIfAvailable: false #Will choose a location upon `/rtp` if location(s) is available in the world
|
||||||
|
#OnlyAllowInWorld: true #Only allow players to use locations that correspond to the world they are standing in
|
||||||
|
|
||||||
Locations:
|
Locations:
|
||||||
- main_loc:
|
- main_loc:
|
||||||
@ -19,3 +22,5 @@ Locations:
|
|||||||
MaxRadius: 100 #optional
|
MaxRadius: 100 #optional
|
||||||
MinRadius: 5 #optional
|
MinRadius: 5 #optional
|
||||||
Shape: square #optional
|
Shape: square #optional
|
||||||
|
MinY: 0 #optional
|
||||||
|
MaxY: 320 #optional
|
Loading…
x
Reference in New Issue
Block a user