diff options
| author | Unknown <shekwancheung0528@gmail.com> | 2019-01-11 17:16:53 +0800 |
|---|---|---|
| committer | Unknown <shekwancheung0528@gmail.com> | 2019-01-11 17:16:53 +0800 |
| commit | 77ff77003ff31dabda47388ca2d9727a185b90f8 (patch) | |
| tree | 73f735d0bfd3a386f0f6551cbc02675ea43206d4 /src/main/java/me/shedaniel/rei/gui/ContainerGuiOverlay.java | |
| parent | def24dd1d0ebd6e12a3a459ece05c0fc94aae4de (diff) | |
| download | RoughlyEnoughItems-77ff77003ff31dabda47388ca2d9727a185b90f8.tar.gz RoughlyEnoughItems-77ff77003ff31dabda47388ca2d9727a185b90f8.tar.bz2 RoughlyEnoughItems-77ff77003ff31dabda47388ca2d9727a185b90f8.zip | |
Crafting Display
Diffstat (limited to 'src/main/java/me/shedaniel/rei/gui/ContainerGuiOverlay.java')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/gui/ContainerGuiOverlay.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/me/shedaniel/rei/gui/ContainerGuiOverlay.java b/src/main/java/me/shedaniel/rei/gui/ContainerGuiOverlay.java index 3ffd95238..643ab5849 100644 --- a/src/main/java/me/shedaniel/rei/gui/ContainerGuiOverlay.java +++ b/src/main/java/me/shedaniel/rei/gui/ContainerGuiOverlay.java @@ -81,6 +81,7 @@ public class ContainerGuiOverlay extends Gui { this.widgets.add(new LabelWidget(rectangle.x + (rectangle.width / 2), rectangle.y + 10, "") { @Override public void draw(int mouseX, int mouseY, float partialTicks) { + page = MathHelper.clamp(page, 0, getTotalPage()); this.text = String.format("%s/%s", page + 1, getTotalPage() + 1); super.draw(mouseX, mouseY, partialTicks); } @@ -148,7 +149,8 @@ public class ContainerGuiOverlay extends Gui { int width = window.getScaledWidth() - startX; if (MinecraftClient.getInstance().currentGui instanceof RecipeViewingWidget) { RecipeViewingWidget widget = (RecipeViewingWidget) MinecraftClient.getInstance().currentGui; - width = window.getScaledWidth() - (widget.getBounds().x + widget.getBounds().width + 10); + startX = widget.getBounds().x + widget.getBounds().width + 10; + width = window.getScaledWidth() - startX; } return new Rectangle(startX, 0, width, window.getScaledHeight()); } |
