From 876ba91837b518f5ae254b7d8d5c9c9c6cc67578 Mon Sep 17 00:00:00 2001 From: tastybento Date: Mon, 23 Aug 2021 19:40:46 -0700 Subject: [PATCH] Set the default game mode when player makes island. --- .../bentobox/managers/IslandsManager.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/world/bentobox/bentobox/managers/IslandsManager.java b/src/main/java/world/bentobox/bentobox/managers/IslandsManager.java index b4e7a57a7..9a1a23de5 100644 --- a/src/main/java/world/bentobox/bentobox/managers/IslandsManager.java +++ b/src/main/java/world/bentobox/bentobox/managers/IslandsManager.java @@ -271,10 +271,10 @@ public class IslandsManager { } // Known unsafe blocks return switch (ground) { - // Unsafe - case ANVIL, BARRIER, CACTUS, END_PORTAL, END_ROD, FIRE, FLOWER_POT, LADDER, LEVER, TALL_GRASS, PISTON_HEAD, - MOVING_PISTON, TORCH, WALL_TORCH, TRIPWIRE, WATER, COBWEB, NETHER_PORTAL, MAGMA_BLOCK -> false; - default -> true; + // Unsafe + case ANVIL, BARRIER, CACTUS, END_PORTAL, END_ROD, FIRE, FLOWER_POT, LADDER, LEVER, TALL_GRASS, PISTON_HEAD, + MOVING_PISTON, TORCH, WALL_TORCH, TRIPWIRE, WATER, COBWEB, NETHER_PORTAL, MAGMA_BLOCK -> false; + default -> true; }; } @@ -434,7 +434,7 @@ public class IslandsManager { * * @param world - world to check * @param uuid - the player's UUID - * @return Location of the center of the player's protection area or null if an island does not exist. + * @return Location of the center of the player's protection area or null if an island does not exist. * Returns an island location OR a team island location */ @Nullable @@ -856,7 +856,7 @@ public class IslandsManager { } if (island.getOwner().equals(uuid)) { // Owner - island.setHomes(homes.entrySet().stream().collect(Collectors.toMap(this::getHomeName, Map.Entry::getKey))); + island.setHomes(homes.entrySet().stream().collect(Collectors.toMap(this::getHomeName, Map.Entry::getKey))); plugin.getPlayers().clearHomeLocations(world, uuid); } } @@ -1153,6 +1153,9 @@ public class IslandsManager { if (plugin.getIWM().isOnJoinResetXP(world)) { user.getPlayer().setTotalExperience(0); } + + // Set the game mode + user.setGameMode(plugin.getIWM().getDefaultGameMode(world)); } }