diff --git a/pom.xml b/pom.xml index 451a9f3..b1d865f 100644 --- a/pom.xml +++ b/pom.xml @@ -7,10 +7,14 @@ me.ryanhamshire GriefPrevention 15.2.4 + + 1.6 + 1.6 + - spigot-repo - https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + paper-repo + https://repo.destroystokyo.com/repository/maven-public/ worldedit-worldguard-repo @@ -48,8 +52,8 @@ - org.bukkit - bukkit + com.destroystokyo.paper + paper-api 1.10.2-R0.1-SNAPSHOT provided diff --git a/src/me/ryanhamshire/GriefPrevention/CheckForPortalTrapTask.java b/src/me/ryanhamshire/GriefPrevention/CheckForPortalTrapTask.java index 71d85c4..8a5b586 100644 --- a/src/me/ryanhamshire/GriefPrevention/CheckForPortalTrapTask.java +++ b/src/me/ryanhamshire/GriefPrevention/CheckForPortalTrapTask.java @@ -52,6 +52,6 @@ class CheckForPortalTrapTask extends BukkitRunnable instance.portalReturnTaskMap.remove(player.getUniqueId()); return; } - instance.rescuePlayerTrappedInPortal(player); + player.setPortalCooldown(0); } } diff --git a/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java b/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java index 4f724a2..c75e1bd 100644 --- a/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java +++ b/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java @@ -3609,6 +3609,7 @@ public class GriefPrevention extends JavaPlugin !claim.isAdminClaim() && GriefPrevention.instance.config_pvp_noCombatInPlayerLandClaims; } + /* protected boolean isPlayerTrappedInPortal(Block block) { Material playerBlock = block.getType(); @@ -3662,14 +3663,13 @@ public class GriefPrevention extends JavaPlugin } }.runTaskLater(this, 600L); } + */ - //remember where players teleport from (via portals) in case they're trapped at the destination - ConcurrentHashMap portalReturnMap = new ConcurrentHashMap(); + //Track scheduled "rescues" so we can cancel them if the player happens to teleport elsewhere so we can cancel it. ConcurrentHashMap portalReturnTaskMap = new ConcurrentHashMap(); - public void startRescueTask(Player player, Location rescueLocation) + public void startRescueTask(Player player) { BukkitTask task = new CheckForPortalTrapTask(player, this).runTaskLater(GriefPrevention.instance, 600L); - portalReturnMap.put(player.getUniqueId(), rescueLocation); //Cancel existing rescue task if (portalReturnTaskMap.containsKey(player.getUniqueId())) diff --git a/src/me/ryanhamshire/GriefPrevention/PlayerData.java b/src/me/ryanhamshire/GriefPrevention/PlayerData.java index a314a5b..d3c716c 100644 --- a/src/me/ryanhamshire/GriefPrevention/PlayerData.java +++ b/src/me/ryanhamshire/GriefPrevention/PlayerData.java @@ -131,9 +131,6 @@ public class PlayerData //this is an anti-bot strategy. Location noChatLocation = null; - //last rescue location, if player was recently rescued (to undo if rescue was unnecessary) - Location portalTrappedLocation = null; - //ignore list //true means invisible (admin-forced ignore), false means player-created ignore public ConcurrentHashMap ignoredPlayers = new ConcurrentHashMap(); diff --git a/src/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java b/src/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java index 6273bf1..7f35173 100644 --- a/src/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java +++ b/src/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java @@ -763,7 +763,7 @@ class PlayerEventHandler implements Listener new IgnoreLoaderThread(playerID, playerData.ignoredPlayers).start(); //is he possibly stuck in a portal frame? - instance.rescuePlayerTrappedInPortal(player); + player.setPortalCooldown(0); //if we're holding a logout message for this player, don't send that or this event's join message if(GriefPrevention.instance.config_spam_logoutMessageDelaySeconds > 0) @@ -978,11 +978,10 @@ class PlayerEventHandler implements Listener if(!GriefPrevention.instance.claimsEnabledForWorld(event.getTo().getWorld())) return; Player player = event.getPlayer(); - if(event.getCause() == TeleportCause.NETHER_PORTAL) { //FEATURE: when players get trapped in a nether portal, send them back through to the other side - instance.startRescueTask(player, event.getFrom()); + instance.startRescueTask(player); //FEATURE: if the player teleporting doesn't have permission to build a nether portal and none already exists at the destination, cancel the teleportation if(GriefPrevention.instance.config_claims_portalsRequirePermission)