aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2019-12-24 11:31:40 +0800
committershedaniel <daniel@shedaniel.me>2019-12-24 11:31:40 +0800
commit08d80d588a36598114087a79917e36e9d2cc97c3 (patch)
tree95cde698bbf1eca2f83143d39fd206cf2dc803f2 /src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java
parent7d438f554c4173880a407a6bb8fc80b8a4723845 (diff)
downloadRoughlyEnoughItems-08d80d588a36598114087a79917e36e9d2cc97c3.tar.gz
RoughlyEnoughItems-08d80d588a36598114087a79917e36e9d2cc97c3.tar.bz2
RoughlyEnoughItems-08d80d588a36598114087a79917e36e9d2cc97c3.zip
Finishing workstation usage and close #220
Diffstat (limited to 'src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java')
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java
index a71ff972d..1f8e54ad8 100644
--- a/src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java
+++ b/src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java
@@ -28,7 +28,7 @@ import java.util.function.Supplier;
import java.util.stream.Collectors;
public class AutoCraftingButtonWidget extends ButtonWidget {
-
+
private static final Lazy<Boolean> IS_YOG = new Lazy(() -> {
try {
if (MinecraftClient.getInstance().getSession().getProfile().getId().equals(UUID.fromString("f9546389-9415-4358-9c29-2c26b25bff5b")))
@@ -47,7 +47,7 @@ public class AutoCraftingButtonWidget extends ButtonWidget {
private boolean visible = false;
private RecipeCategory<?> category;
private Rectangle displayBounds;
-
+
public AutoCraftingButtonWidget(Rectangle displayBounds, Rectangle rectangle, String text, Supplier<RecipeDisplay> displaySupplier, List<Widget> setupDisplay, RecipeCategory<?> recipeCategory) {
super(rectangle, text);
this.displayBounds = displayBounds;
@@ -58,7 +58,7 @@ public class AutoCraftingButtonWidget extends ButtonWidget {
this.setupDisplay = setupDisplay;
this.category = recipeCategory;
}
-
+
@Override
public void onPressed() {
AutoTransferHandler.Context context = AutoTransferHandler.Context.create(true, containerScreen, displaySupplier.get());
@@ -73,7 +73,7 @@ public class AutoCraftingButtonWidget extends ButtonWidget {
minecraft.openScreen(containerScreen);
ScreenHelper.getLastOverlay().init();
}
-
+
@Override
public void render(int mouseX, int mouseY, float delta) {
this.enabled = false;
@@ -127,29 +127,29 @@ public class AutoCraftingButtonWidget extends ButtonWidget {
}
int x = getBounds().x, y = getBounds().y, width = getBounds().width, height = getBounds().height;
renderBackground(x, y, width, height, this.getTextureId(isHovered(mouseX, mouseY)));
-
+
int colour = 14737632;
if (!this.visible) {
colour = 10526880;
} else if (enabled && isHovered(mouseX, mouseY)) {
colour = 16777120;
}
-
+
fillGradient(x, y, x + width, y + height, color, color);
this.drawCenteredString(font, getText(), x + width / 2, y + (height - 8) / 2, colour);
-
+
if (getTooltips().isPresent())
if (!focused && containsMouse(mouseX, mouseY))
ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(getTooltips().get().split("\n")));
else if (focused)
ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(new Point(x + width / 2, y + height / 2), getTooltips().get().split("\n")));
}
-
+
@Override
protected int getTextureId(boolean boolean_1) {
return !visible ? 0 : boolean_1 && enabled ? (ConfigObject.getInstance().isLighterButtonHover() ? 4 : 3) : 1;
}
-
+
@Override
public Optional<String> getTooltips() {
String str = "";
@@ -168,7 +168,7 @@ public class AutoCraftingButtonWidget extends ButtonWidget {
}
return Optional.of(str);
}
-
+
@Override
public boolean keyPressed(int int_1, int int_2, int int_3) {
if (displaySupplier.get().getRecipeLocation().isPresent() && ClientHelper.getInstance().getCopyRecipeIdentifierKeyBinding().matchesKey(int_1, int_2) && containsMouse(PointHelper.fromMouse())) {