aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java
diff options
context:
space:
mode:
authorDaniel She <shekwancheung0528@gmail.com>2019-05-10 00:20:16 +0800
committerGitHub <noreply@github.com>2019-05-10 00:20:16 +0800
commit67fc756047f34bdbb9f028e48fc725534b3beafc (patch)
tree670f0694b3313eaf712020a9d60dc34404725777 /src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java
parent766b4837c2512cefa3188adc897605a83144f711 (diff)
parent467511401a783fc0a8d625947e69519da1c815e1 (diff)
downloadRoughlyEnoughItems-67fc756047f34bdbb9f028e48fc725534b3beafc.tar.gz
RoughlyEnoughItems-67fc756047f34bdbb9f028e48fc725534b3beafc.tar.bz2
RoughlyEnoughItems-67fc756047f34bdbb9f028e48fc725534b3beafc.zip
Merge pull request #86 from shedaniel/1.14-dev
REi v2.9 (WIP)
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.java14
1 files changed, 12 insertions, 2 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 57dbd5e89..cd294dc69 100644
--- a/src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java
+++ b/src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java
@@ -2,6 +2,7 @@ package me.shedaniel.rei.gui.widget;
import com.mojang.blaze3d.platform.GlStateManager;
import me.shedaniel.rei.RoughlyEnoughItemsCore;
+import me.shedaniel.rei.client.RecipeScreenType;
import net.minecraft.client.render.GuiLighting;
import net.minecraft.util.Identifier;
@@ -12,7 +13,6 @@ import java.util.List;
public class RecipeBaseWidget extends HighlightableWidget {
private static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png");
- private static final Color INNER_COLOR = new Color(198, 198, 198);
private Rectangle bounds;
@@ -38,6 +38,8 @@ public class RecipeBaseWidget extends HighlightableWidget {
@Override
public void render(int mouseX, int mouseY, float delta) {
+ if (!isRendering())
+ return;
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
GuiLighting.disable();
minecraft.getTextureManager().bindTexture(CHEST_GUI_TEXTURE);
@@ -61,7 +63,15 @@ public class RecipeBaseWidget extends HighlightableWidget {
this.blit(x, y + yy, 106, 128 + textureOffset, 4, thisHeight);
this.blit(x + width - 4, y + yy, 252, 128 + textureOffset, 4, thisHeight);
}
- fillGradient(x + 4, y + 4, x + width - 4, y + height - 4, INNER_COLOR.getRGB(), INNER_COLOR.getRGB());
+ fillGradient(x + 4, y + 4, x + width - 4, y + height - 4, getInnerColor(), getInnerColor());
+ }
+
+ protected boolean isRendering() {
+ return RoughlyEnoughItemsCore.getConfigManager().getConfig().screenType != RecipeScreenType.VILLAGER;
+ }
+
+ protected int getInnerColor() {
+ return -3750202;
}
protected int getTextureOffset() {