13
0
geforkt von Mirrors/Paper

Fix accidentally renamed internal damage method

By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2024-02-11 09:58:07 +11:00
Ursprung 49b5ee78bb
Commit 219db06f85
2 geänderte Dateien mit 10 neuen und 10 gelöschten Zeilen

Datei anzeigen

@ -381,7 +381,7 @@
float f2 = 0.0F; float f2 = 0.0F;
- if (f > 0.0F && this.isDamageSourceBlocked(damagesource)) { - if (f > 0.0F && this.isDamageSourceBlocked(damagesource)) {
+ // CraftBukkit - Moved into damageEntity0(DamageSource, float) + // CraftBukkit - Moved into actuallyHurt(DamageSource, float)
+ if (false && f > 0.0F && this.isDamageSourceBlocked(damagesource)) { + if (false && f > 0.0F && this.isDamageSourceBlocked(damagesource)) {
this.hurtCurrentlyUsedShield(f); this.hurtCurrentlyUsedShield(f);
f2 = f; f2 = f;
@ -398,7 +398,7 @@
- this.actuallyHurt(damagesource, f - this.lastHurt); - this.actuallyHurt(damagesource, f - this.lastHurt);
+ // CraftBukkit start + // CraftBukkit start
+ if (!this.damageEntity0(damagesource, f - this.lastHurt)) { + if (!this.actuallyHurt(damagesource, f - this.lastHurt)) {
+ return false; + return false;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
@ -406,21 +406,21 @@
flag1 = false; flag1 = false;
} else { } else {
+ // CraftBukkit start + // CraftBukkit start
+ if (!this.damageEntity0(damagesource, f)) { + if (!this.actuallyHurt(damagesource, f)) {
+ return false; + return false;
+ } + }
this.lastHurt = f; this.lastHurt = f;
- this.invulnerableTime = 20; - this.invulnerableTime = 20;
- this.actuallyHurt(damagesource, f); - this.actuallyHurt(damagesource, f);
+ this.invulnerableTime = this.invulnerableDuration; // CraftBukkit - restore use of maxNoDamageTicks + this.invulnerableTime = this.invulnerableDuration; // CraftBukkit - restore use of maxNoDamageTicks
+ // this.damageEntity0(damagesource, f); + // this.actuallyHurt(damagesource, f);
+ // CraftBukkit end + // CraftBukkit end
this.hurtDuration = 10; this.hurtDuration = 10;
this.hurtTime = this.hurtDuration; this.hurtTime = this.hurtDuration;
} }
- if (damagesource.is(DamageTypeTags.DAMAGES_HELMET) && !this.getItemBySlot(EnumItemSlot.HEAD).isEmpty()) { - if (damagesource.is(DamageTypeTags.DAMAGES_HELMET) && !this.getItemBySlot(EnumItemSlot.HEAD).isEmpty()) {
+ // CraftBukkit - Moved into damageEntity0(DamageSource, float) + // CraftBukkit - Moved into actuallyHurt(DamageSource, float)
+ if (false && damagesource.is(DamageTypeTags.DAMAGES_HELMET) && !this.getItemBySlot(EnumItemSlot.HEAD).isEmpty()) { + if (false && damagesource.is(DamageTypeTags.DAMAGES_HELMET) && !this.getItemBySlot(EnumItemSlot.HEAD).isEmpty()) {
this.hurtHelmet(damagesource, f); this.hurtHelmet(damagesource, f);
f *= 0.75F; f *= 0.75F;
@ -650,7 +650,7 @@
protected float getDamageAfterArmorAbsorb(DamageSource damagesource, float f) { protected float getDamageAfterArmorAbsorb(DamageSource damagesource, float f) {
if (!damagesource.is(DamageTypeTags.BYPASSES_ARMOR)) { if (!damagesource.is(DamageTypeTags.BYPASSES_ARMOR)) {
- this.hurtArmor(damagesource, f); - this.hurtArmor(damagesource, f);
+ // this.hurtArmor(damagesource, f); // CraftBukkit - Moved into damageEntity0(DamageSource, float) + // this.hurtArmor(damagesource, f); // CraftBukkit - Moved into actuallyHurt(DamageSource, float)
f = CombatMath.getDamageAfterAbsorb(f, (float) this.getArmorValue(), (float) this.getAttributeValue(GenericAttributes.ARMOR_TOUGHNESS)); f = CombatMath.getDamageAfterAbsorb(f, (float) this.getArmorValue(), (float) this.getAttributeValue(GenericAttributes.ARMOR_TOUGHNESS));
} }
@ -659,7 +659,7 @@
int i; int i;
- if (this.hasEffect(MobEffects.DAMAGE_RESISTANCE) && !damagesource.is(DamageTypeTags.BYPASSES_RESISTANCE)) { - if (this.hasEffect(MobEffects.DAMAGE_RESISTANCE) && !damagesource.is(DamageTypeTags.BYPASSES_RESISTANCE)) {
+ // CraftBukkit - Moved to damageEntity0(DamageSource, float) + // CraftBukkit - Moved to actuallyHurt(DamageSource, float)
+ if (false && this.hasEffect(MobEffects.DAMAGE_RESISTANCE) && !damagesource.is(DamageTypeTags.BYPASSES_RESISTANCE)) { + if (false && this.hasEffect(MobEffects.DAMAGE_RESISTANCE) && !damagesource.is(DamageTypeTags.BYPASSES_RESISTANCE)) {
i = (this.getEffect(MobEffects.DAMAGE_RESISTANCE).getAmplifier() + 1) * 5; i = (this.getEffect(MobEffects.DAMAGE_RESISTANCE).getAmplifier() + 1) * 5;
int j = 25 - i; int j = 25 - i;
@ -674,7 +674,7 @@
- f = this.getDamageAfterMagicAbsorb(damagesource, f); - f = this.getDamageAfterMagicAbsorb(damagesource, f);
- float f1 = f; - float f1 = f;
+ // CraftBukkit start + // CraftBukkit start
+ protected boolean damageEntity0(final DamageSource damagesource, float f) { // void -> boolean, add final + protected boolean actuallyHurt(final DamageSource damagesource, float f) { // void -> boolean, add final
+ if (!this.isInvulnerableTo(damagesource)) { + if (!this.isInvulnerableTo(damagesource)) {
+ final boolean human = this instanceof EntityHuman; + final boolean human = this instanceof EntityHuman;
+ float originalDamage = f; + float originalDamage = f;

Datei anzeigen

@ -234,9 +234,9 @@
+ // CraftBukkit start + // CraftBukkit start
@Override @Override
- protected void actuallyHurt(DamageSource damagesource, float f) { - protected void actuallyHurt(DamageSource damagesource, float f) {
+ protected boolean damageEntity0(DamageSource damagesource, float f) { // void -> boolean + protected boolean actuallyHurt(DamageSource damagesource, float f) { // void -> boolean
+ if (true) { + if (true) {
+ return super.damageEntity0(damagesource, f); + return super.actuallyHurt(damagesource, f);
+ } + }
+ // CraftBukkit end + // CraftBukkit end
if (!this.isInvulnerableTo(damagesource)) { if (!this.isInvulnerableTo(damagesource)) {