Skip to content
Merged
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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");
}

Expand Down Expand Up @@ -1608,6 +1617,7 @@ public void k(float f) {
}

public boolean r(Entity entity) {
attackTicks = 20; // WindSpigot
this.p(entity);
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ protected Item getLoot() {

@Override
public boolean r(Entity entity) {
attackTicks = 20; // WindSpigot
return entity.damageEntity(DamageSource.mobAttack(this), 3.0F);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down