Updated book code

- Added book transformers
- Added an index page
- Fixed mouse position on right pages
- Books now save position on close
This commit is contained in:
Arthur Uzulin committed 2016-01-30 02:26:16 +11:00
1 parent d0bd1aac90
commit 4b5c849893
22 files changed
+584 -167

No files matched your search

@@ -19,8 +19,12 @@ public class ResourceHelper {
}
public static ResourceLocation getResourceLocation(String path) {
return getResourceLocation(path, false);
}
public static ResourceLocation getResourceLocation(String path, boolean safe) {
if (path == null)
return null;
return safe ? new ResourceLocation("") : null;
if (!path.contains(":")) {
String langPath = Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getLanguageCode();
String defaultLangPath = "en_US";
@@ -34,12 +38,12 @@ public class ResourceHelper {
res = new ResourceLocation(bookRoot + "/" + path);
if (resourceExists(res))
return res;
return null;
return safe ? new ResourceLocation("") : null;
} else {
ResourceLocation res = new ResourceLocation(path);
if (resourceExists(res))
return res;
return null;
return safe ? new ResourceLocation("") : null;
}
}
@@ -103,9 +107,7 @@ public class ResourceHelper {
builder.append(s);
}
String data = builder.toString().trim();
return data;
return builder.toString().trim();
} catch (IOException e) {
e.printStackTrace();
}