aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/recipe
diff options
context:
space:
mode:
authorRecursivePineapple <recursive_pineapple@proton.me>2024-08-08 09:16:57 -0400
committerGitHub <noreply@github.com>2024-08-08 20:16:57 +0700
commit89156d0d8485753e0cea91637fced1b66897a6df (patch)
treec5f8fb72aa0e30822cad8f015fd8a25021915466 /src/main/java/gregtech/api/recipe
parent3c228c3bab6b2fd731063e59b029f98882fc25e6 (diff)
downloadGT5-Unofficial-89156d0d8485753e0cea91637fced1b66897a6df.tar.gz
GT5-Unofficial-89156d0d8485753e0cea91637fced1b66897a6df.tar.bz2
GT5-Unofficial-89156d0d8485753e0cea91637fced1b66897a6df.zip
Added the miniature wormhole generator (#2800)
* Added the miniature wormhole generator * Updated structure & tooltip and added hatch hask * Fixed controller promotion not working * Initial work wormhole render + spotless + git strangeness * Fix wildcard imports * Removed redundant code + added more reasonable defaults * fix * sa * Remove debug print statements --------- Co-authored-by: Martin Robertz <dream-master@gmx.net> Co-authored-by: CookieBrigade <138534411+cookiebrigade@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gregtech/api/recipe')
-rw-r--r--src/main/java/gregtech/api/recipe/check/CheckRecipeResultRegistry.java1
-rw-r--r--src/main/java/gregtech/api/recipe/check/ResultMissingItem.java60
2 files changed, 61 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/recipe/check/CheckRecipeResultRegistry.java b/src/main/java/gregtech/api/recipe/check/CheckRecipeResultRegistry.java
index 41ea858fec..5844a49180 100644
--- a/src/main/java/gregtech/api/recipe/check/CheckRecipeResultRegistry.java
+++ b/src/main/java/gregtech/api/recipe/check/CheckRecipeResultRegistry.java
@@ -155,5 +155,6 @@ public final class CheckRecipeResultRegistry {
register(new ResultInsufficientMachineTier(0));
register(new ResultInsufficientStartupPower(0));
register(new ResultInsufficientStartupPowerBigInt(BigInteger.ZERO));
+ register(new ResultMissingItem());
}
}
diff --git a/src/main/java/gregtech/api/recipe/check/ResultMissingItem.java b/src/main/java/gregtech/api/recipe/check/ResultMissingItem.java
new file mode 100644
index 0000000000..868d664109
--- /dev/null
+++ b/src/main/java/gregtech/api/recipe/check/ResultMissingItem.java
@@ -0,0 +1,60 @@
+package gregtech.api.recipe.check;
+
+import java.util.Objects;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import net.minecraft.client.resources.I18n;
+import net.minecraft.item.ItemStack;
+import net.minecraft.network.PacketBuffer;
+
+import cpw.mods.fml.common.network.ByteBufUtils;
+
+public class ResultMissingItem implements CheckRecipeResult {
+
+ @Nullable
+ public ItemStack itemStack;
+
+ public ResultMissingItem() {
+
+ }
+
+ public ResultMissingItem(@Nullable ItemStack itemStack) {
+ this.itemStack = itemStack;
+ }
+
+ @Override
+ @Nonnull
+ public String getID() {
+ return "missing_item";
+ }
+
+ @Override
+ public boolean wasSuccessful() {
+ return false;
+ }
+
+ @Override
+ @Nonnull
+ public String getDisplayString() {
+ return Objects.requireNonNull(
+ I18n.format("GT5U.gui.text.missing_item", itemStack != null ? itemStack.getDisplayName() : "null"));
+ }
+
+ @Override
+ @Nonnull
+ public CheckRecipeResult newInstance() {
+ return new ResultMissingItem(itemStack != null ? itemStack.copy() : null);
+ }
+
+ @Override
+ public void encode(@Nonnull PacketBuffer buffer) {
+ ByteBufUtils.writeItemStack(buffer, itemStack);
+ }
+
+ @Override
+ public void decode(PacketBuffer buffer) {
+ this.itemStack = ByteBufUtils.readItemStack(buffer);
+ }
+}