Expose LivingEntity hurt direction
This commit is contained in:
parent
3f4b9fd365
commit
1cedeb97af
3 changed files with 37 additions and 9 deletions
|
@ -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<GlobalPos> 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<Pose> 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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue