SPIGOT-3789: Can't Remove Entity Equipment in Same Tick Spawned without using Consumer

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2021-01-27 14:24:20 +11:00
parent 9a6f2ccb6b
commit 67905be24d
2 changed files with 23 additions and 2 deletions

View file

@ -800,6 +800,24 @@
this.setFlag(7, false);
}
} else {
@@ -1957,7 +2377,7 @@
}
}
- this.p();
+ this.updateEquipment(); // PAIL rename
if (this.ticksLived % 20 == 0) {
this.getCombatTracker().g();
}
@@ -2058,7 +2478,7 @@
}
- private void p() {
+ public void updateEquipment() { // PAIL private->public; updateEquipment
Map<EnumItemSlot, ItemStack> map = this.q();
if (map != null) {
@@ -2321,6 +2741,7 @@
}

View file

@ -145,8 +145,11 @@
if (!collection.isEmpty()) {
consumer.accept(new PacketPlayOutUpdateAttributes(this.tracker.getId(), collection));
}
@@ -238,6 +290,11 @@
@@ -236,8 +288,14 @@
if (!list.isEmpty()) {
consumer.accept(new PacketPlayOutEntityEquipment(this.tracker.getId(), list));
}
+ ((EntityLiving) this.tracker).updateEquipment(); // CraftBukkit - SPIGOT-3789: sync again immediately after sending
}
+ // CraftBukkit start - Fix for nonsensical head yaw
@ -157,7 +160,7 @@
if (this.tracker instanceof EntityLiving) {
EntityLiving entityliving = (EntityLiving) this.tracker;
Iterator iterator = entityliving.getEffects().iterator();
@@ -278,6 +335,11 @@
@@ -278,6 +336,11 @@
Set<AttributeModifiable> set = ((EntityLiving) this.tracker).getAttributeMap().getAttributes();
if (!set.isEmpty()) {