File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
main/java/world/bentobox/bentobox/listeners/flags/worldsettings
test/java/world/bentobox/bentobox/listeners/flags/worldsettings Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ public void onPlayerDeath(PlayerDeathEvent e) {
55
55
*
56
56
* @param e - event
57
57
*/
58
- @ EventHandler (priority = EventPriority .HIGHEST )
58
+ @ EventHandler (priority = EventPriority .NORMAL )
59
59
public void onPlayerRespawn (PlayerRespawnEvent e ) {
60
60
final UUID worldUUID = respawn .remove (e .getPlayer ().getUniqueId ());
61
61
if (worldUUID == null ) {
@@ -67,11 +67,11 @@ public void onPlayerRespawn(PlayerRespawnEvent e) {
67
67
return ; // world no longer available
68
68
}
69
69
World w = Util .getWorld (world );
70
+
70
71
String ownerName = e .getPlayer ().getName ();
71
72
if (w != null ) {
72
- final Location respawnLocation = getIslands ().getPrimaryIsland (world , e .getPlayer ().getUniqueId ())
73
- .getSpawnPoint (world .getEnvironment ());
74
- if (respawnLocation != null ) {
73
+ final Location respawnLocation = getIslands ().getHomeLocation (world , e .getPlayer ().getUniqueId ());
74
+ if (respawnLocation != null && getIslands ().isSafeLocation (respawnLocation )) {
75
75
e .setRespawnLocation (respawnLocation );
76
76
// Get the island owner name
77
77
Island island = BentoBox .getInstance ().getIslands ().getIsland (w , User .getInstance (e .getPlayer ()));
Original file line number Diff line number Diff line change @@ -114,9 +114,10 @@ public void setUp() throws Exception {
114
114
when (iwm .getAddon (any ())).thenReturn (opGma );
115
115
safeLocation = mock (Location .class );
116
116
when (safeLocation .getWorld ()).thenReturn (world );
117
- when (island . getSpawnPoint ( Environment . NORMAL )).thenReturn (safeLocation );
117
+ when (im . getHomeLocation ( eq ( world ), any ( UUID . class ) )).thenReturn (safeLocation );
118
118
when (im .getPrimaryIsland (any (), any ())).thenReturn (island );
119
119
when (im .hasIsland (any (), any (UUID .class ))).thenReturn (true );
120
+ when (im .isSafeLocation (safeLocation )).thenReturn (true );
120
121
when (plugin .getIslands ()).thenReturn (im );
121
122
122
123
// when(im.getSafeHomeLocation(any(), any(),
You can’t perform that action at this time.
0 commit comments