diff --git a/src/main/java/codechicken/nei/config/IMCHandler.java b/src/main/java/codechicken/nei/config/IMCHandler.java index 2e2ad5b6..3b85688a 100644 --- a/src/main/java/codechicken/nei/config/IMCHandler.java +++ b/src/main/java/codechicken/nei/config/IMCHandler.java @@ -98,7 +98,7 @@ public class IMCHandler { } // true if not set to false - info.setCustomScroll(tag.hasKey("useCustomScroll") && tag.getBoolean("useCustomScroll")); + info.setUseCustomScroll(tag.hasKey("useCustomScroll") && tag.getBoolean("useCustomScroll")); info.setShowFavoritesButton(!tag.hasKey("showFavoritesButton") || tag.getBoolean("showFavoritesButton")); info.setShowOverlayButton(!tag.hasKey("showOverlayButton") || tag.getBoolean("showOverlayButton")); diff --git a/src/main/java/codechicken/nei/recipe/DebugHandlerWidget.java b/src/main/java/codechicken/nei/recipe/DebugHandlerWidget.java index 57a42c22..1879d73a 100644 --- a/src/main/java/codechicken/nei/recipe/DebugHandlerWidget.java +++ b/src/main/java/codechicken/nei/recipe/DebugHandlerWidget.java @@ -213,13 +213,13 @@ public class DebugHandlerWidget extends Widget implements IContainerInputHandler } public String getRenderLabel() { - return handlerInfo.useCustomScroll() ? "On" : "Off"; + return handlerInfo.getUseCustomScroll() ? "On" : "Off"; } @Override public boolean onButtonPress(boolean rightclick) { - handlerInfo.setCustomScroll(!handlerInfo.useCustomScroll()); - updatePatch(6, handlerInfo.useCustomScroll() ? 1 : 0, 0); + handlerInfo.setUseCustomScroll(!handlerInfo.getUseCustomScroll()); + updatePatch(6, handlerInfo.getUseCustomScroll() ? 1 : 0, 0); return true; } @@ -588,11 +588,11 @@ public class DebugHandlerWidget extends Widget implements IContainerInputHandler final int width = intOrDefault(parts[3], info.getWidth()); final int maxRecipesPerPage = intOrDefault(parts[4], info.getMaxRecipesPerPage()); final int order = intOrDefault(parts[5], NEIClientConfig.handlerOrdering.getOrDefault(handler, 0)); - final boolean useCustomScroll = intOrDefault(parts[6], info.useCustomScroll() ? 1 : 0) == 1; + final boolean useCustomScroll = intOrDefault(parts[6], info.getUseCustomScroll() ? 1 : 0) == 1; info.setYShift(yShift); info.setHandlerDimensions(height, width, maxRecipesPerPage); - info.setCustomScroll(useCustomScroll); + info.setUseCustomScroll(useCustomScroll); NEIClientConfig.handlerOrdering.put(handler, order); } diff --git a/src/main/java/codechicken/nei/recipe/GuiRecipe.java b/src/main/java/codechicken/nei/recipe/GuiRecipe.java index 2d92d510..4fe17e30 100644 --- a/src/main/java/codechicken/nei/recipe/GuiRecipe.java +++ b/src/main/java/codechicken/nei/recipe/GuiRecipe.java @@ -351,7 +351,7 @@ public abstract class GuiRecipe extends GuiContainer i if (!cacheKey.equals(this.recipePageCacheKey)) { this.recipePageCacheKey = cacheKey; - final boolean recipeGrow = this.handlerInfo.useCustomScroll() + final boolean recipeGrow = this.handlerInfo.getUseCustomScroll() && this.handlerInfo.getMaxRecipesPerPage() <= 1; final List widgets = new ArrayList<>(); int shiftY = 0; @@ -373,7 +373,7 @@ public abstract class GuiRecipe extends GuiContainer i this.container.setWidgets(widgets); - if (this.handlerInfo.useCustomScroll()) { + if (this.handlerInfo.getUseCustomScroll()) { this.container.setVerticalScroll(null); } else if (this.container.w == this.xSize - 6) { this.container.setVerticalScroll(VERTICAL_SCROLLBAR); diff --git a/src/main/java/codechicken/nei/recipe/GuiRecipeTab.java b/src/main/java/codechicken/nei/recipe/GuiRecipeTab.java index b5bd5cb4..22990c51 100644 --- a/src/main/java/codechicken/nei/recipe/GuiRecipeTab.java +++ b/src/main/java/codechicken/nei/recipe/GuiRecipeTab.java @@ -265,7 +265,7 @@ public abstract class GuiRecipeTab extends Widget { NEIClientConfig.logger.info("Error setting handler dimensions for " + handler); } - info.setCustomScroll( + info.setUseCustomScroll( record.isSet("useCustomScroll") ? Boolean.parseBoolean(record.get("useCustomScroll")) : false); handlerMap.put(handler, info); NEIClientConfig.logger.info("Loaded " + handler); diff --git a/src/main/java/codechicken/nei/recipe/HandlerInfo.java b/src/main/java/codechicken/nei/recipe/HandlerInfo.java index 4bd40586..57f8d39a 100644 --- a/src/main/java/codechicken/nei/recipe/HandlerInfo.java +++ b/src/main/java/codechicken/nei/recipe/HandlerInfo.java @@ -125,11 +125,11 @@ public class HandlerInfo { this.showOverlayButton = showOverlayButton; } - public boolean useCustomScroll() { + public boolean getUseCustomScroll() { return this.useCustomScroll; } - public void setCustomScroll(boolean useCustomScroll) { + public void setUseCustomScroll(boolean useCustomScroll) { this.useCustomScroll = useCustomScroll; } @@ -165,8 +165,8 @@ public class HandlerInfo { return this; } - public Builder setCustomScroll(boolean useCustomScroll) { - info.setCustomScroll(useCustomScroll); + public Builder setUseCustomScroll(boolean useCustomScroll) { + info.setUseCustomScroll(useCustomScroll); return this; } diff --git a/src/main/java/codechicken/nei/recipe/NEIRecipeWidget.java b/src/main/java/codechicken/nei/recipe/NEIRecipeWidget.java index 36ee9406..ed79534b 100644 --- a/src/main/java/codechicken/nei/recipe/NEIRecipeWidget.java +++ b/src/main/java/codechicken/nei/recipe/NEIRecipeWidget.java @@ -51,7 +51,8 @@ public class NEIRecipeWidget extends Widget { public void update() { this.w = this.handlerInfo.getWidth(); - if (this.showAsWidget || !this.handlerInfo.useCustomScroll() || this.handlerInfo.getMaxRecipesPerPage() > 1) { + if (this.showAsWidget || !this.handlerInfo.getUseCustomScroll() + || this.handlerInfo.getMaxRecipesPerPage() > 1) { this.h = this.handlerInfo.getHeight() + this.handlerInfo.getYShift(); }