#589: Expand the FishHook API

By: Martoph <sager1018@gmail.com>
This commit is contained in:
Bukkit/Spigot 2023-04-16 10:10:23 +10:00
parent dcd02753e8
commit 57fc47e650

View file

@ -9,47 +9,170 @@ import org.jetbrains.annotations.Nullable;
public interface FishHook extends Projectile {
/**
* Get the minimum number of ticks one has to wait for a fish biting.
* Get the minimum number of ticks one has to wait for a fish appearing.
* <p>
* The default is 100 ticks (5 seconds).<br>
* Note that this is before applying lure.
*
* @return Minimum number of ticks one has to wait for a fish biting
* @return Minimum number of ticks one has to wait for a fish appearing
*/
public int getMinWaitTime();
/**
* Set the minimum number of ticks one has to wait for a fish biting.
* Set the minimum number of ticks one has to wait for a fish appearing.
* <p>
* The default is 100 ticks (5 seconds).<br>
* Note that this is before applying lure.
*
* @param minWaitTime Minimum number of ticks one has to wait for a fish
* biting
* appearing
*/
public void setMinWaitTime(int minWaitTime);
/**
* Get the maximum number of ticks one has to wait for a fish biting.
* Get the maximum number of ticks one has to wait for a fish appearing.
* <p>
* The default is 600 ticks (30 seconds).<br>
* Note that this is before applying lure.
*
* @return Maximum number of ticks one has to wait for a fish biting
* @return Maximum number of ticks one has to wait for a fish appearing
*/
public int getMaxWaitTime();
/**
* Set the maximum number of ticks one has to wait for a fish biting.
* Set the maximum number of ticks one has to wait for a fish appearing.
* <p>
* The default is 600 ticks (30 seconds).<br>
* Note that this is before applying lure.
*
* @param maxWaitTime Maximum number of ticks one has to wait for a fish
* biting
* appearing
*/
public void setMaxWaitTime(int maxWaitTime);
/**
* Set both the minimum (default 100) and maximum (default 600) amount
* of ticks one has to wait for a fish appearing.
*
* @param min minimum ticks for a fish to appear
* @param max maximum ticks for a fish to appear
*/
public void setWaitTime(int min, int max);
/**
* Get the minimum number of ticks one has to wait for a fish to bite
* after appearing.
* <p>
* The default is 20 ticks (1 second).<br>
* Lure does not affect this value.
* This will also effect the radius (0.1 * lureTime) of where
* the fish will appear.
*
* @return Minimum number of ticks one has to wait for a fish to bite
*/
public int getMinLureTime();
/**
* Set the minimum number of ticks one has to wait for a fish to bite
* after appearing.
* <p>
* The default is 20 ticks (1 second).<br>
* Lure does not affect this value.
* This will also effect the radius (0.1 * lureTime) of where
* the fish will appear.
*
* @param minLureTime Minimum number of ticks one has to wait for a fish
* to bite
*/
public void setMinLureTime(int minLureTime);
/**
* Get the maximum number of ticks one has to wait for a fish to bite
* after appearing.
* <p>
* The default is 80 ticks (4 second).<br>
* Lure does not affect this value.
* This will also effect the radius (0.1 * lureTime) of where
* the fish will appear.
*
* @return Maximum number of ticks one has to wait for a fish to bite
*/
public int getMaxLureTime();
/**
* Set the maximum number of ticks one has to wait for a fish to bite
* after appearing.
* <p>
* The default is 80 ticks (4 second).<br>
* Lure does not affect this value.
* This will also effect the radius (0.1 * lureTime) of where
* the fish will appear.
*
* @param maxLureTime Maximum number of ticks one has to wait for a fish
* to bite
*/
public void setMaxLureTime(int maxLureTime);
/**
* Set both the minimum (default 20) and maximum (default 80) amount
* of ticks one has to wait for a fish to bite after appearing.
*
* @param min minimum ticks to wait for a bite
* @param max maximum ticks to wait for a bite
*/
public void setLureTime(int min, int max);
/**
* Get the minimum angle (in degrees, 0 being positive Z 90 being negative
* X) of where a fish will appear after the wait time.
* <p>
* The default is 0 degrees.
*
* @return Minimum angle of where a fish will appear
*/
public float getMinLureAngle();
/**
* Set the minimum angle (in degrees, 0 being positive Z 90 being negative
* X) of where a fish will appear after the wait time.
* <p>
* The default is 0 degrees.
*
* @param minLureAngle Minimum angle of where a fish may appear
*/
public void setMinLureAngle(float minLureAngle);
/**
* Get the maximum angle (in degrees, 0 being positive Z 90 being negative
* X) of where a fish will appear after the wait time.
* <p>
* The default is 360 degrees.
*
* @return Maximum angle of where a fish will appear
*/
public float getMaxLureAngle();
/**
* Set the maximum angle (in degrees, 0 being positive Z 90 being negative
* X) of where a fish will appear after the wait time.
* <p>
* The default is 360 degrees.
*
* @param maxLureAngle Maximum angle of where a fish may appear
*/
public void setMaxLureAngle(float maxLureAngle);
/**
* Set both the minimum (default 0) and maximum (default 360) angle of where
* a fish will appear after the wait time.
*
* 0 degrees is positive Z, 90 degrees is negative X.
*
* @param min minimum angle in degrees
* @param max maximum angle in degrees
*/
public void setLureAngle(float min, float max);
/**
* Get whether the lure enchantment should be applied to reduce the wait
* time.
@ -135,6 +258,43 @@ public interface FishHook extends Projectile {
*/
public boolean pullHookedEntity();
/**
* Whether or not wait and lure time will be impacted by direct sky access.
*
* True by default, causes a 50% time increase on average.
*
* @return skylight access influences catch rate
*/
public boolean isSkyInfluenced();
/**
* Set whether or not wait and lure time will be impacted by direct sky
* access.
*
* True by default, causes a 50% time increase on average.
*
* @param skyInfluenced if this hook is influenced by skylight access
*/
public void setSkyInfluenced(boolean skyInfluenced);
/**
* Whether or not wait and lure time will be impacted by rain.
*
* True by default, causes a 25% time decrease on average.
*
* @return rain influences catch rate
*/
public boolean isRainInfluenced();
/**
* Set whether or not wait and lure time will be impacted by rain.
*
* True by default, causes a 25% time decrease on average.
*
* @param rainInfluenced if this hook is influenced by rain
*/
public void setRainInfluenced(boolean rainInfluenced);
/**
* Get the current state of this fish hook.
*