diff options
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/Pig.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/Pig.java.patch | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/Pig.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/Pig.java.patch new file mode 100644 index 0000000000..59fd343ecf --- /dev/null +++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/Pig.java.patch @@ -0,0 +1,33 @@ +--- a/net/minecraft/world/entity/animal/Pig.java ++++ b/net/minecraft/world/entity/animal/Pig.java +@@ -49,7 +51,12 @@ + 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 ++ ++public class Pig extends Animal implements ISteerable, Saddleable { ++ + 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); + private static final Ingredient FOOD_ITEMS = Ingredient.of(Items.CARROT, Items.POTATO, Items.BEETROOT); +@@ -222,8 +255,14 @@ + zombifiedPiglin.setCustomNameVisible(this.isCustomNameVisible()); + } + +- zombifiedPiglin.setPersistenceRequired(); +- level.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(level, lightning); |