diff --git a/src/main/java/com/volmit/iris/gen/IrisTerrainProvider.java b/src/main/java/com/volmit/iris/gen/IrisTerrainProvider.java index 1234ddbb4..a075202ad 100644 --- a/src/main/java/com/volmit/iris/gen/IrisTerrainProvider.java +++ b/src/main/java/com/volmit/iris/gen/IrisTerrainProvider.java @@ -141,7 +141,15 @@ public class IrisTerrainProvider extends SkyTerrainProvider implements IrisConte { spawnable = true; super.onTick(ticks); - tickEffects(); + try + { + tickEffects(); + } + + catch(Throwable e) + { + + } } protected void tickEffects() @@ -494,66 +502,74 @@ public class IrisTerrainProvider extends SkyTerrainProvider implements IrisConte return; } - if(isSpawnable()) + try { - if(!IrisSettings.get().isSystemEntitySpawnOverrides()) + if(isSpawnable()) { - return; - } + if(!IrisSettings.get().isSystemEntitySpawnOverrides()) + { + return; + } - int x = e.getEntity().getLocation().getBlockX(); - int y = e.getEntity().getLocation().getBlockY(); - int z = e.getEntity().getLocation().getBlockZ(); - IrisDimension dim = getDimension(); - IrisRegion region = sampleRegion(x, z); - IrisBiome above = sampleTrueBiome(x, z); - IrisBiome below = sampleTrueBiome(x, y, z); + int x = e.getEntity().getLocation().getBlockX(); + int y = e.getEntity().getLocation().getBlockY(); + int z = e.getEntity().getLocation().getBlockZ(); + IrisDimension dim = getDimension(); + IrisRegion region = sampleRegion(x, z); + IrisBiome above = sampleTrueBiome(x, z); + IrisBiome below = sampleTrueBiome(x, y, z); - if(above.getLoadKey().equals(below.getLoadKey())) - { - below = null; - } + if(above.getLoadKey().equals(below.getLoadKey())) + { + below = null; + } - IrisStructureResult res = getStructure(x, y, z); + IrisStructureResult res = getStructure(x, y, z); - if(res != null && res.getTile() != null) - { - if(trySpawn(res.getTile().getEntitySpawnOverrides(), e)) + if(res != null && res.getTile() != null) + { + if(trySpawn(res.getTile().getEntitySpawnOverrides(), e)) + { + return; + } + } + + if(res != null && res.getStructure() != null) + { + if(trySpawn(res.getStructure().getEntitySpawnOverrides(), e)) + { + return; + } + } + + if(below != null) + { + if(trySpawn(below.getEntitySpawnOverrides(), e)) + { + return; + } + } + + if(trySpawn(above.getEntitySpawnOverrides(), e)) + { + return; + } + + if(trySpawn(region.getEntitySpawnOverrides(), e)) + { + return; + } + + if(trySpawn(dim.getEntitySpawnOverrides(), e)) { return; } } - - if(res != null && res.getStructure() != null) - { - if(trySpawn(res.getStructure().getEntitySpawnOverrides(), e)) - { - return; - } - } - - if(below != null) - { - if(trySpawn(below.getEntitySpawnOverrides(), e)) - { - return; - } - } - - if(trySpawn(above.getEntitySpawnOverrides(), e)) - { - return; - } - - if(trySpawn(region.getEntitySpawnOverrides(), e)) - { - return; - } - - if(trySpawn(dim.getEntitySpawnOverrides(), e)) - { - return; - } + } + + catch(Throwable xe) + { + } } diff --git a/src/main/java/com/volmit/iris/gen/nms/WorldCracker162.java b/src/main/java/com/volmit/iris/gen/nms/WorldCracker162.java index 371f07e58..6fd6fa3cc 100644 --- a/src/main/java/com/volmit/iris/gen/nms/WorldCracker162.java +++ b/src/main/java/com/volmit/iris/gen/nms/WorldCracker162.java @@ -1,32 +1,22 @@ package com.volmit.iris.gen.nms; -import java.util.Optional; - -import org.bukkit.Bukkit; import org.bukkit.World; -import org.bukkit.block.Jigsaw; import org.bukkit.craftbukkit.v1_16_R2.CraftWorld; -import net.minecraft.server.v1_16_R2.BlockJigsaw; import net.minecraft.server.v1_16_R2.ChunkGenerator; import net.minecraft.server.v1_16_R2.DimensionManager; import net.minecraft.server.v1_16_R2.IChunkAccess; -import net.minecraft.server.v1_16_R2.IRegistry; -import net.minecraft.server.v1_16_R2.IRegistryCustom; -import net.minecraft.server.v1_16_R2.IRegistryWritable; import net.minecraft.server.v1_16_R2.MinecraftServer; import net.minecraft.server.v1_16_R2.RegistryMaterials; -import net.minecraft.server.v1_16_R2.ResourceKey; -import net.minecraft.server.v1_16_R2.StructureGenerator; import net.minecraft.server.v1_16_R2.StructureManager; -import net.minecraft.server.v1_16_R2.StructureSettings; import net.minecraft.server.v1_16_R2.WorldDataServer; import net.minecraft.server.v1_16_R2.WorldDimension; import net.minecraft.server.v1_16_R2.WorldServer; public class WorldCracker162 { - public static void makeStuffAt(World world, int x, int z) + @SuppressWarnings("unused") + public static void go(World world, int x, int z) { WorldServer ws = ((CraftWorld) world).getHandle(); MinecraftServer server = ws.getMinecraftServer(); @@ -36,18 +26,6 @@ public class WorldCracker162 WorldDimension wdm = (WorldDimension) registrymaterials.a(WorldDimension.OVERWORLD); DimensionManager dm = wdm.b(); ChunkGenerator cg = wdm.c(); - IChunkAccess ica = ws.getChunkAt(x, z); - } - - public static void attemptGenVillage(World world, int x, int z) - { - WorldServer ws = ((CraftWorld) world).getHandle(); - WorldDataServer wds = ws.worldDataServer; - StructureManager sm = ws.getStructureManager(); - RegistryMaterials registrymaterials = wds.getGeneratorSettings().d(); - WorldDimension wdm = (WorldDimension) registrymaterials.a(WorldDimension.OVERWORLD); - DimensionManager dm = wdm.b(); - ChunkGenerator cg = wdm.c(); - StructureSettings structureSettings = cg.getSettings(); + IChunkAccess ica = ws.getChunkAt(x, z); } }