diff --git a/src/main/java/noppes/npcs/client/gui/SubGuiEffectGeneral.java b/src/main/java/noppes/npcs/client/gui/SubGuiEffectGeneral.java index 1b0ce59b2..2aba49947 100644 --- a/src/main/java/noppes/npcs/client/gui/SubGuiEffectGeneral.java +++ b/src/main/java/noppes/npcs/client/gui/SubGuiEffectGeneral.java @@ -109,7 +109,8 @@ public class SubGuiEffectGeneral extends SubGuiInterface implements ITextfieldLi x = oldX - 4; y += 23; - GuiScrollWindow scrollWindow = new GuiScrollWindow(this, x + 5, y, xSize - 20, ySize - 10 - (y - guiTop), 0) { + int scrollClipHeight = ySize - 10 - (y - guiTop); + GuiScrollWindow scrollWindow = new GuiScrollWindow(this, x + 5, y, xSize - 20, scrollClipHeight, 0) { @Override public void drawComponents(int mouseX, int mouseY, float partialTicks) { super.drawComponents(mouseX, mouseY, partialTicks); @@ -218,6 +219,9 @@ public class SubGuiEffectGeneral extends SubGuiInterface implements ITextfieldLi )); } + int contentBottom = y + 20 + 5; + scrollWindow.maxScrollY = Math.max(0, contentBottom - scrollClipHeight); + } private GuiNpcTextField setIntegerOnly(GuiNpcTextField field, int min, int max, int def) {