JitseB / NPCLib

(Minecraft) NPCLib – Basic non-player character library.
MIT License
197 stars 49 forks source link

Distant NPCs don't spawn when getting closer with ViaVersion #162

Open Cosmiiko opened 3 years ago

Cosmiiko commented 3 years ago

Describe the bug NPCs spawned outside of the players' rendering distance will not appear once the player gets closer to the NPC's location if the server is using ViaVersion.

NPCLib usage option Shaded Maven dependency for npclib-plugin

Server version This server is running Paper version git-Paper-1618 (MC: 1.12.2) (Implementing API version 1.12.2-R0.1-SNAPSHOT)

To Reproduce With a 1.12.2 server running ViaVersion and a 1.16.5 client:

  1. Spawn an NPC far away from the player, far enough that it doesn't / wouldn't render anyway.
  2. In-game, get closer to the NPC The NPC never spawns (and the NPCShowEvent is never triggered).

Calling npc.show(player) manually after the player is close enough makes the NPC appear (although it's interact event doesn't trigger either ??).

Expected behavior The NPC should spawn normally once in render distance, and it's interact event should work as intended. It does work as intended when the client is running 1.12.2 too.

JitseB commented 3 years ago

This seems to be connected to #124. Something is fundamentally wrong with the spawning mechanism. I want to use the chuck request packets supported from 1.9 and forward, but then I have to drop 1.8 support, which would be a bummer...

I'll keep this in mind. Thanks for opening this issue ticket.

Cosmiiko commented 3 years ago

It might be related, although in my case the Hologram doesn't spawn either, and isShown(p) returns false (which makes sense so long the NPC is out of render distance).. Anyway, thanks for taking a look at this!