aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/growthcraft
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/growthcraft')
-rw-r--r--src/Java/gtPlusPlus/xmod/growthcraft/HANDLER_GC.java19
-rw-r--r--src/Java/gtPlusPlus/xmod/growthcraft/booze/Register_Booze.java94
-rw-r--r--src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java191
-rw-r--r--src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/Growthcraft_Old.java12
4 files changed, 176 insertions, 140 deletions
diff --git a/src/Java/gtPlusPlus/xmod/growthcraft/HANDLER_GC.java b/src/Java/gtPlusPlus/xmod/growthcraft/HANDLER_GC.java
index 2428f0a943..6c0c045c21 100644
--- a/src/Java/gtPlusPlus/xmod/growthcraft/HANDLER_GC.java
+++ b/src/Java/gtPlusPlus/xmod/growthcraft/HANDLER_GC.java
@@ -6,22 +6,21 @@ import gtPlusPlus.xmod.growthcraft.fishtrap.FishTrapHandler;
public class HANDLER_GC {
-
- //Run me during Pre-Init
- public static void preInit(){
- if (LoadedMods.Growthcraft){
- Register_Booze.preInit();
+ public static void init() {
+ if (LoadedMods.Growthcraft) {
}
}
- public static void init(){
- if (LoadedMods.Growthcraft){
+ public static void postInit() {
+ if (LoadedMods.Growthcraft) {
+ FishTrapHandler.pamsHarvestCraftCompat();
}
}
- public static void postInit(){
- if (LoadedMods.Growthcraft){
- FishTrapHandler.pamsHarvestCraftCompat();
+ // Run me during Pre-Init
+ public static void preInit() {
+ if (LoadedMods.Growthcraft) {
+ Register_Booze.preInit();
}
}
diff --git a/src/Java/gtPlusPlus/xmod/growthcraft/booze/Register_Booze.java b/src/Java/gtPlusPlus/xmod/growthcraft/booze/Register_Booze.java
index 994bda9228..ed3ca5d73f 100644
--- a/src/Java/gtPlusPlus/xmod/growthcraft/booze/Register_Booze.java
+++ b/src/Java/gtPlusPlus/xmod/growthcraft/booze/Register_Booze.java
@@ -15,48 +15,60 @@ import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
public class Register_Booze {
-
- public static BlockFluidBooze[] jackDanielsWhiskeyFluids;
- public static Item jackDaniels;
- public static Item jackDanielsSeeds;
- public static Item jackDanielsWhiskey;
- public static Item jackDanielsWhiskeyBucket_deprecated;
- public static ItemBucketBooze[] jackDanielsWhiskeyBuckets;
- public static Fluid[] jackDanielsWhiskeyBooze;
- //private static int internalColour = FluidRegistry.getFluid("fluidJackDaniels").getColor();
- private static int internalColour = 0000000;
-
- //Run me during Pre-Init
- public static void preInit(){
- if (LoadedMods.Growthcraft){
- start();
+
+ public static BlockFluidBooze[] jackDanielsWhiskeyFluids;
+ public static Item jackDaniels;
+ public static Item jackDanielsSeeds;
+ public static Item jackDanielsWhiskey;
+ public static Item jackDanielsWhiskeyBucket_deprecated;
+ public static ItemBucketBooze[] jackDanielsWhiskeyBuckets;
+ public static Fluid[] jackDanielsWhiskeyBooze;
+ // private static int internalColour =
+ // FluidRegistry.getFluid("fluidJackDaniels").getColor();
+ private static int internalColour = 0000000;
+
+ // Run me during Pre-Init
+ public static void preInit() {
+ if (LoadedMods.Growthcraft) {
+ Register_Booze.start();
}
}
-
- private static void start(){
- jackDaniels = GrowthCraftHops.hops;
- jackDanielsSeeds = GrowthCraftHops.hopSeeds;
-
- jackDanielsWhiskeyBooze = new Booze[5];
- jackDanielsWhiskeyFluids = new BlockFluidBooze[jackDanielsWhiskeyBooze.length];
- jackDanielsWhiskeyBuckets = new ItemBucketBooze[jackDanielsWhiskeyBooze.length];
- BoozeRegistryHelper.initializeBooze(jackDanielsWhiskeyBooze, jackDanielsWhiskeyFluids, jackDanielsWhiskeyBuckets, "grc.jackDanielsWhiskey", internalColour);
-
- jackDanielsWhiskey = new ItemBoozeBottle(6, -0.5F, jackDanielsWhiskeyBooze).setColor(internalColour).setTipsy(0.7F, 900).setPotionEffects(new int[] { Potion.digSpeed.id }, new int[] { 3600 });
- jackDanielsWhiskeyBucket_deprecated = new ItemBoozeBucketDEPRECATED(jackDanielsWhiskeyBooze).setColor(internalColour);
-
-
- //GameRegistry.registerItem(jackDaniels, "grc.jackDaniels");
- //GameRegistry.registerItem(jackDanielsSeeds, "grc.jackDanielsSeeds");
- GameRegistry.registerItem(jackDanielsWhiskey, "grc.jackDanielsWhiskey");
- GameRegistry.registerItem(jackDanielsWhiskeyBucket_deprecated, "grc.jackDanielsWhiskey_bucket");
-
- BoozeRegistryHelper.registerBooze(jackDanielsWhiskeyBooze, jackDanielsWhiskeyFluids, jackDanielsWhiskeyBuckets, jackDanielsWhiskey, "grc.jackDanielsWhiskey", jackDanielsWhiskeyBucket_deprecated);
-
- CellarRegistry.instance().brew().addBrewing(FluidRegistry.WATER, Items.wheat, jackDanielsWhiskeyBooze[4], 200, 60, 0.4F);
- CellarRegistry.instance().brew().addBrewing(jackDanielsWhiskeyBooze[4], jackDaniels, jackDanielsWhiskeyBooze[0], 350, 60, 0.1F);
-
-
+
+ private static void start() {
+ Register_Booze.jackDaniels = GrowthCraftHops.hops;
+ Register_Booze.jackDanielsSeeds = GrowthCraftHops.hopSeeds;
+
+ Register_Booze.jackDanielsWhiskeyBooze = new Booze[5];
+ Register_Booze.jackDanielsWhiskeyFluids = new BlockFluidBooze[Register_Booze.jackDanielsWhiskeyBooze.length];
+ Register_Booze.jackDanielsWhiskeyBuckets = new ItemBucketBooze[Register_Booze.jackDanielsWhiskeyBooze.length];
+ BoozeRegistryHelper.initializeBooze(Register_Booze.jackDanielsWhiskeyBooze,
+ Register_Booze.jackDanielsWhiskeyFluids, Register_Booze.jackDanielsWhiskeyBuckets,
+ "grc.jackDanielsWhiskey", Register_Booze.internalColour);
+
+ Register_Booze.jackDanielsWhiskey = new ItemBoozeBottle(6, -0.5F, Register_Booze.jackDanielsWhiskeyBooze)
+ .setColor(Register_Booze.internalColour).setTipsy(0.7F, 900).setPotionEffects(new int[] {
+ Potion.digSpeed.id
+ }, new int[] {
+ 3600
+ });
+ Register_Booze.jackDanielsWhiskeyBucket_deprecated = new ItemBoozeBucketDEPRECATED(
+ Register_Booze.jackDanielsWhiskeyBooze).setColor(Register_Booze.internalColour);
+
+ // GameRegistry.registerItem(jackDaniels, "grc.jackDaniels");
+ // GameRegistry.registerItem(jackDanielsSeeds, "grc.jackDanielsSeeds");
+ GameRegistry.registerItem(Register_Booze.jackDanielsWhiskey, "grc.jackDanielsWhiskey");
+ GameRegistry.registerItem(Register_Booze.jackDanielsWhiskeyBucket_deprecated, "grc.jackDanielsWhiskey_bucket");
+
+ BoozeRegistryHelper.registerBooze(Register_Booze.jackDanielsWhiskeyBooze,
+ Register_Booze.jackDanielsWhiskeyFluids, Register_Booze.jackDanielsWhiskeyBuckets,
+ Register_Booze.jackDanielsWhiskey, "grc.jackDanielsWhiskey",
+ Register_Booze.jackDanielsWhiskeyBucket_deprecated);
+
+ CellarRegistry.instance().brew().addBrewing(FluidRegistry.WATER, Items.wheat,
+ Register_Booze.jackDanielsWhiskeyBooze[4], 200, 60, 0.4F);
+ CellarRegistry.instance().brew().addBrewing(Register_Booze.jackDanielsWhiskeyBooze[4],
+ Register_Booze.jackDaniels, Register_Booze.jackDanielsWhiskeyBooze[0], 350, 60, 0.1F);
+
}
-
+
}
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));
}