Search in sources :

Example 1 with ImagesPack

use of com.chattriggers.ctjs.utils.ImagesPack in project ct.js by ChatTriggers.

the class CTJS method injectResourcePack.

private void injectResourcePack(String path) {
    try {
        File pictures = new File(path, "ChatTriggers/images/");
        Field field = FMLClientHandler.class.getDeclaredField("resourcePackList");
        field.setAccessible(true);
        List<IResourcePack> packs = (List<IResourcePack>) field.get(FMLClientHandler.instance());
        imagesPack = new ImagesPack(pictures);
        packs.add(imagesPack);
        pictures.mkdirs();
        assetsDir = pictures;
    } catch (Exception exception) {
        exception.printStackTrace();
    }
}
Also used : Field(java.lang.reflect.Field) List(java.util.List) File(java.io.File) IResourcePack(net.minecraft.client.resources.IResourcePack) ImagesPack(com.chattriggers.ctjs.utils.ImagesPack) IOException(java.io.IOException) FileNotFoundException(java.io.FileNotFoundException)

Aggregations

ImagesPack (com.chattriggers.ctjs.utils.ImagesPack)1 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 Field (java.lang.reflect.Field)1 List (java.util.List)1 IResourcePack (net.minecraft.client.resources.IResourcePack)1