-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// https://docs.blamejared.com/ | ||
// https://www.curseforge.com/minecraft/mc-mods/crafttweaker | ||
// use /ct dump fluids to see all fluid IDs | ||
|
||
var generator = <recipetype:cyclic:generator_fluid>; | ||
|
||
// recipe IDS, not item ids | ||
// see datapack inside the jar file or see https://github.com/Lothrazar/Cyclic/tree/trunk/1.20/src/main/resources/data/cyclic/recipes/generator | ||
|
||
generator.removeRecipe("cyclic:generator/generate_xp","cyclic:generator/generate_lava"); | ||
|
||
|
||
|
||
generator.addRecipe("zoldo", <fluid:minecraft:water>*250, 5, 10); | ||
|
||
generator.addRecipe("lava_tag", "minecraft:lava", 1000, 200, 500); | ||
|
||
|
57 changes: 57 additions & 0 deletions
57
src/main/java/com/lothrazar/cyclic/compat/crafttweaker/EnergyFluidZen.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package com.lothrazar.cyclic.compat.crafttweaker; | ||
|
||
import java.util.Arrays; | ||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.openzen.zencode.java.ZenCodeType; | ||
import com.blamejared.crafttweaker.api.CraftTweakerAPI; | ||
import com.blamejared.crafttweaker.api.action.recipe.ActionAddRecipe; | ||
import com.blamejared.crafttweaker.api.annotation.ZenRegister; | ||
import com.blamejared.crafttweaker.api.fluid.IFluidStack; | ||
import com.blamejared.crafttweaker.api.recipe.manager.base.IRecipeManager; | ||
import com.lothrazar.cyclic.block.generatorfluid.RecipeGeneratorFluid; | ||
import com.lothrazar.cyclic.compat.CompatConstants; | ||
import com.lothrazar.cyclic.registry.CyclicRecipeType; | ||
import com.lothrazar.library.recipe.ingredient.EnergyIngredient; | ||
import com.lothrazar.library.recipe.ingredient.FluidTagIngredient; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.world.item.crafting.RecipeType; | ||
import net.minecraftforge.fluids.FluidStack; | ||
|
||
@ZenRegister | ||
@ZenCodeType.Name("mods.cyclic.generator_fluid") | ||
public class EnergyFluidZen implements IRecipeManager<RecipeGeneratorFluid> { | ||
|
||
private final Logger logger = LogManager.getLogger(); | ||
|
||
@Override | ||
public RecipeType<RecipeGeneratorFluid> getRecipeType() { | ||
return CyclicRecipeType.GENERATOR_FLUID.get(); | ||
} | ||
|
||
@ZenCodeType.Method | ||
public void addRecipe(String name, IFluidStack fluid, int rfPertick, int ticks) { | ||
name = fixRecipeName(name); | ||
RecipeGeneratorFluid m = new RecipeGeneratorFluid(new ResourceLocation(CompatConstants.CRAFTTWEAKER, name), | ||
new FluidTagIngredient(new FluidStack(fluid.getFluid(), 1), "", (int) fluid.getAmount()), | ||
new EnergyIngredient(rfPertick, ticks)); | ||
CraftTweakerAPI.apply(new ActionAddRecipe<RecipeGeneratorFluid>(this, m, "")); | ||
logger.debug("Recipe loaded " + m.getId().toString()); | ||
} | ||
|
||
@ZenCodeType.Method | ||
public void addRecipe(String name, String fluidTag, int amount, int rfPertick, int ticks) { | ||
name = fixRecipeName(name); | ||
RecipeGeneratorFluid m = new RecipeGeneratorFluid(new ResourceLocation(CompatConstants.CRAFTTWEAKER, name), | ||
new FluidTagIngredient(null, fluidTag, amount), | ||
new EnergyIngredient(rfPertick, ticks)); | ||
CraftTweakerAPI.apply(new ActionAddRecipe<RecipeGeneratorFluid>(this, m, "")); | ||
logger.debug("Recipe (tag %s) loaded " + m.getId().toString(), fluidTag); | ||
} | ||
|
||
@ZenCodeType.Method | ||
public void removeRecipe(String... names) { | ||
removeByName(names); | ||
logger.debug("Recipe removed " + Arrays.toString(names)); | ||
} | ||
} |