diff options
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/thaumcraft/aspect')
10 files changed, 51 insertions, 969 deletions
diff --git a/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/GTPP_AspectCompat.java b/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/GTPP_AspectCompat.java index ea4c97fbfc..d5a19a91fc 100644 --- a/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/GTPP_AspectCompat.java +++ b/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/GTPP_AspectCompat.java @@ -10,6 +10,9 @@ import gregtech.api.enums.TC_Aspects; import gregtech.api.util.GT_LanguageManager; import gregtech.common.GT_ThaumcraftCompat; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.xmod.thaumcraft.objects.wrapper.aspect.TC_AspectList_Wrapper; +import gtPlusPlus.xmod.thaumcraft.objects.wrapper.aspect.TC_Aspect_Wrapper; import net.minecraft.util.ResourceLocation; public class GTPP_AspectCompat { @@ -99,8 +102,8 @@ public class GTPP_AspectCompat { // Custom Aspects ASPECT_BALANCE = new TC_Aspect_Wrapper( - "Purity", - 15647411, + "Sagrausten", + Utils.rgbtoHexValue(125, 125, 125), new TC_Aspect_Wrapper[]{ get(TC_Aspects.GELUM), get(TC_Aspects.IGNIS) @@ -108,10 +111,11 @@ public class GTPP_AspectCompat { new ResourceLocation("gregtech:textures/aspects/" + TC_Aspects.RADIO.name() + ".png"), false, 1); + ASPECT_LUST = new TC_Aspect_Wrapper( - "Vengeance", - 15647411, + "Slusium", + Utils.rgbtoHexValue(175, 125, 25), new TC_Aspect_Wrapper[]{ get(TC_Aspects.CORPUS), get(TC_Aspects.ORDO) @@ -119,6 +123,42 @@ public class GTPP_AspectCompat { new ResourceLocation("gregtech:textures/aspects/" + TC_Aspects.NEBRISUM.name() + ".png"), false, 1); + + ASPECT_STARBOUND = + new TC_Aspect_Wrapper( + "Xenil", + Utils.rgbtoHexValue(25, 25, 25), + new TC_Aspect_Wrapper[]{ + get(TC_Aspects.ALIENIS), + ASPECT_BALANCE + }, + new ResourceLocation("gregtech:textures/aspects/" + TC_Aspects.NEBRISUM.name() + ".png"), + false, + 1); + + ASPECT_TOXIC = + new TC_Aspect_Wrapper( + "Xablum", + Utils.rgbtoHexValue(25, 185, 25), + new TC_Aspect_Wrapper[]{ + get(TC_Aspects.CORPUS), + ASPECT_LUST + }, + new ResourceLocation("gregtech:textures/aspects/" + TC_Aspects.NEBRISUM.name() + ".png"), + false, + 1); + + ASPECT_HEAVEN = + new TC_Aspect_Wrapper( + "Zetralt", + Utils.rgbtoHexValue(225, 225, 225), + new TC_Aspect_Wrapper[]{ + get(TC_Aspects.COGNITIO), + ASPECT_BALANCE + }, + new ResourceLocation("gregtech:textures/aspects/" + TC_Aspects.NEBRISUM.name() + ".png"), + false, + 1); @@ -131,11 +171,11 @@ public class GTPP_AspectCompat { new ResourceLocation("gregtech:textures/aspects/" + TC_Aspects.RADIO.name() + ".png"), 1); GTPP_Aspects.CUSTOM_5.mAspect = new Aspect("custom4", 12648384, new Aspect[]{Aspect.LIGHT, Aspect.SOUL}, new ResourceLocation("gregtech:textures/aspects/" + TC_Aspects.RADIO.name() + ".png"), 1);*/ - GT_LanguageManager.addStringLocalization("tc.aspect.Purity", "Balance"); - GT_LanguageManager.addStringLocalization("tc.aspect.Vengeance", "Lust"); - GT_LanguageManager.addStringLocalization("tc.aspect.custom3", "Starbound"); - GT_LanguageManager.addStringLocalization("tc.aspect.custom4", "Toxic"); - GT_LanguageManager.addStringLocalization("tc.aspect.custom5", "Heaven"); + GT_LanguageManager.addStringLocalization("tc.aspect.Sagrausten", "Balance"); + GT_LanguageManager.addStringLocalization("tc.aspect.Slusium", "Lust"); + GT_LanguageManager.addStringLocalization("tc.aspect.Xenil", "Starbound"); + GT_LanguageManager.addStringLocalization("tc.aspect.Xablum", "Toxic"); + GT_LanguageManager.addStringLocalization("tc.aspect.Zetralt", "Zetralt"); } private TC_Aspect_Wrapper get(TC_Aspects aGtObjects) { diff --git a/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/GTPP_AspectStack.java b/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/GTPP_AspectStack.java index d7cfa7d326..23e9035f40 100644 --- a/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/GTPP_AspectStack.java +++ b/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/GTPP_AspectStack.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.thaumcraft.aspect; +import gtPlusPlus.xmod.thaumcraft.objects.wrapper.aspect.TC_Aspect_Wrapper; + public class GTPP_AspectStack { public final TC_Aspect_Wrapper mAspect; diff --git a/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_AspectList_Wrapper.java b/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_AspectList_Wrapper.java deleted file mode 100644 index 0a7f2d6a3c..0000000000 --- a/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_AspectList_Wrapper.java +++ /dev/null @@ -1,40 +0,0 @@ -package gtPlusPlus.xmod.thaumcraft.aspect; - -import net.minecraft.item.ItemStack; - -public class TC_AspectList_Wrapper { - - - //thaumcraft.api.aspects.Aspect; - //thaumcraft.api.aspects.AspectList; - - public TC_AspectList_Wrapper() { - - } - - public TC_AspectList_Wrapper(ItemStack stack) { - - } - - public TC_AspectList_Wrapper(Object invoke) { - // TODO Auto-generated constructor stub - } - - public int size() { - // TODO Auto-generated method stub - return 0; - } - - public Object getVanillaAspectList() { - // TODO Auto-generated method stub - return null; - } - - public void add(TC_Aspect_Wrapper mAspect, int mAmount) { - // TODO Auto-generated method stub - - } - - - -} diff --git a/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_Aspect_Wrapper.java b/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_Aspect_Wrapper.java deleted file mode 100644 index 78c2a670bb..0000000000 --- a/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_Aspect_Wrapper.java +++ /dev/null @@ -1,308 +0,0 @@ -package gtPlusPlus.xmod.thaumcraft.aspect; - -import java.lang.reflect.Array; -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.util.LinkedHashMap; -import java.util.Map; - -import gregtech.api.enums.TC_Aspects; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.reflect.ReflectionUtils; -import net.minecraft.util.ResourceLocation; - -/** - * Wrapper class for Thaumcraft Aspects. - * Used to avoid compile time dependencies. - * @author Alkalus - * - */ -public class TC_Aspect_Wrapper { - - private static Class mClass_Aspect; - private static Field mField_Aspects; - - private final String tag; - private final TC_Aspect_Wrapper[] components; - private final int color; - private String chatcolor; - private final ResourceLocation image; - private final int blend; - - public final Object mAspect; - - /** - * May be null, but links back to the TC_Aspects class from GT for convinience. - */ - public final TC_Aspects mGtEnumField; - - - - - /** - * Statically set the Class objects - */ - static { - mClass_Aspect = ReflectionUtils.getClass("thaumcraft.api.aspects.Aspect"); - } - - /** - * Gets the total aspect list from Thaumcraft, which should contain all other registered aspects. - * @return - A LinkedHashMap(String, Aspect); - */ - public static LinkedHashMap<String, Object> getVanillaAspectList() { - try { - if (mField_Aspects == null) { - mField_Aspects = ReflectionUtils.getField(mClass_Aspect, "aspects"); - } - return (LinkedHashMap<String, Object>) mField_Aspects.get(null); - } catch (IllegalArgumentException | IllegalAccessException e) { - Logger.REFLECTION("Failed configuring TC Aspect compatibility."); - return new LinkedHashMap<String, Object>(); - } - } - - public static Object getVanillaAspectObject(String aAspectName) { - return getVanillaAspectList().get(aAspectName); - } - - - - - - - - - - - - - - - /** - * Vanilla Aspect Constructor - * @param tag - Aspect Name - * @param color - * @param chatcolor - * @param blend - */ - public TC_Aspect_Wrapper(String tag, int color, String chatcolor, int blend) { - this(tag, color, (TC_Aspect_Wrapper[]) null, blend); - this.chatcolor = chatcolor; - } - - /** - * - * Vanilla Aspect Constructor - * @param tag - Aspect Name - * @param color - * @param components - */ - public TC_Aspect_Wrapper(String tag, int color, TC_Aspect_Wrapper[] components) { - this(tag, color, components, false, 1); - } - - /** - * - * Vanilla Aspect Constructor - * @param tag - Aspect Name - * @param color - * @param components - * @param blend - */ - public TC_Aspect_Wrapper(String tag, int color, TC_Aspect_Wrapper[] components, int blend) { - this(tag, color, components, false, blend); - } - - - /** - * - * Vanilla Aspect Constructor - * @param tag - Aspect Name - * @param color - * @param components - * @param image - * @param blend - */ - public TC_Aspect_Wrapper(String tag, int color, TC_Aspect_Wrapper[] components, boolean vanilla, int blend) { - this(tag, color, components, vanilla ? new ResourceLocation("thaumcraft", "textures/aspects/" + tag.toLowerCase() + ".png") : new ResourceLocation(CORE.MODID, "textures/aspects/" + tag.toLowerCase() + ".png"), vanilla, blend); - } - - - public TC_Aspect_Wrapper(String tag, int color, TC_Aspect_Wrapper[] components, ResourceLocation image, boolean vanilla, int blend) { - if (getAspectList().containsKey(tag.toLowerCase())) { - throw new IllegalArgumentException(tag + " already registered!"); - } else { - this.tag = tag.toLowerCase(); - this.components = components; - this.color = color; - this.image = image; - this.blend = blend; - this.mAspect = vanilla ? getVanillaAspectObject(this.tag) : this.generateTcAspect(); - - //Set GT Type if exists - TC_Aspects y = null; - for (TC_Aspects e : TC_Aspects.values()) { - TC_Aspect_Wrapper g; - try { - g = generate(e.mAspect); - if (g != null) { - if (g.tag.equals(this.tag)) { - y = e; - break; - } - } - } catch (IllegalArgumentException e1) { - e1.printStackTrace(); - } - } - mGtEnumField = y; - - - Logger.INFO("[Thaumcraft++] Adding support for Aspect: "+tag); - } - } - - - - /** - * Generates a TC_Aspect from an object, presummed to be a TC Aspect. - * @param aBaseAspect - The TC Aspect to generate from. - * @return - * @throws IllegalArgumentException - * @throws IllegalAccessException - */ - @SuppressWarnings("unused") - public static TC_Aspect_Wrapper generate(Object aBaseAspect) { - try { - Field aTagF = ReflectionUtils.getField(mClass_Aspect, "tag"); - if (aTagF == null) { - return null; - } - String aTafB = (String) aTagF.get(aBaseAspect); - if (aTafB == null) { - return null; - } - String aTag = aTafB.toLowerCase(); - if (aTag != null && getAspectList().containsKey(aTag.toLowerCase())) { - return getAspect(aTag); - } else { - TC_Aspect_Wrapper aTemp = new TC_Aspect_Wrapper( - aTag, - (int) ReflectionUtils.getField(mClass_Aspect, "color").get(aBaseAspect), - generateAspectArrayInternal(ReflectionUtils.getField(mClass_Aspect, "components"), (aBaseAspect)), - (ResourceLocation) ReflectionUtils.getField(mClass_Aspect, "image").get(aBaseAspect), - true, - (int) ReflectionUtils.getField(mClass_Aspect, "blend").get(aBaseAspect) - ); - if (aTemp != null) { - aTemp.chatcolor = (String) ReflectionUtils.getField(mClass_Aspect, "chatcolor").get(aBaseAspect); - return aTemp; - } - else { - return null; - } - } - } - catch (Throwable t) { - t.printStackTrace(); - return null; - } - } - - - /** - * Internal Map containing all the TC_Aspects. - */ - private static Map<String, TC_Aspect_Wrapper> mInternalAspectCache = new LinkedHashMap<String, TC_Aspect_Wrapper>(); - - /** - * Public getter for all TC_Aspects - * @param aAspectName - Aspect Name - * @return - A GT++ Aspect wrapper or null. (TC_Aspect) - */ - public static TC_Aspect_Wrapper getAspect(String aAspectName) { - String aName = aAspectName.toLowerCase(); - TC_Aspect_Wrapper g = mInternalAspectCache.get(aName); - if (g != null) { - return g; - } - else { - try { - TC_Aspect_Wrapper aTemp = generate(getVanillaAspectList().get(aName)); - if (aTemp != null) { - mInternalAspectCache.put(aName, aTemp); - return aTemp; - } - } catch (IllegalArgumentException e) { - e.printStackTrace(); - } - } - return null; - } - - public static Map<String, TC_Aspect_Wrapper> getAspectList(){ - return mInternalAspectCache; - } - - - private static TC_Aspect_Wrapper[] generateAspectArrayInternal(Field aField, Object aInstance) { - //thaumcraft.api.aspects.Aspect.Aspect() - Object[] components; - TC_Aspect_Wrapper[] aAspectArray; - try { - components = (Object[]) aField.get(aInstance); - aAspectArray = new TC_Aspect_Wrapper[components.length]; - if (components.length > 0) { - int i = 0; - for (Object g : components) { - aAspectArray[i] = getAspect((String) ReflectionUtils.getField(mClass_Aspect, "tag").get(g)); - i++; - } - } - } catch (IllegalArgumentException | IllegalAccessException e) { - e.printStackTrace(); - aAspectArray = new TC_Aspect_Wrapper[0]; - } - return aAspectArray; - } - - /** - * Tasty code to generate TC Aspects reflectively. - * @return - */ - public Object generateTcAspect() { - try { - //thaumcraft.api.aspects.Aspect.Aspect() - Object aAspectArray = (Object[]) Array.newInstance(mClass_Aspect, 1); - if (components.length > 0) { - aAspectArray = (Object[]) Array.newInstance(mClass_Aspect, components.length); - int i = 0; - for (TC_Aspect_Wrapper g : components) { - ((Object[]) aAspectArray)[i++] = g.mAspect; - } - } - Constructor constructor = mClass_Aspect.getConstructor(String.class, int.class, aAspectArray.getClass(), ResourceLocation.class, int.class); - Object myObject = constructor.newInstance(tag, color, aAspectArray, image, blend); - - //Set chat colour - if (chatcolor != null && chatcolor.length() > 0) { - Method setChatColour = ReflectionUtils.getMethod(mClass_Aspect, "setChatcolor", String.class); - if (setChatColour != null) { - setChatColour.invoke(myObject, chatcolor); - } - } - return myObject; - } catch (Throwable t) { - t.printStackTrace(); - return null; - } - } - - public static boolean isObjectAnAspect(Object aAspect) { - return mClass_Aspect.isInstance(aAspect); - } - -} diff --git a/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_PageType_Wrapper.java b/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_PageType_Wrapper.java deleted file mode 100644 index 5a608e290f..0000000000 --- a/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_PageType_Wrapper.java +++ /dev/null @@ -1,17 +0,0 @@ -package gtPlusPlus.xmod.thaumcraft.aspect; - -public class TC_PageType_Wrapper { - - public static final TC_PageType_Wrapper TEXT = null; - public static final TC_PageType_Wrapper TEXT_CONCEALED = null; - public static final TC_PageType_Wrapper NORMAL_CRAFTING = null; - public static final TC_PageType_Wrapper ARCANE_CRAFTING = null; - public static final TC_PageType_Wrapper CRUCIBLE_CRAFTING = null; - public static final TC_PageType_Wrapper INFUSION_CRAFTING = null; - public static final TC_PageType_Wrapper COMPOUND_CRAFTING = null; - public static final TC_PageType_Wrapper SMELTING = null; - public static final TC_PageType_Wrapper INFUSION_ENCHANTMENT = null; - public static final TC_PageType_Wrapper IMAGE = null; - public static final TC_PageType_Wrapper ASPECTS = null; - -} diff --git a/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchCategories_Wrapper.java b/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchCategories_Wrapper.java deleted file mode 100644 index 3392dbcff9..0000000000 --- a/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchCategories_Wrapper.java +++ /dev/null @@ -1,89 +0,0 @@ -package gtPlusPlus.xmod.thaumcraft.aspect; - -import cpw.mods.fml.common.FMLLog; -import java.util.Collection; -import java.util.Iterator; -import java.util.LinkedHashMap; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -import org.apache.logging.log4j.Level; - -public class TC_ResearchCategories_Wrapper { - - public static LinkedHashMap<String, TC_ResearchCategoryList_Wrapper> researchCategories = new LinkedHashMap<String, TC_ResearchCategoryList_Wrapper>(); - - public static TC_ResearchCategoryList_Wrapper getResearchList(String key) { - return (TC_ResearchCategoryList_Wrapper) researchCategories.get(key); - } - - public static String getCategoryName(String key) { - return StatCollector.translateToLocal("tc.research_category." + key); - } - - public static TC_ResearchItem_Wrapper getResearch(String key) { - Collection rc = researchCategories.values(); - Iterator i$ = rc.iterator(); - - while (i$.hasNext()) { - Object cat = i$.next(); - Collection rl = ((TC_ResearchCategoryList_Wrapper) cat).research.values(); - Iterator i$1 = rl.iterator(); - - while (i$1.hasNext()) { - Object ri = i$1.next(); - if (((TC_ResearchItem_Wrapper) ri).key.equals(key)) { - return (TC_ResearchItem_Wrapper) ri; - } - } - } - - return null; - } - - public static void registerCategory(String key, ResourceLocation icon, ResourceLocation background) { - if (getResearchList(key) == null) { - TC_ResearchCategoryList_Wrapper rl = new TC_ResearchCategoryList_Wrapper(icon, background); - researchCategories.put(key, rl); - } - - } - - public static void addResearch(TC_ResearchItem_Wrapper ri) { - TC_ResearchCategoryList_Wrapper rl = getResearchList(ri.category); - if (rl != null && !rl.research.containsKey(ri.key)) { - if (!ri.isVirtual()) { - Iterator i$ = rl.research.values().iterator(); - - while (i$.hasNext()) { - TC_ResearchItem_Wrapper rr = (TC_ResearchItem_Wrapper) i$.next(); - if (rr.displayColumn == ri.displayColumn && rr.displayRow == ri.displayRow) { - FMLLog.log(Level.FATAL, - "[Thaumcraft] Research [" + ri.getName() - + "] not added as it overlaps with existing research [" + rr.getName() + "]", - new Object[0]); - return; - } - } - } - - rl.research.put(ri.key, ri); - if (ri.displayColumn < rl.minDisplayColumn) { - rl.minDisplayColumn = ri.displayColumn; - } - - if (ri.displayRow < rl.minDisplayRow) { - rl.minDisplayRow = ri.displayRow; - } - - if (ri.displayColumn > rl.maxDisplayColumn) { - rl.maxDisplayColumn = ri.displayColumn; - } - - if (ri.displayRow > rl.maxDisplayRow) { - rl.maxDisplayRow = ri.displayRow; - } - } - - } -}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchCategoryList_Wrapper.java b/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchCategoryList_Wrapper.java deleted file mode 100644 index 4c9102648a..0000000000 --- a/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchCategoryList_Wrapper.java +++ /dev/null @@ -1,21 +0,0 @@ -package gtPlusPlus.xmod.thaumcraft.aspect; - -import java.util.HashMap; -import java.util.Map; - -import net.minecraft.util.ResourceLocation; - -public class TC_ResearchCategoryList_Wrapper { - public int minDisplayColumn; - public int minDisplayRow; - public int maxDisplayColumn; - public int maxDisplayRow; - public ResourceLocation icon; - public ResourceLocation background; - public Map<String, TC_ResearchItem_Wrapper> research = new HashMap<String, TC_ResearchItem_Wrapper>(); - - public TC_ResearchCategoryList_Wrapper(ResourceLocation icon, ResourceLocation background) { - this.icon = icon; - this.background = background; - } -} diff --git a/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchItem_Wrapper.java b/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchItem_Wrapper.java deleted file mode 100644 index 399ec5ad09..0000000000 --- a/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchItem_Wrapper.java +++ /dev/null @@ -1,244 +0,0 @@ -package gtPlusPlus.xmod.thaumcraft.aspect; - -import gtPlusPlus.xmod.thaumcraft.util.ThaumcraftUtils; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -public class TC_ResearchItem_Wrapper { - - public final String key; - public final String category; - public final TC_AspectList_Wrapper tags; - public String[] parents = null; - public String[] parentsHidden = null; - public String[] siblings = null; - public final int displayColumn; - public final int displayRow; - public final ItemStack icon_item; - public final ResourceLocation icon_resource; - private int complexity; - private boolean isSpecial; - private boolean isSecondary; - private boolean isRound; - private boolean isStub; - private boolean isVirtual; - private boolean isConcealed; - private boolean isHidden; - private boolean isLost; - private boolean isAutoUnlock; - private ItemStack[] itemTriggers; - private String[] entityTriggers; - private TC_Aspect_Wrapper[] aspectTriggers; - private Object[] pages = null; - - public TC_ResearchItem_Wrapper(String key, String category) { - this.key = key; - this.category = category; - this.tags = new TC_AspectList_Wrapper(); - this.icon_resource = null; - this.icon_item = null; - this.displayColumn = 0; - this.displayRow = 0; - this.setVirtual(); - } - - public TC_ResearchItem_Wrapper(String key, String category, TC_AspectList_Wrapper tags, int col, int row, int complex, - ResourceLocation icon) { - this.key = key; - this.category = category; - this.tags = tags; - this.icon_resource = icon; - this.icon_item = null; - this.displayColumn = col; - this.displayRow = row; - this.complexity = complex; - if (this.complexity < 1) { - this.complexity = 1; - } - - if (this.complexity > 3) { - this.complexity = 3; - } - - } - - public TC_ResearchItem_Wrapper(String key, String category, TC_AspectList_Wrapper tags, int col, int row, int complex, ItemStack icon) { - this.key = key; - this.category = category; - this.tags = tags; - this.icon_item = icon; - this.icon_resource = null; - this.displayColumn = col; - this.displayRow = row; - this.complexity = complex; - if (this.complexity < 1) { - this.complexity = 1; - } - - if (this.complexity > 3) { - this.complexity = 3; - } - - } - - public TC_ResearchItem_Wrapper setSpecial() { - this.isSpecial = true; - return this; - } - - public TC_ResearchItem_Wrapper setStub() { - this.isStub = true; - return this; - } - - public TC_ResearchItem_Wrapper setLost() { - this.isLost = true; - return this; - } - - public TC_ResearchItem_Wrapper setConcealed() { - this.isConcealed = true; - return this; - } - - public TC_ResearchItem_Wrapper setHidden() { - this.isHidden = true; - return this; - } - - public TC_ResearchItem_Wrapper setVirtual() { - this.isVirtual = true; - return this; - } - - public TC_ResearchItem_Wrapper setParents(String... par) { - this.parents = par; - return this; - } - - public TC_ResearchItem_Wrapper setParentsHidden(String... par) { - this.parentsHidden = par; - return this; - } - - public TC_ResearchItem_Wrapper setSiblings(String... sib) { - this.siblings = sib; - return this; - } - - public TC_ResearchItem_Wrapper setPages(Object... par) { - this.pages = par; - return this; - } - - public Object[] getPages() { - return this.pages; - } - - public TC_ResearchItem_Wrapper setItemTriggers(ItemStack... par) { - this.itemTriggers = par; - return this; - } - - public TC_ResearchItem_Wrapper setEntityTriggers(String... par) { - this.entityTriggers = par; - return this; - } - - public TC_ResearchItem_Wrapper setAspectTriggers(TC_Aspect_Wrapper... par) { - this.aspectTriggers = par; - return this; - } - - public ItemStack[] getItemTriggers() { - return this.itemTriggers; - } - - public String[] getEntityTriggers() { - return this.entityTriggers; - } - - public TC_Aspect_Wrapper[] getAspectTriggers() { - return this.aspectTriggers; - } - - public TC_ResearchItem_Wrapper registerResearchItem() { - ThaumcraftUtils.addResearch(this); - return this; - } - - public String getName() { - return StatCollector.translateToLocal("tc.research_name." + this.key); - } - - public String getText() { - return StatCollector.translateToLocal("tc.research_text." + this.key); - } - - public boolean isSpecial() { - return this.isSpecial; - } - - public boolean isStub() { - return this.isStub; - } - - public boolean isLost() { - return this.isLost; - } - - public boolean isConcealed() { - return this.isConcealed; - } - - public boolean isHidden() { - return this.isHidden; - } - - public boolean isVirtual() { - return this.isVirtual; - } - - public boolean isAutoUnlock() { - return this.isAutoUnlock; - } - - public TC_ResearchItem_Wrapper setAutoUnlock() { - this.isAutoUnlock = true; - return this; - } - - public boolean isRound() { - return this.isRound; - } - - public TC_ResearchItem_Wrapper setRound() { - this.isRound = true; - return this; - } - - public boolean isSecondary() { - return this.isSecondary; - } - - public TC_ResearchItem_Wrapper setSecondary() { - this.isSecondary = true; - return this; - } - - public int getComplexity() { - return this.complexity; - } - - public TC_ResearchItem_Wrapper setComplexity(int complexity) { - this.complexity = complexity; - return this; - } - - public TC_Aspect_Wrapper getResearchPrimaryTag() { - //TODO - return null; - } - -} diff --git a/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchNoteData_Wrapper.java b/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchNoteData_Wrapper.java deleted file mode 100644 index dbec20cdb8..0000000000 --- a/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchNoteData_Wrapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package gtPlusPlus.xmod.thaumcraft.aspect; - -public class TC_ResearchNoteData_Wrapper { - - public TC_ResearchNoteData_Wrapper(Object researchNoteData) { - // TODO Auto-generated constructor stub - } - - public Object getResearchNoteData() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchPage_Wrapper.java b/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchPage_Wrapper.java deleted file mode 100644 index 23d3a9f575..0000000000 --- a/src/Java/gtPlusPlus/xmod/thaumcraft/aspect/TC_ResearchPage_Wrapper.java +++ /dev/null @@ -1,227 +0,0 @@ -package gtPlusPlus.xmod.thaumcraft.aspect; - -import java.util.List; - -import gtPlusPlus.xmod.thaumcraft.objects.wrapper.recipe.TC_CrucibleRecipe_Wrapper; -import gtPlusPlus.xmod.thaumcraft.objects.wrapper.recipe.TC_IArcaneRecipe_Wrapper; -import gtPlusPlus.xmod.thaumcraft.objects.wrapper.recipe.TC_InfusionEnchantmentRecipe_Wrapper; -import gtPlusPlus.xmod.thaumcraft.objects.wrapper.recipe.TC_InfusionRecipe_Wrapper; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.FurnaceRecipes; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -public class TC_ResearchPage_Wrapper { - public TC_PageType_Wrapper type; - public String text; - public String research; - public ResourceLocation image; - public TC_AspectList_Wrapper aspects; - public Object recipe; - public ItemStack recipeOutput; - - public TC_ResearchPage_Wrapper(String text) { - this.type = TC_PageType_Wrapper.TEXT; - this.text = null; - this.research = null; - this.image = null; - this.aspects = null; - this.recipe = null; - this.recipeOutput = null; - this.type = TC_PageType_Wrapper.TEXT; - this.text = text; - } - - public TC_ResearchPage_Wrapper(String research, String text) { - this.type = TC_PageType_Wrapper.TEXT; - this.text = null; - this.research = null; - this.image = null; - this.aspects = null; - this.recipe = null; - this.recipeOutput = null; - this.type = TC_PageType_Wrapper.TEXT_CONCEALED; - this.research = research; - this.text = text; - } - - public TC_ResearchPage_Wrapper(IRecipe recipe) { - this.type = TC_PageType_Wrapper.TEXT; - this.text = null; - this.research = null; - this.image = null; - this.aspects = null; - this.recipe = null; - this.recipeOutput = null; - this.type = TC_PageType_Wrapper.NORMAL_CRAFTING; - this.recipe = recipe; - this.recipeOutput = recipe.getRecipeOutput(); - } - - public TC_ResearchPage_Wrapper(IRecipe[] recipe) { - this.type = TC_PageType_Wrapper.TEXT; - this.text = null; - this.research = null; - this.image = null; - this.aspects = null; - this.recipe = null; - this.recipeOutput = null; - this.type = TC_PageType_Wrapper.NORMAL_CRAFTING; - this.recipe = recipe; - } - - public TC_ResearchPage_Wrapper(TC_IArcaneRecipe_Wrapper[] recipe) { - this.type = TC_PageType_Wrapper.TEXT; - this.text = null; - this.research = null; - this.image = null; - this.aspects = null; - this.recipe = null; - this.recipeOutput = null; - this.type = TC_PageType_Wrapper.ARCANE_CRAFTING; - this.recipe = recipe; - } - - public TC_ResearchPage_Wrapper(TC_CrucibleRecipe_Wrapper[] recipe) { - this.type = TC_PageType_Wrapper.TEXT; - this.text = null; - this.research = null; - this.image = null; - this.aspects = null; - this.recipe = null; - this.recipeOutput = null; - this.type = TC_PageType_Wrapper.CRUCIBLE_CRAFTING; - this.recipe = recipe; - } - - public TC_ResearchPage_Wrapper(TC_InfusionRecipe_Wrapper[] recipe) { - this.type = TC_PageType_Wrapper.TEXT; - this.text = null; - this.research = null; - this.image = null; - this.aspects = null; - this.recipe = null; - this.recipeOutput = null; - this.type = TC_PageType_Wrapper.INFUSION_CRAFTING; - this.recipe = recipe; - } - - public TC_ResearchPage_Wrapper(List recipe) { - this.type = TC_PageType_Wrapper.TEXT; - this.text = null; - this.research = null; - this.image = null; - this.aspects = null; - this.recipe = null; - this.recipeOutput = null; - this.type = TC_PageType_Wrapper.COMPOUND_CRAFTING; - this.recipe = recipe; - } - - public TC_ResearchPage_Wrapper(TC_IArcaneRecipe_Wrapper recipe) { - this.type = TC_PageType_Wrapper.TEXT; - this.text = null; - this.research = null; - this.image = null; - this.aspects = null; - this.recipe = null; - this.recipeOutput = null; - this.type = TC_PageType_Wrapper.ARCANE_CRAFTING; - this.recipe = recipe; - this.recipeOutput = recipe.getRecipeOutput(); - } - - public TC_ResearchPage_Wrapper(TC_CrucibleRecipe_Wrapper recipe) { - this.type = TC_PageType_Wrapper.TEXT; - this.text = null; - this.research = null; - this.image = null; - this.aspects = null; - this.recipe = null; - this.recipeOutput = null; - this.type = TC_PageType_Wrapper.CRUCIBLE_CRAFTING; - this.recipe = recipe; - this.recipeOutput = recipe.getRecipeOutput(); - } - - public TC_ResearchPage_Wrapper(ItemStack input) { - this.type = TC_PageType_Wrapper.TEXT; - this.text = null; - this.research = null; - this.image = null; - this.aspects = null; - this.recipe = null; - this.recipeOutput = null; - this.type = TC_PageType_Wrapper.SMELTING; - this.recipe = input; - this.recipeOutput = FurnaceRecipes.smelting().getSmeltingResult(input); - } - - public TC_ResearchPage_Wrapper(TC_InfusionRecipe_Wrapper recipe) { - this.type = TC_PageType_Wrapper.TEXT; - this.text = null; - this.research = null; - this.image = null; - this.aspects = null; - this.recipe = null; - this.recipeOutput = null; - this.type = TC_PageType_Wrapper.INFUSION_CRAFTING; - this.recipe = recipe; - if (recipe.getRecipeOutput() instanceof ItemStack) { - this.recipeOutput = (ItemStack) recipe.getRecipeOutput(); - } else { - this.recipeOutput = recipe.getRecipeInput(); - } - - } - - public TC_ResearchPage_Wrapper(TC_InfusionEnchantmentRecipe_Wrapper recipe) { - this.type = TC_PageType_Wrapper.TEXT; - this.text = null; - this.research = null; - this.image = null; - this.aspects = null; - this.recipe = null; - this.recipeOutput = null; - this.type = TC_PageType_Wrapper.INFUSION_ENCHANTMENT; - this.recipe = recipe; - } - - public TC_ResearchPage_Wrapper(ResourceLocation image, String caption) { - this.type = TC_PageType_Wrapper.TEXT; - this.text = null; - this.research = null; - this.image = null; - this.aspects = null; - this.recipe = null; - this.recipeOutput = null; - this.type = TC_PageType_Wrapper.IMAGE; - this.image = image; - this.text = caption; - } - - public TC_ResearchPage_Wrapper(TC_AspectList_Wrapper as) { - this.type = TC_PageType_Wrapper.TEXT; - this.text = null; - this.research = null; - this.image = null; - this.aspects = null; - this.recipe = null; - this.recipeOutput = null; - this.type = TC_PageType_Wrapper.ASPECTS; - this.aspects = as; - } - - public String getTranslatedText() { - String ret = ""; - if (this.text != null) { - ret = StatCollector.translateToLocal(this.text); - if (ret.isEmpty()) { - ret = this.text; - } - } - - return ret; - } -}
\ No newline at end of file |