mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 22:16:08 +00:00
Cleanup Pl3xMap support, general optimisations and warning scrubbing
This commit is contained in:
1 parent
c89d263505
commit
a3a62db800
17 files changed
+79
-39
No files matched your search
@@ -115,17 +115,35 @@ public class HuskHomesAPI {
|
||||
* Returns the maximum number of homes a player can set
|
||||
* @param player the Player being checked
|
||||
* @return the maximum homes a player can set
|
||||
* @deprecated Use getMaxSetHomes instead (capitalized H)
|
||||
*/
|
||||
public int getMaxSethomes(Player player) {
|
||||
@Deprecated
|
||||
public int getMaxSethomes(Player player) { return getMaxSetHomes(player); }
|
||||
|
||||
/**
|
||||
* Returns the maximum number of homes a player can set
|
||||
* @param player the Player being checked
|
||||
* @return the maximum homes a player can set
|
||||
*/
|
||||
public int getMaxSetHomes(Player player) {
|
||||
return Home.getSetHomeLimit(player);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the maximum number of homes a player can set
|
||||
* @param player the Player being checked
|
||||
* @return the maximum homes a player can set
|
||||
* @deprecated Use getFreeSetHomes instead (capitalized H)
|
||||
*/
|
||||
@Deprecated
|
||||
public int getFreeSethomes(Player player) { return getFreeSetHomes(player); }
|
||||
|
||||
/**
|
||||
* Returns the number of homes a player can set for free
|
||||
* @param player the Player being checked
|
||||
* @return the number of free homes a player can set
|
||||
*/
|
||||
public int getFreeSethomes(Player player) {
|
||||
public int getFreeSetHomes(Player player) {
|
||||
return Home.getFreeHomes(player);
|
||||
}
|
||||
|
||||
@@ -202,7 +220,7 @@ public class HuskHomesAPI {
|
||||
* Teleport a player to a specific TeleportationPoint
|
||||
* @param player The player to be teleported
|
||||
* @param point The target teleportationPoint
|
||||
* @param timed Whether or not to do a warmup countdown
|
||||
* @param timed Whether to do a warmup countdown
|
||||
* @see TeleportationPoint
|
||||
*/
|
||||
public void teleportPlayer(Player player, TeleportationPoint point, boolean timed) {
|
||||
@@ -224,7 +242,7 @@ public class HuskHomesAPI {
|
||||
* Teleport a player to a specific TeleportationPoint
|
||||
* @param player The player to be teleported
|
||||
* @param targetPlayerName The target player's name
|
||||
* @param timed Whether or not to do a warmup countdown
|
||||
* @param timed Whether to do a warmup countdown
|
||||
* @see TeleportationPoint
|
||||
*/
|
||||
public void teleportPlayer(Player player, String targetPlayerName, boolean timed) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package me.william278.huskhomes2.commands;
|
||||
|
||||
import org.bukkit.command.*;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -9,7 +10,7 @@ import java.util.Objects;
|
||||
|
||||
public abstract class CommandBase implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
|
||||
if (sender instanceof Player) {
|
||||
onCommand((Player) sender, command, label, args);
|
||||
return true;
|
||||
@@ -34,7 +35,7 @@ public abstract class CommandBase implements CommandExecutor {
|
||||
|
||||
public static class EmptyTab implements TabCompleter {
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender commandSender, Command command, String s, String[] strings) {
|
||||
public List<String> onTabComplete(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, String[] strings) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
@@ -289,7 +290,7 @@ public class EditHomeCommand extends CommandBase implements TabCompleter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
|
||||
Player p = (Player) sender;
|
||||
if (!p.hasPermission("huskhomes.edithome")) {
|
||||
return Collections.emptyList();
|
||||
|
||||
@@ -18,6 +18,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
@@ -198,7 +199,7 @@ public class EditWarpCommand extends CommandBase implements TabCompleter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
|
||||
Player p = (Player) sender;
|
||||
if (!p.hasPermission("huskhomes.editwarp")) {
|
||||
return Collections.emptyList();
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
@@ -78,7 +79,7 @@ public class HomeCommand extends CommandBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
public List<String> onTabComplete(CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
|
||||
Player p = (Player) sender;
|
||||
if (!sender.hasPermission("huskhomes.home")) {
|
||||
return Collections.emptyList();
|
||||
|
||||
@@ -39,7 +39,7 @@ public class HomeListCommand extends CommandBase {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
try {
|
||||
List<Home> homes = DataManager.getPlayerHomes(player.getName(), connection);
|
||||
if (homes == null || homes.isEmpty()) {
|
||||
if (homes.isEmpty()) {
|
||||
MessageManager.sendMessage(player, "error_no_homes_set");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -60,7 +61,7 @@ public class HuskHomesCommand extends CommandBase implements TabCompleter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
|
||||
if (args.length == 0) {
|
||||
if (sender instanceof Player) {
|
||||
showHelpMenu((Player) sender, 1);
|
||||
|
||||
@@ -12,6 +12,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
@@ -47,7 +48,7 @@ public class PublicHomeCommand extends CommandBase implements TabCompleter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
|
||||
if (!(sender instanceof Player p)) {
|
||||
handleConsolePublicHomeTeleport(sender, args);
|
||||
return true;
|
||||
@@ -66,6 +67,7 @@ public class PublicHomeCommand extends CommandBase implements TabCompleter {
|
||||
String homeName = split[1];
|
||||
if (DataManager.homeExists(ownerName, homeName, connection)) {
|
||||
Home home = DataManager.getHome(ownerName, homeName, connection);
|
||||
assert home != null;
|
||||
if (home.isPublic()) {
|
||||
TeleportManager.queueTimedTeleport(p, home, connection);
|
||||
} else {
|
||||
@@ -101,6 +103,7 @@ public class PublicHomeCommand extends CommandBase implements TabCompleter {
|
||||
try {
|
||||
if (DataManager.homeExists(ownerName, homeName, connection)) {
|
||||
Home home = DataManager.getHome(ownerName, homeName, connection);
|
||||
assert home != null;
|
||||
if (!home.isPublic()) {
|
||||
sender.sendMessage("Warning: Bypassed home security (" + home.getName() + " was not set to public by " + home.getOwnerUsername() + ")");
|
||||
}
|
||||
@@ -131,7 +134,7 @@ public class PublicHomeCommand extends CommandBase implements TabCompleter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
public List<String> onTabComplete(CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
|
||||
if (!sender.hasPermission("huskhomes.publichome")) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public class SetSpawnCommand extends CommandBase {
|
||||
return;
|
||||
}
|
||||
SettingHandler.setSpawnLocation(p.getLocation());
|
||||
p.getLocation().getWorld().setSpawnLocation(p.getLocation());
|
||||
p.getWorld().setSpawnLocation(p.getLocation());
|
||||
MessageManager.sendMessage(p, "set_spawn_success");
|
||||
} else {
|
||||
MessageManager.sendMessage(p, "error_command_disabled");
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
@@ -120,7 +121,7 @@ public class TpCommand extends CommandBase {
|
||||
|
||||
public static class Tab implements TabCompleter {
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
|
||||
List<String> players = new ArrayList<>();
|
||||
if (args.length == 0 || args.length == 1) {
|
||||
players.addAll(HuskHomes.getPlayerList().getPlayers());
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
@@ -26,7 +27,7 @@ public class WarpCommand extends CommandBase {
|
||||
private static final HuskHomes plugin = HuskHomes.getInstance();
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
|
||||
if (!(sender instanceof Player p)) {
|
||||
handleConsoleWarp(sender, args);
|
||||
return true;
|
||||
@@ -119,7 +120,7 @@ public class WarpCommand extends CommandBase {
|
||||
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
public List<String> onTabComplete(CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
|
||||
if (!sender.hasPermission("huskhomes.warp")) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ import java.util.logging.Level;
|
||||
public class BlueMap extends Map {
|
||||
|
||||
private static final HuskHomes plugin = HuskHomes.getInstance();
|
||||
private static final HashMap<String,Boolean> queuedWarps = new HashMap<>();
|
||||
private static final HashMap<String,Boolean> queuedPublicHomes = new HashMap<>();
|
||||
private static final HashMap<String, Boolean> queuedWarps = new HashMap<>();
|
||||
private static final HashMap<String, Boolean> queuedPublicHomes = new HashMap<>();
|
||||
|
||||
private void executeQueuedOperations() {
|
||||
try {
|
||||
@@ -49,8 +49,7 @@ public class BlueMap extends Map {
|
||||
}
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
plugin.getLogger().log(Level.WARNING,
|
||||
"An SQL exception occurred retrieving warp and home data when updating the BlueMap.", e);
|
||||
plugin.getLogger().log(Level.WARNING, "An SQL exception occurred retrieving warp and home data when updating the BlueMap.", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +63,7 @@ public class BlueMap extends Map {
|
||||
try {
|
||||
MarkerAPI markerAPI = api.getMarkerAPI();
|
||||
markerAPI.getMarkerSet(WARPS_MARKER_SET_ID).ifPresent(markerSet -> api.getWorld(world.getUID()).ifPresent(blueMapWorld -> {
|
||||
String markerId = WARPS_MARKER_SET_ID + "." + warp.getName();
|
||||
String markerId = getWarpMarkerName(warp.getName());
|
||||
for (BlueMapMap map : blueMapWorld.getMaps()) {
|
||||
POIMarker marker = markerSet.createPOIMarker(markerId, map, warp.getX(), warp.getY(), warp.getZ());
|
||||
marker.setLabel(getWarpInfoMenu(warp));
|
||||
@@ -74,7 +73,8 @@ public class BlueMap extends Map {
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}));
|
||||
} catch (IOException ignored) { }
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}, () -> queuedWarps.put(warp.getName(), true)));
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public class BlueMap extends Map {
|
||||
try {
|
||||
MarkerAPI markerAPI = api.getMarkerAPI();
|
||||
markerAPI.getMarkerSet(WARPS_MARKER_SET_ID).ifPresent(markerSet -> {
|
||||
String markerId = WARPS_MARKER_SET_ID + "." + warpName;
|
||||
String markerId = getWarpMarkerName(warpName);
|
||||
markerSet.removeMarker(markerId);
|
||||
try {
|
||||
markerAPI.save();
|
||||
@@ -109,7 +109,7 @@ public class BlueMap extends Map {
|
||||
try {
|
||||
MarkerAPI markerAPI = api.getMarkerAPI();
|
||||
markerAPI.getMarkerSet(PUBLIC_HOMES_MARKER_SET_ID).ifPresent(markerSet -> api.getWorld(world.getUID()).ifPresent(blueMapWorld -> {
|
||||
String markerId = PUBLIC_HOMES_MARKER_SET_ID + "." + home.getOwnerUsername() + "." + home.getName();
|
||||
String markerId = getPublicHomeMarkerName(home.getOwnerUsername(), home.getName());
|
||||
for (BlueMapMap map : blueMapWorld.getMaps()) {
|
||||
POIMarker marker = markerSet.createPOIMarker(markerId, map, home.getX(), home.getY(), home.getZ());
|
||||
marker.setLabel(getPublicHomeInfoMenu(home));
|
||||
@@ -119,7 +119,8 @@ public class BlueMap extends Map {
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}));
|
||||
} catch (IOException ignored) { }
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}, () -> queuedPublicHomes.put(home.getOwnerUsername() + "." + home.getName(), true)));
|
||||
}
|
||||
|
||||
@@ -131,7 +132,7 @@ public class BlueMap extends Map {
|
||||
try {
|
||||
MarkerAPI markerAPI = api.getMarkerAPI();
|
||||
markerAPI.getMarkerSet(PUBLIC_HOMES_MARKER_SET_ID).ifPresent(markerSet -> {
|
||||
String markerId = PUBLIC_HOMES_MARKER_SET_ID + "." + ownerName + "." + homeName;
|
||||
String markerId = getPublicHomeMarkerName(ownerName, homeName);
|
||||
markerSet.removeMarker(markerId);
|
||||
try {
|
||||
markerAPI.save();
|
||||
|
||||
@@ -21,7 +21,7 @@ public class DynMap extends Map {
|
||||
|
||||
@Override
|
||||
public void removeWarpMarker(String warpName) {
|
||||
String markerId = WARPS_MARKER_SET_ID + "." + warpName;
|
||||
String markerId = getWarpMarkerName(warpName);
|
||||
DynmapAPI dynmapAPI = (DynmapAPI) dynMap;
|
||||
|
||||
MarkerSet markerSet = dynmapAPI.getMarkerAPI().getMarkerSet("huskhomes.warps");
|
||||
@@ -34,7 +34,7 @@ public class DynMap extends Map {
|
||||
|
||||
@Override
|
||||
public void removePublicHomeMarker(String homeName, String ownerName) {
|
||||
String markerId = PUBLIC_HOMES_MARKER_SET_ID + "." + ownerName + "." + homeName;
|
||||
String markerId = getPublicHomeMarkerName(ownerName, homeName);
|
||||
DynmapAPI dynmapAPI = (DynmapAPI) dynMap;
|
||||
|
||||
MarkerSet markerSet = dynmapAPI.getMarkerAPI().getMarkerSet("huskhomes.public_homes");
|
||||
@@ -48,7 +48,7 @@ public class DynMap extends Map {
|
||||
@Override
|
||||
public void addWarpMarker(Warp warp) {
|
||||
try {
|
||||
String markerId = WARPS_MARKER_SET_ID + "." + warp.getName();
|
||||
String markerId = getWarpMarkerName(warp.getName());
|
||||
DynmapAPI dynmapAPI = (DynmapAPI) dynMap;
|
||||
|
||||
MarkerSet markerSet = dynmapAPI.getMarkerAPI().getMarkerSet(WARPS_MARKER_SET_ID);
|
||||
@@ -64,7 +64,7 @@ public class DynMap extends Map {
|
||||
@Override
|
||||
public void addPublicHomeMarker(Home home) {
|
||||
try {
|
||||
String markerId = PUBLIC_HOMES_MARKER_SET_ID + "." + home.getOwnerUsername() + "." + home.getName();
|
||||
String markerId = getPublicHomeMarkerName(home.getOwnerUsername(), home.getName());
|
||||
DynmapAPI dynmapAPI = (DynmapAPI) dynMap;
|
||||
|
||||
MarkerSet markerSet = dynmapAPI.getMarkerAPI().getMarkerSet(PUBLIC_HOMES_MARKER_SET_ID);
|
||||
|
||||
@@ -7,19 +7,30 @@ import static org.apache.commons.lang.StringEscapeUtils.escapeHtml;
|
||||
|
||||
public abstract class Map {
|
||||
|
||||
public Map() { }
|
||||
public Map() {
|
||||
}
|
||||
|
||||
public static final String PUBLIC_HOMES_MARKER_SET_ID = "huskhomes.public_homes";
|
||||
public static final String WARPS_MARKER_SET_ID = "huskhomes.warps";
|
||||
|
||||
public abstract void addWarpMarker(Warp warp);
|
||||
|
||||
public abstract void removeWarpMarker(String warpName);
|
||||
|
||||
public abstract void addPublicHomeMarker(Home home);
|
||||
|
||||
public abstract void removePublicHomeMarker(String homeName, String ownerName);
|
||||
|
||||
public abstract void initialize();
|
||||
|
||||
public String getPublicHomeMarkerName(String ownerName, String homeName) {
|
||||
return PUBLIC_HOMES_MARKER_SET_ID + "." + ownerName + "." + homeName;
|
||||
}
|
||||
|
||||
public String getWarpMarkerName(String warpName) {
|
||||
return WARPS_MARKER_SET_ID + "." + warpName;
|
||||
}
|
||||
|
||||
public String getWarpInfoMenu(Warp warp) {
|
||||
String warpPopup = "<div class=\"infowindow\"><span style=\"font-weight:bold;\">/warp %WARP_NAME%</span><br/><span style=\"font-weight:bold;\">Description: </span>%DESCRIPTION%</div>";
|
||||
warpPopup = warpPopup.replace("%WARP_NAME%", escapeHtml(warp.getName()));
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Pl3xMap extends Map {
|
||||
.hoverTooltip(warp.getName())
|
||||
.clickTooltip(getWarpInfoMenu(warp))
|
||||
.build());
|
||||
warpProviders.get(world.getName()).addMarker(Key.of(WARPS_MARKER_SET_ID + "." + warp.getName()), marker);
|
||||
warpProviders.get(world.getName()).addMarker(Key.of(getWarpMarkerName(warp.getName())), marker);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ public class Pl3xMap extends Map {
|
||||
@Override
|
||||
public void removeWarpMarker(String warpName) {
|
||||
String warpMarkerWorld = null;
|
||||
final Key warpMarkerKey = Key.of(WARPS_MARKER_SET_ID + "." + warpName);
|
||||
final Key warpMarkerKey = Key.of(getWarpMarkerName(warpName));
|
||||
for (String worldName : warpProviders.keySet()) {
|
||||
SimpleLayerProvider warpProvider = warpProviders.get(worldName);
|
||||
if (warpProvider.hasMarker(warpMarkerKey)) {
|
||||
@@ -68,7 +68,7 @@ public class Pl3xMap extends Map {
|
||||
.clickTooltip(getPublicHomeInfoMenu(home))
|
||||
.build());
|
||||
publicHomeProviders.get(world.getName()).addMarker(
|
||||
Key.of(PUBLIC_HOMES_MARKER_SET_ID + "." + home.getOwnerUsername() + "." + home.getName()), marker);
|
||||
Key.of(getPublicHomeMarkerName(home.getOwnerUsername(), home.getName())), marker);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -76,7 +76,7 @@ public class Pl3xMap extends Map {
|
||||
@Override
|
||||
public void removePublicHomeMarker(String homeName, String ownerName) {
|
||||
String publicHomeMarkerWorld = null;
|
||||
final Key publicHomeMarkerKey = Key.of(PUBLIC_HOMES_MARKER_SET_ID + "." + ownerName + "." + homeName);
|
||||
final Key publicHomeMarkerKey = Key.of(getPublicHomeMarkerName(ownerName, homeName));
|
||||
for (String worldName : publicHomeProviders.keySet()) {
|
||||
SimpleLayerProvider warpProvider = publicHomeProviders.get(worldName);
|
||||
if (warpProvider.hasMarker(publicHomeMarkerKey)) {
|
||||
|
||||
@@ -200,7 +200,7 @@ public class TeleportManager {
|
||||
}
|
||||
|
||||
public static void setPlayerDestinationFromTargetPlayer(Player requester, String targetPlayerName, Connection connection) throws SQLException {
|
||||
Player targetPlayer = Bukkit.getPlayer(targetPlayerName);
|
||||
Player targetPlayer = Bukkit.getPlayerExact(targetPlayerName);
|
||||
if (targetPlayer != null) {
|
||||
if (requester.getUniqueId() != targetPlayer.getUniqueId()) {
|
||||
DataManager.setPlayerDestinationLocation(requester,
|
||||
|
||||
@@ -38,7 +38,7 @@ public class TeleportRequestHandler {
|
||||
}
|
||||
|
||||
public static void sendTeleportToRequest(Player requester, String targetPlayerName) {
|
||||
Player targetPlayer = Bukkit.getPlayer(targetPlayerName);
|
||||
Player targetPlayer = Bukkit.getPlayerExact(targetPlayerName);
|
||||
if (targetPlayer != null) {
|
||||
if (targetPlayer.getUniqueId() != requester.getUniqueId()) {
|
||||
if (!VanishChecker.isVanished(targetPlayer)) {
|
||||
@@ -65,7 +65,7 @@ public class TeleportRequestHandler {
|
||||
}
|
||||
|
||||
public static void sendTeleportHereRequest(Player requester, String targetPlayerName) {
|
||||
Player targetPlayer = Bukkit.getPlayer(targetPlayerName);
|
||||
Player targetPlayer = Bukkit.getPlayerExact(targetPlayerName);
|
||||
if (targetPlayer != null) {
|
||||
if (targetPlayer.getUniqueId() != requester.getUniqueId()) {
|
||||
MessageManager.sendMessage(requester, "tpahere_request_sent", targetPlayerName);
|
||||
|
||||
Reference in new issue
Block a user