Updated Thaumcraft API

This commit is contained in:
Adubbz 2013-09-01 19:36:19 +10:00
parent f9a3b8bed6
commit 26ed2b5976
11 changed files with 173 additions and 69 deletions

View File

@ -1,4 +1,4 @@
dir.development=../../
dir.release=../../Biomes O Plenty Releases
release.minecraft.version=1.6.2
release.mod.version=0.6.2
release.mod.version=0.6.3

View File

@ -118,8 +118,6 @@ public class ThaumcraftIntegration {
ThaumcraftApi.registerObjectTag(getBID("mud"), getBMeta("mud"), (new AspectList()).add(Aspect.WATER, 3).add(Aspect.EARTH, 6));
ThaumcraftApi.registerObjectTag(getBID("driedDirt"), getBMeta("driedDirt"), (new AspectList()).add(Aspect.ENTROPY, 1).add(Aspect.EARTH, 1));
ThaumcraftApi.registerObjectTag(getBID("redRock"), getBMeta("redRock"), (new AspectList()).add(Aspect.STONE, 2));
//ThaumcraftApi.registerObjectTag(getBID("ash"), getBMeta("ash"), (new AspectList()).add(Aspect.ENTROPY, 3).add(Aspect.EXCHANGE, 3));
//ThaumcraftApi.registerObjectTag(getBID("ashStone"), getBMeta("ashStone"), (new AspectList()).add(Aspect.STONE, 1).add(Aspect.EXCHANGE, 1));
ThaumcraftApi.registerObjectTag(getBID("hardIce"), getBMeta("hardIce"), (new AspectList()).add(Aspect.STONE, 2).add(Aspect.ICE, 2));
ThaumcraftApi.registerObjectTag(getBID("originGrass"), getBMeta("originGrass"), (new AspectList()).add(Aspect.PLANT, 1).add(Aspect.EARTH, 2));
ThaumcraftApi.registerObjectTag(getBID("hardSand"), getBMeta("hardSand"), (new AspectList()).add(Aspect.STONE, 1).add(Aspect.EARTH, 2));
@ -127,12 +125,12 @@ public class ThaumcraftIntegration {
ThaumcraftApi.registerObjectTag(getBID("holyGrass"), getBMeta("holyGrass"), (new AspectList()).add(Aspect.PLANT, 1).add(Aspect.EARTH, 2).add(Aspect.LIGHT, 1));
ThaumcraftApi.registerObjectTag(getBID("holyDirt"), getBMeta("holyDirt"), (new AspectList()).add(Aspect.LIGHT, 1).add(Aspect.EARTH, 2));
ThaumcraftApi.registerObjectTag(getBID("holyStone"), getBMeta("holyStone"), (new AspectList()).add(Aspect.LIGHT, 1).add(Aspect.STONE, 2));
//ThaumcraftApi.registerObjectTag(getBID("crystal"), getBMeta("crystal"), (new AspectList()).add(Aspect.VALUABLE, 58).add(Aspect.LIGHT, 15).add(Aspect.MAGIC, 20).add(Aspect.CRYSTAL, 50));
ThaumcraftApi.registerObjectTag(getBID("crystal"), getBMeta("crystal"), (new AspectList()).add(Aspect.GREED, 58).add(Aspect.LIGHT, 15).add(Aspect.MAGIC, 20).add(Aspect.CRYSTAL, 50));
ThaumcraftApi.registerObjectTag(getBID("cragRock"), getBMeta("cragRock"), (new AspectList()).add(Aspect.STONE, 2));
ThaumcraftApi.registerObjectTag(getBID("quicksand"), getBMeta("quicksand"), (new AspectList()).add(Aspect.EARTH, 2).add(Aspect.TRAP, 4));
ThaumcraftApi.registerObjectTag(getBID("smolderingGrass"), getBMeta("smolderingGrass"), (new AspectList()).add(Aspect.EARTH, 2).add(Aspect.FIRE, 1));
//ThaumcraftApi.registerObjectTag(getBID("amethystBlock"), getBMeta("amethystBlock"), (new AspectList()).add(Aspect.VALUABLE, 58).add(Aspect.ORDER, 58).add(Aspect.CRYSTAL, 87));
//ThaumcraftApi.registerObjectTag(getBID("amethystOre"), getBMeta("amethystOre"), (new AspectList()).add(Aspect.VALUABLE, 6).add(Aspect.ORDER, 6).add(Aspect.CRYSTAL, 14).add(Aspect.STONE, 4));
ThaumcraftApi.registerObjectTag(getBID("amethystBlock"), getBMeta("amethystBlock"), (new AspectList()).add(Aspect.GREED, 58).add(Aspect.ORDER, 58).add(Aspect.CRYSTAL, 87));
ThaumcraftApi.registerObjectTag(getBID("amethystOre"), getBMeta("amethystOre"), (new AspectList()).add(Aspect.GREED, 6).add(Aspect.ORDER, 6).add(Aspect.CRYSTAL, 14).add(Aspect.STONE, 4));
ThaumcraftApi.registerObjectTag(getBID("redRockCobble"), getBMeta("redRockCobble"), (new AspectList()).add(Aspect.ENTROPY, 1).add(Aspect.STONE, 1));
ThaumcraftApi.registerObjectTag(getBID("giantFlowerRed"), getBMeta("giantFlowerRed"), (new AspectList()).add(Aspect.PLANT, 4).add(Aspect.MAGIC, 1));
ThaumcraftApi.registerObjectTag(getBID("giantFlowerYellow"), getBMeta("giantFlowerYellow"), (new AspectList()).add(Aspect.PLANT, 4).add(Aspect.MAGIC, 1));
@ -143,30 +141,28 @@ public class ThaumcraftIntegration {
for (int i = 10; i < 15; i++)
{
//ThaumcraftApi.registerObjectTag(Items.miscItems.get().itemID, i, (new AspectList()).add(Aspect.VALUABLE, 4).add(Aspect.CRYSTAL, 8));
ThaumcraftApi.registerObjectTag(Items.miscItems.get().itemID, i, (new AspectList()).add(Aspect.GREED, 4).add(Aspect.CRYSTAL, 8));
}
String[] oreTypes = BlockBOPAmethyst.types;
for (int i = 2; i < oreTypes.length; i+=2)
{
//ThaumcraftApi.registerObjectTag(Blocks.amethystOre.get().blockID, i, (new AspectList()).add(Aspect.VALUABLE, 3).add(Aspect.CRYSTAL, 7).add(Aspect.STONE, 4));
ThaumcraftApi.registerObjectTag(Blocks.amethystOre.get().blockID, i, (new AspectList()).add(Aspect.GREED, 3).add(Aspect.CRYSTAL, 7).add(Aspect.STONE, 4));
}
//Items
/*Amethyst*///ThaumcraftApi.registerObjectTag(Items.miscItems.get().itemID, 2, (new AspectList()).add(Aspect.VALUABLE, 8).add(Aspect.PURE, 8).add(Aspect.CRYSTAL, 16));
/*Ashes*///ThaumcraftApi.registerObjectTag(Items.miscItems.get().itemID, 1, (new AspectList()).add(Aspect.ENTROPY, 1).add(Aspect.EXCHANGE, 1));
/*Amethyst*/ThaumcraftApi.registerObjectTag(Items.miscItems.get().itemID, 2, (new AspectList()).add(Aspect.GREED, 8).add(Aspect.ORDER, 8).add(Aspect.CRYSTAL, 16));
/*Ashes*/ThaumcraftApi.registerObjectTag(Items.miscItems.get().itemID, 1, (new AspectList()).add(Aspect.ENTROPY, 1).add(Aspect.EXCHANGE, 1));
/*Mudbrick*/ThaumcraftApi.registerObjectTag(Items.miscItems.get().itemID, 0, (new AspectList()).add(Aspect.EARTH, 2).add(Aspect.FIRE, 1));
/*Dart*/ThaumcraftApi.registerObjectTag(Items.dart.get().itemID, 0, (new AspectList()).add(Aspect.WEAPON, 1));
/*Poison Dart*/ThaumcraftApi.registerObjectTag(Items.dart.get().itemID, 1, (new AspectList()).add(Aspect.PLANT, 2).add(Aspect.WEAPON, 2));
/*Spring Water Bucket*/ThaumcraftApi.registerObjectTag(Fluids.bopBucket.get().itemID, 0, (new AspectList()).add(Aspect.METAL, 13).add(Aspect.VOID, 1).add(Aspect.WATER, 4).add(Aspect.LIFE, 2).add(Aspect.HEAL, 4));
/*Liquid Poison Bucket*/ThaumcraftApi.registerObjectTag(Fluids.bopBucket.get().itemID, 1, (new AspectList()).add(Aspect.METAL, 13).add(Aspect.VOID, 1).add(Aspect.WATER, 2).add(Aspect.WEAPON, 4).add(Aspect.POISON, 4));
ThaumcraftApi.registerObjectTag(Items.food.get().itemID, 0, (new AspectList()).add(Aspect.PLANT, 1).add(Aspect.LIFE, 1));
//ThaumcraftApi.registerObjectTag(Items.sunflowerSeeds.get().itemID, 0, (new AspectList()).add(Aspect.PLANT, 1).add(Aspect.EXCHANGE, 1));
ThaumcraftApi.registerObjectTag(Items.mudball.get().itemID, 0, (new AspectList()).add(Aspect.WATER, 1).add(Aspect.EARTH, 2));
//ThaumcraftApi.registerObjectTag(Items.shroomPowder.get().itemID, -1, (new AspectList()).add(Aspect.PLANT, 2).add(Aspect.ENTROPY, 1));
//ThaumcraftApi.registerObjectTag(Items.bopDisc.get().itemID, -1, (new AspectList()).add(Aspect.SENSES, 12).add(Aspect.VALUABLE, 4).add(Aspect.CROP, 4));
//ThaumcraftApi.registerObjectTag(Items.bopDiscMud.get().itemID, -1, (new AspectList()).add(Aspect.SENSES, 12).add(Aspect.VALUABLE, 4).add(Aspect.EARTH, 2).add(Aspect.WATER, 2));
ThaumcraftApi.registerObjectTag(Items.bopDisc.get().itemID, -1, (new AspectList()).add(Aspect.SENSES, 12).add(Aspect.GREED, 4).add(Aspect.CROP, 4));
ThaumcraftApi.registerObjectTag(Items.bopDiscMud.get().itemID, -1, (new AspectList()).add(Aspect.SENSES, 12).add(Aspect.GREED, 4).add(Aspect.EARTH, 2).add(Aspect.WATER, 2));
//Placer Items
ThaumcraftApi.registerObjectTag(getBID("barley"), getBMeta("barley"), (new AspectList()).add(Aspect.PLANT, 1).add(Aspect.LIFE, 1));

View File

@ -44,8 +44,7 @@ public class ItemApi {
*
* Resources:
* itemEssence, itemWispEssence, itemResource, itemShard, itemNugget,
* itemNuggetChicken, itemNuggetBeef, itemNuggetPork, itemTripleMeatTreat,
* blockWooden, blockMarker
* itemNuggetChicken, itemNuggetBeef, itemNuggetPork, itemTripleMeatTreat
*
* Research:
* itemResearchNotes, itemInkwell, itemThaumonomicon

View File

@ -13,7 +13,6 @@ import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagByte;
import net.minecraftforge.common.EnumHelper;
import net.minecraftforge.oredict.OreDictionary;
import thaumcraft.api.aspects.Aspect;
@ -42,7 +41,7 @@ public class ThaumcraftApi {
public static EnumToolMaterial toolMatElemental = EnumHelper.addToolMaterial("THAUMIUM_ELEMENTAL", 3, 1500, 10F, 3, 18);
public static EnumArmorMaterial armorMatThaumium = EnumHelper.addArmorMaterial("THAUMIUM", 25, new int[] { 2, 6, 5, 2 }, 25);
public static EnumArmorMaterial armorMatSpecial = EnumHelper.addArmorMaterial("SPECIAL", 25, new int[] { 1, 3, 2, 1 }, 25);
//public static final Material fluxGoomaterial = (new MaterialTaint(MapColor.grassColor)).setNoPushMobility();
public static final Material fluxGoomaterial = (new MaterialTaint(MapColor.grassColor));
public static final Material taintMaterial = (new MaterialTaint(MapColor.grassColor));
//Miscellaneous
@ -227,7 +226,7 @@ public class ThaumcraftApi {
return null;
}
//TAGS////////////////////////////////////////
//ASPECTS////////////////////////////////////////
public static Map<List,AspectList> objectTags = new HashMap<List,AspectList>();
@ -284,8 +283,11 @@ public class ThaumcraftApi {
public static void registerObjectTag(String oreDict, AspectList aspects) {
ArrayList<ItemStack> ores = OreDictionary.getOres(oreDict);
if (ores!=null && ores.size()>0) {
for (ItemStack ore:ores)
objectTags.put(Arrays.asList(ore.itemID, ore.getItemDamage()), aspects);
for (ItemStack ore:ores) {
int d = ore.getItemDamage();
if (d==OreDictionary.WILDCARD_VALUE) d = -1;
objectTags.put(Arrays.asList(ore.itemID, d), aspects);
}
}
}
@ -299,21 +301,21 @@ public class ThaumcraftApi {
* @param aspects A ObjectTags object of the associated aspects
*/
public static void registerComplexObjectTag(int id, int meta, AspectList aspects ) {
// if (!exists(id,meta)) {
// AspectList tmp = ThaumcraftApiHelper.generateTags(id, meta);
// if (tmp != null && tmp.size()>0) {
// for(EnumTag tag:tmp.getAspects()) {
// aspects.add(tag, tmp.getAmount(tag));
// }
// }
// registerObjectTag(id,meta,aspects);
// } else {
// AspectList tmp = ThaumcraftApiHelper.getObjectAspects(new ItemStack(id,1,meta));
// for(EnumTag tag:aspects.getAspects()) {
// tmp.merge(tag, tmp.getAmount(tag));
// }
// registerObjectTag(id,meta,tmp);
// }
if (!exists(id,meta)) {
AspectList tmp = ThaumcraftApiHelper.generateTags(id, meta);
if (tmp != null && tmp.size()>0) {
for(Aspect tag:tmp.getAspects()) {
aspects.add(tag, tmp.getAmount(tag));
}
}
registerObjectTag(id,meta,aspects);
} else {
AspectList tmp = ThaumcraftApiHelper.getObjectAspects(new ItemStack(id,1,meta));
for(Aspect tag:aspects.getAspects()) {
tmp.merge(tag, tmp.getAmount(tag));
}
registerObjectTag(id,meta,tmp);
}
}
//CROPS //////////////////////////////////////////////////////////////////////////////////////////
@ -336,5 +338,4 @@ public class ThaumcraftApi {
* FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(Block.crops,1,7));
*/
}

View File

@ -3,24 +3,31 @@ package thaumcraft.api;
import java.lang.reflect.Method;
import net.minecraft.item.ItemStack;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import cpw.mods.fml.common.FMLLog;
public class ThaumcraftApiHelper {
public static AspectList cullTags(AspectList temp) {
// while (temp!=null && temp.size()>5) {
// EnumTag lowest = null;
// int low = Integer.MAX_VALUE;
// for (EnumTag tag:temp.getAspects()) {
// if (temp.getAmount(tag)<low) {
// low = temp.getAmount(tag);
// lowest = tag;
// }
// }
// temp.aspects.remove(lowest);
// }
return temp;
AspectList temp2 = new AspectList();
for (Aspect tag:temp.getAspects()) {
if (tag!=null)
temp2.add(tag, temp.getAmount(tag));
}
while (temp2!=null && temp2.size()>10) {
Aspect lowest = null;
int low = Integer.MAX_VALUE;
for (Aspect tag:temp2.getAspects()) {
if (tag==null) continue;
if (temp2.getAmount(tag)<low) {
low = temp2.getAmount(tag);
lowest = tag;
}
}
temp2.aspects.remove(lowest);
}
return temp2;
}
public static boolean areItemsEqual(ItemStack s1,ItemStack s2)

View File

@ -116,6 +116,15 @@ public class Aspect {
}
return primals;
}
public static ArrayList<Aspect> getCompoundAspects() {
ArrayList<Aspect> compounds = new ArrayList<Aspect>();
Collection<Aspect> pa = aspects.values();
for (Aspect aspect:pa) {
if (!aspect.isPrimal()) compounds.add(aspect);
}
return compounds;
}
public String getChatcolor() {
return chatcolor;
@ -144,6 +153,8 @@ public class Aspect {
public static final Aspect STONE = new Aspect("saxum",0x808080, new Aspect[] {EARTH, EARTH});
public static final Aspect LIFE = new Aspect("victus",0xde0005, new Aspect[] {WATER, EARTH});
public static final Aspect WEATHER = new Aspect("tempestas",0xFFFFFF, new Aspect[] {AIR, WATER});
public static final Aspect ICE = new Aspect("gelum",0xe1ffff, new Aspect[] {WATER, ORDER});
public static final Aspect CRYSTAL = new Aspect("vitreus",0x80ffff, new Aspect[] {STONE, WATER});
//TERTIARY TODO
@ -151,7 +162,12 @@ public class Aspect {
public static final Aspect FLIGHT = new Aspect("volatus",0xe7e7d7, new Aspect[] {AIR, MOTION});
public static final Aspect DARKNESS = new Aspect("tenebrae",0x222222, new Aspect[] {VOID, LIGHT});
public static final Aspect SOUL = new Aspect("spiritus",0xebebfb, new Aspect[] {LIFE, DEATH});
public static final Aspect HEAL = new Aspect("sano",0xff2f34, new Aspect[] {ORDER, LIFE});
public static final Aspect TRAVEL = new Aspect("iter",0xe0585b, new Aspect[] {MOTION, EARTH});
public static final Aspect POISON = new Aspect("venenum",0x89f000, new Aspect[] {WATER, DEATH});
public static final Aspect ELDRITCH = new Aspect("alienis",0x805080, new Aspect[] {VOID, DARKNESS});
public static final Aspect MAGIC = new Aspect("praecantatio",0x9700c0, new Aspect[] {VOID, ENERGY});
public static final Aspect AURA = new Aspect("auram",0xffc0ff, new Aspect[] {MAGIC, AIR});
public static final Aspect TAINT = new Aspect("vitium",0x800080, new Aspect[] {MAGIC, ENTROPY});
@ -165,20 +181,31 @@ public class Aspect {
public static final Aspect FLESH = new Aspect("corpus",0xee478d, new Aspect[] {DEATH,BEAST});
public static final Aspect UNDEAD = new Aspect("exanimis",0x3a4000, new Aspect[] {MOTION, DEATH});
public static final Aspect MIND = new Aspect("cognitio",0xffc2b3, new Aspect[] {EARTH, SOUL});
public static final Aspect MAN = new Aspect("humanus",0xffd7c0, new Aspect[] {BEAST, MIND});
public static final Aspect SENSES = new Aspect("sensus",0x0fd9ff, new Aspect[] {AIR, SOUL});
public static final Aspect MAN = new Aspect("humanus",0xffd7c0, new Aspect[] {BEAST, MIND});
public static final Aspect CROP = new Aspect("messis",0xe1b371, new Aspect[] {SEED, MAN});
public static final Aspect HARVEST = new Aspect("meto",0xeead82, new Aspect[] {CROP, MAN});
public static final Aspect METAL = new Aspect("metallum",0xb5b5cd, new Aspect[] {STONE, ORDER});
public static final Aspect MINE = new Aspect("perfodio",0xFFFFFF, new Aspect[] {MAN, STONE});
public static final Aspect TOOL = new Aspect("instrumentum",0xFFFFFF, new Aspect[] {MAN, METAL});
public static final Aspect WEAPON = new Aspect("telum",0xFFFFFF, new Aspect[] {TOOL, ENTROPY});
public static final Aspect MINE = new Aspect("perfodio",0xdcd2d8, new Aspect[] {MAN, STONE});
public static final Aspect TOOL = new Aspect("instrumentum",0x4040ee, new Aspect[] {MAN, METAL});
public static final Aspect WEAPON = new Aspect("telum",0xc05050, new Aspect[] {TOOL, ENTROPY});
public static final Aspect ARMOR = new Aspect("tutamen",0x00c0c0, new Aspect[] {TOOL, ORDER});
public static final Aspect HUNGER = new Aspect("fames",0x9a0305, new Aspect[] {LIFE, VOID});
public static final Aspect GREED = new Aspect("lucrum",0xe6be44, new Aspect[] {MAN, HUNGER});
public static final Aspect CRAFT = new Aspect("fabrico",0x809d80, new Aspect[] {MAN,TOOL});
public static final Aspect CLOTH = new Aspect("pannus",0xeaeac2, new Aspect[] {TOOL, BEAST});
public static final Aspect MECHANISM = new Aspect("machina",0x8080a0, new Aspect[] {MOTION, TOOL});
public static final Aspect TRAP = new Aspect("vinculum",0x9a8080, new Aspect[] {MOTION, ENTROPY});
public static final Aspect EXCHANGE = new Aspect("permutatio",0x578357, new Aspect[] {MOTION, ORDER});
// public static final Aspect LAVA = new Aspect("lava",0xe85729, new Aspect[] {EARTH, FIRE});
@ -186,19 +213,8 @@ public class Aspect {
// public static final Aspect MUD = new Aspect("lutum",0x473423, new Aspect[] {WATER, EARTH});
// public static final Aspect SAND = new Aspect("sand",0xFFFFFF, new Aspect[] {AIR, EARTH});
// public static final Aspect ASTRAL = new Aspect("Astral",0xFFFFFF, new Aspect[] {VOID, DARKNESS});
// public static final Aspect HEAL = new Aspect("Heal",0xFFFFFF, new Aspect[] {ORDER, LIFE});
// public static final Aspect HARM = new Aspect("Harm",0xFFFFFF, new Aspect[] {ENTROPY, LIFE});
// public static final Aspect BIRD = new Aspect("Bird",0xFFFFFF, new Aspect[] {BEAST, AIR});
// public static final Aspect FISH = new Aspect("Fish",0xFFFFFF, new Aspect[] {BEAST, WATER});
// public static final Aspect TOOL = new Aspect("Tool",0xFFFFFF, new Aspect[] {MAN, METAL});
// public static final Aspect WOOD = new Aspect("Wood",0xFFFFFF, new Aspect[] {TREE, TOOL});
// public static final Aspect MACHINE = new Aspect("Machine",0xFFFFFF, new Aspect[] {TOOL, ORDER});
// public static final Aspect TRAVEL = new Aspect("Travel",0xFFFFFF, new Aspect[] {MOTION, EARTH});
// public static final Aspect TELEPORT = new Aspect("Teleport",0xFFFFFF, new Aspect[] {TRAVEL, VOID});
// public static final Aspect CLAY = new Aspect("Clay",0xFFFFFF, new Aspect[] {SAND, LIFE});
public static final Aspect HEAL = new Aspect("heal",0xFFFFFF, new Aspect[] {ORDER, LIFE});
public static final Aspect POISON = new Aspect("poison",0xFFFFFF, new Aspect[] {WATER, DEATH});
public static final Aspect TRAP = new Aspect("pannus",0xeaeac2, new Aspect[] {MOTION, ENTROPY});
public static final Aspect ICE = new Aspect("ice",0xde0005, new Aspect[] {WATER, ORDER});
}

View File

@ -45,6 +45,19 @@ public class AspectList implements Serializable {
return aspects.size();
}
/**
* @return the amount of total vis in this collection
*/
public int visSize() {
int q = 0;
for (Aspect as:aspects.keySet()) {
q+=this.getAmount(as);
}
return q;
}
/**
* @return an array of all the aspects in this collection
*/

View File

@ -0,0 +1,37 @@
package thaumcraft.api.aspects;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
/**
*
* @author azanor
*
* Used by wispy essences and essentia phials to hold their aspects.
* Useful for similar item containers that store their aspect information in nbt form so TC
* automatically picks up the aspects they contain
*
*/
public interface IAspectContainerItem {
public AspectList getAspects(ItemStack itemstack);
public void setAspects(ItemStack itemstack, AspectList aspects);
}
//Example implementation
/*
@Override
public AspectList getAspects(ItemStack itemstack) {
if (itemstack.hasTagCompound()) {
AspectList aspects = new AspectList();
aspects.readFromNBT(itemstack.getTagCompound());
return aspects.size()>0?aspects:null;
}
return null;
}
@Override
public void setAspects(ItemStack itemstack, AspectList aspects) {
if (!itemstack.hasTagCompound()) itemstack.setTagCompound(new NBTTagCompound());
aspects.writeToNBT(itemstack.getTagCompound());
}
*/

View File

@ -1,7 +1,5 @@
package thaumcraft.api;
package thaumcraft.api.aspects;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
/**

View File

@ -93,6 +93,11 @@ public class ResearchItem
*/
private boolean isHidden;
/**
* Concealed research does not display in the thaumonomicon until parent researches are discovered.
*/
private boolean isConcealed;
/**
* Lost research can only be discovered via knowledge fragments
*/
@ -165,6 +170,12 @@ public class ResearchItem
return this;
}
public ResearchItem setConcealed()
{
this.isConcealed = true;
return this;
}
public ResearchItem setLost()
{
this.isLost = true;
@ -241,6 +252,11 @@ public class ResearchItem
return this.isHidden;
}
public boolean isConcealed()
{
return this.isConcealed;
}
public boolean isLost()
{
return this.isLost;

View File

@ -14,6 +14,7 @@ public class ResearchPage {
public static enum PageType
{
TEXT,
TEXT_CONCEALED,
IMAGE,
CRUCIBLE_CRAFTING,
ARCANE_CRAFTING,
@ -25,6 +26,7 @@ public class ResearchPage {
public PageType type = PageType.TEXT;
public String text=null;
public String research=null;
public ResourceLocation image=null;
public AspectList aspects=null;
public Object recipe=null;
@ -38,6 +40,16 @@ public class ResearchPage {
this.text = text;
}
/**
* @param research this page will only be displayed if the player has discovered this research
* @param text this can (but does not have to) be a reference to a localization variable, not the actual text.
*/
public ResearchPage(String research, String text) {
this.type = PageType.TEXT_CONCEALED;
this.research = research;
this.text = text;
}
/**
* @param recipe a vanilla crafting recipe.
*/
@ -47,6 +59,15 @@ public class ResearchPage {
this.recipeOutput = recipe.getRecipeOutput();
}
/**
* @param recipe a vanilla crafting recipe.
*/
public ResearchPage(IRecipe[] recipe) {
this.type = PageType.NORMAL_CRAFTING;
this.recipe = recipe;
// this.recipeOutput = recipe.getRecipeOutput();
}
/**
* @param recipe a compound crafting recipe.
*/