Reset player GUI state on respawn

This commit is contained in:
Kam committed 2025-07-07 05:22:49 -04:00
1 parent 3e6b37ac05
commit 6b63d89d55
1 file changed
+10
@@ -285,6 +285,16 @@ public class ServerEventsHandler {
}
}
@SubscribeEvent
public void onPlayerRespawn(PlayerEvent.PlayerRespawnEvent event) {
if (event.player == null || event.player.worldObj == null || event.player.worldObj.isRemote)
return;
PlayerData data = PlayerData.get(event.player);
data.setGUIOpen(false);
data.editingNpc = null;
}
private void doExcalibur(EntityPlayer player, EntityLivingBase entity) {
ItemStack item = player.getCurrentEquippedItem();
if (item == null || item.getItem() != CustomItems.excalibur)