From df5229b286931efe5847ea5094dc20208e201898 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Tue, 1 Jan 2013 23:41:41 -0600 Subject: [PATCH] Add experience methods for PlayerFishEvent. Adds BUKKIT-3348 By: feildmaster --- .../bukkit/event/player/PlayerFishEvent.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerFishEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerFishEvent.java index cdc5ebf0a7..a41c62b2f3 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerFishEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerFishEvent.java @@ -12,6 +12,7 @@ public class PlayerFishEvent extends PlayerEvent implements Cancellable { private static final HandlerList handlers = new HandlerList(); private final Entity entity; private boolean cancel = false; + private int exp; private final State state; public PlayerFishEvent(final Player player, final Entity entity, final State state) { @@ -37,6 +38,28 @@ public class PlayerFishEvent extends PlayerEvent implements Cancellable { this.cancel = cancel; } + /** + * Gets the amount of experience received when fishing. + *

+ * Note: This value has no default effect unless the event state is {@link State#CAUGHT_FISH}. + * + * @return the amount of experience to drop + */ + public int getExpToDrop() { + return exp; + } + + /** + * Sets the amount of experience received when fishing. + *

+ * Note: This value has no default effect unless the event state is {@link State#CAUGHT_FISH}. + * + * @param amount the amount of experience to drop + */ + public void setExpToDrop(int amount) { + exp = amount; + } + /** * Gets the state of the fishing *