Skip to content

Commit

Permalink
Skip place if world is null
Browse files Browse the repository at this point in the history
Relates to #57
  • Loading branch information
tastybento committed Jul 29, 2023
1 parent 7c12c90 commit 1452372
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ private void setUpIsland(Island island) {

private void place(ConfigurationSection section, Location center, Environment env) {
World world = env.equals(Environment.NORMAL) ? addon.getOverWorld() : addon.getNetherWorld();
if (world == null) {
return;
}
// Loop through the structures in the file - there could be more than one
for (String vector : section.getKeys(false)) {
StructureRotation rot = StructureRotation.NONE;
Expand Down Expand Up @@ -423,7 +426,7 @@ private static void spawnMob(Block b, BoxedJigsawBlock bjb) {
case "minecraft:village/common/cows" -> EntityType.COW;
case "minecraft:village/common/iron_golem" -> EntityType.IRON_GOLEM;
case "minecraft:village/common/butcher_animals", "minecraft:village/common/animals" -> BUTCHER_ANIMALS.get(rand.nextInt(3));
default -> null;
default -> null;
};
// Boxed
if (type == null && bjb.getPool().startsWith("minecraft:boxed/")) {
Expand Down

0 comments on commit 1452372

Please sign in to comment.