Archiviert
13
0

SPIGOT-2034: Rework damage again, this time for snowballs.

Dieser Commit ist enthalten in:
md_5 2016-03-26 14:10:29 +11:00
Ursprung 9554894553
Commit 6bf25cde7e

Datei anzeigen

@ -365,7 +365,7 @@
i = (this.getEffect(MobEffects.RESISTANCE).getAmplifier() + 1) * 5; i = (this.getEffect(MobEffects.RESISTANCE).getAmplifier() + 1) * 5;
int j = 25 - i; int j = 25 - i;
float f1 = f * (float) j; float f1 = f * (float) j;
@@ -974,22 +1122,126 @@ @@ -974,22 +1122,127 @@
} }
} }
@ -470,6 +470,9 @@
+ if (damagesource.i() instanceof EntityLiving) {// PAIL: rename + if (damagesource.i() instanceof EntityLiving) {// PAIL: rename
+ ((EntityLiving) damagesource.i()).a(EntityLiving.this, 0.5F, EntityLiving.this.locX - damagesource.i().locX, EntityLiving.this.locZ - damagesource.i().locZ); + ((EntityLiving) damagesource.i()).a(EntityLiving.this, 0.5F, EntityLiving.this.locX - damagesource.i().locX, EntityLiving.this.locZ - damagesource.i().locZ);
+ } + }
+ if (f <= 0) {
+ return false;
+ }
+ } + }
+ +
+ absorptionModifier = (float) -event.getDamage(DamageModifier.ABSORPTION); + absorptionModifier = (float) -event.getDamage(DamageModifier.ABSORPTION);
@ -493,16 +496,14 @@
+ this.setAbsorptionHearts(this.getAbsorptionHearts() - f); + this.setAbsorptionHearts(this.getAbsorptionHearts() - f);
+ } + }
+ // CraftBukkit end + // CraftBukkit end
+ return true;
+ } else {
+ return false;
} }
+ return true;
} }
+ return false; // CraftBukkit + return false; // CraftBukkit
} }
public CombatTracker getCombatTracker() { public CombatTracker getCombatTracker() {
@@ -1055,6 +1307,7 @@ @@ -1055,6 +1308,7 @@
public AttributeMapBase getAttributeMap() { public AttributeMapBase getAttributeMap() {
if (this.bp == null) { if (this.bp == null) {
this.bp = new AttributeMapServer(); this.bp = new AttributeMapServer();
@ -510,7 +511,7 @@
} }
return this.bp; return this.bp;
@@ -1329,6 +1582,7 @@ @@ -1329,6 +1583,7 @@
} }
if (this.onGround && !this.world.isClientSide) { if (this.onGround && !this.world.isClientSide) {
@ -518,7 +519,7 @@
this.setFlag(7, false); this.setFlag(7, false);
} }
} else { } else {
@@ -1689,6 +1943,7 @@ @@ -1689,6 +1944,7 @@
} }
if (!this.world.isClientSide) { if (!this.world.isClientSide) {
@ -526,7 +527,7 @@
this.setFlag(7, flag); this.setFlag(7, flag);
} }
@@ -1702,6 +1957,13 @@ @@ -1702,6 +1958,13 @@
if (!list.isEmpty()) { if (!list.isEmpty()) {
for (int i = 0; i < list.size(); ++i) { for (int i = 0; i < list.size(); ++i) {
Entity entity = (Entity) list.get(i); Entity entity = (Entity) list.get(i);
@ -540,7 +541,7 @@
this.C(entity); this.C(entity);
} }
@@ -1918,7 +2180,22 @@ @@ -1918,7 +2181,22 @@
protected void v() { protected void v() {
if (this.bm != null && this.cs()) { if (this.bm != null && this.cs()) {
this.a(this.bm, 16); this.a(this.bm, 16);