Skip to content

Commit 8939e04

Browse files
committed
Remove CrT workarounds now that a few issues have been fixed
1 parent aa2e30e commit 8939e04

File tree

4 files changed

+5
-35
lines changed

4 files changed

+5
-35
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ yamlops_version=1.2.0
3737

3838
#Mod dependencies
3939
cc_tweaked_version=1.111.0
40-
crafttweaker_version=19.0.3
40+
crafttweaker_version=19.0.7
4141
curios_version=8.0.0-beta.5+1.20.6
4242
emi_version=1.1.6
4343
jade_api_id=5288706

src/main/java/mekanism/common/integration/crafttweaker/CrTRecipeComponents.java

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import com.blamejared.crafttweaker.api.fluid.CTFluidIngredient;
44
import com.blamejared.crafttweaker.api.fluid.IFluidStack;
55
import com.blamejared.crafttweaker.api.ingredient.IIngredientWithAmount;
6-
import com.blamejared.crafttweaker.api.ingredient.type.IIngredientEmpty;
76
import com.blamejared.crafttweaker.api.item.IItemStack;
87
import com.blamejared.crafttweaker.api.recipe.component.BuiltinRecipeComponents;
98
import com.blamejared.crafttweaker.api.recipe.component.DecomposedRecipeBuilder;
@@ -59,29 +58,10 @@ private CrTRecipeComponents() {
5958
FloatingLong::equals
6059
);
6160

62-
public static final PairedRecipeComponent<IIngredientWithAmount, IItemStack> ITEM = new PairedRecipeComponent<>(IRecipeComponent.composite(
63-
Mekanism.rl("input/item"),
64-
new TypeToken<>() {},
65-
(a, b) -> Objects.equals(a, b) || a.amount() == b.amount() && RecipeComponentEqualityCheckers.areIngredientsEqual(a.ingredient(), b.ingredient()),
66-
Collections::singletonList,
67-
ingredients -> {
68-
if (ingredients.isEmpty()) {
69-
return IIngredientEmpty.getInstance().asIIngredientWithAmount();
70-
}
71-
IIngredientWithAmount acc = null;
72-
for (IIngredientWithAmount ingredient : ingredients) {
73-
if (acc == null) {
74-
acc = ingredient;
75-
} else {
76-
if (acc.amount() != ingredient.amount()) {
77-
throw new IllegalArgumentException("Amount mismatch");
78-
}
79-
acc = acc.ingredient().or(ingredient.ingredient()).mul(acc.amount());
80-
}
81-
}
82-
return acc;
83-
}
84-
), BuiltinRecipeComponents.Output.ITEMS);
61+
public static final PairedRecipeComponent<IIngredientWithAmount, IItemStack> ITEM = new PairedRecipeComponent<>(
62+
BuiltinRecipeComponents.Input.INGREDIENTS_WITH_AMOUNTS,
63+
BuiltinRecipeComponents.Output.ITEMS
64+
);
8565
public static final PairedRecipeComponent<CTFluidIngredient, IFluidStack> FLUID = new PairedRecipeComponent<>(
8666
BuiltinRecipeComponents.Input.FLUID_INGREDIENTS,
8767
BuiltinRecipeComponents.Output.FLUIDS

src/main/java/mekanism/common/integration/crafttweaker/CrTUtils.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@
5050
import net.minecraft.world.item.ItemStack;
5151
import net.minecraft.world.level.material.Fluid;
5252
import net.neoforged.neoforge.fluids.FluidStack;
53-
import net.neoforged.neoforge.fluids.crafting.SizedFluidIngredient;
54-
import net.neoforged.neoforge.fluids.crafting.TagFluidIngredient;
5553
import org.jetbrains.annotations.Nullable;
5654

5755
public class CrTUtils {
@@ -157,12 +155,6 @@ public static FluidStackIngredient fromCrT(CTFluidIngredient ingredient) {
157155
* Converts one of our fluid ingredients to a CrT fluid ingredient.
158156
*/
159157
public static CTFluidIngredient toCrT(FluidStackIngredient ingredient) {
160-
SizedFluidIngredient sizedIngredient = ingredient.ingredient();
161-
if (sizedIngredient.ingredient() instanceof TagFluidIngredient tagIngredient) {
162-
return new CTFluidIngredient.FluidTagWithAmountIngredient(fluidTags().tag(tagIngredient.tag()).withAmount(sizedIngredient.amount()));
163-
}
164-
//TODO - 1.20.5: Switch to using just this, instead of special casing ingredients once it gets fixed in CrT
165-
// if it doesn't get fixed we need to add support for converting tag ingredients that are part of a compound fluid ingredient
166158
return ExpandSizedFluidIngredient.asCTFluidIngredient(ingredient.ingredient());
167159
}
168160

src/main/java/mekanism/common/integration/crafttweaker/MekCraftTweakerPlugin.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ public void registerModuleConfigurators(IScriptRunModuleConfiguratorRegistration
3434
@Override
3535
public void registerRecipeComponents(IRecipeComponentRegistrationHandler handler) {
3636
//Input/Output
37-
//Note: We only register the input for items as the output uses the one built into crafttweaker
38-
handler.registerRecipeComponent(CrTRecipeComponents.ITEM.input());
3937
for (ChemicalRecipeComponent<?, ?, ?, ?> chemicalComponent : CrTRecipeComponents.CHEMICAL_COMPONENTS) {
4038
handler.registerRecipeComponent(chemicalComponent.input());
4139
handler.registerRecipeComponent(chemicalComponent.output());

0 commit comments

Comments
 (0)