mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-09-07 12:58:02 +02:00
Fixes new team members randomly cannot join island.
https://github.com/BentoBoxWorld/BentoBox/issues/718 Caused by edge case where island owner has no safe home spot and all other safe spots checked were unsafe too. Now uses homeTeleport method to do a full island search for a safe spot.
This commit is contained in:
parent
2946e3c298
commit
a87ef8bff6
@ -5,7 +5,6 @@ import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
|
||||
import com.google.common.collect.BiMap;
|
||||
|
||||
@ -86,11 +85,8 @@ public class IslandTeamInviteAcceptCommand extends ConfirmableCommand {
|
||||
// Add the player as a team member of the new island
|
||||
getIslands().setJoinTeam(teamIsland, playerUUID);
|
||||
//Move player to team's island
|
||||
User prospectiveOwner = User.getInstance(prospectiveOwnerUUID);
|
||||
Location newHome = getIslands().getSafeHomeLocation(getWorld(), prospectiveOwner, 1);
|
||||
user.teleport(newHome);
|
||||
// Set the player's home
|
||||
getPlayers().setHomeLocation(playerUUID, user.getLocation());
|
||||
getPlayers().clearHomeLocations(getWorld(), playerUUID);
|
||||
getIslands().homeTeleport(getWorld(), user.getPlayer());
|
||||
// Delete the old island
|
||||
if (island != null) {
|
||||
getIslands().deleteIsland(island, true);
|
||||
|
Loading…
Reference in New Issue
Block a user