From 5f5b509c7a710502d187769cfe006f6ab8c68cab Mon Sep 17 00:00:00 2001 From: Christian Date: Sun, 13 Oct 2013 11:39:23 -0400 Subject: [PATCH] Allow configuration of the zombie additional summoning mechanic. The vanilla mechanic is a little borked at times. --- .../common/ForgeDummyContainer.java | 6 +++++- .../entity/monster/EntityZombie.java.patch | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch diff --git a/common/net/minecraftforge/common/ForgeDummyContainer.java b/common/net/minecraftforge/common/ForgeDummyContainer.java index 881f533741..86e328aaf2 100644 --- a/common/net/minecraftforge/common/ForgeDummyContainer.java +++ b/common/net/minecraftforge/common/ForgeDummyContainer.java @@ -51,7 +51,7 @@ public class ForgeDummyContainer extends DummyModContainer implements WorldAcces public static boolean disableStitchedFileSaving = false; public static boolean forceDuplicateFluidBlockCrash = true; public static boolean fullBoundingBoxLadders = false; - + public static double zombieSummonBaseChance = 0.1; public static int[] blendRanges = { 20, 15, 10, 5 }; public ForgeDummyContainer() @@ -145,6 +145,10 @@ public class ForgeDummyContainer extends DummyModContainer implements WorldAcces prop.comment = "Control the range of sky blending for colored skies in biomes."; blendRanges = prop.getIntList(); + prop = config.get(Configuration.CATEGORY_GENERAL, "zombieBaseSummonChance", 0.1); + prop.comment = "Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic."; + zombieSummonBaseChance = prop.getDouble(0.1); + if (config.hasChanged()) { config.save(); diff --git a/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch new file mode 100644 index 0000000000..69f39ee11c --- /dev/null +++ b/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch @@ -0,0 +1,19 @@ +--- ../src_base/minecraft/net/minecraft/entity/monster/EntityZombie.java ++++ ../src_work/minecraft/net/minecraft/entity/monster/EntityZombie.java +@@ -34,6 +34,7 @@ + import net.minecraft.util.DamageSource; + import net.minecraft.util.MathHelper; + import net.minecraft.world.World; ++import net.minecraftforge.common.ForgeDummyContainer; + + public class EntityZombie extends EntityMob + { +@@ -70,7 +71,7 @@ + this.getEntityAttribute(SharedMonsterAttributes.followRange).setAttribute(40.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.23000000417232513D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(3.0D); +- this.getAttributeMap().func_111150_b(field_110186_bp).setAttribute(this.rand.nextDouble() * 0.10000000149011612D); ++ this.getAttributeMap().func_111150_b(field_110186_bp).setAttribute(this.rand.nextDouble() * ForgeDummyContainer.zombieSummonBaseChance); + } + + protected void entityInit()