@Override public boolean resourceExists(ResourceLocation location) { if(location == null) { return false; } try { Minecraft.getMinecraft().getResourceManager().getResource(location); return true; } catch(IOException e) { return false; } }
@Override public List<SectionData> getSections() { return new ArrayList<>(Arrays.asList(BookLoader.GSON .fromJson(resourceToString(getResource(getResourceLocation("index.json"))), SectionData[].class))); }
@Override public IResource getResource(ResourceLocation loc) { if(loc == null) { return null; } try { return Minecraft.getMinecraft().getResourceManager().getResource(loc); } catch(IOException e) { return null; } }