Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private <T> void load(String thing, LoadFunc<T> loader, Map<ResourceLocation, T>
}

protected BookContentLoader getContentLoader() {
if (book.isExternal) {
if (!book.useResourcePack) {
return BookContentExternalLoader.INSTANCE;
}
// A quick reload should not reuse stale data, it is initiated by the user anyways
Expand Down
9 changes: 4 additions & 5 deletions Xplat/src/main/java/vazkii/patchouli/common/book/Book.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ public class Book {

public final int textColor, headerColor, nameplateColor, linkColor, linkHoverColor, progressBarColor, progressBarBackground;

public final boolean isExternal;

// JSON Loaded properties

public final boolean useResourcePack;

public final String name;
public final String landingText;

Expand Down Expand Up @@ -116,7 +116,7 @@ public Book(JsonObject root, XplatModContainer owner, ResourceLocation id, boole

this.owner = owner;
this.id = id;
this.isExternal = external;
this.useResourcePack = GsonHelper.getAsBoolean(root, "use_resource_pack", false);;
this.textColor = parseColor(root, "text_color", "000000");
this.headerColor = parseColor(root, "header_color", "333333");
this.nameplateColor = parseColor(root, "nameplate_color", "FFDD00");
Expand All @@ -139,8 +139,7 @@ public Book(JsonObject root, XplatModContainer owner, ResourceLocation id, boole
this.i18n = GsonHelper.getAsBoolean(root, "i18n", false);
this.overflowMode = SerializationUtil.getAsEnum(root, "text_overflow_mode", PatchouliConfigAccess.TextOverflowMode.class, null);

boolean useResourcePack = GsonHelper.getAsBoolean(root, "use_resource_pack", false);
if (!this.isExternal && !useResourcePack) {
if (!external && !this.useResourcePack) {
String message = "Book %s has use_resource_pack set to false. ".formatted(this.id)
+ "This behaviour was removed in 1.20. "
+ "The book author should enable this flag and move all book contents clientside to /assets/, "
Expand Down