From c25ddf063a808e3adb749e22017661f403c5fb7e Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 17 Nov 2016 12:41:03 +1100 Subject: Update to Minecraft 1.11 --- nms-patches/EntityZombie.patch | 70 +++++++++++++----------------------------- 1 file changed, 22 insertions(+), 48 deletions(-) (limited to 'nms-patches/EntityZombie.patch') diff --git a/nms-patches/EntityZombie.patch b/nms-patches/EntityZombie.patch index c4348eb1..2acddcba 100644 --- a/nms-patches/EntityZombie.patch +++ b/nms-patches/EntityZombie.patch @@ -14,15 +14,7 @@ public class EntityZombie extends EntityMonster { protected static final IAttribute a = (new AttributeRanged((IAttribute) null, "zombie.spawnReinforcements", 0.0D, 0.0D, 1.0D)).a("Spawn Reinforcements Chance"); -@@ -19,6 +26,7 @@ - private boolean bD; - private float bE = -1.0F; - private float bF; -+ private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field - - public EntityZombie(World world) { - super(world); -@@ -153,7 +161,14 @@ +@@ -133,7 +140,14 @@ } if (flag) { @@ -38,8 +30,8 @@ } } } -@@ -183,8 +198,8 @@ - if (this.world.getType(new BlockPosition(i1, j1 - 1, k1)).q() && this.world.getLightLevel(new BlockPosition(i1, j1, k1)) < 10) { +@@ -167,8 +181,8 @@ + if (this.world.getType(new BlockPosition(i1, j1 - 1, k1)).r() && this.world.getLightLevel(new BlockPosition(i1, j1, k1)) < 10) { entityzombie.setPosition((double) i1, (double) j1, (double) k1); if (!this.world.isPlayerNearby((double) i1, (double) j1, (double) k1, 7.0D) && this.world.a(entityzombie.getBoundingBox(), (Entity) entityzombie) && this.world.getCubes(entityzombie, entityzombie.getBoundingBox()).isEmpty() && !this.world.containsLiquid(entityzombie.getBoundingBox())) { - this.world.addEntity(entityzombie); @@ -49,23 +41,11 @@ entityzombie.prepare(this.world.D(new BlockPosition(entityzombie)), (GroupDataEntity) null); this.getAttributeInstance(EntityZombie.a).b(new AttributeModifier("Zombie reinforcement caller charge", -0.05000000074505806D, 0)); entityzombie.getAttributeInstance(EntityZombie.a).b(new AttributeModifier("Zombie reinforcement callee charge", -0.05000000074505806D, 0)); -@@ -203,6 +218,11 @@ - public void m() { - if (!this.world.isClientSide && this.isConverting()) { - int i = this.getConversionTime(); -+ // CraftBukkit start - Use wall time instead of ticks for villager conversion -+ int elapsedTicks = MinecraftServer.currentTick - this.lastTick; -+ this.lastTick = MinecraftServer.currentTick; -+ i *= elapsedTicks; -+ // CraftBukkit end - - this.bC -= i; - if (this.bC <= 0) { -@@ -221,7 +241,14 @@ +@@ -191,7 +205,14 @@ + float f = this.world.D(new BlockPosition(this)).b(); - if (this.getItemInMainHand() == null) { - if (this.isBurning() && this.random.nextFloat() < f * 0.3F) { -- entity.setOnFire(2 * (int) f); + if (this.getItemInMainHand().isEmpty() && this.isBurning() && this.random.nextFloat() < f * 0.3F) { +- entity.setOnFire(2 * (int) f); + // CraftBukkit start + EntityCombustByEntityEvent event = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), 2 * (int) f); // PAIL: fixme + this.world.getServer().getPluginManager().callEvent(event); @@ -74,19 +54,19 @@ + entity.setOnFire(event.getDuration()); + } + // CraftBukkit end - } + } + } - if (this.getVillagerType() == EnumZombieType.HUSK && entity instanceof EntityLiving) { -@@ -335,7 +362,7 @@ - entityzombie.setCustomNameVisible(entityvillager.getCustomNameVisible()); +@@ -284,7 +305,7 @@ + entityzombievillager.setCustomNameVisible(entityvillager.getCustomNameVisible()); } -- this.world.addEntity(entityzombie); -+ this.world.addEntity(entityzombie, CreatureSpawnEvent.SpawnReason.INFECTION); // CraftBukkit - add SpawnReason - this.world.a((EntityHuman) null, 1026, new BlockPosition((int) this.locX, (int) this.locY, (int) this.locZ), 0); +- this.world.addEntity(entityzombievillager); ++ this.world.addEntity(entityzombievillager, CreatureSpawnEvent.SpawnReason.INFECTION); // CraftBukkit - add SpawnReason + this.world.a((EntityHuman) null, 1026, new BlockPosition(this), 0); } -@@ -396,7 +423,7 @@ +@@ -334,7 +355,7 @@ entitychicken1.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F); entitychicken1.prepare(difficultydamagescaler, (GroupDataEntity) null); entitychicken1.p(true); @@ -95,24 +75,18 @@ this.startRiding(entitychicken1); } } -@@ -480,7 +507,7 @@ - entityvillager.setCustomNameVisible(this.getCustomNameVisible()); - } - -- this.world.addEntity(entityvillager); -+ this.world.addEntity(entityvillager, CreatureSpawnEvent.SpawnReason.CURED); // CraftBukkit - add SpawnReason - entityvillager.addEffect(new MobEffect(MobEffects.CONFUSION, 200, 0)); - this.world.a((EntityHuman) null, 1027, new BlockPosition((int) this.locX, (int) this.locY, (int) this.locZ), 0); - } -@@ -536,11 +563,12 @@ +@@ -392,7 +413,7 @@ } public void die(DamageSource damagesource) { - super.die(damagesource); + // super.die(damagesource); // CraftBukkit - if (damagesource.getEntity() instanceof EntityCreeper && !(this instanceof EntityPigZombie) && ((EntityCreeper) damagesource.getEntity()).isPowered() && ((EntityCreeper) damagesource.getEntity()).canCauseHeadDrop()) { - ((EntityCreeper) damagesource.getEntity()).setCausedHeadDrop(); - this.a(new ItemStack(Items.SKULL, 1, 2), 0.0F); + if (damagesource.getEntity() instanceof EntityCreeper) { + EntityCreeper entitycreeper = (EntityCreeper) damagesource.getEntity(); + +@@ -405,6 +426,7 @@ + } + } } + super.die(damagesource); // CraftBukkit - moved from above -- cgit v1.2.3