3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 04:20:08 +01:00

SPIGOT-3324: Improve tameable damage handling

Dieser Commit ist enthalten in:
md_5 2017-06-24 10:01:46 +10:00
Ursprung 763827668e
Commit 753a8e700d
4 geänderte Dateien mit 29 neuen und 28 gelöschten Zeilen

Datei anzeigen

@ -309,10 +309,10 @@
} }
+ // CraftBukkit start + // CraftBukkit start
+ if(this instanceof EntityAnimal){ + if (this instanceof EntityAnimal) {
+ ((EntityAnimal)this).resetLove(); + ((EntityAnimal) this).resetLove();
+ if(this instanceof EntityTameableAnimal){ + if (this instanceof EntityTameableAnimal) {
+ ((EntityTameableAnimal)this).getGoalSit().setSitting(false); + ((EntityTameableAnimal) this).getGoalSit().setSitting(false);
+ } + }
+ } + }
+ // CraftBukkit end + // CraftBukkit end

Datei anzeigen

@ -9,25 +9,17 @@
} }
protected void initAttributes() { protected void initAttributes() {
@@ -103,6 +103,9 @@ @@ -108,7 +108,8 @@
return entity.damageEntity(DamageSource.mobAttack(this), 3.0F);
}
+ /* CraftBukkit start
+ // Function disabled as it has no special function anymore after
+ // setSitting is disabled.
public boolean damageEntity(DamageSource damagesource, float f) {
if (this.isInvulnerable(damagesource)) {
return false; return false;
@@ -114,6 +117,7 @@ } else {
return super.damageEntity(damagesource, f); if (this.goalSit != null) {
- this.goalSit.setSitting(false);
+ // CraftBukkit - moved into EntityLiving.d(DamageSource, float)
+ // this.goalSit.setSitting(false);
} }
}
+ // CraftBukkit end */
@Nullable return super.damageEntity(damagesource, f);
protected MinecraftKey J() { @@ -133,7 +134,8 @@
@@ -133,7 +137,8 @@
} }
if (!this.world.isClientSide) { if (!this.world.isClientSide) {
@ -37,7 +29,7 @@
this.c(entityhuman); this.c(entityhuman);
this.setCatType(1 + this.world.random.nextInt(3)); this.setCatType(1 + this.world.random.nextInt(3));
this.p(true); this.p(true);
@@ -237,7 +242,7 @@ @@ -237,7 +239,7 @@
entityocelot.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F); entityocelot.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F);
entityocelot.setAgeRaw(-24000); entityocelot.setAgeRaw(-24000);

Datei anzeigen

@ -27,7 +27,17 @@
this.c(entityhuman); this.c(entityhuman);
this.p(true); this.p(true);
this.world.broadcastEntityEffect(this, (byte) 7); this.world.broadcastEntityEffect(this, (byte) 7);
@@ -316,33 +316,35 @@ @@ -276,7 +276,8 @@
return false;
} else {
if (this.goalSit != null) {
- this.goalSit.setSitting(false);
+ // CraftBukkit - moved into EntityLiving.d(DamageSource, float)
+ // this.goalSit.setSitting(false);
}
return super.damageEntity(damagesource, f);
@@ -316,33 +317,35 @@
} }
static { static {

Datei anzeigen

@ -35,20 +35,19 @@
public void setGoalTarget(@Nullable EntityLiving entityliving) { public void setGoalTarget(@Nullable EntityLiving entityliving) {
super.setGoalTarget(entityliving); super.setGoalTarget(entityliving);
if (entityliving == null) { if (entityliving == null) {
@@ -200,9 +221,10 @@ @@ -200,9 +221,9 @@
Entity entity = damagesource.getEntity(); Entity entity = damagesource.getEntity();
if (this.goalSit != null) { if (this.goalSit != null) {
- this.goalSit.setSitting(false); - this.goalSit.setSitting(false);
+ // CraftBukkit - moved into EntityLiving.d(DamageSource, float) + // CraftBukkit - moved into EntityLiving.d(DamageSource, float)
+ // PAIL : checkme
+ // this.goalSit.setSitting(false); + // this.goalSit.setSitting(false);
} }
- -
if (entity != null && !(entity instanceof EntityHuman) && !(entity instanceof EntityArrow)) { if (entity != null && !(entity instanceof EntityHuman) && !(entity instanceof EntityArrow)) {
f = (f + 1.0F) / 2.0F; f = (f + 1.0F) / 2.0F;
} }
@@ -245,7 +267,7 @@ @@ -245,7 +266,7 @@
itemstack.subtract(1); itemstack.subtract(1);
} }
@ -57,7 +56,7 @@
return true; return true;
} }
} else if (itemstack.getItem() == Items.DYE) { } else if (itemstack.getItem() == Items.DYE) {
@@ -266,7 +288,7 @@ @@ -266,7 +287,7 @@
this.goalSit.setSitting(!this.isSitting()); this.goalSit.setSitting(!this.isSitting());
this.bd = false; this.bd = false;
this.navigation.p(); this.navigation.p();
@ -66,7 +65,7 @@
} }
} else if (itemstack.getItem() == Items.BONE && !this.isAngry()) { } else if (itemstack.getItem() == Items.BONE && !this.isAngry()) {
if (!entityhuman.abilities.canInstantlyBuild) { if (!entityhuman.abilities.canInstantlyBuild) {
@@ -274,12 +296,13 @@ @@ -274,12 +295,13 @@
} }
if (!this.world.isClientSide) { if (!this.world.isClientSide) {