diff options
author | Jakub <53441451+kuba6000@users.noreply.github.com> | 2022-08-29 16:04:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-29 16:04:28 +0200 |
commit | 7d1f51a8937e0a86486267437d444696e81e8aa0 (patch) | |
tree | a5b145e7271998f7b4b968a2212ed487e54a92b5 /src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research | |
parent | 5267969156d30b4bb5f4cb2279ebb49db6bd40e2 (diff) | |
download | GT5-Unofficial-7d1f51a8937e0a86486267437d444696e81e8aa0.tar.gz GT5-Unofficial-7d1f51a8937e0a86486267437d444696e81e8aa0.tar.bz2 GT5-Unofficial-7d1f51a8937e0a86486267437d444696e81e8aa0.zip |
Buildscript + Spotless (#318)
* Convert AES.java to readable class
* Buildscript
* Spotless
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research')
6 files changed, 557 insertions, 559 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_PageType_Wrapper.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_PageType_Wrapper.java index d6c7f66988..3a06ac1b90 100644 --- a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_PageType_Wrapper.java +++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_PageType_Wrapper.java @@ -2,16 +2,15 @@ package gtPlusPlus.xmod.thaumcraft.objects.wrapper.research; 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; - + 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/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchCategories_Wrapper.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchCategories_Wrapper.java index 93869cb8d8..0130ca3b96 100644 --- a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchCategories_Wrapper.java +++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchCategories_Wrapper.java @@ -6,84 +6,83 @@ 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 + + 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; + } + } + } +} diff --git a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchCategoryList_Wrapper.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchCategoryList_Wrapper.java index 3e6f5b78f2..08c69cdca5 100644 --- a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchCategoryList_Wrapper.java +++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchCategoryList_Wrapper.java @@ -2,20 +2,19 @@ package gtPlusPlus.xmod.thaumcraft.objects.wrapper.research; 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 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; - } + public TC_ResearchCategoryList_Wrapper(ResourceLocation icon, ResourceLocation background) { + this.icon = icon; + this.background = background; + } } diff --git a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchItem_Wrapper.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchItem_Wrapper.java index 6372cc0371..be0ae26e61 100644 --- a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchItem_Wrapper.java +++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchItem_Wrapper.java @@ -9,238 +9,242 @@ 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; - } - + 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/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchNoteData_Wrapper.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchNoteData_Wrapper.java index 5adf0150d9..df8d21bbaa 100644 --- a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchNoteData_Wrapper.java +++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchNoteData_Wrapper.java @@ -2,13 +2,12 @@ package gtPlusPlus.xmod.thaumcraft.objects.wrapper.research; 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; - } - + 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/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchPage_Wrapper.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchPage_Wrapper.java index 998f37bf8c..83ddd106a5 100644 --- a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchPage_Wrapper.java +++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/wrapper/research/TC_ResearchPage_Wrapper.java @@ -1,12 +1,11 @@ package gtPlusPlus.xmod.thaumcraft.objects.wrapper.research; -import java.util.List; - import gtPlusPlus.xmod.thaumcraft.objects.wrapper.aspect.TC_AspectList_Wrapper; 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 java.util.List; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.item.crafting.IRecipe; @@ -14,215 +13,214 @@ 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 + 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; + } +} |