diff --git a/v1_19_R2/src/main/java/net/citizensnpcs/nms/v1_19_R2/util/CustomEntityRegistry.java b/v1_19_R2/src/main/java/net/citizensnpcs/nms/v1_19_R2/util/CustomEntityRegistry.java index f74ca7245..1a7efcbfd 100644 --- a/v1_19_R2/src/main/java/net/citizensnpcs/nms/v1_19_R2/util/CustomEntityRegistry.java +++ b/v1_19_R2/src/main/java/net/citizensnpcs/nms/v1_19_R2/util/CustomEntityRegistry.java @@ -152,7 +152,7 @@ public class CustomEntityRegistry extends DefaultedMappedRegistry { public CustomEntityRegistry(DefaultedRegistry> original) throws Throwable { super(original.getDefaultKey().getNamespace(), (ResourceKey>>) IREGISTRY_RESOURCE_KEY.invoke(original), - (Lifecycle) IREGISTRY_LIFECYCLE.invoke(original), IREGISTRY_HOLDER_PROVDER.invoke(original) != null); + (Lifecycle) IREGISTRY_LIFECYCLE.invoke(original), true); this.wrapped = (MappedRegistry>) original; } @@ -303,7 +303,6 @@ public class CustomEntityRegistry extends DefaultedMappedRegistry { return wrapped.size(); } - private static final MethodHandle IREGISTRY_HOLDER_PROVDER = NMS.getGetter(MappedRegistry.class, "m"); private static final MethodHandle IREGISTRY_LIFECYCLE = NMS.getFirstGetter(MappedRegistry.class, Lifecycle.class); // replace regex .*?> ([A-Z_]+).*?of\((.*?)::new.*?$ minecraftClassMap.put(EntityType.\1, \2.class); private static final MethodHandle IREGISTRY_RESOURCE_KEY = NMS.getFirstGetter(MappedRegistry.class, diff --git a/v1_19_R2/src/main/java/net/citizensnpcs/nms/v1_19_R2/util/NMSImpl.java b/v1_19_R2/src/main/java/net/citizensnpcs/nms/v1_19_R2/util/NMSImpl.java index 61991bfa8..8fde94031 100644 --- a/v1_19_R2/src/main/java/net/citizensnpcs/nms/v1_19_R2/util/NMSImpl.java +++ b/v1_19_R2/src/main/java/net/citizensnpcs/nms/v1_19_R2/util/NMSImpl.java @@ -1209,19 +1209,19 @@ public class NMSImpl implements NMSBridge { Preconditions.checkNotNull(recipient); Preconditions.checkNotNull(listPlayer); - ServerPlayer entity = ((CraftPlayer) listPlayer).getHandle(); + ServerPlayer from = ((CraftPlayer) listPlayer).getHandle(); ClientboundPlayerInfoUpdatePacket packet = ClientboundPlayerInfoUpdatePacket - .createPlayerInitializing(Arrays.asList(entity)); + .createPlayerInitializing(Arrays.asList(from)); - boolean list = entity instanceof NPCHolder - ? !((NPCHolder) entity).getNPC().data().get("removefromtablist", Setting.DISABLE_TABLIST.asBoolean()) + boolean list = from instanceof NPCHolder + ? !((NPCHolder) from).getNPC().data().get("removefromtablist", Setting.DISABLE_TABLIST.asBoolean()) : false; - ClientboundPlayerInfoUpdatePacket.Entry entry = new ClientboundPlayerInfoUpdatePacket.Entry(entity.getUUID(), - entity.getGameProfile(), list, entity.latency, entity.gameMode.getGameModeForPlayer(), - !list ? Component.empty() : entity.getTabListDisplayName(), - entity.getChatSession() == null ? null : entity.getChatSession().asData()); + ClientboundPlayerInfoUpdatePacket.Entry entry = new ClientboundPlayerInfoUpdatePacket.Entry(from.getUUID(), + from.getGameProfile(), list, from.latency, from.gameMode.getGameModeForPlayer(), + list ? from.getTabListDisplayName() : Component.empty(), + from.getChatSession() == null ? null : from.getChatSession().asData()); try { PLAYERINFO_ENTRIES.invoke(packet, Lists.newArrayList(entry));