Missing Entity API
== AT == public net.minecraft.world.entity.animal.Fox isDefending()Z public net.minecraft.world.entity.animal.Fox setDefending(Z)V public net.minecraft.world.entity.animal.Fox setFaceplanted(Z)V public net.minecraft.world.entity.animal.Panda getEatCounter()I public net.minecraft.world.entity.animal.Panda setEatCounter(I)V public net.minecraft.world.entity.animal.Bee isRolling()Z public net.minecraft.world.entity.animal.Bee setRolling(Z)V public net.minecraft.world.entity.animal.Bee numCropsGrownSincePollination public net.minecraft.world.entity.animal.Bee ticksWithoutNectarSinceExitingHive public net.minecraft.world.entity.monster.piglin.Piglin isChargingCrossbow()Z public net.minecraft.world.entity.ambient.Bat targetPosition public net.minecraft.world.entity.monster.Ravager attackTick public net.minecraft.world.entity.monster.Ravager stunnedTick public net.minecraft.world.entity.monster.Ravager roarTick public net.minecraft.world.entity.vehicle.MinecartTNT explode(D)V public net.minecraft.world.entity.vehicle.MinecartTNT fuse public net.minecraft.world.entity.monster.Endermite life public net.minecraft.world.entity.projectile.AbstractArrow soundEvent public net.minecraft.world.entity.monster.Phantom anchorPoint public net.minecraft.world.entity.npc.WanderingTrader getWanderTarget()Lnet/minecraft/core/BlockPos; public net.minecraft.world.entity.animal.AbstractSchoolingFish leader public net.minecraft.world.entity.animal.AbstractSchoolingFish schoolSize public net.minecraft.world.entity.animal.Rabbit moreCarrotTicks public net.minecraft.world.entity.AreaEffectCloud ownerUUID public net.minecraft.world.entity.animal.MushroomCow stewEffects public net.minecraft.world.entity.Entity FLAG_INVISIBLE public net.minecraft.world.entity.animal.Cat setRelaxStateOne(Z)V public net.minecraft.world.entity.animal.Cat isRelaxStateOne()Z 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,52 @@
|
||||
package io.papermc.paper.entity;
|
||||
|
||||
import net.minecraft.world.entity.animal.AbstractSchoolingFish;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftFish;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class PaperSchoolableFish extends CraftFish implements SchoolableFish {
|
||||
|
||||
public PaperSchoolableFish(CraftServer server, AbstractSchoolingFish entity) {
|
||||
super(server, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractSchoolingFish getHandle() {
|
||||
return (AbstractSchoolingFish) super.getHandle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startFollowing(@NotNull SchoolableFish fish) {
|
||||
if (this.getHandle().isFollower()) { // If following a fish already, properly remove the old one
|
||||
this.stopFollowing();
|
||||
}
|
||||
|
||||
this.getHandle().startFollowing(((PaperSchoolableFish) fish).getHandle());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopFollowing() {
|
||||
this.getHandle().stopFollowing();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSchoolSize() {
|
||||
return this.getHandle().schoolSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxSchoolSize() {
|
||||
return this.getHandle().getMaxSchoolSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SchoolableFish getSchoolLeader() {
|
||||
AbstractSchoolingFish leader = this.getHandle().leader;
|
||||
if (leader == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (SchoolableFish) leader.getBukkitEntity();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user