completely annihilated animation caching (not worth it)

This commit is contained in:
luisc committed 2025-02-11 18:03:41 -06:00
1 parent 4d963b0205
commit e5673a85e7
7 files changed
+11 -83

No files matched your search

@@ -51,7 +51,6 @@ public class ClientCacheHandler {
ClientCacheHandler.customOverlays.clear();
ClientCacheHandler.skinOverlays.clear();
ClientCacheHandler.playerAnimations.clear();
ClientCacheHandler.playerData.animationData.clearCache();
}
public static void clearSkinCache() {
@@ -8,7 +8,6 @@ import noppes.npcs.LogWriter;
import noppes.npcs.api.handler.IAnimationHandler;
import noppes.npcs.api.handler.data.IAnimation;
import noppes.npcs.controllers.data.Animation;
import noppes.npcs.controllers.data.PlayerData;
import noppes.npcs.util.NBTJsonUtil;
import java.io.*;
@@ -121,10 +120,6 @@ public class AnimationController implements IAnimationHandler {
animations.remove(animation.getID());
animations.put(animation.getID(), (Animation) animation);
for (PlayerData playerData : PlayerDataController.Instance.getAllPlayerData()) {
playerData.animationData.uncacheAnimation(animation.getID());
}
saveAnimationMap();
// Save Animation File
@@ -1,8 +1,6 @@
package noppes.npcs.controllers.data;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import kamkeel.npcs.network.PacketHandler;
import kamkeel.npcs.network.packets.data.UpdateAnimationsPacket;
import net.minecraft.entity.Entity;
@@ -14,7 +12,6 @@ import net.minecraft.util.AxisAlignedBB;
import noppes.npcs.CommonProxy;
import noppes.npcs.DataDisplay;
import noppes.npcs.EventHooks;
import noppes.npcs.Server;
import noppes.npcs.api.entity.IAnimatable;
import noppes.npcs.api.entity.IEntity;
import noppes.npcs.api.handler.data.IAnimation;
@@ -25,7 +22,6 @@ import noppes.npcs.entity.EntityNPCInterface;
import noppes.npcs.scripted.NpcAPI;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -41,8 +37,6 @@ public class AnimationData implements IAnimationData {
public Animation currentClientAnimation;
private boolean isClientAnimating;
private final HashSet<Integer> cachedAnimationIDs = new HashSet<>();
//Client-side values
public int finishedTime = -1;
public int finishedFrame = -1;
@@ -182,22 +176,6 @@ public class AnimationData implements IAnimationData {
}
}
public boolean isCached(int id) {
return this.cachedAnimationIDs.contains(id);
}
public void cacheAnimation(int id) {
this.cachedAnimationIDs.add(id);
}
public void uncacheAnimation(int id) {
this.cachedAnimationIDs.remove(id);
}
public void clearCache() {
this.cachedAnimationIDs.clear();
}
public void viewAnimation(Animation animation, AnimationData animationData, NBTTagCompound animationNBT) {
this.viewAnimation(animation, animationData, animationNBT, animationData.allowAnimation, -1, -1);
}
@@ -69,12 +69,10 @@ public class PlayerData implements IExtendedEntityProperties, IPlayerData {
public ScreenSize screenSize = new ScreenSize(-1,-1);
public void onLogin() {
this.animationData.clearCache();
}
public void onLogout() {
this.partyInvites.clear();
this.animationData.clearCache();
}
@Override