mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-25 19:14:30 +00:00
Merge branch 'dev' into syntax-highlighter-unified
This commit is contained in:
commit
7aeb003806
54 files changed
+2995
-377
No files matched your search
@@ -10,6 +10,7 @@ import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import noppes.npcs.controllers.ScriptController;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.controllers.data.action.ActionManager;
|
||||
|
||||
public class ServerTickHandler {
|
||||
@@ -65,6 +66,11 @@ public class ServerTickHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void playerLogout(PlayerEvent.PlayerLoggedOutEvent event) {
|
||||
// Dismount player from NPC mount before logout to prevent orphaned mount state
|
||||
if (event.player.ridingEntity instanceof EntityNPCInterface) {
|
||||
event.player.mountEntity(null);
|
||||
}
|
||||
|
||||
PlayerData playerData = PlayerData.get(event.player);
|
||||
if (playerData != null) {
|
||||
playerData.onLogout();
|
||||
|
||||
Reference in new issue
Block a user