Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
at develop 49 lines 1.1 kB view raw
1package org.bukkit.event.entity; 2 3import org.bukkit.entity.Entity; 4import org.bukkit.event.Cancellable; 5 6/** 7 * Stores data for pigs being zapped 8 */ 9public class PigZapEvent extends EntityEvent implements Cancellable { 10 11 private boolean canceled; 12 private Entity pig; 13 private Entity pigzombie; 14 private Entity bolt; 15 16 public PigZapEvent(Entity pig, Entity bolt, Entity pigzombie) { 17 super(Type.PIG_ZAP, pig); 18 this.pig = pig; 19 this.bolt = bolt; 20 this.pigzombie = pigzombie; 21 } 22 23 public boolean isCancelled() { 24 return canceled; 25 } 26 27 public void setCancelled(boolean cancel) { 28 canceled = cancel; 29 } 30 31 /** 32 * Gets the bolt which is striking the pig. 33 * 34 * @return lightning entity 35 */ 36 public Entity getLightning() { 37 return bolt; 38 } 39 40 /** 41 * Gets the zombie pig that will replace the pig, 42 * provided the event is not cancelled first. 43 * 44 * @return resulting entity 45 */ 46 public Entity getPigZombie() { 47 return pigzombie; 48 } 49}