From b431d634d9b3692290cdc22656abd805df4f60d1 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Mon, 1 Apr 2013 13:30:47 -0700 Subject: [PATCH] Rename Fish to FishHook. Fixes BUKKIT-3856 "Fish" is a badly named class to represent a fishing hook due to the possibility (or lack of) that Minecraft may be getting fish entities. This commit provides potential future compatibility by deprecating the existing Fish class and moving the methods to a new class: FishHook. By: riking --- .../src/main/java/org/bukkit/entity/Fish.java | 25 ++--------------- .../main/java/org/bukkit/entity/FishHook.java | 28 +++++++++++++++++++ 2 files changed, 30 insertions(+), 23 deletions(-) create mode 100644 paper-api/src/main/java/org/bukkit/entity/FishHook.java diff --git a/paper-api/src/main/java/org/bukkit/entity/Fish.java b/paper-api/src/main/java/org/bukkit/entity/Fish.java index 9ecc4a3364..12ed1ed739 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Fish.java +++ b/paper-api/src/main/java/org/bukkit/entity/Fish.java @@ -2,28 +2,7 @@ package org.bukkit.entity; /** * Represents a fishing hook. + * @deprecated in favor of {@link FishHook} */ -public interface Fish extends Projectile { - - /** - * Gets the chance of a fish biting. - *

- * 0.0 = No Chance.
- * 1.0 = Instant catch. - * - * @return chance the bite chance - */ - public double getBiteChance(); - - /** - * Sets the chance of a fish biting. - *

- * 0.0 = No Chance.
- * 1.0 = Instant catch. - * - * @param chance the bite chance - * @throws IllegalArgumentException if the bite chance is not between 0 - * and 1 - */ - public void setBiteChance(double chance) throws IllegalArgumentException; +public interface Fish extends FishHook { } diff --git a/paper-api/src/main/java/org/bukkit/entity/FishHook.java b/paper-api/src/main/java/org/bukkit/entity/FishHook.java new file mode 100644 index 0000000000..45b7f03dbb --- /dev/null +++ b/paper-api/src/main/java/org/bukkit/entity/FishHook.java @@ -0,0 +1,28 @@ +package org.bukkit.entity; + +/** + * Represents a fishing hook. + */ +public interface FishHook extends Projectile { + /** + * Gets the chance of a fish biting. + *

+ * 0.0 = No Chance.
+ * 1.0 = Instant catch. + * + * @return chance the bite chance + */ + public double getBiteChance(); + + /** + * Sets the chance of a fish biting. + *

+ * 0.0 = No Chance.
+ * 1.0 = Instant catch. + * + * @param chance the bite chance + * @throws IllegalArgumentException if the bite chance is not between 0 + * and 1 + */ + public void setBiteChance(double chance) throws IllegalArgumentException; +}