mirror of
https://github.com/RonanPlugins/BetterRTP.git
synced 2026-02-16 02:21:06 +00:00
particle fix + double setup optimization
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -313,7 +313,7 @@
|
||||
<groupId>xyz.xenondevs</groupId>
|
||||
<artifactId>particle</artifactId>
|
||||
<version>1.8.3</version>
|
||||
<scope>provided</scope>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- Lombok Support (@Getter & @Setter)-->
|
||||
<dependency>
|
||||
|
||||
@@ -44,9 +44,9 @@ public class CmdLocation implements RTPCommand, RTPCommandHelpable {
|
||||
} else if (args.length == 3 && PermissionNode.RTP_OTHER.check(sendi)) {
|
||||
Player p = Bukkit.getPlayer(args[2]);
|
||||
if (p != null && p.isOnline()) {
|
||||
for (String location_name : getLocations(sendi, null).keySet()) {
|
||||
if (location_name.equalsIgnoreCase(args[1].toLowerCase())) {
|
||||
HelperRTP.tp(p, sendi, null, null, RTP_TYPE.COMMAND, false, false, (WorldLocation) getLocations().get(location_name));
|
||||
for (Map.Entry<String, RTPWorld> location : getLocations(sendi, null).entrySet()) {
|
||||
if (location.getKey().equalsIgnoreCase(args[1].toLowerCase())) {
|
||||
HelperRTP.tp(p, sendi, null, null, RTP_TYPE.COMMAND, false, false, (WorldLocation) location.getValue());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -82,16 +82,12 @@ public class CmdLocation implements RTPCommand, RTPCommandHelpable {
|
||||
MessagesUsage.LOCATION.send(sendi, label);
|
||||
}
|
||||
|
||||
private static HashMap<String, RTPWorld> getLocations() {
|
||||
return BetterRTP.getInstance().getRTP().getRTPworldLocations();
|
||||
}
|
||||
|
||||
//Get locations a player has access to
|
||||
public static HashMap<String, RTPWorld> getLocations(CommandSender sendi, @Nullable World world) {
|
||||
HashMap<String, RTPWorld> locations = new HashMap<>();
|
||||
boolean needPermission = BetterRTP.getInstance().getSettings().isLocationNeedPermission();
|
||||
boolean needSameWorld = BetterRTP.getInstance().getSettings().isUseLocationsInSameWorld();
|
||||
for (Map.Entry<String, RTPWorld> location : getLocations().entrySet()) {
|
||||
for (Map.Entry<String, RTPWorld> location : BetterRTP.getInstance().getRTP().getRTPworldLocations().entrySet()) {
|
||||
boolean add = true;
|
||||
if (needPermission) //Do we need permission to go to this location?
|
||||
add = PermissionNode.getLocation(sendi, location.getKey());
|
||||
|
||||
@@ -52,6 +52,7 @@ public class RTPPlayer {
|
||||
loc = event.getLocation();
|
||||
else {
|
||||
QueueData queueData = QueueHandler.getRandomAsync(worldPlayer);
|
||||
//BetterRTP.getInstance().getLogger().warning("Center x " + worldPlayer.getCenterX());
|
||||
if (queueData != null)
|
||||
loc = queueData.getLocation();
|
||||
else
|
||||
|
||||
@@ -66,7 +66,8 @@ public class HelperRTP {
|
||||
return;
|
||||
}
|
||||
//ignore cooldown or else
|
||||
getPl().getRTP().start(setup_info);
|
||||
BetterRTP.getInstance().getLogger().info("Center X: " + pWorld.getCenterX());
|
||||
getPl().getRTP().start(pWorld);
|
||||
}
|
||||
|
||||
private static BetterRTP getPl() {
|
||||
@@ -124,6 +125,7 @@ public class HelperRTP {
|
||||
}
|
||||
}
|
||||
pWorld.setup(setup_name, setup_info.getLocation(), setup_info.getLocation().getBiomes());
|
||||
BetterRTP.getInstance().getLogger().info("Location x: " + setup_info.getLocation().getCenterX());
|
||||
}
|
||||
|
||||
//Setup world (if no location pre-setup)
|
||||
|
||||
@@ -70,6 +70,8 @@ public class QueueHandler implements Listener { //Randomly queues up some safe l
|
||||
available.add(data);
|
||||
}
|
||||
}
|
||||
|
||||
//BetterRTP.getInstance().getLogger().info("Centerx " + rtpWorld.getCenterX());
|
||||
//BetterRTP.getInstance().getLogger().info("Available: " + available.size());
|
||||
return available;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,11 @@ public class WorldPlayer implements RTPWorld, RTPWorld_Defaulted {
|
||||
setup_type = RTP_SETUP_TYPE.PERMISSIONGROUP;
|
||||
this.setup_name = setup_name;
|
||||
setUseWorldBorder(world.getUseWorldborder());
|
||||
|
||||
//BetterRTP.getInstance().getLogger().info("WorldPlayer Center x: " + CenterX);
|
||||
setCenterX(world.getCenterX());
|
||||
//BetterRTP.getInstance().getLogger().info("set to " + world.getCenterX());
|
||||
//BetterRTP.getInstance().getLogger().info("is now " + CenterX);
|
||||
setCenterZ(world.getCenterZ());
|
||||
setMaxRadius(world.getMaxRadius());
|
||||
setMinRadius(world.getMinRadius());
|
||||
@@ -88,6 +92,8 @@ public class WorldPlayer implements RTPWorld, RTPWorld_Defaulted {
|
||||
//Cooldown
|
||||
setCooldown(world.getCooldown());
|
||||
setup = true;
|
||||
|
||||
//BetterRTP.getInstance().getLogger().info("WorldPlayer Center x: " + CenterX);
|
||||
}
|
||||
|
||||
public static boolean checkIsValid(Location loc, RTPWorld rtpWorld) { //Will check if a previously given location is valid
|
||||
|
||||
Reference in New Issue
Block a user