From 6802a1316be36ba2ad513362bc23641b9f7a7654 Mon Sep 17 00:00:00 2001 From: attackeight <71084901+Attack8@users.noreply.github.com> Date: Fri, 22 Mar 2024 09:35:10 -0400 Subject: [PATCH] Respect 'eternal' modifier from Forbidden and Arcanus in Deployer Recipes (#6231) - We Could be Immortal - Fixes Creators-of-Create#6220 --- build.gradle | 2 ++ .../content/kinetics/deployer/BeltDeployerCallbacks.java | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 51000d1ce..a203b1be0 100644 --- a/build.gradle +++ b/build.gradle @@ -204,6 +204,8 @@ dependencies { // runtimeOnly fg.deobf("maven.modrinth:rubidium:0.5.3") // implementation fg.deobf("com.railwayteam.railways:railways-1.18.2-1.1.1:all") { transitive = false } // runtimeOnly fg.deobf("maven.modrinth:spark:1.10.38-forge") + //runtimeOnly fg.deobf("curse.maven:forbidden-arcanus-309858:4729924") + //runtimeOnly fg.deobf("curse.maven:valhelsia-core-416935:3886212") // https://discord.com/channels/313125603924639766/725850371834118214/910619168821354497 // Prevent Mixin annotation processor from getting into IntelliJ's annotation processor settings diff --git a/src/main/java/com/simibubi/create/content/kinetics/deployer/BeltDeployerCallbacks.java b/src/main/java/com/simibubi/create/content/kinetics/deployer/BeltDeployerCallbacks.java index d86d05294..81f43d9ca 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/deployer/BeltDeployerCallbacks.java +++ b/src/main/java/com/simibubi/create/content/kinetics/deployer/BeltDeployerCallbacks.java @@ -94,7 +94,7 @@ public class BeltDeployerCallbacks { public static void activate(TransportedItemStack transported, TransportedItemStackHandlerBehaviour handler, DeployerBlockEntity blockEntity, Recipe recipe) { - + List collect = RecipeApplier.applyRecipeOn(ItemHandlerHelper.copyStackWithSize(transported.stack, 1), recipe) .stream() @@ -113,7 +113,7 @@ public class BeltDeployerCallbacks { .collect(Collectors.toList()); blockEntity.award(AllAdvancements.DEPLOYER); - + TransportedItemStack left = transported.copy(); blockEntity.player.spawnedItemEffects = transported.stack.copy(); left.stack.shrink(1); @@ -128,8 +128,9 @@ public class BeltDeployerCallbacks { } ItemStack heldItem = blockEntity.player.getMainHandItem(); - boolean unbreakable = heldItem.hasTag() && heldItem.getTag() - .getBoolean("Unbreakable"); + boolean unbreakable = heldItem.hasTag() && ( + heldItem.getTag().getBoolean("Unbreakable") || + heldItem.getTag().getString("Modifier").equals("forbidden_arcanus:eternal")); // Forbidden Arcanus Compat, See Creators-of-Create#6220 boolean keepHeld = recipe instanceof ItemApplicationRecipe && ((ItemApplicationRecipe) recipe).shouldKeepHeldItem();