From e7535118d97099285d1ff17909434a994006927a Mon Sep 17 00:00:00 2001 From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Date: Tue, 11 Oct 2022 17:04:26 -0400 Subject: [PATCH] Add missing Entity + Projectile API (#7632) --- build-data/paper.at | 24 + patches/api/Missing-Entity-Behavior-API.patch | 424 +++++++++++++++++- patches/api/More-Projectile-API.patch | 186 ++++++++ .../server/Add-more-WanderingTrader-API.patch | 2 +- .../server/Missing-Entity-Behavior-API.patch | 348 ++++++++++++++ patches/server/More-Projectile-API.patch | 133 ++++++ 6 files changed, 1113 insertions(+), 4 deletions(-) diff --git a/build-data/paper.at b/build-data/paper.at index b5098bd7a7..c7312d8e58 100644 --- a/build-data/paper.at +++ b/build-data/paper.at @@ -223,9 +223,24 @@ 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.monster.Vex hasLimitedLife public net.minecraft.world.entity.monster.Vex limitedLifeTicks +public net.minecraft.world.entity.npc.WanderingTrader wanderTarget +public net.minecraft.world.entity.animal.MushroomCow effect +public net.minecraft.world.entity.animal.MushroomCow effectDuration +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 fuse +public net.minecraft.world.entity.monster.Endermite life +public net.minecraft.world.entity.vehicle.MinecartHopper cooldownTime +public net.minecraft.world.entity.projectile.AbstractArrow soundEvent +public net.minecraft.world.entity.monster.Phantom anchorPoint + # Cook speed multipler API public net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity recipeType @@ -332,6 +347,15 @@ public net.minecraft.world.entity.projectile.FireworkRocketEntity life # More Projectile API public net.minecraft.world.entity.projectile.FishingHook timeUntilLured +public net.minecraft.world.entity.projectile.ShulkerBullet targetDeltaX +public net.minecraft.world.entity.projectile.ShulkerBullet targetDeltaY +public net.minecraft.world.entity.projectile.ShulkerBullet targetDeltaZ +public net.minecraft.world.entity.projectile.ShulkerBullet currentMoveDirection +public net.minecraft.world.entity.projectile.ShulkerBullet flightSteps +public net.minecraft.world.entity.projectile.AbstractArrow soundEvent +public net.minecraft.world.entity.projectile.ThrownTrident dealtDamage +public net.minecraft.world.entity.projectile.Projectile hasBeenShot +public net.minecraft.world.entity.projectile.Projectile leftOwner # Teleport API public net.minecraft.server.network.ServerGamePacketListenerImpl internalTeleport(DDDFFLjava/util/Set;Z)V diff --git a/patches/api/Missing-Entity-Behavior-API.patch b/patches/api/Missing-Entity-Behavior-API.patch index 0ae3bb2adb..9cc0311afb 100644 --- a/patches/api/Missing-Entity-Behavior-API.patch +++ b/patches/api/Missing-Entity-Behavior-API.patch @@ -5,12 +5,30 @@ Subject: [PATCH] Missing Entity Behavior API Co-authored-by: Nassim Jahnke Co-authored-by: Jake Potrebic +Co-authored-by: William Blake Galbreath diff --git a/src/main/java/org/bukkit/entity/AbstractHorse.java b/src/main/java/org/bukkit/entity/AbstractHorse.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/entity/AbstractHorse.java +++ b/src/main/java/org/bukkit/entity/AbstractHorse.java @@ -0,0 +0,0 @@ public interface AbstractHorse extends Vehicle, InventoryHolder, Tameable { + * Gets whether the horse is currently grazing hay. + * + * @return true if eating hay ++ * @deprecated use {@link #isEatingGrass()}, this name is incorrect + */ ++ @Deprecated // Paper - Horse API + boolean isEatingHaystack(); + + /** + * Sets whether the horse is grazing hay. + * + * @param eatingHaystack new hay grazing status ++ * @deprecated use {@link #setEatingGrass(boolean)}, this name is incorrect + */ ++ @Deprecated // Paper - Horse API + void setEatingHaystack(boolean eatingHaystack); + @NotNull @Override public AbstractHorseInventory getInventory(); @@ -20,9 +38,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * Gets if a horse is in their eating grass animation. + * + * @return eating grass animation is active -+ * @deprecated use {@link #isEatingHaystack()} + */ -+ @Deprecated + public boolean isEatingGrass(); + + /** @@ -33,7 +49,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @param eating eating grass animation is active + * @deprecated use {@link #setEatingHaystack(boolean)} + */ -+ @Deprecated + public void setEatingGrass(boolean eating); + + /** @@ -69,6 +84,34 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public void setEating(boolean eating); + // Paper end - Horse API } +diff --git a/src/main/java/org/bukkit/entity/Bat.java b/src/main/java/org/bukkit/entity/Bat.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/Bat.java ++++ b/src/main/java/org/bukkit/entity/Bat.java +@@ -0,0 +0,0 @@ public interface Bat extends Ambient { + * @param state the new state + */ + void setAwake(boolean state); ++ ++ // Paper start ++ /** ++ * Gets the location that this bat is currently trying to move towards. ++ * ++ * @return target location, or null if it's going to find a new location ++ */ ++ @org.jetbrains.annotations.Nullable ++ org.bukkit.Location getTargetLocation(); ++ ++ /** ++ * Sets the location that this bat is currently trying to move towards. ++ *

++ * This can be set to null to cause the bat to recalculate its target location ++ * ++ * @param location location to move towards (world is ignored, will always use the entity's world) ++ */ ++ void setTargetLocation(@org.jetbrains.annotations.Nullable org.bukkit.Location location); ++ // Paper end + } diff --git a/src/main/java/org/bukkit/entity/Bee.java b/src/main/java/org/bukkit/entity/Bee.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/entity/Bee.java @@ -100,6 +143,34 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @return is rolling + */ + boolean isRolling(); ++ ++ /** ++ * Sets how many crops this bee has grown since it last ++ * pollinated. ++ * @param crops number of crops ++ */ ++ void setCropsGrownSincePollination(int crops); ++ ++ /** ++ * Gets how many crops this bee has grown since it last ++ * pollinated. ++ * @return number of crops ++ */ ++ int getCropsGrownSincePollination(); ++ ++ /** ++ * Sets how many ticks this bee has gone without pollinating. ++ * ++ * @param ticks number of ticks ++ */ ++ void setTicksSincePollination(int ticks); ++ ++ /** ++ * Gets how many ticks this bee has gone without pollinating ++ * ++ * @return number of ticks ++ */ ++ int getTicksSincePollination(); + // Paper end } diff --git a/src/main/java/org/bukkit/entity/Cat.java b/src/main/java/org/bukkit/entity/Cat.java @@ -143,6 +214,47 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public boolean isHeadUp(); + // Paper End - More cat api } +diff --git a/src/main/java/org/bukkit/entity/Chicken.java b/src/main/java/org/bukkit/entity/Chicken.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/Chicken.java ++++ b/src/main/java/org/bukkit/entity/Chicken.java +@@ -0,0 +0,0 @@ package org.bukkit.entity; + /** + * Represents a Chicken. + */ +-public interface Chicken extends Animals {} ++// Paper start ++public interface Chicken extends Animals { ++ ++ /** ++ * Gets if this chicken was spawned as a chicken jockey. ++ * ++ * @return is chicken jockey ++ */ ++ boolean isChickenJockey(); ++ ++ /** ++ * Sets if this chicken was spawned as a chicken jockey. ++ * ++ * @param isChickenJockey is chicken jockey ++ */ ++ void setIsChickenJockey(boolean isChickenJockey); ++ ++ /** ++ * Gets the number of ticks till this chicken lays an egg. ++ * ++ * @return ticks till the chicken lays an egg ++ */ ++ int getEggLayTime(); ++ ++ /** ++ * Sets the number of ticks till this chicken lays an egg. ++ * ++ * @param eggLayTime ticks till the chicken lays an egg ++ */ ++ void setEggLayTime(int eggLayTime); ++} ++// Paper end diff --git a/src/main/java/org/bukkit/entity/Enderman.java b/src/main/java/org/bukkit/entity/Enderman.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/entity/Enderman.java @@ -182,6 +294,33 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @param hasBeenStaredAt whether the enderman has been stared at + */ + void setHasBeenStaredAt(boolean hasBeenStaredAt); ++ // Paper end + } +diff --git a/src/main/java/org/bukkit/entity/Endermite.java b/src/main/java/org/bukkit/entity/Endermite.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/Endermite.java ++++ b/src/main/java/org/bukkit/entity/Endermite.java +@@ -0,0 +0,0 @@ public interface Endermite extends Monster { + */ + @Deprecated + void setPlayerSpawned(boolean playerSpawned); ++ // Paper start ++ /** ++ * Sets how many ticks this endermite has been living for. ++ * If this value is greater than 2400, this endermite will despawn. ++ * ++ * @param ticks lifetime ticks ++ */ ++ void setLifetimeTicks(int ticks); ++ ++ /** ++ * Gets how long this endermite has been living for. ++ * This value will tick up while {@link LivingEntity#getRemoveWhenFarAway()} is false. ++ * If this value is greater than 2400, this endermite will despawn. ++ * ++ * @return lifetime ticks ++ */ ++ int getLifetimeTicks(); + // Paper end } diff --git a/src/main/java/org/bukkit/entity/Fox.java b/src/main/java/org/bukkit/entity/Fox.java @@ -268,6 +407,112 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @throws IllegalArgumentException if the explosion power is less than 0 or greater than 127 + */ + void setExplosionPower(int explosionPower); ++ // Paper end + } +diff --git a/src/main/java/org/bukkit/entity/Llama.java b/src/main/java/org/bukkit/entity/Llama.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/Llama.java ++++ b/src/main/java/org/bukkit/entity/Llama.java +@@ -0,0 +0,0 @@ public interface Llama extends ChestedHorse, RangedEntity { // Paper + @NotNull + @Override + LlamaInventory getInventory(); ++ ++ // Paper start ++ /** ++ * Checks if this llama is in a caravan. ++ * This means that this llama is currently following ++ * another llama. ++ * ++ * @return is in caravan ++ */ ++ boolean inCaravan(); ++ ++ /** ++ * Joins a caravan, with the provided llama being the leader ++ * of the caravan. ++ * This llama will then follow the provided llama. ++ * ++ * @param llama head of caravan to join ++ */ ++ void joinCaravan(@NotNull Llama llama); ++ ++ /** ++ * Leaves the current caravan that they are in. ++ */ ++ void leaveCaravan(); ++ ++ /** ++ * Get the llama that this llama is following. ++ *

++ * Does not necessarily mean the leader of the entire caravan. ++ * ++ * @return the llama currently being followed ++ */ ++ @org.jetbrains.annotations.Nullable ++ Llama getCaravanHead(); ++ ++ /** ++ * Checks if another llama is currently following behind ++ * this llama. ++ * ++ * @return true if being followed in the caravan ++ */ ++ boolean hasCaravanTail(); ++ ++ /** ++ * Gets the llama that is currently following behind ++ * this llama. ++ * ++ * @return the llama following this llama, or null if none is following them ++ */ ++ @org.jetbrains.annotations.Nullable ++ Llama getCaravanTail(); ++ // Paper end + } +diff --git a/src/main/java/org/bukkit/entity/MushroomCow.java b/src/main/java/org/bukkit/entity/MushroomCow.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/MushroomCow.java ++++ b/src/main/java/org/bukkit/entity/MushroomCow.java +@@ -0,0 +0,0 @@ public interface MushroomCow extends Cow { + */ + BROWN; + } ++ // Paper start ++ ++ /** ++ * Gets how long the effect applied to stew ++ * from this mushroom cow is. ++ * ++ * @return duration of the effect (in ticks) ++ */ ++ int getStewEffectDuration(); ++ ++ /** ++ * Sets how long the effect applied to stew ++ * from this mushroom cow is. ++ * ++ * @param duration duration of the effect (in ticks) ++ */ ++ void setStewEffectDuration(int duration); ++ ++ /** ++ * Gets the type of effect applied to stew ++ * from this mushroom cow is. ++ * ++ * @return effect type, or null if an effect is currently not set ++ */ ++ @org.jetbrains.annotations.Nullable ++ org.bukkit.potion.PotionEffectType getStewEffectType(); ++ ++ /** ++ * Sets the type of effect applied to stew ++ * from this mushroom cow is. ++ * ++ * @param type new effect type ++ * or null if this cow does not give effects ++ */ ++ void setStewEffect(@org.jetbrains.annotations.Nullable org.bukkit.potion.PotionEffectType type); + // Paper end } diff --git a/src/main/java/org/bukkit/entity/Panda.java b/src/main/java/org/bukkit/entity/Panda.java @@ -362,6 +607,32 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public enum Gene { NORMAL(false), +diff --git a/src/main/java/org/bukkit/entity/Phantom.java b/src/main/java/org/bukkit/entity/Phantom.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/Phantom.java ++++ b/src/main/java/org/bukkit/entity/Phantom.java +@@ -0,0 +0,0 @@ public interface Phantom extends Flying { + * @param shouldBurnInDay True to burn in sunlight + */ + public void setShouldBurnInDay(boolean shouldBurnInDay); ++ ++ /** ++ * Gets the location that this phantom circles around when not attacking a player ++ * This will be changed after attacking a player. ++ * ++ * @return circling location ++ */ ++ @org.jetbrains.annotations.NotNull ++ org.bukkit.Location getAnchorLocation(); ++ ++ /** ++ * Sets the location that this phantom circles around when not attacking a player ++ * ++ * @param location circling location (world is ignored, will always use the entity's world) ++ */ ++ void setAnchorLocation(@org.jetbrains.annotations.NotNull org.bukkit.Location location); + // Paper end + } diff --git a/src/main/java/org/bukkit/entity/Piglin.java b/src/main/java/org/bukkit/entity/Piglin.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/entity/Piglin.java @@ -417,6 +688,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @param standing whether the polar bear should be standing + */ + void setStanding(boolean standing); ++ +} +// Paper end diff --git a/src/main/java/org/bukkit/entity/Raider.java b/src/main/java/org/bukkit/entity/Raider.java @@ -444,6 +716,73 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + void setCelebrating(boolean celebrating); + // Paper end } +diff --git a/src/main/java/org/bukkit/entity/Ravager.java b/src/main/java/org/bukkit/entity/Ravager.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/Ravager.java ++++ b/src/main/java/org/bukkit/entity/Ravager.java +@@ -0,0 +0,0 @@ package org.bukkit.entity; + /** + * Illager beast. + */ +-public interface Ravager extends Raider { } ++// Paper start - Missing Entity Behavior ++public interface Ravager extends Raider { ++ ++ /** ++ * Gets how many ticks this ravager is attacking for. ++ * When attacking, the ravager cannot move. ++ * ++ * @return ticks attacking or -1 if they are currently not attacking ++ */ ++ int getAttackTicks(); ++ ++ /** ++ * Sets how many ticks this ravager is attacking for. ++ * When attacking, the ravager cannot move. ++ * This will tick down till it gets to -1, where this ravager will no longer be attacking. ++ * ++ * @param ticks ticks attacking or -1 if they should no longer be attacking ++ */ ++ void setAttackTicks(int ticks); ++ ++ /** ++ * Gets how many ticks the ravager is stunned for. ++ * The ravager cannot move or attack while stunned. ++ * At 0, this will cause the ravager to roar. ++ * ++ * @return ticks stunned or -1 if they are currently not stunned ++ */ ++ int getStunnedTicks(); ++ ++ /** ++ * Sets how many ticks the ravager is stunned for. ++ * The ravager cannot move or attack while stunned. ++ * At 0, this will cause the ravager to roar. ++ * ++ * @param ticks ticks stunned or -1 if they should no longer be stunned ++ */ ++ void setStunnedTicks(int ticks); ++ ++ /** ++ * Gets how many ticks the ravager is roaring for. ++ * While roaring, the ravager cannot move ++ * ++ * @return ticks roaring or -1 if they are currently not roaring ++ */ ++ int getRoarTicks(); ++ ++ /** ++ * Sets how many ticks the ravager is roaring for. ++ * While roaring, the ravager cannot move ++ * This will tick down till it gets to -1, where it is no longer active. ++ * If set to 11, this will play a sound and hurt nearby players. ++ * ++ * @param ticks ticks roaring or -1 if they should no longer be roaring ++ */ ++ void setRoarTicks(int ticks); ++ ++} ++// Paper end diff --git a/src/main/java/org/bukkit/entity/Trident.java b/src/main/java/org/bukkit/entity/Trident.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/entity/Trident.java @@ -563,6 +902,37 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + void setLimitedLifetimeTicks(int ticks); // Paper end } +diff --git a/src/main/java/org/bukkit/entity/WanderingTrader.java b/src/main/java/org/bukkit/entity/WanderingTrader.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/WanderingTrader.java ++++ b/src/main/java/org/bukkit/entity/WanderingTrader.java +@@ -0,0 +0,0 @@ public interface WanderingTrader extends AbstractVillager { + * @return whether the mob will drink + */ + public boolean canDrinkMilk(); ++ ++ /** ++ * Gets the location that this wandering trader is currently ++ * wandering towards. ++ *

++ * This will return null if the wandering trader has finished ++ * wandering towards the given location. ++ * ++ * @return the location currently wandering towards, or null if not wandering ++ */ ++ @org.jetbrains.annotations.Nullable ++ org.bukkit.Location getWanderingTowards(); ++ ++ /** ++ * Sets the location that this wandering trader is currently wandering towards. ++ *

++ * This can be set to null to prevent the wandering trader from wandering further. ++ * ++ * @param location location to wander towards (world is ignored, will always use the entity's world) ++ */ ++ void setWanderingTowards(@org.jetbrains.annotations.Nullable org.bukkit.Location location); + // Paper end + } diff --git a/src/main/java/org/bukkit/entity/Warden.java b/src/main/java/org/bukkit/entity/Warden.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/entity/Warden.java @@ -653,3 +1023,51 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + void setConversionTime(int time, boolean broadcastEntityEvent); + // Paper stop - missing entity behaviour api - converting without entity event } +diff --git a/src/main/java/org/bukkit/entity/minecart/ExplosiveMinecart.java b/src/main/java/org/bukkit/entity/minecart/ExplosiveMinecart.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/minecart/ExplosiveMinecart.java ++++ b/src/main/java/org/bukkit/entity/minecart/ExplosiveMinecart.java +@@ -0,0 +0,0 @@ import org.bukkit.entity.Minecart; + * Represents a Minecart with TNT inside it that can explode when triggered. + */ + public interface ExplosiveMinecart extends Minecart { ++ // Paper start - Entity API ++ /** ++ * Set the number of ticks until the minecart explodes after being primed. ++ * ++ * @param fuseTicks fuse ticks or -1 if the fuse isn't primed ++ */ ++ void setFuseTicks(int fuseTicks); ++ ++ /** ++ * Retrieve the number of ticks until the explosive minecart explodes ++ * ++ * @return number of ticks or -1 if the fuse isn't primed ++ */ ++ int getFuseTicks(); ++ // Paper end + } +diff --git a/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java b/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java ++++ b/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java +@@ -0,0 +0,0 @@ public interface HopperMinecart extends Minecart, InventoryHolder, LootableEntit + * @param enabled new enabled state + */ + void setEnabled(boolean enabled); ++ // Paper start ++ /** ++ * Gets the number of ticks that this hopper minecart cannot pickup items up for. ++ * ++ * @return ticks left on cooldown ++ */ ++ int getPickupCooldown(); ++ ++ /** ++ * Sets the number of ticks that this hopper minecart cannot pickup items for. ++ * ++ * @param cooldown cooldown length in ticks ++ */ ++ void setPickupCooldown(int cooldown); ++ // Paper end + } diff --git a/patches/api/More-Projectile-API.patch b/patches/api/More-Projectile-API.patch index 65a655abcf..2a5def33e0 100644 --- a/patches/api/More-Projectile-API.patch +++ b/patches/api/More-Projectile-API.patch @@ -5,6 +5,47 @@ Subject: [PATCH] More Projectile API Co-authored-by: Nassim Jahnke +diff --git a/src/main/java/org/bukkit/entity/AbstractArrow.java b/src/main/java/org/bukkit/entity/AbstractArrow.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/AbstractArrow.java ++++ b/src/main/java/org/bukkit/entity/AbstractArrow.java +@@ -0,0 +0,0 @@ public interface AbstractArrow extends Projectile { + @NotNull + org.bukkit.inventory.ItemStack getItemStack(); + ++ /** ++ * Sets the amount of ticks this arrow has been alive in the world ++ * This is used to determine when the arrow should be automatically despawned. ++ * ++ * @param ticks lifetime ticks ++ */ ++ void setLifetimeTicks(int ticks); ++ ++ /** ++ * Gets how many ticks this arrow has been in the world for. ++ * ++ * @return ticks this arrow has been in the world ++ */ ++ int getLifetimeTicks(); ++ ++ /** ++ * Gets the sound that is played when this arrow hits an entity. ++ * ++ * @return sound that plays ++ */ ++ @NotNull ++ org.bukkit.Sound getHitSound(); ++ ++ /** ++ * Sets the sound that is played when this arrow hits an entity. ++ * ++ * @param sound sound that is played ++ */ ++ void setHitSound(@NotNull org.bukkit.Sound sound); ++ + /** + * Sets this arrow to "noclip" status. + * diff --git a/src/main/java/org/bukkit/entity/Firework.java b/src/main/java/org/bukkit/entity/Firework.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/entity/Firework.java @@ -134,6 +175,122 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @param ticks Number of ticks + */ + void setWaitTime(int ticks); ++ // Paper end + } +diff --git a/src/main/java/org/bukkit/entity/Projectile.java b/src/main/java/org/bukkit/entity/Projectile.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/Projectile.java ++++ b/src/main/java/org/bukkit/entity/Projectile.java +@@ -0,0 +0,0 @@ public interface Projectile extends Entity { + */ + @Deprecated(forRemoval = true) // Paper + public void setBounce(boolean doesBounce); ++ // Paper start ++ ++ /** ++ * Gets whether the projectile has left the ++ * hitbox of their shooter and can now hit entities. ++ * ++ * @return has left shooter's hitbox ++ */ ++ boolean hasLeftShooter(); ++ ++ /** ++ * Sets whether the projectile has left the ++ * hitbox of their shooter and can now hit entities. ++ * ++ * This is recalculated each tick if the projectile has a shooter. ++ * ++ * @param leftShooter has left shooter's hitbox ++ */ ++ void setHasLeftShooter(boolean leftShooter); ++ ++ /** ++ * Gets whether the projectile has been ++ * shot into the world and has sent a projectile ++ * shot game event. ++ * ++ * @return has been shot into the world ++ */ ++ boolean hasBeenShot(); ++ ++ /** ++ * Sets whether the projectile has been ++ * shot into the world and has sent a projectile ++ * shot game event in the next tick. ++ * ++ * Setting this to false will cause a game event ++ * to fire and the value to be set back to true. ++ * ++ * @param beenShot has been in shot into the world ++ */ ++ void setHasBeenShot(boolean beenShot); ++ // Paper end + } +diff --git a/src/main/java/org/bukkit/entity/ShulkerBullet.java b/src/main/java/org/bukkit/entity/ShulkerBullet.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/ShulkerBullet.java ++++ b/src/main/java/org/bukkit/entity/ShulkerBullet.java +@@ -0,0 +0,0 @@ public interface ShulkerBullet extends Projectile { + * @param target the entity to target + */ + void setTarget(@Nullable Entity target); ++ // Paper start ++ /** ++ * Gets the relative offset that this shulker bullet should move towards, ++ * note that this will change each tick as the skulker bullet approaches the target. ++ * ++ * @return target delta offset ++ */ ++ @org.jetbrains.annotations.NotNull ++ org.bukkit.util.Vector getTargetDelta(); ++ ++ ++ /** ++ * Sets the relative offset that this shulker bullet should move towards, ++ * note that this will change each tick as the skulker bullet approaches the target. ++ * This is usually relative towards their target. ++ * ++ * @param vector target ++ */ ++ void setTargetDelta(@org.jetbrains.annotations.NotNull org.bukkit.util.Vector vector); ++ ++ /** ++ * Gets the current movement direction. ++ * This is used to determine the next movement direction to ensure ++ * that the bullet does not move in the same direction. ++ * ++ * @return null or their current direction ++ */ ++ @Nullable ++ org.bukkit.block.BlockFace getCurrentMovementDirection(); ++ ++ /** ++ * Set the current movement direction. ++ * This is used to determine the next movement direction to ensure ++ * that the bullet does not move in the same direction. ++ * ++ * Set to null to simply pick a random direction. ++ * ++ * @param movementDirection null or a direction ++ */ ++ void setCurrentMovementDirection(@Nullable org.bukkit.block.BlockFace movementDirection); ++ ++ /** ++ * Gets how many ticks this shulker bullet ++ * will attempt to move in its current direction. ++ * ++ * @return number of steps ++ */ ++ int getFlightSteps(); ++ ++ /** ++ * Sets how many ticks this shulker bullet ++ * will attempt to move in its current direction. ++ * ++ * @param steps number of steps ++ */ ++ void setFlightSteps(int steps); + // Paper end } diff --git a/src/main/java/org/bukkit/entity/ThrownPotion.java b/src/main/java/org/bukkit/entity/ThrownPotion.java @@ -179,3 +336,32 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + void splash(); + // Paper end } +diff --git a/src/main/java/org/bukkit/entity/Trident.java b/src/main/java/org/bukkit/entity/Trident.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/Trident.java ++++ b/src/main/java/org/bukkit/entity/Trident.java +@@ -0,0 +0,0 @@ public interface Trident extends AbstractArrow, ThrowableProjectile { + * @throws IllegalArgumentException if the loyalty level is lower than 0 or greater than 127 + */ + void setLoyaltyLevel(int loyaltyLevel); ++ ++ /** ++ * Gets if this trident has dealt damage to an ++ * entity yet or has hit the floor. ++ * ++ * If neither of these events have occurred yet, this will ++ * return false. ++ * ++ * @return has dealt damage ++ */ ++ boolean hasDealtDamage(); ++ ++ /** ++ * Sets if this trident has dealt damage to an entity ++ * yet or has hit the floor. ++ * ++ * @param hasDealtDamage has dealt damage or hit the floor ++ */ ++ void setHasDealtDamage(boolean hasDealtDamage); + } + // Paper end diff --git a/patches/server/Add-more-WanderingTrader-API.patch b/patches/server/Add-more-WanderingTrader-API.patch index 3f9ee2352e..969da3821a 100644 --- a/patches/server/Add-more-WanderingTrader-API.patch +++ b/patches/server/Add-more-WanderingTrader-API.patch @@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java @@ -0,0 +0,0 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill @Nullable - private BlockPos wanderTarget; + public BlockPos wanderTarget; private int despawnDelay; + // Paper start - Add more WanderingTrader API + public boolean canDrinkPotion = true; diff --git a/patches/server/Missing-Entity-Behavior-API.patch b/patches/server/Missing-Entity-Behavior-API.patch index ce853bfdef..e0cc040e49 100644 --- a/patches/server/Missing-Entity-Behavior-API.patch +++ b/patches/server/Missing-Entity-Behavior-API.patch @@ -5,6 +5,7 @@ Subject: [PATCH] Missing Entity Behavior API Co-authored-by: Nassim Jahnke Co-authored-by: Jake Potrebic +Co-authored-by: William Blake Galbreath diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 @@ -55,6 +56,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public void setStanding(boolean angry) { if (angry) { this.setEating(false); +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java +@@ -0,0 +0,0 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob { + @Nullable + private Llama caravanHead; + @Nullable +- private Llama caravanTail; ++ public Llama caravanTail; // Paper + + public Llama(EntityType type, Level world) { + super(type, world); diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java @@ -210,6 +224,36 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end - Horse API } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBat.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBat.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBat.java +@@ -0,0 +0,0 @@ public class CraftBat extends CraftAmbient implements Bat { + public void setAwake(boolean state) { + this.getHandle().setResting(!state); + } ++ // Paper start ++ @Override ++ public org.bukkit.Location getTargetLocation() { ++ net.minecraft.core.BlockPos pos = this.getHandle().targetPosition; ++ if (pos == null) { ++ return null; ++ } ++ ++ return net.minecraft.server.MCUtil.toLocation(this.getHandle().getLevel(), pos); ++ } ++ ++ @Override ++ public void setTargetLocation(org.bukkit.Location location) { ++ net.minecraft.core.BlockPos pos = null; ++ if (location != null) { ++ pos = net.minecraft.server.MCUtil.toBlockPosition(location); ++ } ++ ++ this.getHandle().targetPosition = pos; ++ } ++ // Paper end + } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBee.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBee.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBee.java @@ -235,6 +279,26 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public net.kyori.adventure.util.TriState getRollingOverride() { + return this.getHandle().rollingOverride; + } ++ ++ @Override ++ public void setCropsGrownSincePollination(int crops) { ++ this.getHandle().numCropsGrownSincePollination = crops; ++ } ++ ++ @Override ++ public int getCropsGrownSincePollination() { ++ return this.getHandle().numCropsGrownSincePollination; ++ } ++ ++ @Override ++ public void setTicksSincePollination(int ticks) { ++ this.getHandle().ticksWithoutNectarSinceExitingHive = ticks; ++ } ++ ++ @Override ++ public int getTicksSincePollination() { ++ return this.getHandle().ticksWithoutNectarSinceExitingHive; ++ } + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java @@ -267,6 +331,36 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper End - More cat api } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftChicken.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftChicken.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftChicken.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftChicken.java +@@ -0,0 +0,0 @@ public class CraftChicken extends CraftAnimals implements Chicken { + public EntityType getType() { + return EntityType.CHICKEN; + } ++ // Paper start ++ @Override ++ public boolean isChickenJockey() { ++ return this.getHandle().isChickenJockey(); ++ } ++ ++ @Override ++ public void setIsChickenJockey(boolean isChickenJockey) { ++ this.getHandle().setChickenJockey(isChickenJockey); ++ } ++ ++ @Override ++ public int getEggLayTime() { ++ return this.getHandle().eggTime; ++ } ++ ++ @Override ++ public void setEggLayTime(int eggLayTime) { ++ this.getHandle().eggTime = eggLayTime; ++ } ++ // Paper end + } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java @@ -300,6 +394,26 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public EnderMan getHandle() { return (EnderMan) entity; +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEndermite.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEndermite.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEndermite.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEndermite.java +@@ -0,0 +0,0 @@ public class CraftEndermite extends CraftMonster implements Endermite { + public void setPlayerSpawned(boolean playerSpawned) { + // Nop + } ++ // Paper start ++ @Override ++ public void setLifetimeTicks(int ticks) { ++ this.getHandle().life = ticks; ++ } ++ ++ @Override ++ public int getLifetimeTicks() { ++ return this.getHandle().life; ++ } ++ // Paper end + } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java @@ -368,6 +482,140 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java +@@ -0,0 +0,0 @@ public class CraftLlama extends CraftChestedHorse implements Llama, com.destroys + public EntityType getType() { + return EntityType.LLAMA; + } ++ ++ // Paper start ++ @Override ++ public boolean inCaravan() { ++ return this.getHandle().inCaravan(); ++ } ++ ++ @Override ++ public void joinCaravan(@org.jetbrains.annotations.NotNull Llama llama) { ++ this.getHandle().joinCaravan(((CraftLlama) llama).getHandle()); ++ } ++ ++ @Override ++ public void leaveCaravan() { ++ this.getHandle().leaveCaravan(); ++ } ++ ++ @Override ++ public boolean hasCaravanTail() { ++ return this.getHandle().hasCaravanTail(); ++ } ++ ++ @Override ++ public Llama getCaravanHead() { ++ return this.getHandle().getCaravanHead() == null ? null : (Llama) this.getHandle().getCaravanHead().getBukkitEntity(); ++ } ++ ++ @Override ++ public Llama getCaravanTail() { ++ return this.getHandle().caravanTail == null ? null : (Llama) this.getHandle().caravanTail.getBukkitEntity(); ++ } ++ // Paper end + } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java +@@ -0,0 +0,0 @@ public final class CraftMinecartHopper extends CraftMinecartContainer implements + public void setEnabled(boolean enabled) { + ((MinecartHopper) getHandle()).setEnabled(enabled); + } ++ // Paper start ++ @Override ++ public net.minecraft.world.entity.vehicle.MinecartHopper getHandle() { ++ return (net.minecraft.world.entity.vehicle.MinecartHopper) super.getHandle(); ++ } ++ ++ @Override ++ public int getPickupCooldown() { ++ return this.getHandle().cooldownTime; ++ } ++ ++ @Override ++ public void setPickupCooldown(int cooldown) { ++ this.getHandle().setCooldown(cooldown); ++ } ++ // Paper end + } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartTNT.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartTNT.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartTNT.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartTNT.java +@@ -0,0 +0,0 @@ final class CraftMinecartTNT extends CraftMinecart implements ExplosiveMinecart + public EntityType getType() { + return EntityType.MINECART_TNT; + } ++ // Paper start ++ @Override ++ public net.minecraft.world.entity.vehicle.MinecartTNT getHandle() { ++ return (net.minecraft.world.entity.vehicle.MinecartTNT) entity; ++ } ++ ++ @Override ++ public void setFuseTicks(int fuseTicks) { ++ this.getHandle().fuse = fuseTicks; ++ } ++ ++ @Override ++ public int getFuseTicks() { ++ return this.getHandle().getFuse(); ++ } ++ // Paper end + } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java +@@ -0,0 +0,0 @@ public class CraftMushroomCow extends CraftCow implements MushroomCow { + this.getHandle().setMushroomType(net.minecraft.world.entity.animal.MushroomCow.MushroomType.values()[variant.ordinal()]); + } + ++ // Paper start ++ @Override ++ public int getStewEffectDuration() { ++ return this.getHandle().effectDuration; ++ } ++ ++ @Override ++ public void setStewEffectDuration(int duration) { ++ this.getHandle().effectDuration = duration; ++ } ++ ++ @Override ++ public org.bukkit.potion.PotionEffectType getStewEffectType() { ++ net.minecraft.world.effect.MobEffect effect = this.getHandle().effect; ++ if (effect == null) { ++ return null; ++ } ++ ++ return org.bukkit.potion.PotionEffectType.getById(net.minecraft.world.effect.MobEffect.getId(effect)); ++ } ++ ++ @Override ++ public void setStewEffect(org.bukkit.potion.PotionEffectType type) { ++ net.minecraft.world.effect.MobEffect effect = null; ++ if (type != null) { ++ effect = net.minecraft.world.effect.MobEffect.byId(type.getId()); ++ } ++ ++ this.getHandle().effect = effect; ++ } ++ // Paper end ++ + @Override + public String toString() { + return "CraftMushroomCow"; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPanda.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPanda.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPanda.java @@ -405,6 +653,36 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public boolean isRolling() { +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java +@@ -0,0 +0,0 @@ public class CraftPhantom extends CraftFlying implements Phantom { + public void setShouldBurnInDay(boolean shouldBurnInDay) { + getHandle().setShouldBurnInDay(shouldBurnInDay); + } ++ ++ @Override ++ public org.bukkit.Location getAnchorLocation() { ++ net.minecraft.core.BlockPos pos = this.getHandle().anchorPoint; ++ if (pos == null) { ++ return null; ++ } ++ ++ return net.minecraft.server.MCUtil.toLocation(this.getHandle().getLevel(), pos); ++ } ++ ++ @Override ++ public void setAnchorLocation(org.bukkit.Location location) { ++ net.minecraft.core.BlockPos pos = null; ++ if (location != null) { ++ pos = net.minecraft.server.MCUtil.toBlockPosition(location); ++ } ++ ++ this.getHandle().anchorPoint = pos; ++ } + // Paper end + } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java @@ -465,6 +743,46 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public void setCelebrating(boolean celebrating) { + this.getHandle().setCelebrating(celebrating); + } ++ // Paper end + } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftRavager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftRavager.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftRavager.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftRavager.java +@@ -0,0 +0,0 @@ public class CraftRavager extends CraftRaider implements Ravager { + public String toString() { + return "CraftRavager"; + } ++ // Paper start - Missing Entity Behavior ++ @Override ++ public int getAttackTicks() { ++ return this.getHandle().getAttackTick(); ++ } ++ ++ @Override ++ public void setAttackTicks(int ticks) { ++ this.getHandle().attackTick = ticks; ++ } ++ ++ @Override ++ public int getStunnedTicks() { ++ return this.getHandle().getStunnedTick(); ++ } ++ ++ @Override ++ public void setStunnedTicks(int ticks) { ++ this.getHandle().stunnedTick = ticks; ++ } ++ ++ @Override ++ public int getRoarTicks() { ++ return this.getHandle().getRoarTick(); ++ } ++ ++ @Override ++ public void setRoarTicks(int ticks) { ++ this.getHandle().roarTick = ticks; ++ } + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java @@ -556,6 +874,36 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWanderingTrader.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWanderingTrader.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWanderingTrader.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWanderingTrader.java +@@ -0,0 +0,0 @@ public class CraftWanderingTrader extends CraftAbstractVillager implements Wande + public boolean canDrinkMilk() { + return getHandle().canDrinkMilk; + } ++ ++ @Override ++ public org.bukkit.Location getWanderingTowards() { ++ net.minecraft.core.BlockPos pos = this.getHandle().wanderTarget; ++ if (pos == null) { ++ return null; ++ } ++ ++ return net.minecraft.server.MCUtil.toLocation(this.getHandle().getLevel(), pos); ++ } ++ ++ @Override ++ public void setWanderingTowards(org.bukkit.Location location) { ++ net.minecraft.core.BlockPos pos = null; ++ if (location != null) { ++ pos = net.minecraft.server.MCUtil.toBlockPosition(location); ++ } ++ ++ this.getHandle().wanderTarget = pos; ++ } + // Paper end + } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWarden.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWarden.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWarden.java diff --git a/patches/server/More-Projectile-API.patch b/patches/server/More-Projectile-API.patch index 199fb4e7ec..7c184503c6 100644 --- a/patches/server/More-Projectile-API.patch +++ b/patches/server/More-Projectile-API.patch @@ -30,6 +30,74 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java b/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java +@@ -0,0 +0,0 @@ public abstract class AbstractProjectile extends CraftEntity implements Projecti + public void setBounce(boolean doesBounce) { + this.doesBounce = doesBounce; + } ++ // Paper start ++ @Override ++ public boolean hasLeftShooter() { ++ return this.getHandle().leftOwner; ++ } ++ ++ @Override ++ public void setHasLeftShooter(boolean leftShooter) { ++ this.getHandle().leftOwner = leftShooter; ++ } ++ ++ @Override ++ public boolean hasBeenShot() { ++ return this.getHandle().hasBeenShot; ++ } ++ ++ @Override ++ public void setHasBeenShot(boolean beenShot) { ++ this.getHandle().hasBeenShot = beenShot; ++ } ++ ++ @Override ++ public net.minecraft.world.entity.projectile.Projectile getHandle() { ++ return (net.minecraft.world.entity.projectile.Projectile) entity; ++ } ++ // Paper end + + } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java +@@ -0,0 +0,0 @@ public class CraftArrow extends AbstractProjectile implements AbstractArrow { + return org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(getHandle().getPickupItem()); + } + ++ @Override ++ public void setLifetimeTicks(int ticks) { ++ this.getHandle().life = ticks; ++ } ++ ++ @Override ++ public int getLifetimeTicks() { ++ return this.getHandle().life; ++ } ++ ++ @org.jetbrains.annotations.NotNull ++ @Override ++ public org.bukkit.Sound getHitSound() { ++ return org.bukkit.craftbukkit.CraftSound.getBukkit(this.getHandle().soundEvent); ++ } ++ ++ @Override ++ public void setHitSound(@org.jetbrains.annotations.NotNull org.bukkit.Sound sound) { ++ this.getHandle().setSoundEvent(org.bukkit.craftbukkit.CraftSound.getSoundEffect(sound)); ++ } ++ + @Override + public void setNoPhysics(boolean noPhysics) { + this.getHandle().setNoPhysics(noPhysics); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java @@ -157,6 +225,51 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftShulkerBullet.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftShulkerBullet.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftShulkerBullet.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftShulkerBullet.java +@@ -0,0 +0,0 @@ public class CraftShulkerBullet extends AbstractProjectile implements ShulkerBul + this.getHandle().setTarget(target == null ? null : ((CraftEntity) target).getHandle()); + } + ++ @Override ++ public org.bukkit.util.Vector getTargetDelta() { ++ net.minecraft.world.entity.projectile.ShulkerBullet bullet = this.getHandle(); ++ return new org.bukkit.util.Vector(bullet.targetDeltaX, bullet.targetDeltaY, bullet.targetDeltaZ); ++ } ++ ++ @Override ++ public void setTargetDelta(org.bukkit.util.Vector vector) { ++ net.minecraft.world.entity.projectile.ShulkerBullet bullet = this.getHandle(); ++ bullet.targetDeltaX = vector.getX(); ++ bullet.targetDeltaY = vector.getY(); ++ bullet.targetDeltaZ = vector.getZ(); ++ } ++ ++ @Override ++ public org.bukkit.block.BlockFace getCurrentMovementDirection() { ++ return org.bukkit.craftbukkit.block.CraftBlock.notchToBlockFace(this.getHandle().currentMoveDirection); ++ } ++ ++ @Override ++ public void setCurrentMovementDirection(org.bukkit.block.BlockFace movementDirection) { ++ this.getHandle().currentMoveDirection = org.bukkit.craftbukkit.block.CraftBlock.blockFaceToNotch(movementDirection); ++ } ++ ++ @Override ++ public int getFlightSteps() { ++ return this.getHandle().flightSteps; ++ } ++ ++ @Override ++ public void setFlightSteps(int steps) { ++ this.getHandle().flightSteps = steps; ++ } ++ + @Override + public String toString() { + return "CraftShulkerBullet"; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java @@ -194,6 +307,26 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public net.minecraft.world.entity.projectile.ThrownPotion getHandle() { return (net.minecraft.world.entity.projectile.ThrownPotion) entity; +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java +@@ -0,0 +0,0 @@ public class CraftTrident extends CraftArrow implements Trident { + com.google.common.base.Preconditions.checkArgument(loyaltyLevel >= 0 && loyaltyLevel <= 127, "The loyalty level has to be between 0 and 127"); + this.getHandle().setLoyalty((byte) loyaltyLevel); + } ++ ++ @Override ++ public boolean hasDealtDamage() { ++ return this.getHandle().dealtDamage; ++ } ++ ++ @Override ++ public void setHasDealtDamage(boolean hasDealtDamage) { ++ this.getHandle().dealtDamage = hasDealtDamage; ++ } + // Paper end + } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java