diff options
| author | shedaniel <daniel@shedaniel.me> | 2020-01-17 14:31:30 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2020-01-17 14:31:30 +0800 |
| commit | 7a1cf35934ef14c04f884fe6ae34282e1d6243ba (patch) | |
| tree | e84d0c5bfb9929f065544e96ecc1fb07d3496c29 /src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java | |
| parent | b4be45e414504afb49910d766bebcd00f55b052b (diff) | |
| download | RoughlyEnoughItems-7a1cf35934ef14c04f884fe6ae34282e1d6243ba.tar.gz RoughlyEnoughItems-7a1cf35934ef14c04f884fe6ae34282e1d6243ba.tar.bz2 RoughlyEnoughItems-7a1cf35934ef14c04f884fe6ae34282e1d6243ba.zip | |
3.3.12
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.java | 13 |
1 files changed, 6 insertions, 7 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 0fe31025b..c0d37da28 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java @@ -11,7 +11,6 @@ import me.shedaniel.math.api.Point; import me.shedaniel.math.api.Rectangle; import me.shedaniel.math.impl.PointHelper; import me.shedaniel.rei.api.*; -import me.shedaniel.rei.api.annotations.Internal; import me.shedaniel.rei.gui.toast.CopyRecipeIdentifierToast; import me.shedaniel.rei.impl.ScreenHelper; import net.minecraft.client.MinecraftClient; @@ -20,6 +19,7 @@ import net.minecraft.client.resource.language.I18n; import net.minecraft.util.Formatting; import net.minecraft.util.Identifier; import net.minecraft.util.Lazy; +import org.jetbrains.annotations.ApiStatus; import java.time.LocalDateTime; import java.util.List; @@ -28,11 +28,10 @@ import java.util.UUID; import java.util.function.Supplier; import java.util.stream.Collectors; -@Internal -@Deprecated +@ApiStatus.Internal public class AutoCraftingButtonWidget extends ButtonWidget { - private static final Lazy<Boolean> IS_YOG = new Lazy(() -> { + private static final Lazy<Boolean> IS_YOG = new Lazy<>(() -> { try { if (MinecraftClient.getInstance().getSession().getProfile().getId().equals(UUID.fromString("f9546389-9415-4358-9c29-2c26b25bff5b"))) return true; @@ -54,7 +53,7 @@ public class AutoCraftingButtonWidget extends ButtonWidget { public AutoCraftingButtonWidget(Rectangle displayBounds, Rectangle rectangle, String text, Supplier<RecipeDisplay> displaySupplier, List<Widget> setupDisplay, RecipeCategory<?> recipeCategory) { super(rectangle, text); this.displayBounds = displayBounds; - this.displaySupplier = () -> displaySupplier.get(); + this.displaySupplier = displaySupplier; Optional<Identifier> recipe = displaySupplier.get().getRecipeLocation(); extraTooltip = recipe.isPresent() ? I18n.translate("text.rei.recipe_id", Formatting.GRAY.toString(), recipe.get().toString()) : ""; this.containerScreen = ScreenHelper.getLastContainerScreen(); @@ -124,7 +123,7 @@ public class AutoCraftingButtonWidget extends ButtonWidget { errorTooltip = error == null || error.isEmpty() ? null : Lists.newArrayList(); if (errorTooltip != null) { for (String s : error) { - if (!errorTooltip.stream().anyMatch(ss -> ss.equalsIgnoreCase(s))) + if (errorTooltip.stream().noneMatch(ss -> ss.equalsIgnoreCase(s))) errorTooltip.add(s); } } @@ -150,7 +149,7 @@ public class AutoCraftingButtonWidget extends ButtonWidget { @Override protected int getTextureId(boolean boolean_1) { - return !visible ? 0 : boolean_1 && enabled ? (ConfigObject.getInstance().isLighterButtonHover() ? 4 : 3) : 1; + return !visible ? 0 : boolean_1 && enabled ? 4 : 1; } @Override |
