Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Luis C.M committed 2024-03-13 14:00:23 -05:00
commit befe115e74
5 files changed
+15 -16

No files matched your search

@@ -5,10 +5,7 @@ import noppes.npcs.client.gui.OverlayQuestTracking;
import noppes.npcs.client.gui.customoverlay.OverlayCustom;
import noppes.npcs.client.renderer.ImageData;
import noppes.npcs.config.ConfigClient;
import noppes.npcs.controllers.data.Animation;
import noppes.npcs.controllers.data.AnimationData;
import noppes.npcs.controllers.data.Party;
import noppes.npcs.controllers.data.SkinOverlay;
import noppes.npcs.controllers.data.*;
import noppes.npcs.util.CacheHashMap;
import java.util.HashMap;
@@ -17,7 +14,7 @@ import java.util.UUID;
public class ClientCacheHandler {
private static final CacheHashMap<String, CacheHashMap.CachedObject<ImageData>> imageDataCache = new CacheHashMap<>((long) ConfigClient.CacheLife * 60 * 1000);
public static final HashMap<Integer, Animation> animationCache = new HashMap<>();
public static PlayerData playerData = new PlayerData();
public static OverlayQuestTracking questTrackingOverlay = null;
public static HashMap<Integer, OverlayCustom> customOverlays = new HashMap<>();
public static HashMap<UUID, HashMap<Integer, SkinOverlay>> skinOverlays = new HashMap<>();
@@ -56,6 +53,7 @@ public class ClientCacheHandler {
ClientCacheHandler.customOverlays.clear();
ClientCacheHandler.skinOverlays.clear();
ClientCacheHandler.playerAnimations.clear();
ClientCacheHandler.playerData.animationData.clearCache();
party = null;
}
}
@@ -192,18 +192,19 @@ public class ClientProxy extends CommonProxy {
((IReloadableResourceManager)Minecraft.getMinecraft().getResourceManager()).registerReloadListener(new CustomNpcResourceListener());
}
public static PlayerData playerData = new PlayerData();
@Override
public PlayerData getPlayerData(EntityPlayer player) {
if (player.getUniqueID() == Minecraft.getMinecraft().thePlayer.getUniqueID()) {
if (playerData.player != player) {
playerData.player = player;
}
if(ClientCacheHandler.playerData != null){
if (ClientCacheHandler.playerData.player != player) {
ClientCacheHandler.playerData.player = player;
}
return playerData;
} else {
return null;
return ClientCacheHandler.playerData;
}
}
return null;
}
@Override
@@ -116,7 +116,7 @@ public class PacketHandlerClient extends PacketHandlerServer{
SyncController.clientSync(synctype, compound, type == EnumPacketClient.SYNC_END);
if(synctype == SyncType.PLAYER_DATA){
ClientProxy.playerData.setNBT(compound);
ClientCacheHandler.playerData.setNBT(compound);
}
}
else if(type == EnumPacketClient.SYNC_UPDATE){
@@ -68,7 +68,7 @@ public class PlayerData implements IExtendedEntityProperties, IPlayerData {
public ScreenSize screenSize = new ScreenSize(-1,-1);
public void onLogin() {
this.animationData.clearCache();
}
public void onLogout() {