mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 08:39:58 +03:00
25 lines
1.1 KiB
Diff
25 lines
1.1 KiB
Diff
--- ../src-base/minecraft/net/minecraft/entity/passive/EntityPig.java
|
|
+++ ../src-work/minecraft/net/minecraft/entity/passive/EntityPig.java
|
|
@@ -3,6 +3,9 @@
|
|
import com.google.common.collect.Sets;
|
|
import java.util.Set;
|
|
import javax.annotation.Nullable;
|
|
+
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
|
+
|
|
import net.minecraft.block.Block;
|
|
import net.minecraft.entity.Entity;
|
|
import net.minecraft.entity.EntityAgeable;
|
|
@@ -204,6 +207,11 @@
|
|
if (!this.worldObj.isRemote && !this.isDead)
|
|
{
|
|
EntityPigZombie entitypigzombie = new EntityPigZombie(this.worldObj);
|
|
+ // CraftBukkit start
|
|
+ if (CraftEventFactory.callPigZapEvent(this, lightningBolt, entitypigzombie).isCancelled()) {
|
|
+ return;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
entitypigzombie.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.GOLDEN_SWORD));
|
|
entitypigzombie.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
|
|
entitypigzombie.setNoAI(this.isAIDisabled());
|