diff --git a/README.md b/README.md index 3c5b175d0..50254f383 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ See the patches list below. [WindSpigot-0015] Configurable explosion animations and sound [WindSpigot-0016] Configurable weather changes [WindSpigot-0017] Configurable fishing rod speed multiplier +[WindSpigot-0018] Restore attackTicks [PandaSpigot-0115] Break up and make tab spam limits configurable [PandaSpigot-0105] Fix SPIGOT-2622: Only one player receiving the server shutdown message diff --git a/WindSpigot-Server/src/main/java/net/minecraft/server/EntityIronGolem.java b/WindSpigot-Server/src/main/java/net/minecraft/server/EntityIronGolem.java index 7f8e4dfba..22e24f24a 100644 --- a/WindSpigot-Server/src/main/java/net/minecraft/server/EntityIronGolem.java +++ b/WindSpigot-Server/src/main/java/net/minecraft/server/EntityIronGolem.java @@ -123,6 +123,7 @@ public void a(NBTTagCompound nbttagcompound) { @Override public boolean r(Entity entity) { + attackTicks = 20; // WindSpigot this.c = 10; this.world.broadcastEntityEffect(this, (byte) 4); boolean flag = entity.damageEntity(DamageSource.mobAttack(this), 7 + this.random.nextInt(15)); diff --git a/WindSpigot-Server/src/main/java/net/minecraft/server/EntityLiving.java b/WindSpigot-Server/src/main/java/net/minecraft/server/EntityLiving.java index 6b43d7133..f48510a94 100644 --- a/WindSpigot-Server/src/main/java/net/minecraft/server/EntityLiving.java +++ b/WindSpigot-Server/src/main/java/net/minecraft/server/EntityLiving.java @@ -44,6 +44,7 @@ public abstract class EntityLiving extends Entity { public int av; public float aw; public int deathTicks; + public int attackTicks; // WindSpigot - restore attackTicks public float ay; public float az; public float aA; @@ -259,6 +260,12 @@ public void K() { } this.aE = this.aF; + // WindSpigot start + if (attackTicks > 0) { + --attackTicks; + } + // WindSpigot end + if (this.hurtTicks > 0) { --this.hurtTicks; } @@ -412,6 +419,7 @@ public void b(NBTTagCompound nbttagcompound) { nbttagcompound.setShort("HurtTime", (short) this.hurtTicks); nbttagcompound.setInt("HurtByTimestamp", this.hurtTimestamp); nbttagcompound.setShort("DeathTime", (short) this.deathTicks); + nbttagcompound.setShort("AttackTime", (short) attackTicks); // WindSpigot nbttagcompound.setFloat("AbsorptionAmount", this.getAbsorptionHearts()); ItemStack[] aitemstack = this.getEquipment(); int i = aitemstack.length; @@ -499,6 +507,7 @@ public void a(NBTTagCompound nbttagcompound) { this.hurtTicks = nbttagcompound.getShort("HurtTime"); this.deathTicks = nbttagcompound.getShort("DeathTime"); + attackTicks = nbttagcompound.getShort("AttackTime"); // WindSpigot this.hurtTimestamp = nbttagcompound.getInt("HurtByTimestamp"); } @@ -1608,6 +1617,7 @@ public void k(float f) { } public boolean r(Entity entity) { + attackTicks = 20; // WindSpigot this.p(entity); return false; } diff --git a/WindSpigot-Server/src/main/java/net/minecraft/server/EntityMonster.java b/WindSpigot-Server/src/main/java/net/minecraft/server/EntityMonster.java index 77ee5447a..65d44f347 100644 --- a/WindSpigot-Server/src/main/java/net/minecraft/server/EntityMonster.java +++ b/WindSpigot-Server/src/main/java/net/minecraft/server/EntityMonster.java @@ -70,6 +70,7 @@ protected String n(int i) { @Override public boolean r(Entity entity) { + attackTicks = 20; // WindSpigot float f = (float) this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).getValue(); int i = 0; diff --git a/WindSpigot-Server/src/main/java/net/minecraft/server/EntityOcelot.java b/WindSpigot-Server/src/main/java/net/minecraft/server/EntityOcelot.java index d33b20650..6b4558983 100644 --- a/WindSpigot-Server/src/main/java/net/minecraft/server/EntityOcelot.java +++ b/WindSpigot-Server/src/main/java/net/minecraft/server/EntityOcelot.java @@ -110,6 +110,7 @@ protected Item getLoot() { @Override public boolean r(Entity entity) { + attackTicks = 20; // WindSpigot return entity.damageEntity(DamageSource.mobAttack(this), 3.0F); } diff --git a/WindSpigot-Server/src/main/java/net/minecraft/server/EntityRabbit.java b/WindSpigot-Server/src/main/java/net/minecraft/server/EntityRabbit.java index 3d6124b8a..5e5b5b414 100644 --- a/WindSpigot-Server/src/main/java/net/minecraft/server/EntityRabbit.java +++ b/WindSpigot-Server/src/main/java/net/minecraft/server/EntityRabbit.java @@ -229,6 +229,7 @@ protected String bp() { @Override public boolean r(Entity entity) { + attackTicks = 20; // WindSpigot if (this.getRabbitType() == 99) { this.makeSound("mob.attack", 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F); return entity.damageEntity(DamageSource.mobAttack(this), 8.0F); diff --git a/WindSpigot-Server/src/main/java/net/minecraft/server/EntityWolf.java b/WindSpigot-Server/src/main/java/net/minecraft/server/EntityWolf.java index 333e4078f..7a9919384 100644 --- a/WindSpigot-Server/src/main/java/net/minecraft/server/EntityWolf.java +++ b/WindSpigot-Server/src/main/java/net/minecraft/server/EntityWolf.java @@ -241,6 +241,7 @@ public boolean damageEntity(DamageSource damagesource, float f) { @Override public boolean r(Entity entity) { + attackTicks = 20; // WindSpigot boolean flag = entity.damageEntity(DamageSource.mobAttack(this), ((int) this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).getValue())); diff --git a/WindSpigot-Server/src/main/java/org/spigotmc/ActivationRange.java b/WindSpigot-Server/src/main/java/org/spigotmc/ActivationRange.java index fa7b0bebb..cec74eb1c 100644 --- a/WindSpigot-Server/src/main/java/org/spigotmc/ActivationRange.java +++ b/WindSpigot-Server/src/main/java/org/spigotmc/ActivationRange.java @@ -176,8 +176,8 @@ public static boolean checkEntityImmunities(Entity entity) { // special cases. if (entity instanceof EntityLiving) { EntityLiving living = (EntityLiving) entity; - if ( /* TODO: Missed mapping? living.attackTicks > 0 || */ living.hurtTicks > 0 - || living.effects.size() > 0) { + if (living.attackTicks > 0 || living.hurtTicks > 0 + || !living.effects.isEmpty()) { return true; } if (entity instanceof EntityCreature && ((EntityCreature) entity).getGoalTarget() != null) {