generated from CleanroomMC/TemplateDevEnv
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
11 changed files
with
490 additions
and
4 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
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,99 @@ | ||
|
||
// Auto generated groovyscript example file | ||
// MODS_LOADED: futuremc | ||
|
||
log.info 'mod \'futuremc\' detected, running script' | ||
|
||
// Blast Furnace: | ||
// Converts an input itemstack into an output itemstack at the cost of burnable fuel. | ||
|
||
mods.futuremc.blast_furnace.removeByInput(item('minecraft:gold_ore')) | ||
mods.futuremc.blast_furnace.removeByOutput(item('minecraft:iron_ingot')) | ||
// mods.futuremc.blast_furnace.removeAll() | ||
|
||
mods.futuremc.blast_furnace.recipeBuilder() | ||
.input(item('minecraft:clay')) | ||
.output(item('minecraft:diamond')) | ||
.register() | ||
|
||
mods.futuremc.blast_furnace.recipeBuilder() | ||
.input(item('minecraft:gold_ingot')) | ||
.output(item('minecraft:clay')) | ||
.register() | ||
|
||
|
||
// Campfire: | ||
// Converts an input itemstack into an output itemstack when placed on the Campfire. | ||
|
||
mods.futuremc.campfire.removeByInput(item('minecraft:fish')) | ||
mods.futuremc.campfire.removeByOutput(item('minecraft:cooked_mutton')) | ||
// mods.futuremc.campfire.removeAll() | ||
|
||
mods.futuremc.campfire.recipeBuilder() | ||
.input(item('minecraft:clay')) | ||
.output(item('minecraft:diamond')) | ||
.duration(10) | ||
.register() | ||
|
||
mods.futuremc.campfire.recipeBuilder() | ||
.input(item('minecraft:gold_ingot')) | ||
.output(item('minecraft:clay')) | ||
.duration(1) | ||
.register() | ||
|
||
|
||
// Smithing: | ||
// Converts two input itemstacks into an output output itemstack in the Smithing Table. | ||
|
||
mods.futuremc.smithing.removeByInput(item('minecraft:diamond_hoe')) | ||
// mods.futuremc.smithing.removeByInput(item('futuremc:netherite_ingot')) | ||
mods.futuremc.smithing.removeByOutput(item('futuremc:netherite_pickaxe')) | ||
// mods.futuremc.smithing.removeAll() | ||
|
||
mods.futuremc.smithing.recipeBuilder() | ||
.input(item('minecraft:clay'), item('minecraft:gold_ingot')) | ||
.output(item('minecraft:diamond')) | ||
.register() | ||
|
||
mods.futuremc.smithing.recipeBuilder() | ||
.input(item('minecraft:gold_ingot') * 4, item('minecraft:clay')) | ||
.output(item('minecraft:clay') * 8) | ||
.register() | ||
|
||
|
||
// Smoker: | ||
// Converts an input itemstack into an output itemstack at the cost of burnable fuel. | ||
|
||
mods.futuremc.smoker.removeByInput(item('minecraft:porkchop')) | ||
mods.futuremc.smoker.removeByOutput(item('minecraft:baked_potato')) | ||
// mods.futuremc.smoker.removeAll() | ||
|
||
mods.futuremc.smoker.recipeBuilder() | ||
.input(item('minecraft:clay')) | ||
.output(item('minecraft:diamond')) | ||
.register() | ||
|
||
mods.futuremc.smoker.recipeBuilder() | ||
.input(item('minecraft:gold_ingot')) | ||
.output(item('minecraft:clay')) | ||
.register() | ||
|
||
|
||
// Stoenecutter: | ||
// Converts an input itemstack into an output itemstack via selecting the desired output from the Stonecutter GUI. | ||
|
||
mods.futuremc.stonecutter.removeByInput(item('minecraft:stonebrick')) | ||
mods.futuremc.stonecutter.removeByOutput(item('minecraft:stone_slab')) | ||
// mods.futuremc.stonecutter.removeAll() | ||
|
||
mods.futuremc.stonecutter.recipeBuilder() | ||
.input(item('minecraft:clay')) | ||
.output(item('minecraft:diamond')) | ||
.register() | ||
|
||
mods.futuremc.stonecutter.recipeBuilder() | ||
.input(item('minecraft:gold_ingot')) | ||
.output(item('minecraft:clay')) | ||
.register() | ||
|
||
|
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
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
68 changes: 68 additions & 0 deletions
68
src/main/java/com/cleanroommc/groovyscript/compat/mods/futuremc/BlastFurnace.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,68 @@ | ||
package com.cleanroommc.groovyscript.compat.mods.futuremc; | ||
|
||
import com.cleanroommc.groovyscript.api.GroovyLog; | ||
import com.cleanroommc.groovyscript.api.IIngredient; | ||
import com.cleanroommc.groovyscript.api.documentation.annotations.*; | ||
import com.cleanroommc.groovyscript.compat.mods.ModSupport; | ||
import com.cleanroommc.groovyscript.helper.recipe.AbstractRecipeBuilder; | ||
import com.cleanroommc.groovyscript.registry.StandardListRegistry; | ||
import org.jetbrains.annotations.Nullable; | ||
import thedarkcolour.futuremc.recipe.SimpleRecipe; | ||
import thedarkcolour.futuremc.recipe.furnace.BlastFurnaceRecipes; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
|
||
@RegistryDescription | ||
public class BlastFurnace extends StandardListRegistry<SimpleRecipe> { | ||
|
||
@Override | ||
public Collection<SimpleRecipe> getRecipes() { | ||
return BlastFurnaceRecipes.INSTANCE.getRecipes(); | ||
} | ||
|
||
@RecipeBuilderDescription(example = { | ||
@Example(".input(item('minecraft:clay')).output(item('minecraft:diamond'))"), | ||
@Example(".input(item('minecraft:gold_ingot')).output(item('minecraft:clay'))") | ||
}) | ||
public RecipeBuilder recipeBuilder() { | ||
return new RecipeBuilder(); | ||
} | ||
|
||
@MethodDescription(example = @Example("item('minecraft:gold_ore')")) | ||
public void removeByInput(IIngredient input) { | ||
getRecipes().removeIf(r -> Arrays.stream(r.getInput().getMatchingStacks()).anyMatch(input) && addBackup(r)); | ||
} | ||
|
||
@MethodDescription(example = @Example("item('minecraft:iron_ingot')")) | ||
public void removeByOutput(IIngredient output) { | ||
getRecipes().removeIf(r -> output.test(r.getOutput()) && addBackup(r)); | ||
} | ||
|
||
@Property(property = "input", comp = @Comp(eq = 1)) | ||
@Property(property = "output", comp = @Comp(eq = 1)) | ||
public static class RecipeBuilder extends AbstractRecipeBuilder<SimpleRecipe> { | ||
|
||
@Override | ||
public String getErrorMsg() { | ||
return "Error adding FutureMC Blast Furnace recipe"; | ||
} | ||
|
||
@Override | ||
public void validate(GroovyLog.Msg msg) { | ||
validateItems(msg, 1, 1, 1, 1); | ||
validateFluids(msg); | ||
} | ||
|
||
@Override | ||
@RecipeBuilderRegistrationMethod | ||
public @Nullable SimpleRecipe register() { | ||
if (!validate()) return null; | ||
SimpleRecipe recipe = new SimpleRecipe(input.get(0).toMcIngredient(), output.get(0)); | ||
ModSupport.FUTURE_MC.get().blastFurnace.add(recipe); | ||
return recipe; | ||
} | ||
|
||
} | ||
|
||
} |
78 changes: 78 additions & 0 deletions
78
src/main/java/com/cleanroommc/groovyscript/compat/mods/futuremc/Campfire.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,78 @@ | ||
package com.cleanroommc.groovyscript.compat.mods.futuremc; | ||
|
||
import com.cleanroommc.groovyscript.api.GroovyLog; | ||
import com.cleanroommc.groovyscript.api.IIngredient; | ||
import com.cleanroommc.groovyscript.api.documentation.annotations.*; | ||
import com.cleanroommc.groovyscript.compat.mods.ModSupport; | ||
import com.cleanroommc.groovyscript.helper.recipe.AbstractRecipeBuilder; | ||
import com.cleanroommc.groovyscript.registry.StandardListRegistry; | ||
import org.jetbrains.annotations.Nullable; | ||
import thedarkcolour.futuremc.recipe.campfire.CampfireRecipe; | ||
import thedarkcolour.futuremc.recipe.campfire.CampfireRecipes; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
|
||
@RegistryDescription | ||
public class Campfire extends StandardListRegistry<CampfireRecipe> { | ||
|
||
@Override | ||
public Collection<CampfireRecipe> getRecipes() { | ||
return CampfireRecipes.INSTANCE.getRecipes(); | ||
} | ||
|
||
@RecipeBuilderDescription(example = { | ||
@Example(".input(item('minecraft:clay')).output(item('minecraft:diamond')).duration(10)"), | ||
@Example(".input(item('minecraft:gold_ingot')).output(item('minecraft:clay')).duration(1)") | ||
}) | ||
public RecipeBuilder recipeBuilder() { | ||
return new RecipeBuilder(); | ||
} | ||
|
||
@MethodDescription(example = @Example("item('minecraft:fish')")) | ||
public void removeByInput(IIngredient input) { | ||
getRecipes().removeIf(r -> Arrays.stream(r.getInput().getMatchingStacks()).anyMatch(input) && addBackup(r)); | ||
} | ||
|
||
@MethodDescription(example = @Example("item('minecraft:cooked_mutton')")) | ||
public void removeByOutput(IIngredient output) { | ||
getRecipes().removeIf(r -> output.test(r.getOutput()) && addBackup(r)); | ||
} | ||
|
||
@Property(property = "input", comp = @Comp(eq = 1)) | ||
@Property(property = "output", comp = @Comp(eq = 1)) | ||
public static class RecipeBuilder extends AbstractRecipeBuilder<CampfireRecipe> { | ||
|
||
@Property(comp = @Comp(gte = 1)) | ||
private int duration; | ||
|
||
@RecipeBuilderMethodDescription | ||
public RecipeBuilder duration(int duration) { | ||
this.duration = duration; | ||
return this; | ||
} | ||
|
||
@Override | ||
public String getErrorMsg() { | ||
return "Error adding FutureMC Campfire recipe"; | ||
} | ||
|
||
@Override | ||
public void validate(GroovyLog.Msg msg) { | ||
validateItems(msg, 1, 1, 1, 1); | ||
validateFluids(msg); | ||
msg.add(duration <= 0, "duration must be greater than or equal to 1, yet it was {}", duration); | ||
} | ||
|
||
@Override | ||
@RecipeBuilderRegistrationMethod | ||
public @Nullable CampfireRecipe register() { | ||
if (!validate()) return null; | ||
CampfireRecipe recipe = new CampfireRecipe(input.get(0).toMcIngredient(), output.get(0), duration); | ||
ModSupport.FUTURE_MC.get().campfire.add(recipe); | ||
return recipe; | ||
} | ||
|
||
} | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/cleanroommc/groovyscript/compat/mods/futuremc/FutureMC.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,13 @@ | ||
package com.cleanroommc.groovyscript.compat.mods.futuremc; | ||
|
||
import com.cleanroommc.groovyscript.compat.mods.GroovyPropertyContainer; | ||
|
||
public class FutureMC extends GroovyPropertyContainer { | ||
|
||
public final BlastFurnace blastFurnace = new BlastFurnace(); | ||
public final Campfire campfire = new Campfire(); | ||
public final Smithing smithing = new Smithing(); | ||
public final Smoker smoker = new Smoker(); | ||
public final Stonecutter stonecutter = new Stonecutter(); | ||
|
||
} |
70 changes: 70 additions & 0 deletions
70
src/main/java/com/cleanroommc/groovyscript/compat/mods/futuremc/Smithing.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,70 @@ | ||
package com.cleanroommc.groovyscript.compat.mods.futuremc; | ||
|
||
import com.cleanroommc.groovyscript.api.GroovyLog; | ||
import com.cleanroommc.groovyscript.api.IIngredient; | ||
import com.cleanroommc.groovyscript.api.documentation.annotations.*; | ||
import com.cleanroommc.groovyscript.compat.mods.ModSupport; | ||
import com.cleanroommc.groovyscript.helper.recipe.AbstractRecipeBuilder; | ||
import com.cleanroommc.groovyscript.registry.StandardListRegistry; | ||
import org.jetbrains.annotations.Nullable; | ||
import thedarkcolour.futuremc.recipe.smithing.SmithingRecipe; | ||
import thedarkcolour.futuremc.recipe.smithing.SmithingRecipes; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
|
||
@RegistryDescription(admonition = @Admonition(value = "groovyscript.wiki.futuremc.smithing.note0", type = Admonition.Type.WARNING)) | ||
public class Smithing extends StandardListRegistry<SmithingRecipe> { | ||
|
||
@Override | ||
public Collection<SmithingRecipe> getRecipes() { | ||
return SmithingRecipes.INSTANCE.getRecipes(); | ||
} | ||
|
||
@RecipeBuilderDescription(example = { | ||
@Example(".input(item('minecraft:clay'), item('minecraft:gold_ingot')).output(item('minecraft:diamond'))"), | ||
@Example(".input(item('minecraft:gold_ingot') * 4, item('minecraft:clay')).output(item('minecraft:clay') * 8)") | ||
}) | ||
public RecipeBuilder recipeBuilder() { | ||
return new RecipeBuilder(); | ||
} | ||
|
||
@MethodDescription(example = { | ||
@Example("item('minecraft:diamond_hoe')"), @Example(value = "item('futuremc:netherite_ingot')", commented = true), | ||
}) | ||
public void removeByInput(IIngredient input) { | ||
getRecipes().removeIf(r -> Arrays.stream(r.getInput().getMatchingStacks()).anyMatch(input) && addBackup(r)); | ||
} | ||
|
||
@MethodDescription(example = @Example("item('futuremc:netherite_pickaxe')")) | ||
public void removeByOutput(IIngredient output) { | ||
getRecipes().removeIf(r -> output.test(r.getOutput()) && addBackup(r)); | ||
} | ||
|
||
@Property(property = "input", comp = @Comp(eq = 2)) | ||
@Property(property = "output", comp = @Comp(eq = 1)) | ||
public static class RecipeBuilder extends AbstractRecipeBuilder<SmithingRecipe> { | ||
|
||
@Override | ||
public String getErrorMsg() { | ||
return "Error adding FutureMC Smithing recipe"; | ||
} | ||
|
||
@Override | ||
public void validate(GroovyLog.Msg msg) { | ||
validateItems(msg, 2, 2, 1, 1); | ||
validateFluids(msg); | ||
} | ||
|
||
@Override | ||
@RecipeBuilderRegistrationMethod | ||
public @Nullable SmithingRecipe register() { | ||
if (!validate()) return null; | ||
SmithingRecipe recipe = new SmithingRecipe(input.get(0).toMcIngredient(), input.get(1).toMcIngredient(), output.get(0)); | ||
ModSupport.FUTURE_MC.get().smithing.add(recipe); | ||
return recipe; | ||
} | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.