mirror of
https://github.com/GTNewHorizons/Mantle.git
synced 2026-11-28 07:35:44 +00:00
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:
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();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user