diff options
| author | shedaniel <daniel@shedaniel.me> | 2021-03-16 01:47:33 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2021-03-16 01:47:33 +0800 |
| commit | d60fd316cc872c8e2d6500f071598ebf79364d4a (patch) | |
| tree | b0400b9e73758c86519cdc7a1f4434a818212247 /api/src/main/java/me | |
| parent | de461fde691f593b85ffeae837b5b419a9abf7cc (diff) | |
| download | RoughlyEnoughItems-d60fd316cc872c8e2d6500f071598ebf79364d4a.tar.gz RoughlyEnoughItems-d60fd316cc872c8e2d6500f071598ebf79364d4a.tar.bz2 RoughlyEnoughItems-d60fd316cc872c8e2d6500f071598ebf79364d4a.zip | |
Implement IGuiIngredientGroup, wrap FluidStack to arch FluidStack properly
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'api/src/main/java/me')
3 files changed, 20 insertions, 4 deletions
diff --git a/api/src/main/java/me/shedaniel/rei/api/gui/widgets/Slot.java b/api/src/main/java/me/shedaniel/rei/api/gui/widgets/Slot.java index c11c3484c..1092d7675 100644 --- a/api/src/main/java/me/shedaniel/rei/api/gui/widgets/Slot.java +++ b/api/src/main/java/me/shedaniel/rei/api/gui/widgets/Slot.java @@ -24,6 +24,7 @@ package me.shedaniel.rei.api.gui.widgets; import me.shedaniel.math.Point; +import me.shedaniel.math.Rectangle; import me.shedaniel.rei.api.ingredient.EntryStack; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -32,21 +33,25 @@ import java.util.Collection; import java.util.List; public abstract class Slot extends WidgetWithBounds { + public static final byte UN_MARKED = 0; + public static final byte INPUT = 1; + public static final byte OUTPUT = 2; + @NotNull public Slot unmarkInputOrOutput() { - setNoticeMark((byte) 0); + setNoticeMark(UN_MARKED); return this; } @NotNull public final Slot markInput() { - setNoticeMark((byte) 1); + setNoticeMark(INPUT); return this; } @NotNull public final Slot markOutput() { - setNoticeMark((byte) 2); + setNoticeMark(OUTPUT); return this; } @@ -148,9 +153,13 @@ public abstract class Slot extends WidgetWithBounds { @NotNull public abstract Slot entries(Collection<? extends EntryStack<?>> stacks); + public abstract EntryStack<?> getCurrentEntry(); + @NotNull public abstract List<EntryStack<?>> getEntries(); + public abstract Rectangle getInnerBounds(); + @Nullable public Tooltip getCurrentTooltip(Point point) { return null; diff --git a/api/src/main/java/me/shedaniel/rei/api/ingredient/EntryIngredient.java b/api/src/main/java/me/shedaniel/rei/api/ingredient/EntryIngredient.java index 2d9feb9bb..5eea0debe 100644 --- a/api/src/main/java/me/shedaniel/rei/api/ingredient/EntryIngredient.java +++ b/api/src/main/java/me/shedaniel/rei/api/ingredient/EntryIngredient.java @@ -44,7 +44,8 @@ public interface EntryIngredient extends List<EntryStack<?>> { return Internals.getEntryIngredientProvider().of(stacks); } + @SuppressWarnings({"RedundantCast", "rawtypes"}) static <T> EntryIngredient of(Iterable<? extends EntryStack<? extends T>> stacks) { - return Internals.getEntryIngredientProvider().of((Iterable<EntryStack<?>>) stacks); + return Internals.getEntryIngredientProvider().of((Iterable<EntryStack<?>>) (Iterable) stacks); } } diff --git a/api/src/main/java/me/shedaniel/rei/api/ingredient/EntryStack.java b/api/src/main/java/me/shedaniel/rei/api/ingredient/EntryStack.java index 9e62eb9a1..57a51896e 100644 --- a/api/src/main/java/me/shedaniel/rei/api/ingredient/EntryStack.java +++ b/api/src/main/java/me/shedaniel/rei/api/ingredient/EntryStack.java @@ -155,12 +155,18 @@ public interface EntryStack<T> extends TextRepresentable, Renderer { public static final Supplier<Boolean> TRUE = () -> true; public static final Supplier<Boolean> FALSE = () -> false; public static final Settings<Supplier<Boolean>> RENDER = new Settings<>(TRUE); + @Deprecated public static final Settings<Supplier<Boolean>> CHECK_TAGS = new Settings<>(FALSE); + @Deprecated public static final Settings<Supplier<Boolean>> CHECK_AMOUNT = new Settings<>(FALSE); + @Deprecated public static final Settings<Supplier<Boolean>> TOOLTIP_ENABLED = new Settings<>(TRUE); + @Deprecated public static final Settings<Supplier<Boolean>> TOOLTIP_APPEND_MOD = new Settings<>(TRUE); public static final Settings<Supplier<Boolean>> RENDER_COUNTS = new Settings<>(TRUE); + @Deprecated public static final Settings<Function<EntryStack<?>, List<Component>>> TOOLTIP_APPEND_EXTRA = new Settings<>(stack -> Collections.emptyList()); + @Deprecated public static final Settings<Function<EntryStack<?>, String>> COUNTS = new Settings<>(stack -> null); private static short nextId; |
