Set the default game mode when player makes island.

This commit is contained in:
tastybento 2021-08-23 19:40:46 -07:00
parent 6c75733417
commit 876ba91837

View File

@ -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;
};
}
@ -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));
}
}