Display aspect icons for empty, labeled jars.

This commit is contained in:
David Vierra committed 2015-05-15 21:40:32 -10:00
1 parent 822f26749a
commit dfd0b003d9
1 file changed
+11 -3
@@ -77,7 +77,12 @@ public class Thaumcraft extends IntegrationModule
NBTTagCompound tag = itemStack.getTagCompound();
if (tag == null)
return;
if (tag.hasKey("AspectFilter")) {
setDrawerAspectName(drawer, tag.getString("AspectFilter"));
return;
}
NBTTagList tagAspects = tag.getTagList("Aspects", Constants.NBT.TAG_COMPOUND);
if (tagAspects == null || tagAspects.tagCount() == 0)
return;
@@ -86,10 +91,13 @@ public class Thaumcraft extends IntegrationModule
if (tagAspect == null || !tagAspect.hasKey("key"))
return;
String key = tagAspect.getString("key");
setDrawerAspectName(drawer, tagAspect.getString("key"));
}
private void setDrawerAspectName (IDrawer drawer, String aspectName) {
AspectList allAspects = ThaumcraftApiHelper.getAllAspects(1);
for (Aspect a : allAspects.aspects.keySet()) {
if (a.getTag().equals(key)) {
if (a.getTag().equals(aspectName)) {
drawer.setExtendedData("aspect", a);
return;
}