Skip to content

Commit be80b66

Browse files
Copilotrubensworks
andcommitted
Fix MC 1.21.11 upmerge compilation errors (#193)
* Initial plan * Fix upmerge compilation errors for MC 1.21.11 Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
1 parent 70e5639 commit be80b66

3 files changed

Lines changed: 15 additions & 17 deletions

File tree

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ org.gradle.caching=true
3232

3333
# Dependencies
3434
cyclopscore_version=1.25.5-871
35-
integrateddynamics_version=1.24.1-1463
35+
integrateddynamics_version=1.24.1-1652
3636
commoncapabilities_version=2.9.7-303
3737
integratedtunnels_version=1.8.30-534

src/main/java/org/cyclops/integratedcrafting/gametest/GameTestsAdvancements.java

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import net.minecraft.core.BlockPos;
55
import net.minecraft.gametest.framework.GameTestAssertException;
66
import net.minecraft.gametest.framework.GameTestHelper;
7-
import net.minecraft.nbt.Tag;
7+
import net.minecraft.nbt.CompoundTag;
88
import net.minecraft.nbt.TagParser;
99
import net.minecraft.network.chat.Component;
1010
import net.minecraft.resources.Identifier;
@@ -21,7 +21,6 @@
2121
import org.cyclops.integrateddynamics.RegistryEntries;
2222
import org.cyclops.integrateddynamics.api.evaluate.variable.IValue;
2323
import org.cyclops.integrateddynamics.api.evaluate.variable.IVariable;
24-
import org.cyclops.integrateddynamics.api.evaluate.variable.ValueDeseralizationContext;
2524
import org.cyclops.integrateddynamics.api.part.PartPos;
2625
import org.cyclops.integrateddynamics.api.part.PartTarget;
2726
import org.cyclops.integrateddynamics.api.part.write.IPartStateWriter;
@@ -31,6 +30,7 @@
3130
import org.cyclops.integrateddynamics.core.evaluate.variable.Variable;
3231
import org.cyclops.integrateddynamics.core.helper.PartHelpers;
3332
import org.cyclops.integrateddynamics.core.part.event.PartVariableDrivenVariableContentsUpdatedEvent;
33+
import org.cyclops.integrateddynamics.core.test.TestHelpers;
3434

3535
import static org.cyclops.integratedcrafting.gametest.GameTestHelpersIntegratedCrafting.createBasicNetwork;
3636
import static org.cyclops.integratedcrafting.gametest.GameTestHelpersIntegratedCrafting.enableRecipeInWriter;
@@ -161,20 +161,19 @@ public void testAdvancementInsertRecipePlanks(GameTestHelper helper) {
161161

162162
// Deserialize the recipe value from the exact same SNBT that the advancement JSON expects.
163163
// This guarantees ValuePredicate.test() will find equal values via ValueHelpers.areValuesEqual().
164-
Tag recipeTag;
164+
CompoundTag recipeTag;
165165
try {
166166
recipeTag =
167-
TagParser.parseTag(
167+
TagParser.parseCompoundFully(
168168
"{output:{\"minecraft:itemstack\":[{id:\"minecraft:oak_planks\",Count:4}]},"
169169
+ "input:{\"minecraft:itemstack\":[{val:[{condition:5,prototype:{id:\"minecraft:oak_log\",Count:1}}],type:0b}]}}");
170170
} catch (com.mojang.brigadier.exceptions.CommandSyntaxException e) {
171171
throw new RuntimeException(e);
172172
}
173173
IValue recipeValue =
174-
ValueHelpers.deserializeRaw(
175-
ValueDeseralizationContext.of(helper.getLevel()),
176-
ValueTypes.OBJECT_RECIPE,
177-
recipeTag);
174+
TestHelpers.deserialize(
175+
recipeTag,
176+
valueInput -> ValueHelpers.deserializeRaw(valueInput, ValueTypes.OBJECT_RECIPE));
178177
IVariable<?> variable = new Variable<>(recipeValue);
179178

180179
// Fire the event directly, mirroring what PartTypeInterfaceCrafting.State.reloadRecipe() does
@@ -317,20 +316,19 @@ public void testAdvancementCraftCraftingWriterNegative(GameTestHelper helper) {
317316
public void testAdvancementInsertRecipePlanksNegative(GameTestHelper helper) {
318317
ServerPlayer player = helper.makeMockServerPlayerInLevel();
319318

320-
Tag recipeTag;
319+
CompoundTag recipeTag;
321320
try {
322321
recipeTag =
323-
TagParser.parseTag(
322+
TagParser.parseCompoundFully(
324323
"{output:{\"minecraft:itemstack\":[{id:\"minecraft:oak_planks\",Count:4}]},"
325324
+ "input:{\"minecraft:itemstack\":[{val:[{condition:5,prototype:{id:\"minecraft:oak_log\",Count:1}}],type:0b}]}}");
326325
} catch (com.mojang.brigadier.exceptions.CommandSyntaxException e) {
327326
throw new RuntimeException(e);
328327
}
329328
IValue recipeValue =
330-
ValueHelpers.deserializeRaw(
331-
ValueDeseralizationContext.of(helper.getLevel()),
332-
ValueTypes.OBJECT_RECIPE,
333-
recipeTag);
329+
TestHelpers.deserialize(
330+
recipeTag,
331+
valueInput -> ValueHelpers.deserializeRaw(valueInput, ValueTypes.OBJECT_RECIPE));
334332
IVariable<?> variable = new Variable<>(recipeValue);
335333

336334
// Fire with wrong part type (crafting_writer instead of interface_crafting)

src/main/java/org/cyclops/integratedcrafting/gametest/GameTestsItemsCraft.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -791,15 +791,15 @@ public void testItemsCraftDeadBushTagReusableNeedsCrafting(GameTestHelper helper
791791
GameTestHelpersIntegratedCrafting.INetworkPositions<PartTypeInterfaceCrafting.State> positions = createBasicNetwork(helper, POS, Blocks.CRAFTING_TABLE, Blocks.CRAFTING_TABLE);
792792

793793
// Insert items in interface chest: no shears, but iron ingots to craft them
794-
ChestBlockEntity chestIn = helper.getBlockEntity(POS.east());
794+
ChestBlockEntity chestIn = helper.getBlockEntity(POS.east(), ChestBlockEntity.class);
795795
chestIn.setItem(0, new ItemStack(Items.IRON_INGOT, 2));
796796
chestIn.setItem(1, new ItemStack(Items.SPRUCE_SAPLING, 10));
797797

798798
// Add dead bush recipe with reusable shears to crafting interface 0
799799
createDeadBushTagReusableRecipe(helper, positions);
800800

801801
// Add shears recipe to crafting interface 1
802-
positions.interfaceRecipeAdders().get(1).accept(Triple.of(0, RecipeType.CRAFTING, ResourceLocation.fromNamespaceAndPath("minecraft", "shears")));
802+
positions.interfaceRecipeAdders().get(1).accept(Triple.of(0, RecipeType.CRAFTING, Identifier.fromNamespaceAndPath("minecraft", "shears")));
803803

804804
// Speed up crafting interfaces, to craft once every tick
805805
GameTestHelpersIntegratedCrafting.setCraftingInterfaceUpdateInterval(positions.interfaces().get(0), 1);

0 commit comments

Comments
 (0)