Update to Minecraft 1.16.2

This commit is contained in:
md_5
2020-08-12 07:00:00 +10:00
parent 4b9bc9daa5
commit 9c9fb593f5
208 changed files with 2144 additions and 2455 deletions

View File

@@ -10,19 +10,19 @@
+
public class EntityPig extends EntityAnimal implements ISteerable, ISaddleable {
private static final DataWatcherObject<Boolean> bv = DataWatcher.a(EntityPig.class, DataWatcherRegistry.i);
private static final DataWatcherObject<Boolean> bo = DataWatcher.a(EntityPig.class, DataWatcherRegistry.i);
@@ -204,7 +208,13 @@
}
entitypigzombie.setPersistent();
- this.world.addEntity(entitypigzombie);
- worldserver.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);
+ worldserver.addEntity(entitypigzombie, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING);
+ // CraftBukkit end
this.die();
} else {
super.onLightningStrike(entitylightning);
super.onLightningStrike(worldserver, entitylightning);