From b2cedaf36c79429598b8b6be2d0b892b889ec91b Mon Sep 17 00:00:00 2001 From: fullwall Date: Tue, 10 Dec 2024 19:01:36 +0800 Subject: [PATCH] Fix players waiting for 60 ticks client timeout delay before becoming interactable in 1.21.4 --- .../net/citizensnpcs/nms/v1_10_R1/entity/EntityHumanNPC.java | 1 - .../net/citizensnpcs/nms/v1_11_R1/entity/EntityHumanNPC.java | 1 - .../net/citizensnpcs/nms/v1_12_R1/entity/EntityHumanNPC.java | 1 - .../net/citizensnpcs/nms/v1_13_R2/entity/EntityHumanNPC.java | 1 - .../net/citizensnpcs/nms/v1_14_R1/entity/EntityHumanNPC.java | 1 - .../net/citizensnpcs/nms/v1_15_R1/entity/EntityHumanNPC.java | 1 - .../net/citizensnpcs/nms/v1_16_R3/entity/EntityHumanNPC.java | 1 - .../net/citizensnpcs/nms/v1_17_R1/entity/EntityHumanNPC.java | 1 - .../net/citizensnpcs/nms/v1_18_R2/entity/EntityHumanNPC.java | 1 - .../net/citizensnpcs/nms/v1_19_R3/entity/EntityHumanNPC.java | 1 - .../net/citizensnpcs/nms/v1_20_R4/entity/EntityHumanNPC.java | 3 --- .../net/citizensnpcs/nms/v1_21_R3/entity/EntityHumanNPC.java | 2 +- .../net/citizensnpcs/nms/v1_8_R3/entity/EntityHumanNPC.java | 1 - 13 files changed, 1 insertion(+), 15 deletions(-) diff --git a/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/entity/EntityHumanNPC.java b/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/entity/EntityHumanNPC.java index a6001f14a..96c024d97 100644 --- a/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/entity/EntityHumanNPC.java +++ b/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/entity/EntityHumanNPC.java @@ -240,7 +240,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable controllerJump = new PlayerControllerJump(this); controllerMove = new PlayerControllerMove(this); navigation = new PlayerNavigation(this, world); - invulnerableTicks = 0; } @Override diff --git a/v1_11_R1/src/main/java/net/citizensnpcs/nms/v1_11_R1/entity/EntityHumanNPC.java b/v1_11_R1/src/main/java/net/citizensnpcs/nms/v1_11_R1/entity/EntityHumanNPC.java index e2a1f6bb2..5f6f52551 100644 --- a/v1_11_R1/src/main/java/net/citizensnpcs/nms/v1_11_R1/entity/EntityHumanNPC.java +++ b/v1_11_R1/src/main/java/net/citizensnpcs/nms/v1_11_R1/entity/EntityHumanNPC.java @@ -269,7 +269,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable controllerJump = new PlayerControllerJump(this); controllerMove = new PlayerControllerMove(this); navigation = new PlayerNavigation(this, world); - invulnerableTicks = 0; } @Override diff --git a/v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/entity/EntityHumanNPC.java b/v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/entity/EntityHumanNPC.java index c64bb86e6..f0d4aa0ac 100644 --- a/v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/entity/EntityHumanNPC.java +++ b/v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/entity/EntityHumanNPC.java @@ -277,7 +277,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable controllerJump = new PlayerControllerJump(this); controllerMove = new PlayerControllerMove(this); navigation = new PlayerNavigation(this, world); - invulnerableTicks = 0; setSkinFlags((byte) 0xFF); } diff --git a/v1_13_R2/src/main/java/net/citizensnpcs/nms/v1_13_R2/entity/EntityHumanNPC.java b/v1_13_R2/src/main/java/net/citizensnpcs/nms/v1_13_R2/entity/EntityHumanNPC.java index c521f16fe..ba45ee550 100644 --- a/v1_13_R2/src/main/java/net/citizensnpcs/nms/v1_13_R2/entity/EntityHumanNPC.java +++ b/v1_13_R2/src/main/java/net/citizensnpcs/nms/v1_13_R2/entity/EntityHumanNPC.java @@ -267,7 +267,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable controllerJump = new PlayerControllerJump(this); controllerMove = new PlayerControllerMove(this); navigation = new PlayerNavigation(this, world); - invulnerableTicks = 0; setSkinFlags((byte) 0xFF); } diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/EntityHumanNPC.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/EntityHumanNPC.java index 75c22b239..f950eed6b 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/EntityHumanNPC.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/EntityHumanNPC.java @@ -269,7 +269,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable controllerJump = new PlayerControllerJump(this); controllerMove = new PlayerControllerMove(this); navigation = new PlayerNavigation(this, world); - invulnerableTicks = 0; setSkinFlags((byte) 0xFF); } diff --git a/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/entity/EntityHumanNPC.java b/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/entity/EntityHumanNPC.java index d1dcca0fb..605ebe15c 100644 --- a/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/entity/EntityHumanNPC.java +++ b/v1_15_R1/src/main/java/net/citizensnpcs/nms/v1_15_R1/entity/EntityHumanNPC.java @@ -269,7 +269,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable controllerJump = new PlayerControllerJump(this); controllerMove = new PlayerControllerMove(this); navigation = new PlayerNavigation(this, world); - invulnerableTicks = 0; setSkinFlags((byte) 0xFF); } diff --git a/v1_16_R3/src/main/java/net/citizensnpcs/nms/v1_16_R3/entity/EntityHumanNPC.java b/v1_16_R3/src/main/java/net/citizensnpcs/nms/v1_16_R3/entity/EntityHumanNPC.java index 4522c2f47..d7215a9af 100644 --- a/v1_16_R3/src/main/java/net/citizensnpcs/nms/v1_16_R3/entity/EntityHumanNPC.java +++ b/v1_16_R3/src/main/java/net/citizensnpcs/nms/v1_16_R3/entity/EntityHumanNPC.java @@ -241,7 +241,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable conn.setPacketListener(playerConnection); } catch (IOException e) { } - invulnerableTicks = 0; setSkinFlags((byte) 0xFF); } diff --git a/v1_17_R1/src/main/java/net/citizensnpcs/nms/v1_17_R1/entity/EntityHumanNPC.java b/v1_17_R1/src/main/java/net/citizensnpcs/nms/v1_17_R1/entity/EntityHumanNPC.java index 1bf225f5f..4a04ac794 100644 --- a/v1_17_R1/src/main/java/net/citizensnpcs/nms/v1_17_R1/entity/EntityHumanNPC.java +++ b/v1_17_R1/src/main/java/net/citizensnpcs/nms/v1_17_R1/entity/EntityHumanNPC.java @@ -261,7 +261,6 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable } catch (IOException e) { // swallow } - this.invulnerableTime = 0; setSkinFlags((byte) 0xFF); } diff --git a/v1_18_R2/src/main/java/net/citizensnpcs/nms/v1_18_R2/entity/EntityHumanNPC.java b/v1_18_R2/src/main/java/net/citizensnpcs/nms/v1_18_R2/entity/EntityHumanNPC.java index 47958f89c..8cb78a115 100644 --- a/v1_18_R2/src/main/java/net/citizensnpcs/nms/v1_18_R2/entity/EntityHumanNPC.java +++ b/v1_18_R2/src/main/java/net/citizensnpcs/nms/v1_18_R2/entity/EntityHumanNPC.java @@ -261,7 +261,6 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable conn.setListener(connection); } catch (IOException e) { } - this.invulnerableTime = 0; setSkinFlags((byte) 0xFF); } diff --git a/v1_19_R3/src/main/java/net/citizensnpcs/nms/v1_19_R3/entity/EntityHumanNPC.java b/v1_19_R3/src/main/java/net/citizensnpcs/nms/v1_19_R3/entity/EntityHumanNPC.java index f2f13d6b3..ad89158bd 100644 --- a/v1_19_R3/src/main/java/net/citizensnpcs/nms/v1_19_R3/entity/EntityHumanNPC.java +++ b/v1_19_R3/src/main/java/net/citizensnpcs/nms/v1_19_R3/entity/EntityHumanNPC.java @@ -266,7 +266,6 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable conn.setListener(connection); } catch (IOException e) { } - this.invulnerableTime = 0; setSkinFlags((byte) 0xFF); } diff --git a/v1_20_R4/src/main/java/net/citizensnpcs/nms/v1_20_R4/entity/EntityHumanNPC.java b/v1_20_R4/src/main/java/net/citizensnpcs/nms/v1_20_R4/entity/EntityHumanNPC.java index 9917fe2c1..e4f2ef6d2 100644 --- a/v1_20_R4/src/main/java/net/citizensnpcs/nms/v1_20_R4/entity/EntityHumanNPC.java +++ b/v1_20_R4/src/main/java/net/citizensnpcs/nms/v1_20_R4/entity/EntityHumanNPC.java @@ -60,13 +60,11 @@ import net.minecraft.world.phys.Vec3; public class EntityHumanNPC extends ServerPlayer implements NPCHolder, SkinnableEntity, ForwardingMobAI { private PlayerAdvancements advancements; - private MobAI ai; private int jumpTicks = 0; private final CitizensNPC npc; private boolean setBukkitEntity; private final SkinPacketTracker skinTracker; - private EmptyServerStatsCounter statsCache; public EntityHumanNPC(MinecraftServer minecraftServer, ServerLevel world, GameProfile gameProfile, @@ -269,7 +267,6 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable } catch (IOException e) { e.printStackTrace(); } - this.invulnerableTime = 0; setSkinFlags((byte) 0xFF); } diff --git a/v1_21_R3/src/main/java/net/citizensnpcs/nms/v1_21_R3/entity/EntityHumanNPC.java b/v1_21_R3/src/main/java/net/citizensnpcs/nms/v1_21_R3/entity/EntityHumanNPC.java index 8923fa27d..aa67a24f8 100644 --- a/v1_21_R3/src/main/java/net/citizensnpcs/nms/v1_21_R3/entity/EntityHumanNPC.java +++ b/v1_21_R3/src/main/java/net/citizensnpcs/nms/v1_21_R3/entity/EntityHumanNPC.java @@ -268,7 +268,7 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable } catch (IOException e) { e.printStackTrace(); } - this.invulnerableTime = 0; + setClientLoaded(true); setSkinFlags((byte) 0xFF); } diff --git a/v1_8_R3/src/main/java/net/citizensnpcs/nms/v1_8_R3/entity/EntityHumanNPC.java b/v1_8_R3/src/main/java/net/citizensnpcs/nms/v1_8_R3/entity/EntityHumanNPC.java index 7f809b354..b595c2f98 100644 --- a/v1_8_R3/src/main/java/net/citizensnpcs/nms/v1_8_R3/entity/EntityHumanNPC.java +++ b/v1_8_R3/src/main/java/net/citizensnpcs/nms/v1_8_R3/entity/EntityHumanNPC.java @@ -241,7 +241,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable controllerJump = new PlayerControllerJump(this); controllerMove = new PlayerControllerMove(this); navigation = new PlayerNavigation(this, world); - invulnerableTicks = 0; } public boolean isNavigating() {