From 40626b5cefc60e4f82c4cf1f88e205122fcc5e4f Mon Sep 17 00:00:00 2001 From: Boblet Date: Thu, 2 Nov 2023 14:52:04 +0100 Subject: [PATCH] this either fixes post impact mob spawning or destroys everything --- changelog | 6 +++--- .../com/hbm/main/ModEventHandlerImpact.java | 17 ++++++++--------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/changelog b/changelog index 562b40a8f..6f1c1771c 100644 --- a/changelog +++ b/changelog @@ -13,8 +13,6 @@ * Material cost is equivalent to 1 ingot * For ease of mass-production, 9-fold molds are also available * Used to craft hadron magnets, reducing crafting complexity be removing annoying upgrade recipes which make automation more complicated and needlessly inflate the amount of materials required for a magnet tier that isn't even the one that's being made -* Neodymium os now a valid crucible material -* Particle accelerators will now evenly distribute items using IO if both inputs are equal, making the antischrabidium recipe a lot easier to automate ## Changed * Changed many tool recipes that exclusively used polymer to now also accept bakelite @@ -25,6 +23,8 @@ * Doubled coal bedrock ore's coal output to 8 coal * A new config option now replaces the iron and copper bedrock ores in 528 mode with hematite and malachite * the industrial generator now has three additional ports on its underside, meaning it is now a lot easier to properly automate all necessary IO +* Neodymium is now a valid crucible material +* Particle accelerators will now evenly distribute items using IO if both inputs are equal, making the antischrabidium recipe a lot easier to automate ## Fixed -* Pipe and power networks now force the chunk to be saved on transfer, ensuring that rapid changes in the fluid/energy level aren't lost when the tile entity is unloaded \ No newline at end of file +* Pipe and power networks now force the chunk to be saved on transfer, ensuring that rapid changes in the fluid/energy level aren't lost when the tile entity is unloaded diff --git a/src/main/java/com/hbm/main/ModEventHandlerImpact.java b/src/main/java/com/hbm/main/ModEventHandlerImpact.java index 27529784c..d371296af 100644 --- a/src/main/java/com/hbm/main/ModEventHandlerImpact.java +++ b/src/main/java/com/hbm/main/ModEventHandlerImpact.java @@ -31,7 +31,7 @@ import net.minecraft.world.EnumSkyBlock; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.storage.ExtendedBlockStorage; import net.minecraftforge.common.DimensionManager; -import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.event.entity.living.LivingSpawnEvent.CheckSpawn; import net.minecraftforge.event.terraingen.BiomeEvent; import net.minecraftforge.event.terraingen.DecorateBiomeEvent; import net.minecraftforge.event.terraingen.PopulateChunkEvent; @@ -100,22 +100,21 @@ public class ModEventHandlerImpact { }*/ @SubscribeEvent - public void extinction(EntityJoinWorldEvent event) { + public void extinction(CheckSpawn event) { TomSaveData data = TomSaveData.forWorld(event.world); if(data.impact) { - if(!(event.entity instanceof EntityPlayer) && event.entity instanceof EntityLivingBase) { - EntityLivingBase living = (EntityLivingBase) event.entity; + if(!(event.entityLiving instanceof EntityPlayer) && event.entityLiving instanceof EntityLivingBase) { if(event.world.provider.dimensionId == 0) { - if(event.entity.height >= 0.85f || event.entity.width >= 0.85f && event.entity.ticksExisted < 20 && !(event.entity instanceof EntityWaterMob) && !living.isChild()) { - event.setCanceled(true); + if(event.entityLiving.height >= 0.85F || event.entityLiving.width >= 0.85F && !(event.entity instanceof EntityWaterMob) && !event.entityLiving.isChild()) { + event.setResult(Result.DENY); } } - if(event.entity instanceof EntityWaterMob && event.entity.ticksExisted < 20) { + if(event.entityLiving instanceof EntityWaterMob) { Random rand = new Random(); - if(rand.nextInt(9) != 0) { - event.setCanceled(true); + if(rand.nextInt(5) != 0) { + event.setResult(Result.DENY); } } }