Fixed /trapped overriding in the nether.

Now other plugins can override the destination even in nether worlds.
This commit is contained in:
ryanhamshire 2016-06-16 11:11:47 -07:00
parent c7327d4982
commit 0e6d7bf11f
2 changed files with 7 additions and 7 deletions

View File

@ -1534,7 +1534,7 @@ public abstract class DataStore
this.addDefault(defaults, Messages.NoBuildOutsideClaims, "You can't build here unless you claim some land first.", null);
this.addDefault(defaults, Messages.PlayerOfflineTime, " Last login: {0} days ago.", "0: number of full days since last login");
this.addDefault(defaults, Messages.BuildingOutsideClaims, "Other players can build here, too. Consider creating a land claim to protect your work!", null);
this.addDefault(defaults, Messages.TrappedWontWorkHere, "Sorry, unable to find a safe location to teleport you to. Contact an admin, or consider /kill if you don't want to wait.", null);
this.addDefault(defaults, Messages.TrappedWontWorkHere, "Sorry, unable to find a safe location to teleport you to. Contact an admin.", null);
this.addDefault(defaults, Messages.CommandBannedInPvP, "You can't use that command while in PvP combat.", null);
this.addDefault(defaults, Messages.UnclaimCleanupWarning, "The land you've unclaimed may be changed by other players or cleaned up by administrators. If you've built something there you want to keep, you should reclaim it.", null);
this.addDefault(defaults, Messages.BuySellNotConfigured, "Sorry, buying anhd selling claim blocks is disabled.", null);

View File

@ -2307,19 +2307,19 @@ public class GriefPrevention extends JavaPlugin
return true;
}
//rescue destination may be set by GPFlags or other plugin, ask to find out
SaveTrappedPlayerEvent event = new SaveTrappedPlayerEvent(claim);
Bukkit.getPluginManager().callEvent(event);
//if the player is in the nether or end, he's screwed (there's no way to programmatically find a safe place for him)
if(player.getWorld().getEnvironment() != Environment.NORMAL)
if(player.getWorld().getEnvironment() != Environment.NORMAL && event.getDestination() == null)
{
GriefPrevention.sendMessage(player, TextMode.Err, Messages.TrappedWontWorkHere);
return true;
}
//rescue destination may be set by GPFlags, ask to find out
SaveTrappedPlayerEvent event = new SaveTrappedPlayerEvent(claim);
Bukkit.getPluginManager().callEvent(event);
//if the player is in an administrative claim, he should contact an admin
if(claim.isAdminClaim() && event.getDestination() != null)
if(claim.isAdminClaim() && event.getDestination() == null)
{
GriefPrevention.sendMessage(player, TextMode.Err, Messages.TrappedWontWorkHere);
return true;