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!
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);
}
}
}