diff options
author | Andre LeBlanc <andre@norcode.com> | 2013-02-26 15:54:47 -0500 |
---|---|---|
committer | Kane Y <kanepyork@gmail.com> | 2013-03-20 16:02:15 -0700 |
commit | f416636f062c28d44bf278cde719fbc35cc1d7b3 (patch) | |
tree | 8e245950498d9cf2d6f794b21068c24603e158d1 /src/main/java | |
parent | a8f96663eef1a80c7673748111fc12127c067838 (diff) | |
download | bukkit-f416636f062c28d44bf278cde719fbc35cc1d7b3.tar bukkit-f416636f062c28d44bf278cde719fbc35cc1d7b3.tar.gz bukkit-f416636f062c28d44bf278cde719fbc35cc1d7b3.tar.lz bukkit-f416636f062c28d44bf278cde719fbc35cc1d7b3.tar.xz bukkit-f416636f062c28d44bf278cde719fbc35cc1d7b3.zip |
Add Fish (Hook) entity to PlayerFishEvent. Adds BUKKIT-1025
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/event/player/PlayerFishEvent.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/event/player/PlayerFishEvent.java b/src/main/java/org/bukkit/event/player/PlayerFishEvent.java index e675b5c7..c8d0acda 100644 --- a/src/main/java/org/bukkit/event/player/PlayerFishEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerFishEvent.java @@ -1,5 +1,6 @@ package org.bukkit.event.player; +import org.bukkit.entity.Fish; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; import org.bukkit.entity.Entity; @@ -14,10 +15,24 @@ public class PlayerFishEvent extends PlayerEvent implements Cancellable { private boolean cancel = false; private int exp; private final State state; + private final Fish hookEntity; + /** + * @deprecated replaced by {@link #PlayerFishEvent(Player, Entity, Fish, + * State)} to include the {@link Fish} hook entity. + * @param player + * @param entity + * @param state + */ + @Deprecated public PlayerFishEvent(final Player player, final Entity entity, final State state) { + this(player, entity, null, state); + } + + public PlayerFishEvent(final Player player, final Entity entity, final Fish hookEntity, final State state) { super(player); this.entity = entity; + this.hookEntity = hookEntity; this.state = state; } @@ -30,6 +45,14 @@ public class PlayerFishEvent extends PlayerEvent implements Cancellable { return entity; } + /** + * Gets the fishing hook. + * @return Fish the entity representing the fishing hook/bobber. + */ + public Fish getHook() { + return hookEntity; + } + public boolean isCancelled() { return cancel; } |