aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gregtech/api/util/FishPondFakeRecipe.java
diff options
context:
space:
mode:
authorMartin Robertz <dream-master@gmx.net>2021-12-15 16:11:54 +0100
committerGitHub <noreply@github.com>2021-12-15 16:11:54 +0100
commit128c74faa99dfef8d056c1d82c6e4388b9d470e8 (patch)
tree2c84162154ba681232f86dffd4106db530236814 /src/Java/gregtech/api/util/FishPondFakeRecipe.java
parent47ce336f288a45aa3244c8ae1177499fa5080942 (diff)
parentff4b8c7068c2ea7d654e9beda00646d23e62b314 (diff)
downloadGT5-Unofficial-128c74faa99dfef8d056c1d82c6e4388b9d470e8.tar.gz
GT5-Unofficial-128c74faa99dfef8d056c1d82c6e4388b9d470e8.tar.bz2
GT5-Unofficial-128c74faa99dfef8d056c1d82c6e4388b9d470e8.zip
Merge pull request #65 from GTNewHorizons/unified-build-script2
Move sources and resources
Diffstat (limited to 'src/Java/gregtech/api/util/FishPondFakeRecipe.java')
-rw-r--r--src/Java/gregtech/api/util/FishPondFakeRecipe.java80
1 files changed, 0 insertions, 80 deletions
diff --git a/src/Java/gregtech/api/util/FishPondFakeRecipe.java b/src/Java/gregtech/api/util/FishPondFakeRecipe.java
deleted file mode 100644
index bc7cdb4701..0000000000
--- a/src/Java/gregtech/api/util/FishPondFakeRecipe.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package gregtech.api.util;
-
-import java.util.ArrayList;
-
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.WeightedRandomFishable;
-
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.AutoMap;
-import gtPlusPlus.core.recipe.common.CI;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
-import net.minecraftforge.common.FishingHooks;
-import net.minecraftforge.fluids.FluidStack;
-
-public class FishPondFakeRecipe {
-
- public static ArrayList<WeightedRandomFishable> fish = new ArrayList<WeightedRandomFishable>();
- public static ArrayList<WeightedRandomFishable> junk = new ArrayList<WeightedRandomFishable>();
- public static ArrayList<WeightedRandomFishable> treasure = new ArrayList<WeightedRandomFishable>();
-
- @SuppressWarnings("unchecked")
- public static boolean generateFishPondRecipes() {
-
- try {
- fish = (ArrayList<WeightedRandomFishable>) ReflectionUtils.getField(FishingHooks.class, "fish").get(null);
- junk = (ArrayList<WeightedRandomFishable>) ReflectionUtils.getField(FishingHooks.class, "junk").get(null);
- treasure = (ArrayList<WeightedRandomFishable>) ReflectionUtils.getField(FishingHooks.class, "treasure").get(null);
- }
- catch (IllegalArgumentException | IllegalAccessException e) {
- Logger.INFO("Error generating Fish Pond Recipes. [1]");
- e.printStackTrace();
- }
-
- AutoMap<ArrayList<WeightedRandomFishable>> mega = new AutoMap<ArrayList<WeightedRandomFishable>>();
- mega.put(fish);
- mega.put(junk);
- mega.put(treasure);
-
- int mType = 14;
- for (ArrayList<WeightedRandomFishable> f : mega.values()) {
- for (int e=0;e<f.size();e++) {
- if (f.get(e) != null) {
- WeightedRandomFishable u = f.get(e);
- try {
- ItemStack t = (ItemStack) ReflectionUtils.getField(WeightedRandomFishable.class, "field_150711_b").get(u);
- addNewFishPondLoot(mType, new ItemStack[]{t}, new int[] {10000});
- }
- catch (IllegalArgumentException | IllegalAccessException e1) {
- Logger.INFO("Error generating Fish Pond Recipes. [2]");
- e1.printStackTrace();
- }
- }
- }
- mType++;
- }
-
- return true;
- }
-
- public static void addNewFishPondLoot(int circuit, ItemStack[] outputItems, int[] chances) {
- GTPP_Recipe x = new GTPP_Recipe(
- true,
- new ItemStack[]{CI.getNumberedCircuit(circuit)},
- outputItems,
- null,
- chances,
- new FluidStack[]{null},
- new FluidStack[]{null},
- 100, //1 Tick
- 0, //No Eu produced
- circuit //Magic Number
- );
- if (x != null) {
- Logger.INFO("Fishing ["+circuit+"]: "+ItemUtils.getArrayStackNames(outputItems));
- GTPP_Recipe.GTPP_Recipe_Map.sFishPondRecipes.addRecipe(x);
- }
- }
-
-}