2018-08-01 11:29:24 +02:00
|
|
|
--- a/net/minecraft/server/EntityPigZombie.java
|
|
|
|
+++ b/net/minecraft/server/EntityPigZombie.java
|
2019-04-23 04:00:00 +02:00
|
|
|
@@ -123,16 +123,27 @@
|
2018-08-01 11:29:24 +02:00
|
|
|
} else {
|
|
|
|
Entity entity = damagesource.getEntity();
|
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
- if (entity instanceof EntityHuman && !((EntityHuman) entity).isCreative()) {
|
2018-08-01 11:29:24 +02:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ boolean result = super.damageEntity(damagesource, f);
|
|
|
|
+
|
2019-04-23 04:00:00 +02:00
|
|
|
+ if (result && entity instanceof EntityHuman && !((EntityHuman) entity).isCreative()) {
|
2018-08-01 11:29:24 +02:00
|
|
|
this.a(entity);
|
|
|
|
}
|
|
|
|
|
|
|
|
- return super.damageEntity(damagesource, f);
|
|
|
|
+ return result;
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-05 02:18:01 +02:00
|
|
|
private void a(Entity entity) {
|
|
|
|
- this.angerLevel = 400 + this.random.nextInt(400);
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ org.bukkit.event.entity.PigZombieAngerEvent event = new org.bukkit.event.entity.PigZombieAngerEvent((org.bukkit.entity.PigZombie) this.getBukkitEntity(), (entity == null) ? null : entity.getBukkitEntity(), 400 + this.random.nextInt(400));
|
|
|
|
+ this.world.getServer().getPluginManager().callEvent(event);
|
|
|
|
+ if (event.isCancelled()) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ this.angerLevel = event.getNewAnger();
|
|
|
|
+ // CraftBukkit end
|
|
|
|
this.soundDelay = this.random.nextInt(40);
|
|
|
|
if (entity instanceof EntityLiving) {
|
2018-10-22 21:00:00 +02:00
|
|
|
this.setLastDamager((EntityLiving) entity);
|