diff options
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Pig.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Pig.java.patch | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Pig.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Pig.java.patch new file mode 100644 index 0000000000..b9d1eaf983 --- /dev/null +++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Pig.java.patch @@ -0,0 +1,30 @@ +--- a/net/minecraft/world/entity/animal/Pig.java ++++ b/net/minecraft/world/entity/animal/Pig.java +@@ -51,7 +51,9 @@ + import net.minecraft.world.phys.Vec3; + import org.joml.Vector3f; + +-public class Pig extends Animal implements ItemSteerable, Saddleable { ++// CraftBukkit start ++import org.bukkit.craftbukkit.event.CraftEventFactory; ++// CraftBukkit end + + private static final EntityDataAccessor<Boolean> DATA_SADDLE_ID = SynchedEntityData.defineId(Pig.class, EntityDataSerializers.BOOLEAN); + private static final EntityDataAccessor<Integer> DATA_BOOST_TIME = SynchedEntityData.defineId(Pig.class, EntityDataSerializers.INT); +@@ -268,8 +255,14 @@ + zombifiedpiglin.setCustomNameVisible(this.isCustomNameVisible()); + } + +- zombifiedpiglin.setPersistenceRequired(); +- serverlevel.addFreshEntity(zombifiedpiglin); ++ entitypigzombie.setPersistenceRequired(); ++ // CraftBukkit start ++ if (CraftEventFactory.callPigZapEvent(this, lightning, entitypigzombie).isCancelled()) { ++ return; ++ } ++ // CraftBukkit - added a reason for spawning this creature ++ level.addFreshEntity(entitypigzombie, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); ++ // CraftBukkit end + this.discard(); + } else { + super.thunderHit(serverlevel, lightningbolt); |