@@ -40,7 +40,7 @@
|
||||
@@ -298,7 +321,7 @@
|
||||
Entity entity = damagesource.getEntity();
|
||||
|
||||
if (!this.level.isClientSide) {
|
||||
if (!this.level().isClientSide) {
|
||||
- this.setOrderedToSit(false);
|
||||
+ // this.setOrderedToSit(false); // CraftBukkit - moved into EntityLiving.damageEntity(DamageSource, float)
|
||||
}
|
||||
@@ -55,31 +55,31 @@
|
||||
} else {
|
||||
this.getAttribute(GenericAttributes.MAX_HEALTH).setBaseValue(8.0D);
|
||||
}
|
||||
@@ -349,7 +372,7 @@
|
||||
itemstack.shrink(1);
|
||||
}
|
||||
|
||||
- this.heal((float) item.getFoodProperties().getNutrition());
|
||||
+ this.heal((float) item.getFoodProperties().getNutrition(), org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.EATING); // CraftBukkit
|
||||
return EnumInteractionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@@ -360,7 +383,7 @@
|
||||
this.setOrderedToSit(!this.isOrderedToSit());
|
||||
this.jumping = false;
|
||||
this.navigation.stop();
|
||||
- this.setTarget((EntityLiving) null);
|
||||
+ this.setTarget((EntityLiving) null, TargetReason.FORGOT_TARGET, true); // CraftBukkit - reason
|
||||
return EnumInteractionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@@ -382,7 +405,8 @@
|
||||
@@ -348,7 +371,7 @@
|
||||
itemstack.shrink(1);
|
||||
}
|
||||
|
||||
- if (this.random.nextInt(3) == 0) {
|
||||
+ // CraftBukkit - added event call and isCancelled check.
|
||||
+ if (this.random.nextInt(3) == 0 && !CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) {
|
||||
this.tame(entityhuman);
|
||||
- this.heal((float) item.getFoodProperties().getNutrition());
|
||||
+ this.heal((float) item.getFoodProperties().getNutrition(), org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.EATING); // CraftBukkit
|
||||
return EnumInteractionResult.SUCCESS;
|
||||
} else {
|
||||
if (item instanceof ItemDye) {
|
||||
@@ -376,7 +399,7 @@
|
||||
this.setOrderedToSit(!this.isOrderedToSit());
|
||||
this.jumping = false;
|
||||
this.navigation.stop();
|
||||
this.setTarget((EntityLiving) null);
|
||||
- this.setTarget((EntityLiving) null);
|
||||
+ this.setTarget((EntityLiving) null, TargetReason.FORGOT_TARGET, true); // CraftBukkit - reason
|
||||
return EnumInteractionResult.SUCCESS;
|
||||
} else {
|
||||
return enuminteractionresult;
|
||||
@@ -387,7 +410,8 @@
|
||||
itemstack.shrink(1);
|
||||
}
|
||||
|
||||
- if (this.random.nextInt(3) == 0) {
|
||||
+ // CraftBukkit - added event call and isCancelled check.
|
||||
+ if (this.random.nextInt(3) == 0 && !CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) {
|
||||
this.tame(entityhuman);
|
||||
this.navigation.stop();
|
||||
this.setTarget((EntityLiving) null);
|
||||
|
||||
Reference in New Issue
Block a user