diff options
| author | Draknyte1 <Draknyte1@hotmail.com> | 2016-11-06 19:32:27 +1000 |
|---|---|---|
| committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-11-06 19:32:27 +1000 |
| commit | cbe0e497be8e466c380a5b4fa781b314ede9ada3 (patch) | |
| tree | b85848b432adf458e3abda466ee46d9dfc3e454b /src/Java/gtPlusPlus/xmod/growthcraft/fishtrap | |
| parent | c40416b036c0e89451e1558253ccf07bbee028d0 (diff) | |
| download | GT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.tar.gz GT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.tar.bz2 GT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.zip | |
Revert "$ Cleaned up the entire project."
This reverts commit 0669f5eb9d5029a8b94ec552171b0837605f7747.
# Conflicts:
# src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java
# src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java
Revert "% Cleaned up Imports."
This reverts commit 3654052fb63a571c5eaca7f20714b87c17f7e966.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/growthcraft/fishtrap')
| -rw-r--r-- | src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java | 191 | ||||
| -rw-r--r-- | src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_Old.java | 12 |
2 files changed, 89 insertions, 114 deletions
diff --git a/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java b/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java index 5e35a360c3..7f62c7fe53 100644 --- a/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java +++ b/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java @@ -9,185 +9,160 @@ import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.item.ItemStack; public class FishTrapHandler { + + private static final String[] fishTypes = {"fish", "junk", "treasure"}; - private static final String[] fishTypes = { - "fish", "junk", "treasure" - }; - - final static String prefix = "food"; - - final static String suffix = "raw"; - final static String seaweed = "cropSeaweed"; - final static String greenheartFish = "Greenheartfish"; - private static final String[] harvestcraftFish = { - "Anchovy", "Bass", "Carp", "Catfish", "Charr", "Clam", "Crab", "Crayfish", "Eel", "Frog", "Grouper", - "Herring", "Jellyfish", "Mudfish", "Octopus", "Perch", "Scallop", "Shrimp", "Snail", "Snapper", "Tilapia", - "Trout", "Tuna", "Turtle", "Walleye" - }; - protected static void addFish(final String lootType, final ItemStack lootStack, final int lootChance) { - if (LoadedMods.getModVersion("Growthcraft").contains("2.3.1")) { - if (lootType == FishTrapHandler.fishTypes[0]) { + protected static void addFish(String lootType, ItemStack lootStack, int lootChance){ + if (LoadedMods.getModVersion("Growthcraft").contains("2.3.1")){ + if (lootType == fishTypes[0]){ Growthcraft_Old.addTrapFish(lootStack, lootChance); - Utils.LOG_INFO("Added " + lootStack.getDisplayName() + " as an extra Fish for Growthcraft Fishtraps."); + Utils.LOG_INFO("Added "+lootStack.getDisplayName()+" as an extra Fish for Growthcraft Fishtraps."); } - else if (lootType == FishTrapHandler.fishTypes[1]) { + else if (lootType == fishTypes[1]){ Growthcraft_Old.addTrapJunk(lootStack, lootChance); - Utils.LOG_INFO("Added " + lootStack.getDisplayName() + " as extra Junk for Growthcraft Fishtraps."); + Utils.LOG_INFO("Added "+lootStack.getDisplayName()+" as extra Junk for Growthcraft Fishtraps."); } - else if (lootType == FishTrapHandler.fishTypes[2]) { + else if (lootType == fishTypes[2]){ Growthcraft_Old.addTrapTreasure(lootStack, lootChance); - Utils.LOG_INFO("Added " + lootStack.getDisplayName() + " as extra Treasure for Growthcraft Fishtraps."); + Utils.LOG_INFO("Added "+lootStack.getDisplayName()+" as extra Treasure for Growthcraft Fishtraps."); } else { return; } } - + else { - Utils.LOG_INFO("Extra Fish loot for Growthcraft Fishtraps disabled. Found V." - + LoadedMods.getModVersion("Growthcraft")); + Utils.LOG_INFO("Extra Fish loot for Growthcraft Fishtraps disabled. Found V."+LoadedMods.getModVersion("Growthcraft")); } - + } - - private static void addGregtechCentrifugeRecipe(final ItemStack input) { - if (LoadedMods.Gregtech) { - GT_Values.RA.addCentrifugeRecipe(input, null, null, FluidUtils.getFluidStack("methane", 96), null, null, - null, null, null, null, null, 19 * 20, 5); + + final static String prefix = "food"; + final static String suffix = "raw"; + final static String seaweed = "cropSeaweed"; + final static String greenheartFish = "Greenheartfish"; + private static final String[] harvestcraftFish = { + "Anchovy", "Bass", "Carp", "Catfish", "Charr", "Clam", "Crab", "Crayfish", "Eel", "Frog", "Grouper", "Herring", + "Jellyfish", "Mudfish", "Octopus", "Perch", "Scallop", "Shrimp", "Snail", "Snapper", "Tilapia", "Trout", "Tuna", "Turtle", "Walleye"}; + public static void pamsHarvestCraftCompat(){ + for (int i = 0; i < harvestcraftFish.length; i++){ + String itemName = prefix+harvestcraftFish[i]+suffix; + int lootChance = getLootChance(harvestcraftFish[i]); + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken(itemName, 1) != null){ + addFish("fish", ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1), lootChance); + addGregtechMaceratorRecipe(ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1)); + addGregtechCentrifugeRecipe(ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1)); + addGregtechFluidRecipe(ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1)); + } } - } - - private static void addGregtechFluidRecipe(final ItemStack input) { - if (LoadedMods.Gregtech) { - GT_Values.RA.addFluidExtractionRecipe(input, null, FluidUtils.getFluidStack("fishoil", 4), 0, 64 / 4, 4); // 4eu/t - // total - // eu - // used - // = - // 64 - // so - // time - // = - // 64/4 + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken(greenheartFish, 1) != null){ + addFish("fish", ItemUtils.getItemStackOfAmountFromOreDict(greenheartFish, 1), getLootChance(greenheartFish)); + addGregtechMaceratorRecipe(ItemUtils.getItemStackOfAmountFromOreDict(greenheartFish, 1)); + addGregtechCentrifugeRecipe(ItemUtils.getItemStackOfAmountFromOreDict(greenheartFish, 1)); + addGregtechFluidRecipe(ItemUtils.getItemStackOfAmountFromOreDict(greenheartFish, 1)); } - } - - private static void addGregtechMaceratorRecipe(final ItemStack input) { - if (LoadedMods.Gregtech) { - GT_ModHandler.addPulverisationRecipe(input, ItemUtils.getItemStackOfAmountFromOreDict("dustMeatRaw", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustTinyBone", 1), 0); + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken(seaweed, 1) != null){ + addFish("junk", ItemUtils.getItemStackOfAmountFromOreDict(seaweed, 1), getLootChance(seaweed)); } } - - private static int getLootChance(final String name) { - if (name == FishTrapHandler.harvestcraftFish[0]) { + + private static int getLootChance(String name){ + if (name == harvestcraftFish[0]){ return 20; } - else if (name == FishTrapHandler.harvestcraftFish[1]) { + else if (name == harvestcraftFish[1]){ return 10; } - else if (name == FishTrapHandler.harvestcraftFish[2]) { + else if (name == harvestcraftFish[2]){ return 15; } - else if (name == FishTrapHandler.harvestcraftFish[3]) { + else if (name == harvestcraftFish[3]){ return 55; } - else if (name == FishTrapHandler.harvestcraftFish[4]) { + else if (name == harvestcraftFish[4]){ return 5; } - else if (name == FishTrapHandler.harvestcraftFish[5]) { + else if (name == harvestcraftFish[5]){ return 8; } - else if (name == FishTrapHandler.harvestcraftFish[6]) { + else if (name == harvestcraftFish[6]){ return 11; } - else if (name == FishTrapHandler.harvestcraftFish[7]) { + else if (name == harvestcraftFish[7]){ return 11; } - else if (name == FishTrapHandler.harvestcraftFish[8]) { + else if (name == harvestcraftFish[8]){ return 15; } - else if (name == FishTrapHandler.harvestcraftFish[9]) { + else if (name == harvestcraftFish[9]){ return 1; } - else if (name == FishTrapHandler.harvestcraftFish[10]) { + else if (name == harvestcraftFish[10]){ return 5; } - else if (name == FishTrapHandler.harvestcraftFish[11]) { + else if (name == harvestcraftFish[11]){ return 10; } - else if (name == FishTrapHandler.harvestcraftFish[12]) { + else if (name == harvestcraftFish[12]){ return 25; } - else if (name == FishTrapHandler.harvestcraftFish[13]) { + else if (name == harvestcraftFish[13]){ return 15; } - else if (name == FishTrapHandler.harvestcraftFish[14]) { + else if (name == harvestcraftFish[14]){ return 20; - } // "Perch", "Scallop", "Shrimp", "Snail", "Snapper", "Tilapia", - // "Trout", "Tuna", "Turtle", "Walleye"}; - else if (name == FishTrapHandler.harvestcraftFish[15]) { + } //"Perch", "Scallop", "Shrimp", "Snail", "Snapper", "Tilapia", "Trout", "Tuna", "Turtle", "Walleye"}; + else if (name == harvestcraftFish[15]){ return 22; } - else if (name == FishTrapHandler.harvestcraftFish[16]) { + else if (name == harvestcraftFish[16]){ return 10; } - else if (name == FishTrapHandler.harvestcraftFish[17]) { + else if (name == harvestcraftFish[17]){ return 35; } - else if (name == FishTrapHandler.harvestcraftFish[18]) { + else if (name == harvestcraftFish[18]){ return 3; } - else if (name == FishTrapHandler.harvestcraftFish[19]) { + else if (name == harvestcraftFish[19]){ return 20; } - else if (name == FishTrapHandler.harvestcraftFish[20]) { + else if (name == harvestcraftFish[20]){ return 4; } - else if (name == FishTrapHandler.harvestcraftFish[21]) { + else if (name == harvestcraftFish[21]){ return 40; } - else if (name == FishTrapHandler.harvestcraftFish[22]) { + else if (name == harvestcraftFish[22]){ return 30; } - else if (name == FishTrapHandler.harvestcraftFish[23]) { + else if (name == harvestcraftFish[23]){ return 5; } - else if (name == FishTrapHandler.harvestcraftFish[24]) { + else if (name == harvestcraftFish[24]){ return 8; } else { return 25; } } - - public static void pamsHarvestCraftCompat() { - for (int i = 0; i < FishTrapHandler.harvestcraftFish.length; i++) { - final String itemName = FishTrapHandler.prefix + FishTrapHandler.harvestcraftFish[i] - + FishTrapHandler.suffix; - final int lootChance = FishTrapHandler.getLootChance(FishTrapHandler.harvestcraftFish[i]); - if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken(itemName, 1) != null) { - FishTrapHandler.addFish("fish", ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1), lootChance); - FishTrapHandler.addGregtechMaceratorRecipe(ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1)); - FishTrapHandler.addGregtechCentrifugeRecipe(ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1)); - FishTrapHandler.addGregtechFluidRecipe(ItemUtils.getItemStackOfAmountFromOreDict(itemName, 1)); - } - } - if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken(FishTrapHandler.greenheartFish, 1) != null) { - FishTrapHandler.addFish("fish", - ItemUtils.getItemStackOfAmountFromOreDict(FishTrapHandler.greenheartFish, 1), - FishTrapHandler.getLootChance(FishTrapHandler.greenheartFish)); - FishTrapHandler.addGregtechMaceratorRecipe( - ItemUtils.getItemStackOfAmountFromOreDict(FishTrapHandler.greenheartFish, 1)); - FishTrapHandler.addGregtechCentrifugeRecipe( - ItemUtils.getItemStackOfAmountFromOreDict(FishTrapHandler.greenheartFish, 1)); - FishTrapHandler.addGregtechFluidRecipe( - ItemUtils.getItemStackOfAmountFromOreDict(FishTrapHandler.greenheartFish, 1)); - } - if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken(FishTrapHandler.seaweed, 1) != null) { - FishTrapHandler.addFish("junk", ItemUtils.getItemStackOfAmountFromOreDict(FishTrapHandler.seaweed, 1), - FishTrapHandler.getLootChance(FishTrapHandler.seaweed)); + + private static void addGregtechCentrifugeRecipe(ItemStack input){ + if (LoadedMods.Gregtech){ + GT_Values.RA.addCentrifugeRecipe(input, null, null, FluidUtils.getFluidStack("methane", 96), null, null, null, null, null, null, null, 19*20, 5); + } + } + + private static void addGregtechMaceratorRecipe(ItemStack input){ + if (LoadedMods.Gregtech){ + GT_ModHandler.addPulverisationRecipe(input, ItemUtils.getItemStackOfAmountFromOreDict("dustMeatRaw", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustTinyBone", 1), 0); } } - + + private static void addGregtechFluidRecipe(ItemStack input){ + if (LoadedMods.Gregtech){ + GT_Values.RA.addFluidExtractionRecipe(input, null, FluidUtils.getFluidStack("fishoil", 4), 0, (64/4), 4); //4eu/t total eu used = 64 so time = 64/4 + } + } + } diff --git a/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_Old.java b/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_Old.java index 02c468ef3a..d7521fc579 100644 --- a/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_Old.java +++ b/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_Old.java @@ -6,18 +6,18 @@ import net.minecraft.item.ItemStack; public class Growthcraft_Old { - public static void addTrapFish(final ItemStack loot, final int lootChance) { - FishTrapRegistry.instance().addTrapFish(new FishTrapEntry(loot, lootChance)); + public static void addTrapJunk(ItemStack loot, int lootChance){ + FishTrapRegistry.instance().addTrapJunk(new FishTrapEntry(loot, lootChance)); } - public static void addTrapJunk(final ItemStack loot, final int lootChance) { - FishTrapRegistry.instance().addTrapJunk(new FishTrapEntry(loot, lootChance)); + public static void addTrapTreasure(ItemStack loot, int lootChance){ + FishTrapRegistry.instance().addTrapTreasure(new FishTrapEntry(loot, lootChance)); } - public static void addTrapTreasure(final ItemStack loot, final int lootChance) { - FishTrapRegistry.instance().addTrapTreasure(new FishTrapEntry(loot, lootChance)); + public static void addTrapFish(ItemStack loot, int lootChance){ + FishTrapRegistry.instance().addTrapFish(new FishTrapEntry(loot, lootChance)); } |
