mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 19:34:09 +01:00
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 <rikingcoding@gmail.com>
This commit is contained in:
parent
b92795e7e8
commit
b431d634d9
2 changed files with 30 additions and 23 deletions
|
@ -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.
|
||||
* <p>
|
||||
* 0.0 = No Chance.<br>
|
||||
* 1.0 = Instant catch.
|
||||
*
|
||||
* @return chance the bite chance
|
||||
*/
|
||||
public double getBiteChance();
|
||||
|
||||
/**
|
||||
* Sets the chance of a fish biting.
|
||||
* <p>
|
||||
* 0.0 = No Chance.<br>
|
||||
* 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 {
|
||||
}
|
||||
|
|
28
paper-api/src/main/java/org/bukkit/entity/FishHook.java
Normal file
28
paper-api/src/main/java/org/bukkit/entity/FishHook.java
Normal file
|
@ -0,0 +1,28 @@
|
|||
package org.bukkit.entity;
|
||||
|
||||
/**
|
||||
* Represents a fishing hook.
|
||||
*/
|
||||
public interface FishHook extends Projectile {
|
||||
/**
|
||||
* Gets the chance of a fish biting.
|
||||
* <p>
|
||||
* 0.0 = No Chance.<br>
|
||||
* 1.0 = Instant catch.
|
||||
*
|
||||
* @return chance the bite chance
|
||||
*/
|
||||
public double getBiteChance();
|
||||
|
||||
/**
|
||||
* Sets the chance of a fish biting.
|
||||
* <p>
|
||||
* 0.0 = No Chance.<br>
|
||||
* 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;
|
||||
}
|
Loading…
Reference in a new issue