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,10 @@
|
||||
--- a/net/minecraft/world/entity/animal/AbstractSchoolingFish.java
|
||||
+++ b/net/minecraft/world/entity/animal/AbstractSchoolingFish.java
|
||||
@@ -51,6 +51,7 @@
|
||||
}
|
||||
|
||||
public void stopFollowing() {
|
||||
+ if (this.leader == null) return; // Avoid NPE, plugins can now set the leader and certain fish goals might cause this method to be called
|
||||
this.leader.removeFollower();
|
||||
this.leader = null;
|
||||
}
|
||||
@@ -110,7 +110,21 @@
|
||||
}
|
||||
|
||||
boolean isHiveValid() {
|
||||
@@ -671,8 +703,14 @@
|
||||
@@ -533,11 +565,13 @@
|
||||
this.setFlag(4, hasStung);
|
||||
}
|
||||
|
||||
+ public net.kyori.adventure.util.TriState rollingOverride = net.kyori.adventure.util.TriState.NOT_SET; // Paper - Rolling override
|
||||
public boolean isRolling() {
|
||||
return this.getFlag(2);
|
||||
}
|
||||
|
||||
public void setRolling(boolean nearTarget) {
|
||||
+ nearTarget = rollingOverride.toBooleanOrElse(nearTarget); // Paper - Rolling override
|
||||
this.setFlag(2, nearTarget);
|
||||
}
|
||||
|
||||
@@ -671,8 +705,14 @@
|
||||
if (this.isInvulnerableTo(world, source)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -126,7 +140,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1082,7 +1120,7 @@
|
||||
@@ -1082,7 +1122,7 @@
|
||||
|
||||
BeeGoToHiveGoal() {
|
||||
super();
|
||||
@@ -135,7 +149,7 @@
|
||||
this.blacklistedTargets = Lists.newArrayList();
|
||||
this.setFlags(EnumSet.of(Goal.Flag.MOVE));
|
||||
}
|
||||
@@ -1196,7 +1234,7 @@
|
||||
@@ -1196,7 +1236,7 @@
|
||||
|
||||
BeeGoToKnownFlowerGoal() {
|
||||
super();
|
||||
@@ -144,7 +158,7 @@
|
||||
this.setFlags(EnumSet.of(Goal.Flag.MOVE));
|
||||
}
|
||||
|
||||
@@ -1301,7 +1339,7 @@
|
||||
@@ -1301,7 +1341,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,7 +167,7 @@
|
||||
Bee.this.level().levelEvent(2011, blockposition, 15);
|
||||
Bee.this.level().setBlockAndUpdate(blockposition, iblockdata1);
|
||||
Bee.this.incrementNumCropsGrownSincePollination();
|
||||
@@ -1378,7 +1416,7 @@
|
||||
@@ -1378,7 +1418,7 @@
|
||||
@Override
|
||||
protected void alertOther(Mob mob, LivingEntity target) {
|
||||
if (mob instanceof Bee && this.mob.hasLineOfSight(target)) {
|
||||
@@ -162,7 +176,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1387,7 +1425,7 @@
|
||||
@@ -1387,7 +1427,7 @@
|
||||
private static class BeeBecomeAngryTargetGoal extends NearestAttackableTargetGoal<Player> {
|
||||
|
||||
BeeBecomeAngryTargetGoal(Bee bee) {
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
--- a/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||
+++ b/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||
@@ -74,7 +74,7 @@
|
||||
@@ -50,6 +50,7 @@
|
||||
public int age;
|
||||
protected static final ImmutableList<SensorType<? extends Sensor<? super Tadpole>>> SENSOR_TYPES = ImmutableList.of(SensorType.NEAREST_LIVING_ENTITIES, SensorType.NEAREST_PLAYERS, SensorType.HURT_BY, SensorType.FROG_TEMPTATIONS);
|
||||
protected static final ImmutableList<MemoryModuleType<?>> MEMORY_TYPES = ImmutableList.of(MemoryModuleType.LOOK_TARGET, MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.PATH, MemoryModuleType.NEAREST_VISIBLE_ADULT, MemoryModuleType.TEMPTATION_COOLDOWN_TICKS, MemoryModuleType.IS_TEMPTED, MemoryModuleType.TEMPTING_PLAYER, MemoryModuleType.BREED_TARGET, MemoryModuleType.IS_PANICKING);
|
||||
+ public boolean ageLocked; // Paper
|
||||
|
||||
public Tadpole(EntityType<? extends AbstractFish> type, Level world) {
|
||||
super(type, world);
|
||||
@@ -74,7 +75,7 @@
|
||||
|
||||
@Override
|
||||
public Brain<Tadpole> getBrain() {
|
||||
@@ -9,7 +17,55 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -225,12 +225,17 @@
|
||||
@@ -102,7 +103,7 @@
|
||||
@Override
|
||||
public void aiStep() {
|
||||
super.aiStep();
|
||||
- if (!this.level().isClientSide) {
|
||||
+ if (!this.level().isClientSide && !this.ageLocked) { // Paper
|
||||
this.setAge(this.age + 1);
|
||||
}
|
||||
|
||||
@@ -112,12 +113,14 @@
|
||||
public void addAdditionalSaveData(CompoundTag nbt) {
|
||||
super.addAdditionalSaveData(nbt);
|
||||
nbt.putInt("Age", this.age);
|
||||
+ nbt.putBoolean("AgeLocked", this.ageLocked); // Paper
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readAdditionalSaveData(CompoundTag nbt) {
|
||||
super.readAdditionalSaveData(nbt);
|
||||
this.setAge(nbt.getInt("Age"));
|
||||
+ this.ageLocked = nbt.getBoolean("AgeLocked"); // Paper
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -169,6 +172,7 @@
|
||||
Bucketable.saveDefaultDataToBucketTag(this, stack);
|
||||
CustomData.update(DataComponents.BUCKET_ENTITY_DATA, stack, (nbttagcompound) -> {
|
||||
nbttagcompound.putInt("Age", this.getAge());
|
||||
+ nbttagcompound.putBoolean("AgeLocked", this.ageLocked); // Paper
|
||||
});
|
||||
}
|
||||
|
||||
@@ -179,6 +183,7 @@
|
||||
this.setAge(nbt.getInt("Age"));
|
||||
}
|
||||
|
||||
+ this.ageLocked = nbt.getBoolean("AgeLocked"); // Paper
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -210,6 +215,7 @@
|
||||
}
|
||||
|
||||
private void ageUp(int seconds) {
|
||||
+ if (this.ageLocked) return; // Paper
|
||||
this.setAge(this.age + seconds * 20);
|
||||
}
|
||||
|
||||
@@ -225,12 +231,17 @@
|
||||
Level world = this.level();
|
||||
|
||||
if (world instanceof ServerLevel worldserver) {
|
||||
|
||||
@@ -61,12 +61,12 @@
|
||||
+ @Override
|
||||
+ public InventoryHolder getOwner() {
|
||||
+ return (org.bukkit.entity.AbstractHorse) AbstractHorse.this.getBukkitEntity();
|
||||
+ }
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public Location getLocation() {
|
||||
+ return AbstractHorse.this.getBukkitEntity().getLocation();
|
||||
}
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
};
|
||||
+ public int maxDomestication = 100; // CraftBukkit - store max domestication value
|
||||
@@ -118,7 +118,36 @@
|
||||
}
|
||||
|
||||
if (this.canEatGrass()) {
|
||||
@@ -883,6 +940,7 @@
|
||||
@@ -720,7 +777,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ }
|
||||
+
|
||||
+ // Paper start - Horse API
|
||||
+ public void setMouthOpen(boolean open) {
|
||||
+ this.setFlag(FLAG_OPEN_MOUTH, open);
|
||||
+ }
|
||||
+ public boolean isMouthOpen() {
|
||||
+ return this.getFlag(FLAG_OPEN_MOUTH);
|
||||
}
|
||||
+ // Paper end - Horse API
|
||||
|
||||
@Override
|
||||
public InteractionResult mobInteract(Player player, InteractionHand hand) {
|
||||
@@ -764,6 +830,11 @@
|
||||
this.setFlag(16, eatingGrass);
|
||||
}
|
||||
|
||||
+ // Paper start - Horse API
|
||||
+ public void setForceStanding(boolean standing) {
|
||||
+ this.setFlag(FLAG_STANDING, standing);
|
||||
+ }
|
||||
+ // Paper end - Horse API
|
||||
public void setStanding(boolean angry) {
|
||||
if (angry) {
|
||||
this.setEating(false);
|
||||
@@ -883,6 +954,7 @@
|
||||
if (this.getOwnerUUID() != null) {
|
||||
nbt.putUUID("Owner", this.getOwnerUUID());
|
||||
}
|
||||
@@ -126,20 +155,19 @@
|
||||
|
||||
if (!this.inventory.getItem(0).isEmpty()) {
|
||||
nbt.put("SaddleItem", this.inventory.getItem(0).save(this.registryAccess()));
|
||||
@@ -909,7 +967,12 @@
|
||||
|
||||
@@ -910,6 +982,11 @@
|
||||
if (uuid != null) {
|
||||
this.setOwnerUUID(uuid);
|
||||
+ }
|
||||
}
|
||||
+ // CraftBukkit start
|
||||
+ if (nbt.contains("Bukkit.MaxDomestication")) {
|
||||
+ this.maxDomestication = nbt.getInt("Bukkit.MaxDomestication");
|
||||
}
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
if (nbt.contains("SaddleItem", 10)) {
|
||||
ItemStack itemstack = (ItemStack) ItemStack.parse(this.registryAccess(), nbt.getCompound("SaddleItem")).orElse(ItemStack.EMPTY);
|
||||
@@ -1012,6 +1075,17 @@
|
||||
@@ -1012,6 +1089,17 @@
|
||||
|
||||
@Override
|
||||
public void handleStartJump(int height) {
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
--- a/net/minecraft/world/entity/animal/horse/Llama.java
|
||||
+++ b/net/minecraft/world/entity/animal/horse/Llama.java
|
||||
@@ -82,6 +82,11 @@
|
||||
@@ -71,17 +71,23 @@
|
||||
@Nullable
|
||||
private Llama caravanHead;
|
||||
@Nullable
|
||||
- private Llama caravanTail;
|
||||
+ public Llama caravanTail; // Paper
|
||||
|
||||
public Llama(EntityType<? extends Llama> type, Level world) {
|
||||
super(type, world);
|
||||
this.getNavigation().setRequiredPathLength(40.0F);
|
||||
+ this.maxDomestication = 30; // Paper - Missing entity API; configure max temper instead of a hardcoded value
|
||||
}
|
||||
|
||||
public boolean isTraderLlama() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -12,3 +25,12 @@
|
||||
private void setStrength(int strength) {
|
||||
this.entityData.set(Llama.DATA_STRENGTH_ID, Math.max(1, Math.min(5, strength)));
|
||||
}
|
||||
@@ -289,7 +295,7 @@
|
||||
|
||||
@Override
|
||||
public int getMaxTemper() {
|
||||
- return 30;
|
||||
+ return super.getMaxTemper(); // Paper - Missing entity API; delegate to parent
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user