mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-04 18:12:09 +01:00
#571: Expand the FishHook API
By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
parent
fe61d84f47
commit
7502690157
1 changed files with 64 additions and 0 deletions
|
@ -1,5 +1,8 @@
|
|||
package org.bukkit.entity;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Represents a fishing hook.
|
||||
*/
|
||||
|
@ -98,4 +101,65 @@ public interface FishHook extends Projectile {
|
|||
*/
|
||||
@Deprecated
|
||||
public void setBiteChance(double chance) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Check whether or not this fish hook is in open water.
|
||||
* <p>
|
||||
* Open water is defined by a 5x4x5 area of water, air and lily pads. If in
|
||||
* open water, treasure items may be caught.
|
||||
*
|
||||
* @return true if in open water, false otherwise
|
||||
*/
|
||||
public boolean isInOpenWater();
|
||||
|
||||
/**
|
||||
* Get the entity hooked by this fish hook.
|
||||
*
|
||||
* @return the hooked entity. null if none
|
||||
*/
|
||||
@Nullable
|
||||
public Entity getHookedEntity();
|
||||
|
||||
/**
|
||||
* Set the entity hooked by this fish hook.
|
||||
*
|
||||
* @param entity the entity to set, or null to unhook
|
||||
*/
|
||||
public void setHookedEntity(@Nullable Entity entity);
|
||||
|
||||
/**
|
||||
* Pull the hooked entity to the caster of this fish hook. If no entity is
|
||||
* hooked, this method has no effect.
|
||||
*
|
||||
* @return true if pulled, false if no entity is hooked
|
||||
*/
|
||||
public boolean pullHookedEntity();
|
||||
|
||||
/**
|
||||
* Get the current state of this fish hook.
|
||||
*
|
||||
* @return the fish hook state
|
||||
*/
|
||||
@NotNull
|
||||
public HookState getState();
|
||||
|
||||
/**
|
||||
* Represents a state in which a fishing hook may be.
|
||||
*/
|
||||
public enum HookState {
|
||||
|
||||
/**
|
||||
* The fishing hook has been cast and is either in the air or resting
|
||||
* against a block on the ground.
|
||||
*/
|
||||
UNHOOKED,
|
||||
/**
|
||||
* The fishing hook has hooked an entity.
|
||||
*/
|
||||
HOOKED_ENTITY,
|
||||
/**
|
||||
* The fishing hook is bobbing in the water, waiting for a bite.
|
||||
*/
|
||||
BOBBING;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue