Missing Entity API
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com> Co-authored-by: SoSeDiK <mrsosedik@gmail.com> Co-authored-by: booky10 <boooky10@gmail.com> Co-authored-by: Amin <amin.haddou@frg.wwschool.de> Co-authored-by: TrollyLoki <trollyloki@gmail.com> Co-authored-by: FireInstall <kettnerl@hu-berlin.de> Co-authored-by: maxcom1 <46265094+maxcom1@users.noreply.github.com> Co-authored-by: TotalledZebra <Holappa57@gmail.com>
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
package io.papermc.paper.entity;
|
||||
|
||||
import org.bukkit.entity.Fish;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Represents a fish that can school with other fish.
|
||||
*/
|
||||
@NullMarked
|
||||
public interface SchoolableFish extends Fish {
|
||||
|
||||
/**
|
||||
* Forces this fish to follow the given fish.
|
||||
*
|
||||
* @param leader fish to follow
|
||||
*/
|
||||
void startFollowing(SchoolableFish leader);
|
||||
|
||||
/**
|
||||
* Causes the fish to stop following their current
|
||||
* leader.
|
||||
*/
|
||||
void stopFollowing();
|
||||
|
||||
/**
|
||||
* Gets the amount of fish currently following this fish.
|
||||
*
|
||||
* @return school size
|
||||
*/
|
||||
int getSchoolSize();
|
||||
|
||||
/**
|
||||
* Gets the maximum number of fish that will naturally follow this fish.
|
||||
*
|
||||
* @return max school size
|
||||
*/
|
||||
int getMaxSchoolSize();
|
||||
|
||||
/**
|
||||
* Gets the fish that this entity is currently following.
|
||||
*
|
||||
* @return following fish
|
||||
*/
|
||||
@Nullable SchoolableFish getSchoolLeader();
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user