mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 04:35:03 +00:00
Merge branch 'dev' into janino-scripts
This commit is contained in:
commit
fb0332e5cf
53 files changed
+3017
-376
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