mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-06 00:18:36 +01:00
Fixes island creation on reservation.
New island panel was not being shown to reserved island players when using /island or /island go. https://github.com/BentoBoxWorld/BentoBox/issues/875
This commit is contained in:
parent
91077ef895
commit
d622c12425
@ -37,8 +37,9 @@ public class IslandGoCommand extends DelayedTeleportCommand {
|
||||
return false;
|
||||
}
|
||||
if (island.isReserved()) {
|
||||
// Send player to create and island
|
||||
return getParent().getSubCommand("create").map(createCmd -> createCmd.call(user, createCmd.getLabel(), Collections.emptyList())).orElse(false);
|
||||
// Send player to create an island
|
||||
getParent().getSubCommand("create").ifPresent(createCmd -> createCmd.call(user, createCmd.getLabel(), Collections.emptyList()));
|
||||
return false;
|
||||
}
|
||||
if ((getIWM().inWorld(user.getWorld()) && Flags.PREVENT_TELEPORT_WHEN_FALLING.isSetForWorld(user.getWorld()))
|
||||
&& user.getPlayer().getFallDistance() > 0) {
|
||||
|
@ -208,7 +208,7 @@ public class IslandGoCommandTest {
|
||||
when(im.getIsland(any(), any(UUID.class))).thenReturn(island);
|
||||
when(ic.call(any(), any(), any())).thenReturn(true);
|
||||
when(island.isReserved()).thenReturn(true);
|
||||
assertTrue(igc.canExecute(user, igc.getLabel(), Collections.emptyList()));
|
||||
assertFalse(igc.canExecute(user, igc.getLabel(), Collections.emptyList()));
|
||||
verify(ic).call(any(), any(), any());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user