ForgePatch/patches/minecraft/net/minecraft/entity/monster/ZombieEntity.java.patch

48 lines
4.0 KiB
Diff
Raw Normal View History

2019-05-23 23:02:15 +00:00
--- a/net/minecraft/entity/monster/ZombieEntity.java
+++ b/net/minecraft/entity/monster/ZombieEntity.java
@@ -107,7 +107,7 @@
2019-05-23 23:02:15 +00:00
this.func_110148_a(SharedMonsterAttributes.field_111263_d).func_111128_a((double)0.23F);
this.func_110148_a(SharedMonsterAttributes.field_111264_e).func_111128_a(3.0D);
this.func_110148_a(SharedMonsterAttributes.field_188791_g).func_111128_a(2.0D);
- this.func_110140_aT().func_111150_b(field_110186_bp).func_111128_a(this.field_70146_Z.nextDouble() * (double)0.1F);
+ this.func_110140_aT().func_111150_b(field_110186_bp).func_111128_a(this.field_70146_Z.nextDouble() * net.minecraftforge.common.ForgeConfig.SERVER.zombieBaseSummonChance.get());
}
protected void func_70088_a() {
@@ -281,12 +281,16 @@
2019-05-23 23:02:15 +00:00
livingentity = (LivingEntity)p_70097_1_.func_76346_g();
}
2019-06-25 02:01:03 +00:00
- if (livingentity != null && this.field_70170_p.func_175659_aa() == Difficulty.HARD && (double)this.field_70146_Z.nextFloat() < this.func_110148_a(field_110186_bp).func_111126_e() && this.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223601_d)) {
2019-05-23 23:02:15 +00:00
int i = MathHelper.func_76128_c(this.field_70165_t);
int j = MathHelper.func_76128_c(this.field_70163_u);
int k = MathHelper.func_76128_c(this.field_70161_v);
- ZombieEntity zombieentity = new ZombieEntity(this.field_70170_p);
+ net.minecraftforge.event.entity.living.ZombieEvent.SummonAidEvent event = net.minecraftforge.event.ForgeEventFactory.fireZombieSummonAid(this, field_70170_p, i, j, k, livingentity, this.func_110148_a(field_110186_bp).func_111126_e());
+ if (event.getResult() == net.minecraftforge.eventbus.api.Event.Result.DENY) return true;
+ if (event.getResult() == net.minecraftforge.eventbus.api.Event.Result.ALLOW ||
2019-06-25 02:01:03 +00:00
+ livingentity != null && this.field_70170_p.func_175659_aa() == Difficulty.HARD && (double)this.field_70146_Z.nextFloat() < this.func_110148_a(field_110186_bp).func_111126_e() && net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_70170_p, this)) {
+ ZombieEntity zombieentity = event.getCustomSummonedAid() != null && event.getResult() == net.minecraftforge.eventbus.api.Event.Result.ALLOW ? event.getCustomSummonedAid() : EntityType.field_200725_aD.func_200721_a(this.field_70170_p);
2019-05-23 23:02:15 +00:00
+
for(int l = 0; l < 50; ++l) {
int i1 = i + MathHelper.func_76136_a(this.field_70146_Z, 7, 40) * MathHelper.func_76136_a(this.field_70146_Z, -1, 1);
int j1 = j + MathHelper.func_76136_a(this.field_70146_Z, 7, 40) * MathHelper.func_76136_a(this.field_70146_Z, -1, 1);
@@ -296,6 +300,7 @@
2019-05-23 23:02:15 +00:00
zombieentity.func_70107_b((double)i1, (double)j1, (double)k1);
if (!this.field_70170_p.func_217358_a((double)i1, (double)j1, (double)k1, 7.0D) && this.field_70170_p.func_217346_i(zombieentity) && this.field_70170_p.func_217345_j(zombieentity) && !this.field_70170_p.func_72953_d(zombieentity.func_174813_aQ())) {
this.field_70170_p.func_217376_c(zombieentity);
+ if (livingentity != null)
zombieentity.func_70624_b(livingentity);
zombieentity.func_213386_a(this.field_70170_p, this.field_70170_p.func_175649_E(new BlockPos(zombieentity)), SpawnReason.REINFORCEMENT, (ILivingEntityData)null, (CompoundNBT)null);
this.func_110148_a(field_110186_bp).func_111121_a(new AttributeModifier("Zombie reinforcement caller charge", (double)-0.05F, AttributeModifier.Operation.ADDITION));
@@ -429,7 +434,7 @@
2019-05-23 23:02:15 +00:00
float f = p_213386_2_.func_180170_c();
this.func_98053_h(this.field_70146_Z.nextFloat() < 0.55F * f);
if (p_213386_4_ == null) {
- p_213386_4_ = new ZombieEntity.GroupData(p_213386_1_.func_201674_k().nextFloat() < 0.05F);
+ p_213386_4_ = new ZombieEntity.GroupData(p_213386_1_.func_201674_k().nextFloat() < net.minecraftforge.common.ForgeConfig.SERVER.zombieBabyChance.get());
}
if (p_213386_4_ instanceof ZombieEntity.GroupData) {