aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/reliquary
diff options
context:
space:
mode:
authorJakub <53441451+kuba6000@users.noreply.github.com>2022-08-29 16:04:28 +0200
committerGitHub <noreply@github.com>2022-08-29 16:04:28 +0200
commit7d1f51a8937e0a86486267437d444696e81e8aa0 (patch)
treea5b145e7271998f7b4b968a2212ed487e54a92b5 /src/main/java/gtPlusPlus/xmod/reliquary
parent5267969156d30b4bb5f4cb2279ebb49db6bd40e2 (diff)
downloadGT5-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/reliquary')
-rw-r--r--src/main/java/gtPlusPlus/xmod/reliquary/HANDLER_Reliquary.java31
-rw-r--r--src/main/java/gtPlusPlus/xmod/reliquary/item/ReliquaryItems.java285
-rw-r--r--src/main/java/gtPlusPlus/xmod/reliquary/util/AlkahestRecipeWrapper.java77
-rw-r--r--src/main/java/gtPlusPlus/xmod/reliquary/util/ReliquaryRecipeHandler.java90
4 files changed, 249 insertions, 234 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/reliquary/HANDLER_Reliquary.java b/src/main/java/gtPlusPlus/xmod/reliquary/HANDLER_Reliquary.java
index 7ebb4c7b1f..4e6317fe21 100644
--- a/src/main/java/gtPlusPlus/xmod/reliquary/HANDLER_Reliquary.java
+++ b/src/main/java/gtPlusPlus/xmod/reliquary/HANDLER_Reliquary.java
@@ -5,22 +5,17 @@ import gtPlusPlus.xmod.reliquary.util.ReliquaryRecipeHandler;
public class HANDLER_Reliquary {
- public static void preInit() {
- if (LoadedMods.Reliquary) {
-
- }
- }
-
- public static void init() {
- if (LoadedMods.Reliquary) {
-
- }
- }
-
- public static void postInit() {
- if (LoadedMods.Reliquary) {
- ReliquaryRecipeHandler.gregifyDefaultRecipes();
- }
- }
-
+ public static void preInit() {
+ if (LoadedMods.Reliquary) {}
+ }
+
+ public static void init() {
+ if (LoadedMods.Reliquary) {}
+ }
+
+ public static void postInit() {
+ if (LoadedMods.Reliquary) {
+ ReliquaryRecipeHandler.gregifyDefaultRecipes();
+ }
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/reliquary/item/ReliquaryItems.java b/src/main/java/gtPlusPlus/xmod/reliquary/item/ReliquaryItems.java
index d1fb67a7d3..27505892d1 100644
--- a/src/main/java/gtPlusPlus/xmod/reliquary/item/ReliquaryItems.java
+++ b/src/main/java/gtPlusPlus/xmod/reliquary/item/ReliquaryItems.java
@@ -1,10 +1,9 @@
package gtPlusPlus.xmod.reliquary.item;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
@@ -12,149 +11,149 @@ import net.minecraft.item.ItemStack;
public class ReliquaryItems {
- private static Class<?> CLASS_MAIN = ReflectionUtils.getClass("xreliquary.Reliquary");
- private static Field FIELD_CONTENT = ReflectionUtils.getField(CLASS_MAIN, "CONTENT");
- private static Object OBJECT_CONTENT = ReflectionUtils.getFieldValue(FIELD_CONTENT);
- private static Method METHOD_GETITEM = ReflectionUtils.getMethod(OBJECT_CONTENT, "getItem", new Class[] {String.class});
-
- public static Item getItem(String name) {
- try {
- return (Item) METHOD_GETITEM.invoke(OBJECT_CONTENT, name);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- }
- return null;
- }
-
- public static ItemStack emptyVoidTear() {
- return new ItemStack(getItem("void_tear_empty"), 1, 0);
- }
-
- public static ItemStack glowingWater() {
- return new ItemStack(getItem("glowing_water"));
- }
-
- public static ItemStack emptyVial() {
- return new ItemStack(getItem("potion"), 1, 0);
- }
-
- public static ItemStack emperorChalice() {
- return new ItemStack(getItem("emperor_chalice"));
- }
-
- public static ItemStack infernalChalice() {
- return new ItemStack(getItem("infernal_chalice"));
- }
-
- public static ItemStack witherSkull() {
- return new ItemStack(Items.skull, 1, 1);
- }
-
- public static ItemStack roseBush() {
- return new ItemStack(Blocks.double_plant, 1, 4);
- }
-
- public static ItemStack blackWool() {
- return new ItemStack(Blocks.wool, 1, 15);
- }
-
- public static ItemStack lapis() {
- return new ItemStack(Items.dye, 1, 4);
- }
-
- public static ItemStack gunPart(int i, int m) {
- return new ItemStack(getItem("gun_part"), i, m);
- }
-
- public static ItemStack magazine(int m) {
- return magazine(1, m);
- }
-
- public static ItemStack magazine(int i, int m) {
- return new ItemStack(getItem("magazine"), i, m);
- }
-
- public static ItemStack bullet(int m) {
- return bullet(1, m);
- }
-
- public static ItemStack bullet(int i, int m) {
- return new ItemStack(getItem("bullet"), i, m);
- }
-
- public static ItemStack ingredient(int m) {
- return new ItemStack(getItem("mob_ingredient"), 1, m);
- }
-
- public static ItemStack enderHeart() {
- return ingredient(11);
- }
-
- public static ItemStack creeperGland() {
- return ingredient(3);
- }
-
- public static ItemStack slimePearl() {
- return ingredient(4);
- }
-
- public static ItemStack batWing() {
- return ingredient(5);
- }
-
- public static ItemStack ribBone() {
- return ingredient(0);
- }
-
- public static ItemStack witherRib() {
- return ingredient(1);
- }
-
- public static ItemStack stormEye() {
- return ingredient(8);
- }
-
- public static ItemStack fertileEssence() {
- return ingredient(9);
- }
-
- public static ItemStack frozenCore() {
- return ingredient(10);
- }
-
- public static ItemStack moltenCore() {
- return ingredient(7);
- }
-
- public static ItemStack zombieHeart() {
- return ingredient(6);
- }
-
- public static ItemStack infernalClaw() {
- return ingredient(13);
- }
-
- public static ItemStack shellFragment() {
- return ingredient(14);
- }
-
- public static ItemStack squidBeak() {
- return ingredient(12);
- }
-
- public static ItemStack spiderFangs() {
- return ingredient(2);
- }
+ private static Class<?> CLASS_MAIN = ReflectionUtils.getClass("xreliquary.Reliquary");
+ private static Field FIELD_CONTENT = ReflectionUtils.getField(CLASS_MAIN, "CONTENT");
+ private static Object OBJECT_CONTENT = ReflectionUtils.getFieldValue(FIELD_CONTENT);
+ private static Method METHOD_GETITEM =
+ ReflectionUtils.getMethod(OBJECT_CONTENT, "getItem", new Class[] {String.class});
+
+ public static Item getItem(String name) {
+ try {
+ return (Item) METHOD_GETITEM.invoke(OBJECT_CONTENT, name);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ }
+ return null;
+ }
+
+ public static ItemStack emptyVoidTear() {
+ return new ItemStack(getItem("void_tear_empty"), 1, 0);
+ }
+
+ public static ItemStack glowingWater() {
+ return new ItemStack(getItem("glowing_water"));
+ }
+
+ public static ItemStack emptyVial() {
+ return new ItemStack(getItem("potion"), 1, 0);
+ }
+
+ public static ItemStack emperorChalice() {
+ return new ItemStack(getItem("emperor_chalice"));
+ }
+
+ public static ItemStack infernalChalice() {
+ return new ItemStack(getItem("infernal_chalice"));
+ }
+
+ public static ItemStack witherSkull() {
+ return new ItemStack(Items.skull, 1, 1);
+ }
+
+ public static ItemStack roseBush() {
+ return new ItemStack(Blocks.double_plant, 1, 4);
+ }
+
+ public static ItemStack blackWool() {
+ return new ItemStack(Blocks.wool, 1, 15);
+ }
+
+ public static ItemStack lapis() {
+ return new ItemStack(Items.dye, 1, 4);
+ }
+
+ public static ItemStack gunPart(int i, int m) {
+ return new ItemStack(getItem("gun_part"), i, m);
+ }
+
+ public static ItemStack magazine(int m) {
+ return magazine(1, m);
+ }
+
+ public static ItemStack magazine(int i, int m) {
+ return new ItemStack(getItem("magazine"), i, m);
+ }
+
+ public static ItemStack bullet(int m) {
+ return bullet(1, m);
+ }
+
+ public static ItemStack bullet(int i, int m) {
+ return new ItemStack(getItem("bullet"), i, m);
+ }
+
+ public static ItemStack ingredient(int m) {
+ return new ItemStack(getItem("mob_ingredient"), 1, m);
+ }
+
+ public static ItemStack enderHeart() {
+ return ingredient(11);
+ }
+
+ public static ItemStack creeperGland() {
+ return ingredient(3);
+ }
+
+ public static ItemStack slimePearl() {
+ return ingredient(4);
+ }
+
+ public static ItemStack batWing() {
+ return ingredient(5);
+ }
+
+ public static ItemStack ribBone() {
+ return ingredient(0);
+ }
+
+ public static ItemStack witherRib() {
+ return ingredient(1);
+ }
+
+ public static ItemStack stormEye() {
+ return ingredient(8);
+ }
+
+ public static ItemStack fertileEssence() {
+ return ingredient(9);
+ }
+
+ public static ItemStack frozenCore() {
+ return ingredient(10);
+ }
+
+ public static ItemStack moltenCore() {
+ return ingredient(7);
+ }
+
+ public static ItemStack zombieHeart() {
+ return ingredient(6);
+ }
+
+ public static ItemStack infernalClaw() {
+ return ingredient(13);
+ }
+
+ public static ItemStack shellFragment() {
+ return ingredient(14);
+ }
+
+ public static ItemStack squidBeak() {
+ return ingredient(12);
+ }
- public static ItemStack heartPearl(int m) {
- return new ItemStack(getItem("heart_pearl"), 1, m);
- }
+ public static ItemStack spiderFangs() {
+ return ingredient(2);
+ }
- public static ItemStack nianZhu(int m) {
- return new ItemStack(getItem("heart_zhu"), 1, m);
- }
+ public static ItemStack heartPearl(int m) {
+ return new ItemStack(getItem("heart_pearl"), 1, m);
+ }
- public static ItemStack emptyVoidSatchel() {
- return new ItemStack(getItem("void_tear_empty"), 1, 0);
- }
+ public static ItemStack nianZhu(int m) {
+ return new ItemStack(getItem("heart_zhu"), 1, m);
+ }
+ public static ItemStack emptyVoidSatchel() {
+ return new ItemStack(getItem("void_tear_empty"), 1, 0);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/reliquary/util/AlkahestRecipeWrapper.java b/src/main/java/gtPlusPlus/xmod/reliquary/util/AlkahestRecipeWrapper.java
index 6086b74ec4..1418a8d086 100644
--- a/src/main/java/gtPlusPlus/xmod/reliquary/util/AlkahestRecipeWrapper.java
+++ b/src/main/java/gtPlusPlus/xmod/reliquary/util/AlkahestRecipeWrapper.java
@@ -1,47 +1,52 @@
package gtPlusPlus.xmod.reliquary.util;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
-
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
import net.minecraft.item.ItemStack;
public class AlkahestRecipeWrapper {
- public ItemStack item = null;
- public int yield = 0;
- public int cost = 0;
- public String dictionaryName = null;
+ public ItemStack item = null;
+ public int yield = 0;
+ public int cost = 0;
+ public String dictionaryName = null;
+
+ public AlkahestRecipeWrapper(ItemStack par1, int par2, int par3) {
+ this.item = par1;
+ this.yield = par2;
+ this.cost = par3;
+ }
- public AlkahestRecipeWrapper(ItemStack par1, int par2, int par3) {
- this.item = par1;
- this.yield = par2;
- this.cost = par3;
- }
+ public AlkahestRecipeWrapper(String par1, int par2, int par3) {
+ this.dictionaryName = par1;
+ this.yield = par2;
+ this.cost = par3;
+ }
- public AlkahestRecipeWrapper(String par1, int par2, int par3) {
- this.dictionaryName = par1;
- this.yield = par2;
- this.cost = par3;
- }
+ public Object getOriginalRecipe() {
+ try {
+ Constructor<?> o;
+ if (dictionaryName == null) {
+ o = ReflectionUtils.getClass("xreliquary.util.alkahestry.AlkahestRecipe")
+ .getConstructor(ItemStack.class, int.class, int.class);
+ } else {
+ o = ReflectionUtils.getClass("xreliquary.util.alkahestry.AlkahestRecipe")
+ .getConstructor(String.class, int.class, int.class);
+ }
- public Object getOriginalRecipe() {
- try {
- Constructor<?> o;
- if (dictionaryName == null) {
- o = ReflectionUtils.getClass("xreliquary.util.alkahestry.AlkahestRecipe").getConstructor(ItemStack.class, int.class, int.class);
- }
- else {
- o = ReflectionUtils.getClass("xreliquary.util.alkahestry.AlkahestRecipe").getConstructor(String.class, int.class, int.class);
- }
-
- Object r = o.newInstance(dictionaryName == null ? item : dictionaryName, yield, cost);
- if (r != null) {
- return r;
- }
+ Object r = o.newInstance(dictionaryName == null ? item : dictionaryName, yield, cost);
+ if (r != null) {
+ return r;
+ }
- } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- // oops
- }
- return null;
- }
-} \ No newline at end of file
+ } catch (NoSuchMethodException
+ | SecurityException
+ | InstantiationException
+ | IllegalAccessException
+ | IllegalArgumentException
+ | InvocationTargetException e) {
+ // oops
+ }
+ return null;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/reliquary/util/ReliquaryRecipeHandler.java b/src/main/java/gtPlusPlus/xmod/reliquary/util/ReliquaryRecipeHandler.java
index 1133e67fe6..c0f19fecbc 100644
--- a/src/main/java/gtPlusPlus/xmod/reliquary/util/ReliquaryRecipeHandler.java
+++ b/src/main/java/gtPlusPlus/xmod/reliquary/util/ReliquaryRecipeHandler.java
@@ -16,41 +16,57 @@ import net.minecraft.item.ItemStack;
public class ReliquaryRecipeHandler {
- public static boolean removeAlkahestRecipe(ItemStack aOutput) {
- return false;
- }
-
- public static boolean addAlkahestRecipe(ItemStack[] aInputs, ItemStack aOutput) {
- if (aInputs == null || aInputs.length <= 0 || aInputs.length > 9) {
- return false;
- }
- return false;
- }
-
- public static void gregifyDefaultRecipes() {
- Logger.INFO("Gregifying Reliquary recipes.");
- if (GT_ModHandler.removeRecipeByOutput(ReliquaryItems.glowingWater())) {
- Logger.INFO("Removing recipe for Glowing Water.");
- }
- if (GT_ModHandler.removeRecipeByOutput(ReliquaryItems.emptyVoidTear())) {
- Logger.INFO("Removing recipe for Empty Void Tears.");
- }
- if (GT_ModHandler.removeRecipeByOutput(ReliquaryItems.emperorChalice())) {
- Logger.INFO("Removing recipe for the Emperor Chalice.");
- }
- if (GT_ModHandler.removeRecipeByOutput(ReliquaryItems.infernalChalice())) {
- Logger.INFO("Removing recipe for the Infernal Chalice.");
- }
- Logger.INFO("Finished removing original recipes.");
-
- // Add new recipes
- if (CORE.RA.addChemicalRecipe(ALLOY.ENERGYCRYSTAL.getDust(4), ReliquaryItems.emptyVial(), FluidUtils.getHotWater(2000), null, ReliquaryItems.glowingWater(), 20 * 30, 500)) {
- Logger.INFO("Added new recipe for Glowing Water.");
- }
- if (CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {ItemUtils.simpleMetaStack(Items.ender_eye, 0, 32), CI.getFieldGenerator(5, GTNH ? 8 : 4), CI.getTieredComponent(OrePrefixes.plate, 5, GTNH ? 16 : 8), CI.getEmitter(3, 20)}, FluidUtils.getUUM(50), ReliquaryItems.emptyVoidTear(), 20 * 2000, 2000)){
- Logger.INFO("Added new recipe for Empty Void Tears.");
- }
- Logger.INFO("Finished adding new recipes.");
-
- }
+ public static boolean removeAlkahestRecipe(ItemStack aOutput) {
+ return false;
+ }
+
+ public static boolean addAlkahestRecipe(ItemStack[] aInputs, ItemStack aOutput) {
+ if (aInputs == null || aInputs.length <= 0 || aInputs.length > 9) {
+ return false;
+ }
+ return false;
+ }
+
+ public static void gregifyDefaultRecipes() {
+ Logger.INFO("Gregifying Reliquary recipes.");
+ if (GT_ModHandler.removeRecipeByOutput(ReliquaryItems.glowingWater())) {
+ Logger.INFO("Removing recipe for Glowing Water.");
+ }
+ if (GT_ModHandler.removeRecipeByOutput(ReliquaryItems.emptyVoidTear())) {
+ Logger.INFO("Removing recipe for Empty Void Tears.");
+ }
+ if (GT_ModHandler.removeRecipeByOutput(ReliquaryItems.emperorChalice())) {
+ Logger.INFO("Removing recipe for the Emperor Chalice.");
+ }
+ if (GT_ModHandler.removeRecipeByOutput(ReliquaryItems.infernalChalice())) {
+ Logger.INFO("Removing recipe for the Infernal Chalice.");
+ }
+ Logger.INFO("Finished removing original recipes.");
+
+ // Add new recipes
+ if (CORE.RA.addChemicalRecipe(
+ ALLOY.ENERGYCRYSTAL.getDust(4),
+ ReliquaryItems.emptyVial(),
+ FluidUtils.getHotWater(2000),
+ null,
+ ReliquaryItems.glowingWater(),
+ 20 * 30,
+ 500)) {
+ Logger.INFO("Added new recipe for Glowing Water.");
+ }
+ if (CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemUtils.simpleMetaStack(Items.ender_eye, 0, 32),
+ CI.getFieldGenerator(5, GTNH ? 8 : 4),
+ CI.getTieredComponent(OrePrefixes.plate, 5, GTNH ? 16 : 8),
+ CI.getEmitter(3, 20)
+ },
+ FluidUtils.getUUM(50),
+ ReliquaryItems.emptyVoidTear(),
+ 20 * 2000,
+ 2000)) {
+ Logger.INFO("Added new recipe for Empty Void Tears.");
+ }
+ Logger.INFO("Finished adding new recipes.");
+ }
}