mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 11:44:19 +01:00
Treat ComplexParts as proxies for setLastDamageCause. Fixes BUKKIT-1821
By: feildmaster <admin@feildmaster.com>
This commit is contained in:
parent
d96b0ca73f
commit
fdbd4efbd6
1 changed files with 11 additions and 0 deletions
|
@ -5,6 +5,7 @@ import org.bukkit.craftbukkit.CraftServer;
|
||||||
import org.bukkit.entity.ComplexEntityPart;
|
import org.bukkit.entity.ComplexEntityPart;
|
||||||
import org.bukkit.entity.ComplexLivingEntity;
|
import org.bukkit.entity.ComplexLivingEntity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
|
|
||||||
public class CraftComplexPart extends CraftEntity implements ComplexEntityPart {
|
public class CraftComplexPart extends CraftEntity implements ComplexEntityPart {
|
||||||
public CraftComplexPart(CraftServer server, EntityComplexPart entity) {
|
public CraftComplexPart(CraftServer server, EntityComplexPart entity) {
|
||||||
|
@ -15,6 +16,16 @@ public class CraftComplexPart extends CraftEntity implements ComplexEntityPart {
|
||||||
return (ComplexLivingEntity) getHandle().owner.getBukkitEntity();
|
return (ComplexLivingEntity) getHandle().owner.getBukkitEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setLastDamageCause(EntityDamageEvent cause) {
|
||||||
|
getParent().setLastDamageCause(cause);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EntityDamageEvent getLastDamageCause() {
|
||||||
|
return getParent().getLastDamageCause();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EntityComplexPart getHandle() {
|
public EntityComplexPart getHandle() {
|
||||||
return (EntityComplexPart) entity;
|
return (EntityComplexPart) entity;
|
||||||
|
|
Loading…
Reference in a new issue