aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_Old.java
diff options
context:
space:
mode:
authorboubou19 <miisterunknown@gmail.com>2023-04-09 01:08:26 +0200
committerGitHub <noreply@github.com>2023-04-09 01:08:26 +0200
commit26caa265b7eae49767947e1ff4e6cfc8166b07f5 (patch)
tree0fc0332da7a843cf153bf75fcc2e20601bbf18ee /src/main/java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_Old.java
parentc33b3ba66194c7441fbd437530d21a51aa4395d5 (diff)
downloadGT5-Unofficial-26caa265b7eae49767947e1ff4e6cfc8166b07f5.tar.gz
GT5-Unofficial-26caa265b7eae49767947e1ff4e6cfc8166b07f5.tar.bz2
GT5-Unofficial-26caa265b7eae49767947e1ff4e6cfc8166b07f5.zip
clean up GT++ code (#589)
* yeet big reactor support * yeet IC2 classic support * yeet pneumaticraft support * yeet More Planets support * yeet Immersive Engineering support * yeet Psychedilicraft support * yeet Beyond Reality Core support * sort mods to see what must be purged * yeet simply jetpacks * yeet RFTools * yeet xReliquary * yeet RedTech * yeet Mekanism * yeet GrowthCraft * yeet ihl * leftover cleaning * yeet thermal fondation support * yeet compact windmills support * spotless * remove constants from LoadedMods (part 1 / 2) * spotless * remove constants from LoadedMods (part 2 / 2) * use mod id enum instead of strings + optimize imports * Loaded.isModLoaded -> enum * restore RA init * missing ! * start organizing recipes stuff * fix crash on world load in dev * remove unused class * remove HazmatUtils.java * move all the removals * remove enableHarderRecipesForHighTierCasings and usages(disabled in the pack) * move some pyrolyse oven recipes to its own file * sa * bump GT version * bump GT5U version * spotless apply * use Everglades entry from the mod enum --------- Co-authored-by: miozune <miozune@gmail.com> Co-authored-by: Martin Robertz <dream-master@gmx.net>
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_Old.java')
-rw-r--r--src/main/java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_Old.java83
1 files changed, 0 insertions, 83 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_Old.java b/src/main/java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_Old.java
deleted file mode 100644
index 0d1fd8e7dd..0000000000
--- a/src/main/java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_Old.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package gtPlusPlus.xmod.growthcraft.fishtrap;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import net.minecraft.item.ItemStack;
-
-public class Growthcraft_Old {
-
- Method addTrapJunk;
- Method addTrapTreasure;
- Method addTrapFish;
- Object FishTrapRegistryO;
-
- public Growthcraft_Old() {
- setFishTrapRegistry();
- }
-
- void setFishTrapRegistry() {
- try {
- Class<?> FishTrapRegistryClass = Class
- .forName("gtPlusPlus.xmod.growthcraft.fishtrap.FishTrapHandler.mFishingRegistry");
- Class<?> FishTrapEntry = Class.forName("growthcraft.api.fishtrap.FishTrapEntry");
- if (FishTrapRegistryClass.isInstance(FishTrapHandler.getFishingRegistry())) {
- addTrapJunk = FishTrapRegistryClass.getDeclaredMethod("addTrapJunk", FishTrapEntry);
- addTrapTreasure = FishTrapRegistryClass.getDeclaredMethod("addTrapTreasure", FishTrapEntry);
- addTrapFish = FishTrapRegistryClass.getDeclaredMethod("addTrapFish", FishTrapEntry);
- FishTrapRegistryO = FishTrapHandler.getFishingRegistry();
- }
- } catch (ClassNotFoundException | NoSuchMethodException | SecurityException e) {
- e.printStackTrace();
- }
- }
-
- private Object createFishTrapEntry(ItemStack loot, int chance) {
- try {
- Class<?> FishTrapEntry = Class.forName("growthcraft.api.fishtrap.FishTrapEntry");
- Object o = FishTrapEntry.getConstructor(ItemStack.class, int.class);
- if (FishTrapEntry != null) {
- Constructor[] constructors = FishTrapEntry.getDeclaredConstructors();
- constructors[0].setAccessible(true);
- Object x = constructors[0].newInstance(loot, chance);
- if (x != null) {
- return x;
- }
- }
- } catch (ClassNotFoundException | NoSuchMethodException | SecurityException | InstantiationException
- | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {}
-
- return null;
- }
-
- private boolean invoke(Method m, ItemStack o, int p) {
- try {
- Object I = createFishTrapEntry(o, p);
- m.invoke(FishTrapRegistryO, I);
- return true;
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {}
- return false;
- }
-
- public void addTrapJunk(final ItemStack loot, final int lootChance) {
- // FishTrapRegistry.instance().addTrapJunk(new FishTrapEntry(loot, lootChance));
- if (addTrapJunk != null) {
- invoke(addTrapJunk, loot, lootChance);
- }
- }
-
- public void addTrapTreasure(final ItemStack loot, final int lootChance) {
- // FishTrapRegistry.instance().addTrapTreasure(new FishTrapEntry(loot, lootChance));
- if (addTrapTreasure != null) {
- invoke(addTrapTreasure, loot, lootChance);
- }
- }
-
- public void addTrapFish(final ItemStack loot, final int lootChance) {
- // FishTrapRegistry.instance().addTrapFish(new FishTrapEntry(loot, lootChance));
- if (addTrapFish != null) {
- invoke(addTrapFish, loot, lootChance);
- }
- }
-}