diff --git a/paper-server/patches/sources/net/minecraft/world/entity/player/Player.java.patch b/paper-server/patches/sources/net/minecraft/world/entity/player/Player.java.patch index 8c29630de0..4a72a85d08 100644 --- a/paper-server/patches/sources/net/minecraft/world/entity/player/Player.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/entity/player/Player.java.patch @@ -35,12 +35,20 @@ public final InventoryMenu inventoryMenu; public AbstractContainerMenu containerMenu; protected FoodData foodData = new FoodData(); -@@ -188,7 +198,18 @@ +@@ -181,13 +191,24 @@ + private Optional lastDeathLocation; + @Nullable + public FishingHook fishing; +- protected float hurtDir; ++ public float hurtDir; // Paper - protected -> public + @Nullable + public Vec3 currentImpulseImpactPos; + @Nullable public Entity currentExplosionCause; private boolean ignoreFallDamageFromCurrentImpulse; private int currentImpulseContextResetGraceTime; + public boolean affectsSpawning = true; // Paper - Affects Spawning API - ++ + // CraftBukkit start + public boolean fauxSleeping; + public int oldLevel = -1; @@ -50,10 +58,9 @@ + return (CraftHumanEntity) super.getBukkitEntity(); + } + // CraftBukkit end -+ + public Player(Level world, BlockPos pos, float yaw, GameProfile gameProfile) { super(EntityType.PLAYER, world); - this.lastItemInMainHand = ItemStack.EMPTY; @@ -261,7 +282,7 @@ this.updateIsUnderwater(); super.tick(); @@ -605,10 +612,12 @@ } @Override -@@ -2005,18 +2201,29 @@ +@@ -2003,20 +2199,31 @@ + @Override + public ImmutableList getDismountPoses() { return ImmutableList.of(Pose.STANDING, Pose.CROUCHING, Pose.SWIMMING); - } - ++ } ++ + // Paper start - PlayerReadyArrowEvent + protected boolean tryReadyArrow(ItemStack bow, ItemStack itemstack) { + return !(this instanceof ServerPlayer) || @@ -617,9 +626,9 @@ + org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(bow), + org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack) + ).callEvent(); -+ } + } + // Paper end - PlayerReadyArrowEvent -+ + @Override public ItemStack getProjectile(ItemStack stack) { if (!(stack.getItem() instanceof ProjectileWeaponItem)) { diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java index 8012ee71e1..42c41cd4b2 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -125,6 +125,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { } } + // Paper start + @Override + public void setHurtDirection(float hurtDirection) { + this.getHandle().hurtDir = hurtDirection; + } + // Paper end + @Override public int getSleepTicks() { return this.getHandle().sleepCounter; diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index c196948760..1ca252f365 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -1024,4 +1024,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { this.getHandle().take(((CraftItem) item).getHandle(), quantity); } // Paper end - pickup animation API + + // Paper start - hurt direction API + @Override + public float getHurtDirection() { + return this.getHandle().getHurtDir(); + } + + @Override + public void setHurtDirection(final float hurtDirection) { + throw new UnsupportedOperationException("Cannot set the hurt direction on a non player"); + } + // Paper end - hurt direction API }