Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add String based alternatives to builders that use Aspects #60

Merged
merged 5 commits into from
Jun 24, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions examples/thaumcraft.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mods.thaumcraft.InfusionCrafting.recipeBuilder()
.mainInput(item('minecraft:gunpowder'))
.output(item('minecraft:gold_ingot'))
.aspect(aspect('terra') * 20)
.aspect(aspect('ignis') * 30)
.aspect('ignis', 30)
.input(crystal('aer'))
.input(crystal('ignis'))
.input(crystal('aqua'))
Expand All @@ -41,22 +41,23 @@ mods.thaumcraft.ArcaneWorkbench.shapedBuilder()
.row(' ')
.row(' ')
.key('S', item('minecraft:pumpkin_seeds'))
.aspect(aspect('terra'))
.aspect('terra')
.vis(5)
.register()

//mods.thaumcraft.Aspect.aspectBuilder()
// .tag('humor')
// .chatColor(14013676)
// .component(aspect('cognito'))
// .component(aspect('perditio'))
// .component('perditio')
// .image(resource('thaumcraft:textures/aspects/humor.png'))
// .register()

mods.thaumcraft.AspectHelper.aspectBuilder()
.object(item('minecraft:stone'))
.stripAspects()
.aspect(aspect('ignis') * 20)
.aspect('ordo', 5)
.register()

mods.thaumcraft.AspectHelper.aspectBuilder()
Expand All @@ -68,7 +69,7 @@ mods.thaumcraft.AspectHelper.aspectBuilder()
mods.thaumcraft.AspectHelper.aspectBuilder()
.entity(entity('minecraft:chicken'))
.stripAspects()
.aspect(aspect('bestia') * 20)
.aspect('bestia', 20)
.register()

mods.thaumcraft.Warp.addWarp(item('minecraft:pumpkin'), 3)
Expand Down Expand Up @@ -116,10 +117,10 @@ mods.thaumcraft.SmeltingBonus.removeByOutput(item('minecraft:gold_nugget'))
// .formulaAspect(aspect('herba') * 5)
// .formulaAspect(aspect('ordo') * 5)
// .formulaAspect(aspect('perditio') * 5)
// .formulaAspect(aspect('aer') * 5)
// .formulaAspect(aspect('ignis') * 5)
// .formulaAspect('aer', 5)
// .formulaAspect('ignis', 5)
// .formulaAspect(aspect('terra') * 5)
// .formulaAspect(aspect('aqua') * 5)
// .formulaAspect('aqua', 5)
// .icon(resource('thaumcraft:textures/aspects/humor.png'))
// .background(resource('thaumcraft:textures/gui/gui_research_back_1.jpg'))
// .background2(resource('thaumcraft:textures/gui/gui_research_back_over.png'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ public RecipeBuilder aspect(AspectStack aspectIn) {
return this;
}

public RecipeBuilder aspect(String tag, int amount) {
return this.aspect(new AspectStack(tag, amount));
}

public RecipeBuilder catalyst(IIngredient catalyst) {
this.catalyst = catalyst;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ public RecipeBuilder aspect(AspectStack aspect) {
return this;
}

public RecipeBuilder aspect(String tag, int amount) {
return this.aspect(new AspectStack(tag, amount));
}

public RecipeBuilder instability(int instability) {
this.instability = instability;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.minecraft.potion.Potion;
import net.minecraft.util.ResourceLocation;
import thaumcraft.api.ThaumcraftApi;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.*;
import thaumcraft.common.lib.research.ResearchManager;
Expand Down Expand Up @@ -106,6 +107,11 @@ public ResearchCategoryBuilder formulaAspect(AspectStack aspect) {
return this;
}

public ResearchCategoryBuilder formulaAspect(String tag, int amount) {
this.formula.add(Aspect.getAspect(tag), amount);
return this;
}

public ResearchCategoryBuilder icon(String icon) {
this.icon = new ResourceLocation(icon);
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import org.apache.commons.lang3.ArrayUtils;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;

import java.util.ArrayList;
Expand All @@ -37,6 +38,11 @@ public ArcaneRecipeBuilder aspect(AspectStack aspect) {
return this;
}

public ArcaneRecipeBuilder aspect(String tag, int amount) {
this.aspects.add(Aspect.getAspect(tag), amount);
return this;
}

public ArcaneRecipeBuilder vis(int vis) {
this.vis = vis;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public AspectBuilder component(AspectStack component) {
return this;
}

public AspectBuilder component(String tag, int amount) {
return this.component(new AspectStack(tag, amount));
}

public AspectBuilder image(String image) {
this.image = new ResourceLocation(image);
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,10 @@ public AspectHelperBuilder aspect(AspectStack aspect) {
return this;
}

public AspectHelperBuilder aspect(String tag, int amount) {
return this.aspect(new AspectStack(tag, amount));
}

public AspectHelperBuilder stripAspects() {
if (entity != null) {
ModSupport.THAUMCRAFT.get().aspectHelper.removeAll(entity);
Expand Down