aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2019-01-21 20:19:33 +0800
committerUnknown <shekwancheung0528@gmail.com>2019-01-21 20:19:33 +0800
commitced2b8eea039105d126ff5e2458e05b0a97687d2 (patch)
treed5b3d92563e596c7386cb3cc149210df5897dd41 /src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java
parent0cde1f4a8357c950fac589809a09d55e30fa3ce3 (diff)
downloadRoughlyEnoughItems-2.1.0.42.tar.gz
RoughlyEnoughItems-2.1.0.42.tar.bz2
RoughlyEnoughItems-2.1.0.42.zip
Resizable Recipe Base, Better Language Files, Trying to fix recipes not being loadedv2.1.0.42
Diffstat (limited to 'src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java')
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java
index 4134ad510..5e9cb4dc3 100644
--- a/src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java
+++ b/src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java
@@ -1,10 +1,12 @@
package me.shedaniel.rei.gui.widget;
import com.mojang.blaze3d.platform.GlStateManager;
+import me.shedaniel.rei.RoughlyEnoughItemsCore;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.Drawable;
import net.minecraft.client.render.GuiLighting;
import net.minecraft.util.Identifier;
+import net.minecraft.util.math.MathHelper;
import java.awt.*;
import java.util.ArrayList;
@@ -30,7 +32,16 @@ public class RecipeBaseWidget extends Drawable implements IWidget {
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
GuiLighting.disable();
MinecraftClient.getInstance().getTextureManager().bindTexture(CHEST_GUI_TEXTURE);
- drawTexturedRect(bounds.x, bounds.y, 106, 190, bounds.width, bounds.height);
+ drawTexturedRect(bounds.x, bounds.y, 106, 190, bounds.width / 2, bounds.height / 2);
+ drawTexturedRect(bounds.x + bounds.width / 2, bounds.y, 256 - bounds.width / 2, 190, bounds.width / 2, bounds.height / 2);
+ drawTexturedRect(bounds.x, bounds.y + bounds.height / 2, 106, 190 + 66 - bounds.height / 2, bounds.width / 2, bounds.height / 2);
+ drawTexturedRect(bounds.x + bounds.width / 2, bounds.y + bounds.height / 2, 256 - bounds.width / 2, 190 + 66 - bounds.height / 2, bounds.width / 2, bounds.height / 2);
+ if (bounds.height > 40)
+ for(int i = 20; i < bounds.height - 20; i += MathHelper.clamp(20, 0, bounds.height - 20 - i)) {
+ int height = MathHelper.clamp(20, 0, bounds.height - 20 - i);
+ drawTexturedRect(bounds.x, bounds.y + i, 106, 230, bounds.width / 2, height);
+ drawTexturedRect(bounds.x + bounds.width / 2, bounds.y + i, 256 - bounds.width / 2, 210, bounds.width / 2, height);
+ }
}
}