mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-25 10:29:41 -05:00
Fixed CraftLivingEntity.damage when the entity is an EntityComplex.
Fixes BUKKIT-589: if you call damage on an instance of EnderDragon, no damage is done. Reason for bug: damage calls Entity.damageEntity. But EntityComplex overrides damageEntity to do nothing. Fix: CraftComplexLiving should call EntityComplex.e instead of Entity.damageEntity. e is the method that actually does damage to an instance of EntityComplex.
This commit is contained in:
1 parent
872dad5540
commit
e92bdab57a
2 files changed
+46
-1
No files matched your search
@@ -0,0 +1,26 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
public class EntityComplex extends EntityLiving {
|
||||
|
||||
protected int t = 100;
|
||||
|
||||
public EntityComplex(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
public int getMaxHealth() {
|
||||
return this.t;
|
||||
}
|
||||
|
||||
public boolean a(EntityComplexPart entitycomplexpart, DamageSource damagesource, int i) {
|
||||
return this.damageEntity(damagesource, i);
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, int i) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean e(DamageSource damagesource, int i) { // CraftBukkit - protected -> public
|
||||
return super.damageEntity(damagesource, i);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user