mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-11 21:57:40 +00:00
Reset player GUI state on respawn
This commit is contained in:
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)
|
||||
|
||||
Reference in new issue
Block a user