Skip to content

Commit

Permalink
fix singleton aspect, change texture, make example (#231)
Browse files Browse the repository at this point in the history
* fix singleton aspect, change texture, make example

* convert to hex int
  • Loading branch information
WaitingIdly committed Oct 1, 2024
1 parent 64d3bfa commit 866a77c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
14 changes: 10 additions & 4 deletions examples/postInit/thaumcraft.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,17 @@ mods.thaumcraft.arcane_workbench.shapelessBuilder()
// mods.thaumcraft.aspect.removeAll()

mods.thaumcraft.aspect.aspectBuilder()
.tag('humor')
.chatColor(14013676)
.tag('clay')
.chatColor(0xD5D4EC)
.image(resource('placeholdername:textures/items/clay_2.png'))
.register()

mods.thaumcraft.aspect.aspectBuilder()
.tag('snack')
.chatColor(0xD5D4EC)
.component(aspect('cognitio'))
.component('perditio')
.image(resource('thaumcraft:textures/aspects/humor.png'))
.component('clay')
.image(resource('placeholdername:textures/items/snack.png'))
.register()


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
@RegistryDescription
public class Aspect extends VirtualizedRegistry<thaumcraft.api.aspects.Aspect> {

@RecipeBuilderDescription(example = @Example(".tag('humor').chatColor(14013676).component(aspect('cognitio')).component('perditio').image(resource('thaumcraft:textures/aspects/humor.png'))"))
@RecipeBuilderDescription(example = {
@Example(".tag('clay').chatColor(0xD5D4EC).image(resource('placeholdername:textures/items/clay_2.png'))"),
@Example(".tag('snack').chatColor(0xD5D4EC).component(aspect('cognitio')).component('clay').image(resource('placeholdername:textures/items/snack.png'))")
})
public AspectBuilder aspectBuilder() {
return new AspectBuilder();
}
Expand Down Expand Up @@ -117,7 +120,8 @@ public AspectBuilder blend(int blend) {
@RecipeBuilderRegistrationMethod
public thaumcraft.api.aspects.Aspect register() {
try {
thaumcraft.api.aspects.Aspect aspect = new thaumcraft.api.aspects.Aspect(tag, chatColor, components.getAspects(), image, blend);
var components = this.components.size() == 0 ? null : this.components.getAspects();
thaumcraft.api.aspects.Aspect aspect = new thaumcraft.api.aspects.Aspect(tag, chatColor, components, image, blend);
ModSupport.THAUMCRAFT.get().aspect.add(aspect);
return aspect;
} catch (IllegalArgumentException e) {
Expand Down

0 comments on commit 866a77c

Please sign in to comment.