mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-10 10:28:21 +01:00
Remove incorrect JavaDoc and forced use of SafeSpotTeleport builder
This commit is contained in:
parent
a0dcb15026
commit
63e6f244bd
@ -52,14 +52,9 @@ public class SafeSpotTeleport {
|
||||
|
||||
/**
|
||||
* Teleports and entity to a safe spot on island
|
||||
* @param plugin - plugin object
|
||||
* @param entity - entity to teleport
|
||||
* @param location - the location initial desired location to go to
|
||||
* @param failureMessage - locale key for the failure message
|
||||
* @param portal - true if this is a portal teleport
|
||||
* @param homeNumber - home number to go to
|
||||
* @param builder - safe spot teleport builder
|
||||
*/
|
||||
public SafeSpotTeleport(Builder builder) {
|
||||
SafeSpotTeleport(Builder builder) {
|
||||
this.plugin = builder.getPlugin();
|
||||
this.entity = builder.getEntity();
|
||||
this.location = builder.getLocation();
|
||||
@ -72,6 +67,7 @@ public class SafeSpotTeleport {
|
||||
// If the desired location is safe, then that's where you'll go if there's no portal
|
||||
bestSpot = location;
|
||||
} else {
|
||||
plugin.logDebug("Insta teleport Player's velocity = " + entity.getVelocity());
|
||||
// If this is not a portal teleport, then go to the safe location immediately
|
||||
Util.teleportAsync(entity, location).thenRun(() -> {
|
||||
if (runnable != null) Bukkit.getScheduler().runTask(plugin, runnable);
|
||||
@ -155,6 +151,7 @@ public class SafeSpotTeleport {
|
||||
location.getBlock().setType(Material.AIR, false);
|
||||
location.getBlock().getRelative(BlockFace.UP).setType(Material.AIR, false);
|
||||
location.getBlock().getRelative(BlockFace.UP).getRelative(BlockFace.UP).setType(m, false);
|
||||
plugin.logDebug("Make and teleport Player's velocity = " + entity.getVelocity());
|
||||
Util.teleportAsync(entity, location.clone().add(new Vector(0.5D, 0D, 0.5D))).thenRun(() -> {
|
||||
if (runnable != null) Bukkit.getScheduler().runTask(plugin, runnable);
|
||||
});
|
||||
@ -237,7 +234,9 @@ public class SafeSpotTeleport {
|
||||
plugin.getPlayers().setHomeLocation(User.getInstance(entity), loc, homeNumber);
|
||||
}
|
||||
// Return to main thread and teleport the player
|
||||
plugin.logDebug("Safe teleport spot Player's velocity = " + entity.getVelocity());
|
||||
Bukkit.getScheduler().runTask(plugin, () -> Util.teleportAsync(entity, loc).thenRun(() -> {
|
||||
plugin.logDebug("Teleported. Player's velocity = " + entity.getVelocity());
|
||||
if (runnable != null) Bukkit.getScheduler().runTask(plugin, runnable);
|
||||
}));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user