aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/growthcraft/fishtrap')
-rw-r--r--src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java191
-rw-r--r--src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_Old.java12
2 files changed, 114 insertions, 89 deletions
diff --git a/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java b/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java
index 7f62c7fe53..5e35a360c3 100644
--- a/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java
+++ b/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java
@@ -9,160 +9,185 @@ import gtPlusPlus.core.util.item.ItemUtils;
import net.minecraft.item.ItemStack;
public class FishTrapHandler {
-
- private static final String[] fishTypes = {"fish", "junk", "treasure"};
- protected static void addFish(String lootType, ItemStack lootStack, int lootChance){
- if (LoadedMods.getModVersion("Growthcraft").contains("2.3.1")){
- if (lootType == fishTypes[0]){
+ 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]) {
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 == fishTypes[1]){
+ else if (lootType == FishTrapHandler.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 == fishTypes[2]){
+ else if (lootType == FishTrapHandler.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"));
}
-
+
}
-
- 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 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);
}
- 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 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(seaweed, 1) != null){
- addFish("junk", ItemUtils.getItemStackOfAmountFromOreDict(seaweed, 1), getLootChance(seaweed));
+ }
+
+ private static void addGregtechMaceratorRecipe(final ItemStack input) {
+ if (LoadedMods.Gregtech) {
+ GT_ModHandler.addPulverisationRecipe(input, ItemUtils.getItemStackOfAmountFromOreDict("dustMeatRaw", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTinyBone", 1), 0);
}
}
-
- private static int getLootChance(String name){
- if (name == harvestcraftFish[0]){
+
+ private static int getLootChance(final String name) {
+ if (name == FishTrapHandler.harvestcraftFish[0]) {
return 20;
}
- else if (name == harvestcraftFish[1]){
+ else if (name == FishTrapHandler.harvestcraftFish[1]) {
return 10;
}
- else if (name == harvestcraftFish[2]){
+ else if (name == FishTrapHandler.harvestcraftFish[2]) {
return 15;
}
- else if (name == harvestcraftFish[3]){
+ else if (name == FishTrapHandler.harvestcraftFish[3]) {
return 55;
}
- else if (name == harvestcraftFish[4]){
+ else if (name == FishTrapHandler.harvestcraftFish[4]) {
return 5;
}
- else if (name == harvestcraftFish[5]){
+ else if (name == FishTrapHandler.harvestcraftFish[5]) {
return 8;
}
- else if (name == harvestcraftFish[6]){
+ else if (name == FishTrapHandler.harvestcraftFish[6]) {
return 11;
}
- else if (name == harvestcraftFish[7]){
+ else if (name == FishTrapHandler.harvestcraftFish[7]) {
return 11;
}
- else if (name == harvestcraftFish[8]){
+ else if (name == FishTrapHandler.harvestcraftFish[8]) {
return 15;
}
- else if (name == harvestcraftFish[9]){
+ else if (name == FishTrapHandler.harvestcraftFish[9]) {
return 1;
}
- else if (name == harvestcraftFish[10]){
+ else if (name == FishTrapHandler.harvestcraftFish[10]) {
return 5;
}
- else if (name == harvestcraftFish[11]){
+ else if (name == FishTrapHandler.harvestcraftFish[11]) {
return 10;
}
- else if (name == harvestcraftFish[12]){
+ else if (name == FishTrapHandler.harvestcraftFish[12]) {
return 25;
}
- else if (name == harvestcraftFish[13]){
+ else if (name == FishTrapHandler.harvestcraftFish[13]) {
return 15;
}
- else if (name == harvestcraftFish[14]){
+ else if (name == FishTrapHandler.harvestcraftFish[14]) {
return 20;
- } //"Perch", "Scallop", "Shrimp", "Snail", "Snapper", "Tilapia", "Trout", "Tuna", "Turtle", "Walleye"};
- else if (name == harvestcraftFish[15]){
+ } // "Perch", "Scallop", "Shrimp", "Snail", "Snapper", "Tilapia",
+ // "Trout", "Tuna", "Turtle", "Walleye"};
+ else if (name == FishTrapHandler.harvestcraftFish[15]) {
return 22;
}
- else if (name == harvestcraftFish[16]){
+ else if (name == FishTrapHandler.harvestcraftFish[16]) {
return 10;
}
- else if (name == harvestcraftFish[17]){
+ else if (name == FishTrapHandler.harvestcraftFish[17]) {
return 35;
}
- else if (name == harvestcraftFish[18]){
+ else if (name == FishTrapHandler.harvestcraftFish[18]) {
return 3;
}
- else if (name == harvestcraftFish[19]){
+ else if (name == FishTrapHandler.harvestcraftFish[19]) {
return 20;
}
- else if (name == harvestcraftFish[20]){
+ else if (name == FishTrapHandler.harvestcraftFish[20]) {
return 4;
}
- else if (name == harvestcraftFish[21]){
+ else if (name == FishTrapHandler.harvestcraftFish[21]) {
return 40;
}
- else if (name == harvestcraftFish[22]){
+ else if (name == FishTrapHandler.harvestcraftFish[22]) {
return 30;
}
- else if (name == harvestcraftFish[23]){
+ else if (name == FishTrapHandler.harvestcraftFish[23]) {
return 5;
}
- else if (name == harvestcraftFish[24]){
+ else if (name == FishTrapHandler.harvestcraftFish[24]) {
return 8;
}
else {
return 25;
}
}
-
- 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);
+
+ 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 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 d7521fc579..02c468ef3a 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 addTrapJunk(ItemStack loot, int lootChance){
- FishTrapRegistry.instance().addTrapJunk(new FishTrapEntry(loot, lootChance));
+ public static void addTrapFish(final ItemStack loot, final int lootChance) {
+ FishTrapRegistry.instance().addTrapFish(new FishTrapEntry(loot, lootChance));
}
- public static void addTrapTreasure(ItemStack loot, int lootChance){
- FishTrapRegistry.instance().addTrapTreasure(new FishTrapEntry(loot, lootChance));
+ public static void addTrapJunk(final ItemStack loot, final int lootChance) {
+ FishTrapRegistry.instance().addTrapJunk(new FishTrapEntry(loot, lootChance));
}
- public static void addTrapFish(ItemStack loot, int lootChance){
- FishTrapRegistry.instance().addTrapFish(new FishTrapEntry(loot, lootChance));
+ public static void addTrapTreasure(final ItemStack loot, final int lootChance) {
+ FishTrapRegistry.instance().addTrapTreasure(new FishTrapEntry(loot, lootChance));
}