diff options
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/forestry')
6 files changed, 69 insertions, 73 deletions
diff --git a/src/Java/gtPlusPlus/xmod/forestry/HANDLER_FR.java b/src/Java/gtPlusPlus/xmod/forestry/HANDLER_FR.java index 9bdf9a83dd..dbc0589fd2 100644 --- a/src/Java/gtPlusPlus/xmod/forestry/HANDLER_FR.java +++ b/src/Java/gtPlusPlus/xmod/forestry/HANDLER_FR.java @@ -6,8 +6,6 @@ import java.lang.reflect.Method; import cpw.mods.fml.common.Optional; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.util.reflect.ReflectionUtils; -import gtPlusPlus.xmod.forestry.bees.custom.GTPP_Bees; -import gtPlusPlus.xmod.forestry.bees.custom.GTPP_Branch_Definition; import gtPlusPlus.xmod.forestry.bees.items.FR_ItemRegistry; import gtPlusPlus.xmod.forestry.bees.recipe.FR_Gregtech_Recipes; import net.minecraft.block.Block; @@ -23,7 +21,7 @@ public class HANDLER_FR { public static void Init(){ if (LoadedMods.Forestry){ - new GTPP_Bees(); + //new GTPP_Bees(); TODO- Will Investigate this properly later. } } diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bee_Definition.java b/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bee_Definition.java index f33d99af29..7e3738d9fb 100644 --- a/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bee_Definition.java +++ b/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bee_Definition.java @@ -1,31 +1,27 @@ package gtPlusPlus.xmod.forestry.bees.custom; +import java.lang.reflect.Field; +import java.util.Arrays; +import java.util.Locale; + +import org.apache.commons.lang3.reflect.FieldUtils; +import org.apache.commons.lang3.text.WordUtils; + import forestry.api.apiculture.*; import forestry.api.core.EnumHumidity; import forestry.api.core.EnumTemperature; import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IAllele; -import forestry.apiculture.genetics.Bee; -import forestry.apiculture.genetics.BeeDefinition; -import forestry.apiculture.genetics.BeeVariation; -import forestry.apiculture.genetics.IBeeDefinition; +import forestry.apiculture.genetics.*; import forestry.core.genetics.alleles.AlleleHelper; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.common.BiomeDictionary.Type; -import org.apache.commons.lang3.reflect.FieldUtils; -import org.apache.commons.lang3.text.WordUtils; - -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.util.Arrays; -import java.util.Locale; - public enum GTPP_Bee_Definition implements IBeeDefinition { @@ -814,10 +810,10 @@ public enum GTPP_Bee_Definition implements IBeeDefinition { protected final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, IAlleleBeeSpecies parent2, int chance) { IAllele[] template = getTemplate(); - Utils.LOG_INFO("[Bees-Debug] parent1: "+(parent1 != null)); - Utils.LOG_INFO("[Bees-Debug] parent2: "+(parent2 != null)); - Utils.LOG_INFO("[Bees-Debug] chance: "+(chance)); - Utils.LOG_INFO("[Bees-Debug] template: "+(template != null)); + Logger.DEBUG_BEES("parent1: "+(parent1 != null)); + Logger.DEBUG_BEES("parent2: "+(parent2 != null)); + Logger.DEBUG_BEES("chance: "+(chance)); + Logger.DEBUG_BEES("template: "+(template != null)); return BeeManager.beeMutationFactory.createMutation(parent1, parent2, template, chance); } diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java b/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java index 0d15f16964..9e24eb5a53 100644 --- a/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java +++ b/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.forestry.bees.custom; +import static gtPlusPlus.GTplusplus.mGregMatLoader; + import java.lang.reflect.*; import org.apache.commons.lang3.reflect.FieldUtils; @@ -8,14 +10,15 @@ import cpw.mods.fml.common.Loader; import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IAllele; import gregtech.GT_Mod; -import gregtech.api.enums.*; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.base.ingots.BaseItemIngot_OLD; import gtPlusPlus.core.item.base.misc.BaseItemMisc; import gtPlusPlus.core.item.base.misc.BaseItemMisc.MiscTypes; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.fluid.FluidUtils; import gtPlusPlus.core.util.item.ItemUtils; -import gtPlusPlus.core.util.materials.MaterialUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -48,11 +51,11 @@ public class GTPP_Bees { if (Loader.isModLoaded("Forestry") /*&& tryGetBeesBoolean()*/) { for (IAllele o : AlleleManager.alleleRegistry.getRegisteredAlleles().values()){ - //Utils.LOG_INFO("[Bees-Debug] =================================================="); - //Utils.LOG_INFO("[Bees-Debug] Name: "+o.getName()); - //Utils.LOG_INFO("[Bees-Debug] Name: "+o.getUnlocalizedName()); - //Utils.LOG_INFO("[Bees-Debug] getUID: "+o.getUID()); - //Utils.LOG_INFO("[Bees-Debug] isDominant: "+o.isDominant()); + //Utils.LOG_DEBUG_BEES(" =================================================="); + //Utils.LOG_DEBUG_BEES(" Name: "+o.getName()); + //Utils.LOG_DEBUG_BEES(" Name: "+o.getUnlocalizedName()); + //Utils.LOG_DEBUG_BEES(" getUID: "+o.getUID()); + //Utils.LOG_DEBUG_BEES(" isDominant: "+o.isDominant()); } //Set Materials and Comb stacks from GT via Reflection @@ -65,7 +68,7 @@ public class GTPP_Bees { GTPP_Bee_Definition.initBees(); } catch (Throwable t){ - Utils.LOG_INFO("[Bees] Failed to load bees, probably due to an ancient forestry version"); + Logger.BEES("Failed to load bees, probably due to an ancient forestry version"); t.printStackTrace(); } } @@ -73,19 +76,22 @@ public class GTPP_Bees { private void setCustomItems() { dropForceGem = new BaseItemMisc("Force", new short[]{250, 250, 20}, 64, MiscTypes.GEM, null); - MaterialUtils.tryEnableMaterial(Materials.Force); - MaterialUtils.tryEnableMaterialPart(OrePrefixes.dust, Materials.Force); - MaterialUtils.tryEnableMaterialPart(OrePrefixes.ingot, Materials.Force); + mGregMatLoader.enableMaterial(Materials.Force); + //MaterialUtils.tryEnableMaterial(Materials.Force); + //MaterialUtils.tryEnableMaterialPart(OrePrefixes.dust, Materials.Force); + //MaterialUtils.tryEnableMaterialPart(OrePrefixes.ingot, Materials.Force); dropBiomassBlob = new BaseItemMisc("Biomass", new short[]{33, 225, 24}, 64, MiscTypes.DROP, null); dropEthanolBlob = new BaseItemMisc("Ethanol", new short[]{255, 128, 0}, 64, MiscTypes.DROP, null); //Nikolite may not exist, so lets make it. dropNikoliteDust = ItemUtils.generateSpecialUseDusts("Nikolite", "Nikolite", Utils.rgbtoHexValue(60, 180, 200))[2]; - MaterialUtils.tryEnableMaterial(Materials.Nikolite); - MaterialUtils.tryEnableMaterialPart(OrePrefixes.dust, Materials.Nikolite); - MaterialUtils.tryEnableMaterialPart(OrePrefixes.ingot, Materials.Nikolite); - MaterialUtils.tryEnableMaterialPart(OrePrefixes.plate, Materials.Nikolite); - MaterialUtils.tryEnableMaterial(Materials.BlueAlloy); + mGregMatLoader.enableMaterial(Materials.BlueAlloy); + mGregMatLoader.enableMaterial(Materials.Nikolite); + //MaterialUtils.tryEnableMaterial(Materials.Nikolite); + //MaterialUtils.tryEnableMaterialPart(OrePrefixes.dust, Materials.Nikolite); + //MaterialUtils.tryEnableMaterialPart(OrePrefixes.ingot, Materials.Nikolite); + //MaterialUtils.tryEnableMaterialPart(OrePrefixes.plate, Materials.Nikolite); + //MaterialUtils.tryEnableMaterial(Materials.BlueAlloy); if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotNikolite", 1) == null){ new BaseItemIngot_OLD("itemIngotNikolite", "Nikolite", Utils.rgbtoHexValue(60, 180, 200), 0); } @@ -136,22 +142,22 @@ public class GTPP_Bees { Enum gtCombTypeStone = Enum.valueOf(gtCombEnumClass, "STONE"); Object oCombObject = gtCombs.get(null); - Utils.LOG_INFO("[Bees-Debug] Field getModifiers: "+gtCombs.getModifiers()); - Utils.LOG_INFO("[Bees-Debug] Field toGenericString: "+gtCombs.toGenericString()); - Utils.LOG_INFO("[Bees-Debug] Field getClass: "+gtCombs.getClass()); - Utils.LOG_INFO("[Bees-Debug] Field isEnumConstant: "+gtCombs.isEnumConstant()); - Utils.LOG_INFO("[Bees-Debug] Field isSynthetic: "+gtCombs.isSynthetic()); - Utils.LOG_INFO("[Bees-Debug] Field get(gtBees) != null: "+(gtCombs.get(gtBees) != null)); - Utils.LOG_INFO("[Bees-Debug] Field isAccessible: "+gtCombs.isAccessible()); + Logger.DEBUG_BEES("Field getModifiers: "+gtCombs.getModifiers()); + Logger.DEBUG_BEES("Field toGenericString: "+gtCombs.toGenericString()); + Logger.DEBUG_BEES("Field getClass: "+gtCombs.getClass()); + Logger.DEBUG_BEES("Field isEnumConstant: "+gtCombs.isEnumConstant()); + Logger.DEBUG_BEES("Field isSynthetic: "+gtCombs.isSynthetic()); + Logger.DEBUG_BEES("Field get(gtBees) != null: "+(gtCombs.get(gtBees) != null)); + Logger.DEBUG_BEES("Field isAccessible: "+gtCombs.isAccessible()); - Utils.LOG_INFO("[Bees] gtBees: "+(gtBees != null)); - Utils.LOG_INFO("[Bees] gtCombItemClass: "+(gtCombItemClass != null)); - Utils.LOG_INFO("[Bees] gtCombEnumClass: "+(gtCombEnumClass != null)); - Utils.LOG_INFO("[Bees] gtCombs: "+(gtCombs != null)); - Utils.LOG_INFO("[Bees] gtCombTypeSlag: "+(gtCombTypeSlag != null)); - Utils.LOG_INFO("[Bees] gtCombTypeStone: "+(gtCombTypeStone != null)); - Utils.LOG_INFO("[Bees] oCombObject: "+(oCombObject != null)); + Logger.BEES("gtBees: "+(gtBees != null)); + Logger.BEES("gtCombItemClass: "+(gtCombItemClass != null)); + Logger.BEES("gtCombEnumClass: "+(gtCombEnumClass != null)); + Logger.BEES("gtCombs: "+(gtCombs != null)); + Logger.BEES("gtCombTypeSlag: "+(gtCombTypeSlag != null)); + Logger.BEES("gtCombTypeStone: "+(gtCombTypeStone != null)); + Logger.BEES("oCombObject: "+(oCombObject != null)); //if (gtCombItemClass.isInstance(oCombObject)){ @@ -159,7 +165,7 @@ public class GTPP_Bees { getStackForType = gtCombItemClass.getDeclaredMethod("getStackForType", gtCombEnumClass); if (getStackForType != null) { - Utils.LOG_INFO("[Bees] Found Method: getStackForType"); + Logger.BEES("Found Method: getStackForType"); } if (Comb_Slag == null){ Comb_Slag = (ItemStack) getStackForType.invoke(gtBees, gtCombTypeSlag); @@ -169,12 +175,12 @@ public class GTPP_Bees { } /*} else { - Utils.LOG_INFO("[Bees] oCombObject was not an instance of gregtech.common.items.ItemComb"); + Utils.LOG_BEES("oCombObject was not an instance of gregtech.common.items.ItemComb"); }*/ } catch (NullPointerException | ClassNotFoundException | IllegalArgumentException | IllegalAccessException | NoSuchMethodException | SecurityException | InvocationTargetException e){ - Utils.LOG_INFO("[Bees] Bad Reflection. setMaterials()"); + Logger.BEES("Bad Reflection. setMaterials()"); } PTFE = trySetValue("Polytetrafluoroethylene"); diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Branch_Definition.java b/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Branch_Definition.java index add7198bd8..f59f0c537f 100644 --- a/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Branch_Definition.java +++ b/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Branch_Definition.java @@ -5,7 +5,7 @@ import java.lang.reflect.Method; import forestry.api.genetics.IAllele; import forestry.api.genetics.IClassification; -import gtPlusPlus.core.util.Utils; +import gtPlusPlus.api.objects.Logger; public enum GTPP_Branch_Definition { @@ -29,14 +29,14 @@ public enum GTPP_Branch_Definition { Enum enumA = mActualValues; Method methodMyMethod = gtBranchDefClass.getMethod("getTemplate"); - Utils.LOG_INFO("[Bees] gtBranchDefClass: "+(gtBranchDefClass != null)); - Utils.LOG_INFO("[Bees] enumA: "+(enumA != null)); - Utils.LOG_INFO("[Bees] methodMyMethod: "+(methodMyMethod != null)); + Logger.INFO("[Bees] gtBranchDefClass: "+(gtBranchDefClass != null)); + Logger.INFO("[Bees] enumA: "+(enumA != null)); + Logger.INFO("[Bees] methodMyMethod: "+(methodMyMethod != null)); return (IAllele[]) methodMyMethod.invoke(enumA); } catch (ClassNotFoundException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { - Utils.LOG_INFO("[Bees] Bad Reflection. getTemplate()"); + Logger.INFO("[Bees] Bad Reflection. getTemplate()"); e.printStackTrace(); //gregtech.loaders.misc.GT_BranchDefinition.getTemplate() return null; @@ -51,14 +51,14 @@ public enum GTPP_Branch_Definition { Method methodMyMethod = gtBranchDefClass.getMethod("getBranch"); - Utils.LOG_INFO("[Bees] gtBranchDefClass: "+(gtBranchDefClass != null)); - Utils.LOG_INFO("[Bees] enum_MY_SAMPLE_ENUM: "+(enum_MY_SAMPLE_ENUM != null)); - Utils.LOG_INFO("[Bees] methodMyMethod: "+(methodMyMethod != null)); + Logger.INFO("[Bees] gtBranchDefClass: "+(gtBranchDefClass != null)); + Logger.INFO("[Bees] enum_MY_SAMPLE_ENUM: "+(enum_MY_SAMPLE_ENUM != null)); + Logger.INFO("[Bees] methodMyMethod: "+(methodMyMethod != null)); return (IClassification) methodMyMethod.invoke(enum_MY_SAMPLE_ENUM); } catch (ClassNotFoundException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { - Utils.LOG_INFO("[Bees] Bad Reflection. getBranch()"); + Logger.INFO("[Bees] Bad Reflection. getBranch()"); e.printStackTrace(); return null; } diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/inventory/InventoryDenseBeeHouse.java b/src/Java/gtPlusPlus/xmod/forestry/bees/inventory/InventoryDenseBeeHouse.java index 6b21461b62..5cb1d06982 100644 --- a/src/Java/gtPlusPlus/xmod/forestry/bees/inventory/InventoryDenseBeeHouse.java +++ b/src/Java/gtPlusPlus/xmod/forestry/bees/inventory/InventoryDenseBeeHouse.java @@ -13,18 +13,13 @@ package gtPlusPlus.xmod.forestry.bees.inventory; import java.util.ArrayList; import java.util.Collection; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -import forestry.api.apiculture.BeeManager; -import forestry.api.apiculture.IBee; -import forestry.api.apiculture.IBeeHousing; -import forestry.api.apiculture.IBeekeepingMode; -import forestry.api.apiculture.IHiveFrame; +import forestry.api.apiculture.*; import forestry.apiculture.InventoryBeeHousing; import forestry.apiculture.inventory.IApiaryInventory; import forestry.core.access.IAccessHandler; import forestry.core.utils.SlotUtil; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; public class InventoryDenseBeeHouse extends InventoryBeeHousing implements IApiaryInventory { public static final int SLOT_FRAMES_1 = 9; @@ -70,6 +65,7 @@ public class InventoryDenseBeeHouse extends InventoryBeeHousing implements IApia return hiveFrames; } + @Override public void wearOutFrames(IBeeHousing beeHousing, int amount) { IBeekeepingMode beekeepingMode = BeeManager.beeRoot.getBeekeepingMode(beeHousing.getWorld()); int wear = Math.round(amount * beekeepingMode.getWearModifier()); diff --git a/src/Java/gtPlusPlus/xmod/forestry/trees/TreefarmManager.java b/src/Java/gtPlusPlus/xmod/forestry/trees/TreefarmManager.java index 74a627b2c5..9aea37e0d4 100644 --- a/src/Java/gtPlusPlus/xmod/forestry/trees/TreefarmManager.java +++ b/src/Java/gtPlusPlus/xmod/forestry/trees/TreefarmManager.java @@ -2,8 +2,8 @@ package gtPlusPlus.xmod.forestry.trees; import cpw.mods.fml.common.Optional; import gregtech.api.enums.OrePrefixes; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.LoadedMods; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import net.minecraft.block.Block; @@ -100,10 +100,10 @@ public class TreefarmManager { public static boolean isSapling(final Block log){ if (log != null){ if (OrePrefixes.sapling.contains(new ItemStack(log, 1))){ - Utils.LOG_INFO(""+log.getLocalizedName()); + Logger.INFO(""+log.getLocalizedName()); } if (log.getLocalizedName().toLowerCase().contains("sapling")){ - Utils.LOG_INFO(""+log.getLocalizedName()); + Logger.INFO(""+log.getLocalizedName()); return true; } } |