@@ -22,10 +22,10 @@
|
||||
Logger logger;
|
||||
|
||||
if (nbttagcompound.contains("attack")) {
|
||||
@@ -143,12 +149,19 @@
|
||||
@@ -142,9 +148,16 @@
|
||||
@Override
|
||||
public boolean skipAttackInteraction(Entity entity) {
|
||||
if (entity instanceof EntityHuman) {
|
||||
EntityHuman entityhuman = (EntityHuman) entity;
|
||||
if (entity instanceof EntityHuman entityhuman) {
|
||||
+ // CraftBukkit start
|
||||
+ DamageSource source = entityhuman.damageSources().playerAttack(entityhuman);
|
||||
+ EntityDamageEvent event = CraftEventFactory.callNonLivingEntityDamageEvent(this, source, 1.0F, false);
|
||||
@@ -33,11 +33,8 @@
|
||||
+ return true;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
this.attack = new Interaction.PlayerAction(entityhuman.getUUID(), this.level().getGameTime());
|
||||
if (entityhuman instanceof EntityPlayer) {
|
||||
EntityPlayer entityplayer = (EntityPlayer) entityhuman;
|
||||
|
||||
if (entityhuman instanceof EntityPlayer entityplayer) {
|
||||
- CriterionTriggers.PLAYER_HURT_ENTITY.trigger(entityplayer, this, entityhuman.damageSources().generic(), 1.0F, 1.0F, false);
|
||||
+ CriterionTriggers.PLAYER_HURT_ENTITY.trigger(entityplayer, this, source, (float) event.getFinalDamage(), 1.0F, false); // CraftBukkit
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user