Fixed redundant function calls for saving player data in NoppesUtilServer when using isGUIOpen(). Added getServerTime() to NpcAPI.

This commit is contained in:
luisc committed 2021-11-22 02:33:28 -06:00
1 parent 77c2897109
commit 8a7f40189e
3 files changed
+7 -19

No files matched your search

@@ -707,16 +707,8 @@ public class NoppesUtilServer {
}
public static void isGUIOpen(ByteBuf buffer, EntityPlayer player) throws IOException {
EntityPlayer pl = MinecraftServer.getServer().getConfigurationManager().func_152612_a(player.getDisplayName());
PlayerData playerdata;
if(pl == null)
playerdata = PlayerDataController.instance.getDataFromUsername(player.getDisplayName());
else
playerdata = PlayerDataController.instance.getPlayerData(pl);
PlayerData playerdata = PlayerDataController.instance.getPlayerData(player);
boolean isGUIOpen = buffer.readBoolean();
playerdata.setGUIOpen(isGUIOpen);
sendPlayerData(EnumPlayerData.Players, (EntityPlayerMP)player, player.getDisplayName());
}
}