ThaumicSponge

Ever wanted to write a plugin to integrate with Thaumcraft?

Well, now you can! (Sort of).

After some of the recent marvels of Mixins, I’ve elected to start up a project that I’ve always wanted to do. ThaumicSponge.

This description is pretty lacking (as is the API and implementation of ThaumicSponge), but it will get better! I swear!

Source

Some things I managed to get done today:

Edit aura nodes!
Example plugin code:

import com.gabizou.thaumicsponge.api.data.ThaumicKeys;
import com.gabizou.thaumicsponge.api.data.manipulator.immutable.ImmutableAuraNodeData;
import com.gabizou.thaumicsponge.api.data.manipulator.mutable.AuraNodeData;
import com.gabizou.thaumicsponge.api.data.type.Aspects;
import com.gabizou.thaumicsponge.api.data.type.AuraNodeTypes;
import com.gabizou.thaumicsponge.api.entity.AuraNode;

@Listener
public void spawn(SpawnEntityEvent entityEvent) {
  for (Entity entity : entityEvent.getEntities()) {
    if (entity instanceof AuraNode) {
      AuraNodeData data = entity.get(AuraNodeData.class).get();
      System.err.printf("***** Found Aura Node *****\n");
      System.err.printf("Aura node size: " + data.nodeSize() + "\n");
      System.err.printf("Aura node type: " + data.nodeType().get().getId() + "\n");
      System.err.printf("Aura node Aspect: " + data.aspect().get().getId() + "\n");
      System.err.printf("Aura node stable: " + (data.stabilized().get() ? "true" : "false") + "\n");
      data.set(ThaumicKeys.AURA_NODE_ASPECT, Aspects.ALIENIS);
      data.set(ThaumicKeys.AURA_NODE_SIZE, 360);
      data.set(ThaumicKeys.AURA_NODE_TYPE, AuraNodeTypes.TAINT);
      entity.offer(data);
    }
  }
}

image

15 Likes

YEAH! Bring them on!
A collection of custom Sponge tweaks would be something really cool we could show off at the wild party we call State of Sponge 9.
Burning question: Will we be able to mutate Taint with FLARD?

7 Likes

I will put this on Discovery One tonight. Im guessing Inscrutable has already done so to the scs?

1 Like

Nope. There’s no official downloads, and it doesn’t seem to do much yet. I’m hoping this will become a suite of tools. Feel free to compile what there is and try it if you like, guinea pigs are always needed :wink:

1 Like

Might we make some change for sponge addon mods/plugins to register something into CommonModuleRegistry without mixins?

Yes, it’s intended. Just a bit difficult with core mods being the only thing possible to register their CatalogTypes so early before static initialization of plugins.

You gave me ideas for Botaina…

2 Likes

And api for baubles… Both tc and botania uses baubles mod.

1 Like

Some Disco Nodes:

2 Likes

I’m not sure how one for baubles would work as all baubles does is add extra slots/inventory to the player for “special Items” so maybe an API to find that idk… But I came up with some fun ideas for Botania now to sit down and implement it :smile:

Thanks to @Mumfrey, some issues with mixins were fixed and a testable jar can now be produced.