From f2978f54ee21691f46c9a78ffa916af203254263 Mon Sep 17 00:00:00 2001 From: KryptonCaptain Date: Wed, 24 Jan 2018 15:48:27 +1100 Subject: [PATCH] Fix spawn weightings Override vanilla spawn weight to correctly integrate biome specific weights for skeleton/zombies --- .../etfuturum/core/proxy/CommonProxy.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/main/java/ganymedes01/etfuturum/core/proxy/CommonProxy.java b/src/main/java/ganymedes01/etfuturum/core/proxy/CommonProxy.java index 753988386..5559e0267 100644 --- a/src/main/java/ganymedes01/etfuturum/core/proxy/CommonProxy.java +++ b/src/main/java/ganymedes01/etfuturum/core/proxy/CommonProxy.java @@ -36,6 +36,8 @@ import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.monster.EntityEnderman; import net.minecraft.entity.monster.EntityMagmaCube; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.entity.monster.EntityZombie; import net.minecraft.entity.passive.EntityPig; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -97,15 +99,20 @@ public void registerEntities() { if (ConfigurationHandler.enableHusk) { ModEntityList.registerEntity(EntityHusk.class, "husk", id++, EtFuturum.instance, 80, 3, true, 7828833, 14735761); + //change spawn weights + EntityRegistry.removeSpawn(EntityZombie.class, EnumCreatureType.monster, new BiomeGenBase[] { BiomeGenBase.desert, BiomeGenBase.desertHills }); - EntityRegistry.addSpawn(EntityHusk.class, 80, 4, 4, EnumCreatureType.monster, new BiomeGenBase[] { BiomeGenBase.desert }); - EntityRegistry.addSpawn(EntityHusk.class, 80, 4, 4, EnumCreatureType.monster, new BiomeGenBase[] { BiomeGenBase.desertHills }); + EntityRegistry.addSpawn(EntityZombie.class, 19, 4, 4, EnumCreatureType.monster, new BiomeGenBase[] { BiomeGenBase.desert, BiomeGenBase.desertHills }); + EntityRegistry.addSpawn(EntityZombieVillager.class, 1, 1, 1, EnumCreatureType.monster, new BiomeGenBase[] { BiomeGenBase.desert, BiomeGenBase.desertHills }); + EntityRegistry.addSpawn(EntityHusk.class, 80, 4, 4, EnumCreatureType.monster, new BiomeGenBase[] { BiomeGenBase.desert, BiomeGenBase.desertHills }); } if (ConfigurationHandler.enableStray) { ModEntityList.registerEntity(EntityStray.class, "stray", id++, EtFuturum.instance, 80, 3, true, 6387576, 15133418); + //change spawn weights + EntityRegistry.removeSpawn(EntitySkeleton.class, EnumCreatureType.monster, new BiomeGenBase[] { BiomeGenBase.icePlains, BiomeGenBase.iceMountains }); - EntityRegistry.addSpawn(EntityStray.class, 80, 4, 4, EnumCreatureType.monster, new BiomeGenBase[] { BiomeGenBase.icePlains }); - EntityRegistry.addSpawn(EntityStray.class, 80, 4, 4, EnumCreatureType.monster, new BiomeGenBase[] { BiomeGenBase.iceMountains }); + EntityRegistry.addSpawn(EntitySkeleton.class, 20, 4, 4, EnumCreatureType.monster, new BiomeGenBase[] { BiomeGenBase.icePlains, BiomeGenBase.iceMountains }); + EntityRegistry.addSpawn(EntityStray.class, 80, 4, 4, EnumCreatureType.monster, new BiomeGenBase[] { BiomeGenBase.icePlains, BiomeGenBase.iceMountains }); } if (ConfigurationHandler.enableNetherEndermen) { EntityRegistry.addSpawn(EntityEnderman.class, 1, 4, 4, EnumCreatureType.monster, new BiomeGenBase[] { BiomeGenBase.hell }); @@ -128,7 +135,8 @@ public void registerEntities() { if (ConfigurationHandler.enableShearableGolems) ModEntityList.registerEntity(EntityNewSnowGolem.class, "snow_golem", id++, EtFuturum.instance, 80, 3, true); - //make magmas slightly more common, hopefully. not sure if this will overwrite existing or add to it. only small dif either way + //make magmas slightly more common, hopefully. + EntityRegistry.removeSpawn(EntityMagmaCube.class, EnumCreatureType.monster, new BiomeGenBase[] { BiomeGenBase.hell }); EntityRegistry.addSpawn(EntityMagmaCube.class, 2, 4, 4, EnumCreatureType.monster, new BiomeGenBase[] { BiomeGenBase.hell }); }