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