Skip to content

Commit

Permalink
e
Browse files Browse the repository at this point in the history
  • Loading branch information
JieningYu committed Feb 25, 2023
1 parent b65b5b7 commit 301f4f3
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 24 deletions.
2 changes: 1 addition & 1 deletion index.toml
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ metafile = true

[[files]]
file = "mods/cabricality-mod.pw.toml"
hash = "bfffceeb354915a98521d40bde55e1eaccc213e7edd273490f7afc3ab51f64f7"
hash = "a49d2bcbece8a0e85c971f4ae6ca5d7b9ea2e19fa70c7dfe0f940d52d044088e"
metafile = true

[[files]]
Expand Down
6 changes: 3 additions & 3 deletions mods/cabricality-mod.pw.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ filename = "cabricality-0.2.3.jar"
side = "both"

[download]
url = "https://cdn.modrinth.com/data/BHRmiEC5/versions/RTOko0gJ/cabricality-0.2.3.jar"
url = "https://cdn.modrinth.com/data/BHRmiEC5/versions/XoE1AyzE/cabricality-0.2.3.jar"
hash-format = "sha1"
hash = "ab1de36066b39192ff7fb10142a93455669072e1"
hash = "a8626562976d6c8ecddb6fe662603a447ef3149b"

[update]
[update.modrinth]
mod-id = "BHRmiEC5"
version = "RTOko0gJ"
version = "XoE1AyzE"
2 changes: 1 addition & 1 deletion pack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pack-format = "packwiz:1.1.0"
[index]
file = "index.toml"
hash-format = "sha256"
hash = "5cddadf8b51e8c4e5fc5255ce41a60976f7065c76aa5f9f7eb348b7d8b024f45"
hash = "095841da9e7a38fb4cc5d691a815b530ce20e8f024b2ec5a467748254985ba9f"

[versions]
minecraft = "1.18.2"
Expand Down
60 changes: 41 additions & 19 deletions src/main/java/com/dm/earth/cabricality/tweak/RecipeTweaks.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,24 @@ public void addRecipes(AddRecipesCallback.RecipeHandler handler) {
handler.register(AE2.id("compacting", "matter_plastics"),
id -> new CompactingRecipe(new FreePRP(id)
.setIngredient(matterBall, matterBall, matterBall, matterBall,
matterBall, matterBall, matterBall, matterBall, matterBall)
matterBall, matterBall, matterBall, matterBall,
matterBall)
.setResult(CABF.asProcessingOutput("matter_plastics"))
.setHeatRequirement(HeatCondition.SUPERHEATED)));
}

