mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-12-27 03:27:34 +01:00
Merge branch 'develop' of https://github.com/BentoBoxWorld/bentobox.git into develop
This commit is contained in:
commit
583311ce03
@ -52,7 +52,7 @@ public class SafeSpotTeleport {
|
|||||||
* @param plugin - plugin object
|
* @param plugin - plugin object
|
||||||
* @param entity - entity to teleport
|
* @param entity - entity to teleport
|
||||||
* @param location - the location
|
* @param location - the location
|
||||||
* @param failureMessage - already translated failure message
|
* @param failureMessage - locale key for the failure message
|
||||||
* @param portal - true if this is a portal teleport
|
* @param portal - true if this is a portal teleport
|
||||||
* @param homeNumber - home number to go to
|
* @param homeNumber - home number to go to
|
||||||
*/
|
*/
|
||||||
@ -122,7 +122,7 @@ public class SafeSpotTeleport {
|
|||||||
}
|
}
|
||||||
} else if (entity instanceof Player && !failureMessage.isEmpty()) {
|
} else if (entity instanceof Player && !failureMessage.isEmpty()) {
|
||||||
// Failed, no safe spot
|
// Failed, no safe spot
|
||||||
entity.sendMessage(failureMessage);
|
User.getInstance(entity).notify(failureMessage);
|
||||||
if (overrideGamemode && ((Player)entity).getGameMode().equals(GameMode.SPECTATOR)) {
|
if (overrideGamemode && ((Player)entity).getGameMode().equals(GameMode.SPECTATOR)) {
|
||||||
if (plugin.getIWM().inWorld(entity.getLocation())) {
|
if (plugin.getIWM().inWorld(entity.getLocation())) {
|
||||||
((Player)entity).setGameMode(plugin.getIWM().getDefaultGameMode(entity.getWorld()));
|
((Player)entity).setGameMode(plugin.getIWM().getDefaultGameMode(entity.getWorld()));
|
||||||
@ -416,7 +416,7 @@ public class SafeSpotTeleport {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (failureMessage.isEmpty() && entity instanceof Player) {
|
if (failureMessage.isEmpty() && entity instanceof Player) {
|
||||||
failureMessage = User.getInstance(entity).getTranslation("general.errors.warp-not-safe");
|
failureMessage = "general.errors.warp-not-safe";
|
||||||
}
|
}
|
||||||
return new SafeSpotTeleport(plugin, entity, location, failureMessage, portal, homeNumber, overrideGamemode);
|
return new SafeSpotTeleport(plugin, entity, location, failureMessage, portal, homeNumber, overrideGamemode);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user