diff options
| author | Danielshe <shekwancheung0528@gmail.com> | 2019-11-03 14:44:52 +0800 |
|---|---|---|
| committer | Danielshe <shekwancheung0528@gmail.com> | 2019-11-03 14:44:59 +0800 |
| commit | 9f5a9eae9a7863412cc5eb433bf15e5ee71da616 (patch) | |
| tree | 0e6b0b94af061c5e9023b1ff19f339a6c30149be /src/main/java/me/shedaniel/rei/api/Entry.java | |
| parent | 3e3e25855b9f6df507a7d4c8a07c64b9a502fae2 (diff) | |
| download | RoughlyEnoughItems-9f5a9eae9a7863412cc5eb433bf15e5ee71da616.tar.gz RoughlyEnoughItems-9f5a9eae9a7863412cc5eb433bf15e5ee71da616.tar.bz2 RoughlyEnoughItems-9f5a9eae9a7863412cc5eb433bf15e5ee71da616.zip | |
3.2.1
Diffstat (limited to 'src/main/java/me/shedaniel/rei/api/Entry.java')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/api/Entry.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/main/java/me/shedaniel/rei/api/Entry.java b/src/main/java/me/shedaniel/rei/api/Entry.java index fca8f9fd2..c0eb609bb 100644 --- a/src/main/java/me/shedaniel/rei/api/Entry.java +++ b/src/main/java/me/shedaniel/rei/api/Entry.java @@ -5,6 +5,7 @@ package me.shedaniel.rei.api; +import me.shedaniel.rei.api.annotations.ToBeRemoved; import me.shedaniel.rei.impl.FluidEntry; import me.shedaniel.rei.impl.ItemStackEntry; import net.minecraft.fluid.Fluid; @@ -12,7 +13,9 @@ import net.minecraft.item.ItemStack; import javax.annotation.Nullable; -public interface Entry { +@Deprecated +@ToBeRemoved +public interface Entry extends Cloneable { @SuppressWarnings("deprecation") static Entry create(ItemStack itemStack) { return new ItemStackEntry(itemStack); @@ -31,6 +34,18 @@ public interface Entry { @Nullable Fluid getFluid(); + Entry clone(); + + default EntryStack toEntryStack() { + if (getEntryType() == Type.ITEM) + return EntryStack.create(getItemStack()); + if (getEntryType() == Type.FLUID) + return EntryStack.create(getFluid()); + return EntryStack.empty(); + } + + boolean equalsEntry(Entry other, boolean checkTags); + public static enum Type { ITEM, FLUID } |
