@@ -11,35 +11,19 @@
|
||||
+
|
||||
public class EntityPig extends EntityAnimal {
|
||||
|
||||
private static final DataWatcherObject<Boolean> bC = DataWatcher.a(EntityPig.class, DataWatcherRegistry.i);
|
||||
@@ -118,13 +123,14 @@
|
||||
}
|
||||
|
||||
public void die(DamageSource damagesource) {
|
||||
- super.die(damagesource);
|
||||
+ // super.die(damagesource); // CraftBukkit - Moved to end
|
||||
if (!this.world.isClientSide) {
|
||||
if (this.hasSaddle()) {
|
||||
this.a((IMaterial) Items.SADDLE);
|
||||
}
|
||||
|
||||
private static final DataWatcherObject<Boolean> bz = DataWatcher.a(EntityPig.class, DataWatcherRegistry.i);
|
||||
@@ -163,7 +168,13 @@
|
||||
entitypigzombie.setCustomNameVisible(this.getCustomNameVisible());
|
||||
}
|
||||
+ super.die(damagesource); // CraftBukkit - Moved from above
|
||||
|
||||
- this.world.addEntity(entitypigzombie);
|
||||
+ // CraftBukkit start
|
||||
+ if (CraftEventFactory.callPigZapEvent(this, entitylightning, entitypigzombie).isCancelled()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit - added a reason for spawning this creature
|
||||
+ this.world.addEntity(entitypigzombie, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING);
|
||||
+ // CraftBukkit end
|
||||
this.die();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -157,7 +163,13 @@
|
||||
entitypigzombie.setCustomNameVisible(this.getCustomNameVisible());
|
||||
}
|
||||
|
||||
- this.world.addEntity(entitypigzombie);
|
||||
+ // CraftBukkit start
|
||||
+ if (CraftEventFactory.callPigZapEvent(this, entitylightning, entitypigzombie).isCancelled()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit - added a reason for spawning this creature
|
||||
+ this.world.addEntity(entitypigzombie, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING);
|
||||
+ // CraftBukkit end
|
||||
this.die();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user