mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-04 15:38:00 +01:00
Fixed portals. Still has debug in it.
Need to add nether->overworld portal
This commit is contained in:
parent
f2f8917bf8
commit
b9c262fd5c
@ -26,6 +26,7 @@ general:
|
|||||||
offline-player: "&cThat player is offline or doesn't exist."
|
offline-player: "&cThat player is offline or doesn't exist."
|
||||||
unknown-player: "&cUnknown player!"
|
unknown-player: "&cUnknown player!"
|
||||||
general: "&cThat command is not ready yet - contact admin"
|
general: "&cThat command is not ready yet - contact admin"
|
||||||
|
warp-not-safe: "&cThat warp is not safe right now!"
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
help:
|
help:
|
||||||
|
@ -49,6 +49,7 @@ public class NetherPortals implements Listener {
|
|||||||
Vector p = location.toVector().multiply(new Vector(1, 0, 1));
|
Vector p = location.toVector().multiply(new Vector(1, 0, 1));
|
||||||
Vector spawn = location.getWorld().getSpawnLocation().toVector().multiply(new Vector(1, 0, 1));
|
Vector spawn = location.getWorld().getSpawnLocation().toVector().multiply(new Vector(1, 0, 1));
|
||||||
if (spawn.distanceSquared(p) < (plugin.getSettings().getNetherSpawnRadius() * plugin.getSettings().getNetherSpawnRadius())) {
|
if (spawn.distanceSquared(p) < (plugin.getSettings().getNetherSpawnRadius() * plugin.getSettings().getNetherSpawnRadius())) {
|
||||||
|
plugin.getLogger().info("not away from spawn");
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
@ -56,6 +57,7 @@ public class NetherPortals implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean inWorlds(Location from) {
|
private boolean inWorlds(Location from) {
|
||||||
|
plugin.getLogger().info("In world = " + (from.getWorld().equals(world) || from.getWorld().equals(nether) || from.getWorld().equals(the_end)));
|
||||||
return (from.getWorld().equals(world) || from.getWorld().equals(nether) || from.getWorld().equals(the_end)) ? true : false;
|
return (from.getWorld().equals(world) || from.getWorld().equals(nether) || from.getWorld().equals(the_end)) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,8 +66,10 @@ public class NetherPortals implements Listener {
|
|||||||
|| (!player.getWorld().equals(nether) && !player.getWorld().equals(the_end))
|
|| (!player.getWorld().equals(nether) && !player.getWorld().equals(the_end))
|
||||||
|| (player.getWorld().equals(nether) && plugin.getSettings().isNetherIslands())
|
|| (player.getWorld().equals(nether) && plugin.getSettings().isNetherIslands())
|
||||||
|| (player.getWorld().equals(the_end) && plugin.getSettings().isEndIslands())) {
|
|| (player.getWorld().equals(the_end) && plugin.getSettings().isEndIslands())) {
|
||||||
|
plugin.getLogger().info("No legacy nether or end");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
plugin.getLogger().info("Action!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,6 +109,7 @@ public class NetherPortals implements Listener {
|
|||||||
*/
|
*/
|
||||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||||
public void onEndIslandPortal(PlayerPortalEvent event) {
|
public void onEndIslandPortal(PlayerPortalEvent event) {
|
||||||
|
plugin.getLogger().info("End portal event Is end generated? " + plugin.getSettings().isEndGenerate());
|
||||||
if (!event.getCause().equals(TeleportCause.END_PORTAL) || !plugin.getSettings().isEndGenerate()) {
|
if (!event.getCause().equals(TeleportCause.END_PORTAL) || !plugin.getSettings().isEndGenerate()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -112,15 +117,19 @@ public class NetherPortals implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// If entering a portal in the end, teleport home if you have one, else do nothing
|
// If entering a portal in the end, teleport home if you have one, else do nothing
|
||||||
if (event.getFrom().getWorld().equals(the_end)) {
|
if (event.getFrom().getWorld().equals(the_end)) {
|
||||||
|
plugin.getLogger().info("In end world");
|
||||||
if (plugin.getIslands().hasIsland(event.getPlayer().getUniqueId())) {
|
if (plugin.getIslands().hasIsland(event.getPlayer().getUniqueId())) {
|
||||||
|
event.setCancelled(true);
|
||||||
plugin.getIslands().homeTeleport(event.getPlayer());
|
plugin.getIslands().homeTeleport(event.getPlayer());
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
plugin.getLogger().info("In other world going through end portal");
|
||||||
// If this is island end, then go to the same location, otherwise try spawn
|
// If this is island end, then go to the same location, otherwise try spawn
|
||||||
Location to = plugin.getSettings().isEndIslands() ? event.getFrom().toVector().toLocation(the_end) : the_end.getSpawnLocation();
|
Location to = plugin.getSettings().isEndIslands() ? event.getFrom().toVector().toLocation(the_end) : the_end.getSpawnLocation();
|
||||||
// Else other worlds teleport to the end
|
// Else other worlds teleport to the end
|
||||||
|
event.setCancelled(true);
|
||||||
new SafeTeleportBuilder(plugin)
|
new SafeTeleportBuilder(plugin)
|
||||||
.entity(event.getPlayer())
|
.entity(event.getPlayer())
|
||||||
.location(to)
|
.location(to)
|
||||||
@ -136,6 +145,7 @@ public class NetherPortals implements Listener {
|
|||||||
*/
|
*/
|
||||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||||
public void onEntityPortal(EntityPortalEvent event) {
|
public void onEntityPortal(EntityPortalEvent event) {
|
||||||
|
plugin.getLogger().info(event.getEventName());
|
||||||
if (inWorlds(event.getFrom())) {
|
if (inWorlds(event.getFrom())) {
|
||||||
// Disable entity portal transfer due to dupe glitching
|
// Disable entity portal transfer due to dupe glitching
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -177,6 +187,7 @@ public class NetherPortals implements Listener {
|
|||||||
*/
|
*/
|
||||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||||
public void onNetherPortal(PlayerPortalEvent event) {
|
public void onNetherPortal(PlayerPortalEvent event) {
|
||||||
|
plugin.getLogger().info(event.getEventName() + " " + event.getCause() + " nether");
|
||||||
if (!event.getCause().equals(TeleportCause.NETHER_PORTAL)) {
|
if (!event.getCause().equals(TeleportCause.NETHER_PORTAL)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -185,13 +196,19 @@ public class NetherPortals implements Listener {
|
|||||||
}
|
}
|
||||||
// If entering a portal in the nether or end, teleport home if you have one, else do nothing
|
// If entering a portal in the nether or end, teleport home if you have one, else do nothing
|
||||||
if (!event.getFrom().getWorld().equals(world)) {
|
if (!event.getFrom().getWorld().equals(world)) {
|
||||||
|
plugin.getLogger().info("Entered portal in nether or end");
|
||||||
if (plugin.getIslands().hasIsland(event.getPlayer().getUniqueId())) {
|
if (plugin.getIslands().hasIsland(event.getPlayer().getUniqueId())) {
|
||||||
|
plugin.getLogger().info("player has island - teleporting home");
|
||||||
|
event.setCancelled(true);
|
||||||
plugin.getIslands().homeTeleport(event.getPlayer());
|
plugin.getIslands().homeTeleport(event.getPlayer());
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
plugin.getLogger().info("Entering nether portal in overworld");
|
||||||
// If this is island nether, then go to the same vector, otherwise try spawn
|
// If this is island nether, then go to the same vector, otherwise try spawn
|
||||||
Location to = plugin.getSettings().isNetherIslands() ? event.getFrom().toVector().toLocation(nether) : nether.getSpawnLocation();
|
Location to = plugin.getSettings().isNetherIslands() ? event.getFrom().toVector().toLocation(nether) : nether.getSpawnLocation();
|
||||||
|
plugin.getLogger().info("Going to " + to);
|
||||||
|
event.setCancelled(true);
|
||||||
// Else other worlds teleport to the nether
|
// Else other worlds teleport to the nether
|
||||||
new SafeTeleportBuilder(plugin)
|
new SafeTeleportBuilder(plugin)
|
||||||
.entity(event.getPlayer())
|
.entity(event.getPlayer())
|
||||||
|
@ -135,7 +135,7 @@ public abstract class AbstractFlagListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generic place blocks checker
|
* Generic flag checker
|
||||||
* @param e
|
* @param e
|
||||||
* @param loc
|
* @param loc
|
||||||
* @param breakBlocks
|
* @param breakBlocks
|
||||||
|
@ -6,6 +6,7 @@ package us.tastybento.bskyblock.listeners.flags;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.player.PlayerPortalEvent;
|
import org.bukkit.event.player.PlayerPortalEvent;
|
||||||
|
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||||
|
|
||||||
import us.tastybento.bskyblock.lists.Flags;
|
import us.tastybento.bskyblock.lists.Flags;
|
||||||
|
|
||||||
@ -18,6 +19,14 @@ public class PortalListener extends AbstractFlagListener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||||
public void onPlayerPortal(PlayerPortalEvent e) {
|
public void onPlayerPortal(PlayerPortalEvent e) {
|
||||||
checkIsland(e, e.getFrom(), Flags.PORTAL);
|
if (e.getPlayer().isOp()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (e.getCause().equals(TeleportCause.NETHER_PORTAL)) {
|
||||||
|
checkIsland(e, e.getFrom(), Flags.PORTAL);
|
||||||
|
} else if (e.getCause().equals(TeleportCause.END_PORTAL)) {
|
||||||
|
// Silent check because it's spammy
|
||||||
|
checkIsland(e, e.getFrom(), Flags.PORTAL, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,8 +61,10 @@ public class SafeSpotTeleport {
|
|||||||
this.portal = portal;
|
this.portal = portal;
|
||||||
this.homeNumber = homeNumber;
|
this.homeNumber = homeNumber;
|
||||||
|
|
||||||
|
plugin.getLogger().info("Safe teleport called");
|
||||||
// Put player into spectator mode
|
// Put player into spectator mode
|
||||||
if (entity instanceof Player && ((Player)entity).getGameMode().equals(GameMode.SURVIVAL)) {
|
if (entity instanceof Player && ((Player)entity).getGameMode().equals(GameMode.SURVIVAL)) {
|
||||||
|
Bukkit.getLogger().info("Put player into spectator mode");
|
||||||
((Player)entity).setGameMode(GameMode.SPECTATOR);
|
((Player)entity).setGameMode(GameMode.SPECTATOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,8 +78,10 @@ public class SafeSpotTeleport {
|
|||||||
task = plugin.getServer().getScheduler().runTaskTimer(plugin, () -> {
|
task = plugin.getServer().getScheduler().runTaskTimer(plugin, () -> {
|
||||||
List<ChunkSnapshot> chunkSnapshot = new ArrayList<>();
|
List<ChunkSnapshot> chunkSnapshot = new ArrayList<>();
|
||||||
if (checking) {
|
if (checking) {
|
||||||
|
Bukkit.getLogger().info("Checking");
|
||||||
Iterator<Pair<Integer, Integer>> it = chunksToScan.iterator();
|
Iterator<Pair<Integer, Integer>> it = chunksToScan.iterator();
|
||||||
if (!it.hasNext()) {
|
if (!it.hasNext()) {
|
||||||
|
// TODO REMOVE
|
||||||
Bukkit.getLogger().info("Nothing left!");
|
Bukkit.getLogger().info("Nothing left!");
|
||||||
// Nothing left
|
// Nothing left
|
||||||
tidyUp(entity, failureMessage);
|
tidyUp(entity, failureMessage);
|
||||||
@ -92,6 +96,8 @@ public class SafeSpotTeleport {
|
|||||||
// Move to next step
|
// Move to next step
|
||||||
checking = false;
|
checking = false;
|
||||||
checkChunks(chunkSnapshot);
|
checkChunks(chunkSnapshot);
|
||||||
|
} else {
|
||||||
|
Bukkit.getLogger().info("Not checking");
|
||||||
}
|
}
|
||||||
}, 0L, SPEED);
|
}, 0L, SPEED);
|
||||||
}
|
}
|
||||||
@ -103,6 +109,7 @@ public class SafeSpotTeleport {
|
|||||||
if (portal && bestSpot != null) {
|
if (portal && bestSpot != null) {
|
||||||
// No portals found, teleport to the best spot we found
|
// No portals found, teleport to the best spot we found
|
||||||
teleportEntity(bestSpot);
|
teleportEntity(bestSpot);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
// Failed - no safe spot
|
// Failed - no safe spot
|
||||||
if (entity instanceof Player && !failureMessage.isEmpty()) {
|
if (entity instanceof Player && !failureMessage.isEmpty()) {
|
||||||
@ -157,14 +164,18 @@ public class SafeSpotTeleport {
|
|||||||
* @param chunkSnapshot
|
* @param chunkSnapshot
|
||||||
*/
|
*/
|
||||||
private void checkChunks(List<ChunkSnapshot> chunkSnapshot) {
|
private void checkChunks(List<ChunkSnapshot> chunkSnapshot) {
|
||||||
|
Bukkit.getLogger().info("Chunksnapshot = " + chunkSnapshot.size());
|
||||||
// Run async task to scan chunks
|
// Run async task to scan chunks
|
||||||
plugin.getServer().getScheduler().runTaskAsynchronously(plugin, () -> {
|
plugin.getServer().getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||||
|
|
||||||
for (ChunkSnapshot chunk: chunkSnapshot) {
|
for (ChunkSnapshot chunk: chunkSnapshot) {
|
||||||
if (scanChunk(chunk)) {
|
if (scanChunk(chunk)) {
|
||||||
|
Bukkit.getLogger().info("Safe sport found!");
|
||||||
|
task.cancel();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Bukkit.getLogger().info("not found in initial list");
|
||||||
// Nothing happened, change state
|
// Nothing happened, change state
|
||||||
checking = true;
|
checking = true;
|
||||||
});
|
});
|
||||||
@ -176,6 +187,7 @@ public class SafeSpotTeleport {
|
|||||||
* @return true if a safe spot was found
|
* @return true if a safe spot was found
|
||||||
*/
|
*/
|
||||||
private boolean scanChunk(ChunkSnapshot chunk) {
|
private boolean scanChunk(ChunkSnapshot chunk) {
|
||||||
|
Bukkit.getLogger().info("Scanning chunk " + chunk.getX() + " " + chunk.getZ());
|
||||||
// Max height
|
// Max height
|
||||||
int maxHeight = location.getWorld().getMaxHeight() - 20;
|
int maxHeight = location.getWorld().getMaxHeight() - 20;
|
||||||
// Run through the chunk
|
// Run through the chunk
|
||||||
@ -184,6 +196,7 @@ public class SafeSpotTeleport {
|
|||||||
// Work down from the entry point up
|
// Work down from the entry point up
|
||||||
for (int y = Math.min(chunk.getHighestBlockYAt(x, z), maxHeight); y >= 0; y--) {
|
for (int y = Math.min(chunk.getHighestBlockYAt(x, z), maxHeight); y >= 0; y--) {
|
||||||
if (checkBlock(chunk, x,y,z, maxHeight)) {
|
if (checkBlock(chunk, x,y,z, maxHeight)) {
|
||||||
|
Bukkit.getLogger().info("Check block returned true");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} // end y
|
} // end y
|
||||||
@ -196,14 +209,17 @@ public class SafeSpotTeleport {
|
|||||||
* Teleports entity to the safe spot
|
* Teleports entity to the safe spot
|
||||||
*/
|
*/
|
||||||
private void teleportEntity(Location loc) {
|
private void teleportEntity(Location loc) {
|
||||||
|
Bukkit.getLogger().info("Teleporting!");
|
||||||
task.cancel();
|
task.cancel();
|
||||||
// Return to main thread and teleport the player
|
// Return to main thread and teleport the player
|
||||||
plugin.getServer().getScheduler().runTask(plugin, () -> {
|
plugin.getServer().getScheduler().runTask(plugin, () -> {
|
||||||
if (!portal && entity instanceof Player) {
|
if (!portal && entity instanceof Player) {
|
||||||
|
Bukkit.getLogger().info("Setting home");
|
||||||
// Set home
|
// Set home
|
||||||
plugin.getPlayers().setHomeLocation(entity.getUniqueId(), loc, homeNumber);
|
plugin.getPlayers().setHomeLocation(entity.getUniqueId(), loc, homeNumber);
|
||||||
}
|
}
|
||||||
Vector velocity = entity.getVelocity();
|
Vector velocity = entity.getVelocity();
|
||||||
|
Bukkit.getLogger().info("Teleported!");
|
||||||
entity.teleport(loc);
|
entity.teleport(loc);
|
||||||
// Exit spectator mode if in it
|
// Exit spectator mode if in it
|
||||||
if (entity instanceof Player) {
|
if (entity instanceof Player) {
|
||||||
@ -261,62 +277,65 @@ public class SafeSpotTeleport {
|
|||||||
if (!type.equals(Material.AIR)) { // AIR
|
if (!type.equals(Material.AIR)) { // AIR
|
||||||
Material space1 = chunk.getBlockType(x, Math.min(y + 1, worldHeight), z);
|
Material space1 = chunk.getBlockType(x, Math.min(y + 1, worldHeight), z);
|
||||||
Material space2 = chunk.getBlockType(x, Math.min(y + 2, worldHeight), z);
|
Material space2 = chunk.getBlockType(x, Math.min(y + 2, worldHeight), z);
|
||||||
if ((space1.equals(Material.AIR) && space2.equals(Material.AIR))
|
if ((space1.equals(Material.AIR) && space2.equals(Material.AIR)) || (space1.equals(Material.PORTAL) && space2.equals(Material.PORTAL))) {
|
||||||
|| (space1.equals(Material.PORTAL) && space2.equals(Material.PORTAL))
|
if (!type.toString().contains("FENCE") && !type.toString().contains("DOOR") && !type.toString().contains("GATE") && !type.toString().contains("PLATE")) {
|
||||||
&& (!type.toString().contains("FENCE")
|
Bukkit.getLogger().info("Checking " + type);
|
||||||
&& !type.toString().contains("DOOR")
|
switch (type) {
|
||||||
&& !type.toString().contains("GATE")
|
// Unsafe
|
||||||
&& !type.toString().contains("PLATE"))) {
|
case ANVIL:
|
||||||
switch (type) {
|
case BARRIER:
|
||||||
// Unsafe
|
case BOAT:
|
||||||
case ANVIL:
|
case CACTUS:
|
||||||
case BARRIER:
|
case DOUBLE_PLANT:
|
||||||
case BOAT:
|
case ENDER_PORTAL:
|
||||||
case CACTUS:
|
case FIRE:
|
||||||
case DOUBLE_PLANT:
|
case FLOWER_POT:
|
||||||
case ENDER_PORTAL:
|
case LADDER:
|
||||||
case FIRE:
|
case LAVA:
|
||||||
case FLOWER_POT:
|
case LEVER:
|
||||||
case LADDER:
|
case LONG_GRASS:
|
||||||
case LAVA:
|
case PISTON_EXTENSION:
|
||||||
case LEVER:
|
case PISTON_MOVING_PIECE:
|
||||||
case LONG_GRASS:
|
case SIGN_POST:
|
||||||
case PISTON_EXTENSION:
|
case SKULL:
|
||||||
case PISTON_MOVING_PIECE:
|
case STANDING_BANNER:
|
||||||
case PORTAL:
|
case STATIONARY_LAVA:
|
||||||
case SIGN_POST:
|
case STATIONARY_WATER:
|
||||||
case SKULL:
|
case STONE_BUTTON:
|
||||||
case STANDING_BANNER:
|
case TORCH:
|
||||||
case STATIONARY_LAVA:
|
case TRIPWIRE:
|
||||||
case STATIONARY_WATER:
|
case WATER:
|
||||||
case STONE_BUTTON:
|
case WEB:
|
||||||
case TORCH:
|
case WOOD_BUTTON:
|
||||||
case TRIPWIRE:
|
//Block is dangerous
|
||||||
case WATER:
|
break;
|
||||||
case WEB:
|
case PORTAL:
|
||||||
case WOOD_BUTTON:
|
if (portal) {
|
||||||
//Block is dangerous
|
Bukkit.getLogger().info("Portal found");
|
||||||
break;
|
Vector newSpot = new Vector(chunk.getX() * 16 + x + 0.5D, y + 1, chunk.getZ() * 16 + z + 0.5D);
|
||||||
default:
|
|
||||||
// Safe
|
|
||||||
Vector newSpot = new Vector(chunk.getX() * 16 + x + 0.5D, y + 1, chunk.getZ() * 16 + z + 0.5D);
|
|
||||||
// Check for portal
|
|
||||||
if (portal) {
|
|
||||||
if (chunk.getBlockType(x, y, z).equals(Material.PORTAL)) {
|
|
||||||
// Teleport as soon as we find a portal
|
// Teleport as soon as we find a portal
|
||||||
teleportEntity(newSpot.toLocation(world));
|
teleportEntity(newSpot.toLocation(world));
|
||||||
return true;
|
return true;
|
||||||
} else if (bestSpot == null) {
|
|
||||||
// Stash the best spot
|
|
||||||
bestSpot = newSpot.toLocation(world);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
} else {
|
break;
|
||||||
// Regular search - teleport as soon as we find something
|
default:
|
||||||
teleportEntity(newSpot.toLocation(world));
|
// Safe
|
||||||
return true;
|
Vector newSpot = new Vector(chunk.getX() * 16 + x + 0.5D, y + 1, chunk.getZ() * 16 + z + 0.5D);
|
||||||
|
// Check for portal
|
||||||
|
if (portal) {
|
||||||
|
if (bestSpot == null) {
|
||||||
|
Bukkit.getLogger().info("Best spot found = " + bestSpot);
|
||||||
|
// Stash the best spot
|
||||||
|
bestSpot = newSpot.toLocation(world);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Regular search - teleport as soon as we find something
|
||||||
|
Bukkit.getLogger().info("Safe spot found, teleporting to new spot");
|
||||||
|
teleportEntity(newSpot.toLocation(world));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ public class SafeTeleportBuilder {
|
|||||||
private Entity entity;
|
private Entity entity;
|
||||||
private int homeNumber = 0;
|
private int homeNumber = 0;
|
||||||
private boolean portal = false;
|
private boolean portal = false;
|
||||||
private String failureMessage = "";
|
private String failureMessage = "general.errors.warp-not-safe";
|
||||||
private Location location;
|
private Location location;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user