Crash on attempting to set Thaumcraft aspects
ejektaflex opened this issue ยท 5 comments
Issue Description:
Trying out the new Thaumcraft Aspects functions causes an error, even though syntax is correct.
What happens:
I get a bad type on the operand stack.
What you expected to happen:
I'm attempting to remove the Metallum aspect from all harvestcraft items.
Script used (Please Pastebin or gist your script, posting an unpasted or ungist'd script will automatically close this issue):
https://gist.github.com/ejektaflex/820af4a929e71295fea92e8fa8aa471b
Minetweaker.log file (Please Pastebin or gist your file, posting an unpasted or ungist'd file will automatically close this issue):
https://gist.github.com/ejektaflex/ffd05087859b78f7b7426527902e6a6e
Affected Versions (Do not use "latest"):
- Minecraft: 1.12.2
- Forge: 1.12.2 - 14.23.3.2678
- Crafttweaker: 4.1.8
- ModTweaker: 4.0.12
- MTLib: 3.0.4
Your most recent log file where the issue was present:
https://gist.github.com/ejektaflex/345f0cd029baf9a272326a48cfc8b556
You might want to import thaumcraft.aspect.CTAspect
if you are referring to it that way.
I can't get this script to work either, even after importing thaumcraft.aspect.CTAspect and thaumcraft.aspect.CTAspectStack. Tried all sorts of permutations and keep getting errors either like the above, or "identifier not expected", etc. but the error messages are not helping.
Can we have an example script to just loop over an item's aspects (the actual CTAspect objects)?
okay so, this was an oversight by me, but thaumcraft adds aspects after scripts are loaded, so technically, at run time, there are no aspects on any items, so I'll be removing that in the next version.
Saying that however, I will be adding a new method called "removeAspect()", that will remove the aspect from the item, at a later time in the load cycle. If the item doesn't have that specific aspect, then it will do nothing, but if it does, then it will be removed, and the others will be left as they were (I.E, you can loop over all HC items and remove Metallum from them without knowing if they even have Metallum to start with)
Oh that sounds great. Thanks :)
The other methods will also be able handle nonexistent aspects gracefully, right? (meaning getAspects() doesn't go nuts if it's called on an item without aspects) Just want to be clear.