// Ad Astra
{
Arrays.stream(AD_ASTRA_MATERIALS).forEach(material -> Arrays.stream(AD_ASTRA_DECOR_TYPES).forEach(
type -> handler.register(recipeId("stonecutting", material + "_" + type),
id -> VanillaRecipeBuilders.stonecuttingRecipe(id, "", Ingredient.ofTag(
TagKey.of(Registry.ITEM_KEY, C.id(material + "_plates"))),
AD.asStack(2, material + "_" + type)))));
Arrays.stream(AD_ASTRA_MATERIALS)
.forEach(material -> Arrays.stream(AD_ASTRA_DECOR_TYPES).forEach(
type -> handler.register(
recipeId("stonecutting", material + "_" + type),
id -> VanillaRecipeBuilders.stonecuttingRecipe(
id, "", Ingredient.ofTag(
TagKey.of(Registry.ITEM_KEY,
C.id(material + "_plates"))),
AD.asStack(2, material + "_"
+ type)))));

final String[] AD_ASTRA_COMPRESSED_MATERIALS = { "desh", "ostrum", "calorite" };
Arrays.stream(AD_ASTRA_COMPRESSED_MATERIALS).forEach(material -> handler.register(
Expand All @@ -102,22 +108,29 @@ public void addRecipes(AddRecipesCallback.RecipeHandler handler) {

// Indrev
{
final String[] INDREV_PLATES = { "bronze", "electrum", "lead", "silver", "steel", "tin", "tungsten" };
final String[] INDREV_PLATES = { "bronze", "electrum", "lead", "silver", "steel", "tin",
"tungsten" };

Arrays.stream(INDREV_PLATES).forEach(plate -> handler.register(recipeId("pressing", plate + "_plate"),
id -> new PressingRecipe(new FreePRP(id).setIngredient(IR.asIngredient(plate + "_ingot"))
Arrays.stream(INDREV_PLATES).forEach(plate -> handler.register(
recipeId("pressing", plate + "_plate"),
id -> new PressingRecipe(new FreePRP(id)
.setIngredient(IR.asIngredient(plate + "_ingot"))
.setResult(IR.asProcessingOutput(plate + "_plate")))));

handler.register(recipeId("compacting", "aquamarine_quartz"),
id -> new CompactingRecipe(new FreePRP(id).setIngredient(IR.asIngredient("nikolite_dust"))
.setFluidIngredient(FluidIngredient.fromFluid(CabfFluids.REDSTONE, FluidConstants.NUGGET))
id -> new CompactingRecipe(new FreePRP(id)
.setIngredient(IR.asIngredient("nikolite_dust"))
.setFluidIngredient(FluidIngredient.fromFluid(
CabfFluids.REDSTONE, FluidConstants.NUGGET))
.setResult(CABF.asProcessingOutput("aquamarine_quartz"))
.setHeatRequirement(HeatCondition.HEATED)));

handler.register(recipeId("sandpaper_polishing", "aquamarine_quartz"),
id -> new SandPaperPolishingRecipe(
new FreePRP(id).setIngredient(CABF.asIngredient("aquamarine_quartz"))
.setResult(IR.asProcessingOutput("nikolite_ingot"))));
new FreePRP(id).setIngredient(
CABF.asIngredient("aquamarine_quartz"))
.setResult(IR.asProcessingOutput(
"nikolite_ingot"))));
}

// Dusts
Expand All @@ -136,20 +149,24 @@ public void addRecipes(AddRecipesCallback.RecipeHandler handler) {
id -> new FillingRecipe(
new FreePRP(id).setIngredient(CABF.asIngredient("nickel_ingot"))
.setFluidIngredient(FluidIngredient.fromFluid(
TC.asFluid("molten_iron"), FluidConstants.NUGGET * 6))
.setResult(CABF.asProcessingOutput("nickel_compound"))));
TC.asFluid("molten_iron"),
FluidConstants.NUGGET * 6))
.setResult(CABF.asProcessingOutput(
"nickel_compound"))));

// Saws
handler.register(recipeId("crafting", "stone_rod"),
id -> VanillaRecipeBuilders.shapedRecipe("S", "S")
.ingredient('S', Tags.Items.COBBLESTONE).output(CABF.asStack("stone_rod"))
.ingredient('S', Tags.Items.COBBLESTONE)
.output(CABF.asStack("stone_rod"))
.build(id, ""));

handler.register(recipeId("crafting", "stone_saw"),
id -> VanillaRecipeBuilders.shapedRecipe("SRR", "SMR")
.ingredient('S', MC.asIngredient("stick"))
.ingredient('R', CABF.asIngredient("stone_rod"))
.ingredient('M', MC.asIngredient("flint")).output(CABF.asStack("stone_saw"))
.ingredient('M', MC.asIngredient("flint"))
.output(CABF.asStack("stone_saw"))
.build(id, ""));

handler.register(recipeId("crafting", "iron_saw"),
Expand Down Expand Up @@ -191,13 +208,15 @@ public void addRecipes(AddRecipesCallback.RecipeHandler handler) {
// Redstone
handler.register(recipeId("melting", "redstone"),
id -> RecipeManager.deserialize(id,
RecipeBuilderUtil.generateMelting(MC.id("redstone"), CABF.id("redstone"),
RecipeBuilderUtil.generateMelting(MC.id("redstone"),
CABF.id("redstone"),
FluidConstants.INGOT, null, 0, 250, 15)));

handler.register(recipeId("melting", "redstone_block"),
id -> RecipeManager.deserialize(id,
RecipeBuilderUtil.generateMelting(MC.id("redstone_block"),
CABF.id("redstone"), FluidConstants.BLOCK, null, 0, 250, 135)));
CABF.id("redstone"), FluidConstants.BLOCK, null, 0, 250,
135)));
}

@Override
Expand All @@ -221,6 +240,9 @@ public void removeRecipes(RemoveRecipesCallback.RecipeHandler handler) {
handler.remove(TC.id("smeltery", "alloys", "molten_brass"));
handler.remove(TC.id("smeltery", "alloys", "molten_invar"));

handler.removeIf(r -> r.getId().getNamespace().equals(TC.getModId())
&& r.getId().getPath().startsWith("compat/create"));

// Remove wrenches except Create's and AE2's
handler.removeIf(r -> !CR.checkContains(r) && !AE2.checkContains(r) &&
r.getOutput().getItem().getRegistryName().getPath().contains("wrench"));
Expand Down

0 comments on commit 301f4f3

Please sign in to comment.