diff --git a/libs/gregtech-5.09.32.24-dev.jar b/libs/gregtech-5.09.32.24-dev.jar deleted file mode 100644 index f05431a7..00000000 Binary files a/libs/gregtech-5.09.32.24-dev.jar and /dev/null differ diff --git a/src/main/java/com/brandon3055/draconicevolution/common/CommonProxy.java b/src/main/java/com/brandon3055/draconicevolution/common/CommonProxy.java index 4f398f01..f22c0ba4 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/CommonProxy.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/CommonProxy.java @@ -94,7 +94,6 @@ public class CommonProxy { DETab.initialize(); PotionHandler.init(); CCOCIntegration.init(); - ModHelper.init(); DragonChunkLoader.init(); LogHelper.info("Finished Initialization"); diff --git a/src/main/java/com/brandon3055/draconicevolution/integration/ModHelper.java b/src/main/java/com/brandon3055/draconicevolution/integration/ModHelper.java index 8c5f4690..3fdd7bd6 100644 --- a/src/main/java/com/brandon3055/draconicevolution/integration/ModHelper.java +++ b/src/main/java/com/brandon3055/draconicevolution/integration/ModHelper.java @@ -3,7 +3,6 @@ package com.brandon3055.draconicevolution.integration; import com.brandon3055.draconicevolution.common.items.armor.CustomArmorHandler.ArmorSummery; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.common.blocks.GT_TileEntity_Ores; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; @@ -14,19 +13,32 @@ import net.minecraftforge.event.entity.living.LivingAttackEvent; */ public class ModHelper { - public static boolean isTConInstalled; - public static boolean isAvaritiaInstalled; - public static boolean isRotaryCraftInstalled; - public static boolean isGregTechInstalled; + private static boolean isTConInstalled; + private static boolean isAvaritiaInstalled; + //private static boolean isRotaryCraftInstalled; + private static boolean isGregTechInstalled; + private static Item cleaver; private static Item avaritiaSword; - private static Item bedrockSword; + //private static Item bedrockSword; - public static void init() { + private static Class bwores; + private static Class GTores; + + static { isTConInstalled = Loader.isModLoaded("TConstruct"); isAvaritiaInstalled = Loader.isModLoaded("Avaritia"); - isRotaryCraftInstalled = Loader.isModLoaded("RotaryCraft"); + //isRotaryCraftInstalled = Loader.isModLoaded("RotaryCraft"); isGregTechInstalled = Loader.isModLoaded("gregtech"); + + if (isGregTechInstalled) + try { + GTores = Class.forName("gregtech.common.blocks.GT_TileEntity_Ores"); + } catch (ClassNotFoundException e) {} + if (Loader.isModLoaded("bartworks")) + try { + bwores = Class.forName("com.github.bartimaeusnek.bartworks.system.material.BW_MetaGeneratedOreTE"); + } catch (ClassNotFoundException e) {} } public static boolean isHoldingCleaver(EntityPlayer player) { @@ -43,12 +55,12 @@ public class ModHelper { return avaritiaSword != null && player.getHeldItem() != null && player.getHeldItem().getItem().equals(avaritiaSword); } - public static boolean isHoldingBedrockSword(EntityPlayer player) { - if (!isRotaryCraftInstalled) return false; - else if (bedrockSword == null) bedrockSword = GameRegistry.findItem("RotaryCraft", "rotarycraft_item_bedsword"); - - return bedrockSword != null && player.getHeldItem() != null && player.getHeldItem().getItem().equals(bedrockSword); - } +// public static boolean isHoldingBedrockSword(EntityPlayer player) { +// if (!isRotaryCraftInstalled) return false; +// else if (bedrockSword == null) bedrockSword = GameRegistry.findItem("RotaryCraft", "rotarycraft_item_bedsword"); +// +// return bedrockSword != null && player.getHeldItem() != null && player.getHeldItem().getItem().equals(bedrockSword); +// } public static float applyModDamageAdjustments(ArmorSummery summery, LivingAttackEvent event) { if (summery == null) return event.ammount; @@ -61,15 +73,17 @@ public class ModHelper { if (isHoldingAvaritiaSword(attacker)) { event.entityLiving.hurtResistantTime = 0; return 300F; - } else if (isHoldingBedrockSword(attacker)) { - summery.entropy += 10; - - if (summery.entropy > 100) { - summery.entropy = 100; - } - - return Math.max(event.ammount, Math.min(50F, summery.protectionPoints)); - } else if (event.source.isUnblockable() || event.source.canHarmInCreative()) { + } +// else if (isHoldingBedrockSword(attacker)) { +// summery.entropy += 10; +// +// if (summery.entropy > 100) { +// summery.entropy = 100; +// } +// +// return Math.max(event.ammount, Math.min(50F, summery.protectionPoints)); +// } + else if (event.source.isUnblockable() || event.source.canHarmInCreative()) { summery.entropy += 3; if (summery.entropy > 100) { @@ -83,9 +97,7 @@ public class ModHelper { } public static boolean isGregTechTileEntityOre(TileEntity te) { - if (!isGregTechInstalled) return false; - else if (te instanceof gregtech.common.blocks.GT_TileEntity_Ores) return true; - else return false; + return isGregTechInstalled && GTores.isInstance(te) || isGregTechInstalled && Loader.isModLoaded("bartworks") && bwores.isInstance(te); } }