this either fixes post impact mob spawning or destroys everything

This commit is contained in:
Boblet 2023-11-02 14:52:04 +01:00
parent ba61cc42a8
commit 40626b5cef
2 changed files with 11 additions and 12 deletions

View File

@ -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
* 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

View File

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