Files
CustomNPC-Plus/src/main/java/noppes/npcs/client/Client.java
T

44 lines
1.5 KiB
Java
Raw Normal View History

2018-09-13 12:03:28 -04:00
package noppes.npcs.client;
2023-01-12 21:33:06 -05:00
import cpw.mods.fml.common.network.internal.FMLProxyPacket;
2018-09-13 12:03:28 -04:00
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import noppes.npcs.AnimationData;
2018-09-13 12:03:28 -04:00
import noppes.npcs.CustomNpcs;
import noppes.npcs.Server;
import noppes.npcs.client.gui.OverlayQuestTracking;
import noppes.npcs.client.gui.customoverlay.OverlayCustom;
import noppes.npcs.client.renderer.customitem.ImageData;
2018-09-13 12:03:28 -04:00
import noppes.npcs.constants.EnumPacketServer;
import noppes.npcs.controllers.data.SkinOverlay;
2018-09-13 12:03:28 -04:00
2023-01-12 21:33:06 -05:00
import java.io.IOException;
import java.util.HashMap;
import java.util.UUID;
2018-09-13 12:03:28 -04:00
public class Client {
public static OverlayQuestTracking questTrackingOverlay = null;
public static HashMap<Integer, OverlayCustom> customOverlays = new HashMap<>();
public static HashMap<UUID, HashMap<Integer, SkinOverlay>> skinOverlays = new HashMap<>();
public static HashMap<UUID, AnimationData> playerAnimations = new HashMap<>();
private static HashMap<String, ImageData> imageDataCache = new HashMap<>();
2018-09-13 12:03:28 -04:00
public static void sendData(EnumPacketServer enu, Object... obs) {
ByteBuf buffer = Unpooled.buffer();
try {
if(!Server.fillBuffer(buffer, enu, obs))
return;
CustomNpcs.Channel.sendToServer(new FMLProxyPacket(buffer, "CustomNPCs"));
} catch (IOException e) {
e.printStackTrace();
}
}
public static ImageData getImageData(String directory) {
if (!imageDataCache.containsKey(directory)) {
ImageData downloadData = new ImageData(directory);
imageDataCache.put(directory, downloadData);
}
return imageDataCache.get(directory);
}
2018-09-13 12:03:28 -04:00
}