13
0
geforkt von Mirrors/Paper

Add Fish (Hook) entity to PlayerFishEvent. Adds BUKKIT-1025

By: Andre LeBlanc <andre@norcode.com>
Dieser Commit ist enthalten in:
Bukkit/Spigot 2013-02-26 15:54:47 -05:00
Ursprung 6831c464fd
Commit dff43f16bb

Datei anzeigen

@ -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;
}