mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-19 19:25:48 +00:00
Fixes #2240
This commit is contained in:
parent
b36e3e41a8
commit
ec95797cbf
@ -78,6 +78,7 @@
|
||||
* Fixed #2138
|
||||
* Fixed #1951 (again)
|
||||
* Fixed Electric Press not working
|
||||
* Fixed #2240
|
||||
|
||||
## Release Candidate 15 (01 Aug 2020)
|
||||
|
||||
|
@ -62,17 +62,8 @@ public final class TeleportationManager {
|
||||
Location l = waypoint.getLocation();
|
||||
double time = DoubleHandler.fixDouble(0.5 * getTeleportationTime(complexity, source, l));
|
||||
|
||||
String[] lore = {
|
||||
"",
|
||||
"&8\u21E8 &7" + SlimefunPlugin.getLocalization().getResourceString(p, "tooltips.world") + ": &f" + l.getWorld().getName(),
|
||||
"&8\u21E8 &7X: &f" + l.getX(),
|
||||
"&8\u21E8 &7Y: &f" + l.getY(),
|
||||
"&8\u21E8 &7Z: &f" + l.getZ(),
|
||||
"&8\u21E8 &7" + SlimefunPlugin.getLocalization().getMessage(p, "machines.TELEPORTER.gui.time") + ": &f" + time + "s",
|
||||
"",
|
||||
"&8\u21E8 &c" + SlimefunPlugin.getLocalization().getMessage(p, "machines.TELEPORTER.gui.tooltip")
|
||||
};
|
||||
|
||||
String[] lore = { "", "&8\u21E8 &7" + SlimefunPlugin.getLocalization().getResourceString(p, "tooltips.world") + ": &f" + l.getWorld().getName(), "&8\u21E8 &7X: &f" + l.getX(), "&8\u21E8 &7Y: &f" + l.getY(), "&8\u21E8 &7Z: &f" + l.getZ(), "&8\u21E8 &7" + SlimefunPlugin.getLocalization().getMessage(p, "machines.TELEPORTER.gui.time") + ": &f" + time + "s", "", "&8\u21E8 &c" + SlimefunPlugin.getLocalization().getMessage(p, "machines.TELEPORTER.gui.tooltip") };
|
||||
|
||||
menu.addItem(slot, new CustomItem(waypoint.getIcon(), waypoint.getName().replace("player:death ", ""), lore));
|
||||
menu.addMenuClickHandler(slot, (pl, s, item, action) -> {
|
||||
pl.closeInventory();
|
||||
@ -112,7 +103,7 @@ public final class TeleportationManager {
|
||||
}
|
||||
|
||||
private boolean isValid(Player p, Location source) {
|
||||
return p != null && p.getLocation().distanceSquared(source) < 2.0;
|
||||
return p != null && p.isValid() && p.getWorld().getUID().equals(source.getWorld().getUID()) && p.getLocation().distanceSquared(source) < 2.0;
|
||||
}
|
||||
|
||||
private void cancel(UUID uuid, Player p) {
|
||||
|
Loading…
Reference in New Issue
Block a user