Fix #24 Game does not load if Thaumcraft not installed

This commit is contained in:
mezz committed 2015-01-09 23:13:32 -08:00
1 parent 8e11456ea3
commit 629cd06ef6
4 files changed
+15 -15

No files matched your search

@@ -23,8 +23,8 @@ import forestry.api.arboriculture.IToolGrafter;
@Optional.InterfaceList(
{
@Optional.Interface(iface = "IRepairableExtended", modid = "Thaumcraft", striprefs = true),
@Optional.Interface(iface = "IToolGrafter", modid = "forestry", striprefs = true)
@Optional.Interface(iface = "thaumcraft.api.IRepairableExtended", modid = CommonProxy.ThaumcraftID, striprefs = true),
@Optional.Interface(iface = "forestry.api.arboriculture.IToolGrafter", modid = CommonProxy.ForestryID, striprefs = true)
}
)
public class ItemThaumiumGrafter extends Item implements IRepairableExtended, IToolGrafter
@@ -108,7 +108,7 @@ public class ItemThaumiumGrafter extends Item implements IRepairableExtended, IT
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
@Optional.Method(modid = "Thaumcraft")
@Optional.Method(modid = CommonProxy.ThaumcraftID)
public int getItemEnchantability()
{
return ThaumcraftApi.toolMatThaumium.getEnchantability();
@@ -117,7 +117,7 @@ public class ItemThaumiumGrafter extends Item implements IRepairableExtended, IT
/**
* Return the name for this tool's material.
*/
@Optional.Method(modid = "Thaumcraft")
@Optional.Method(modid = CommonProxy.ThaumcraftID)
public String getToolMaterialName()
{
return ThaumcraftApi.toolMatThaumium.toString();
@@ -126,15 +126,13 @@ public class ItemThaumiumGrafter extends Item implements IRepairableExtended, IT
/**
* Return whether this item is repairable in an anvil.
*/
@Optional.Method(modid = "Thaumcraft")
@Optional.Method(modid = CommonProxy.ThaumcraftID)
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return ThaumcraftApi.toolMatThaumium.customCraftingMaterial == par2ItemStack.getItem() ? true : super.getIsRepairable
(par1ItemStack, par2ItemStack);
return ThaumcraftApi.toolMatThaumium.customCraftingMaterial == par2ItemStack.getItem() || super.getIsRepairable(par1ItemStack, par2ItemStack);
}
@Override
@Optional.Method(modid = "Thaumcraft")
public boolean doRepair(ItemStack stack, EntityPlayer player, int enchantLevel)
{
boolean flag = false;
@@ -20,8 +20,8 @@ import forestry.api.core.IToolScoop;
@Optional.InterfaceList(
{
@Optional.Interface(iface = "IRepairable", modid = "Thaumcraft", striprefs = true),
@Optional.Interface(iface = "IToolScoop", modid = "forestry", striprefs = true)
@Optional.Interface(iface = "thaumcraft.api.IRepairable", modid = CommonProxy.ThaumcraftID, striprefs = true),
@Optional.Interface(iface = "forestry.api.core.IToolScoop", modid = CommonProxy.ForestryID, striprefs = true)
}
)
public class ItemThaumiumScoop extends Item implements IRepairable, IToolScoop
@@ -72,6 +72,7 @@ public class ItemThaumiumScoop extends Item implements IRepairable, IToolScoop
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
@Optional.Method(modid = CommonProxy.ThaumcraftID)
public int getItemEnchantability()
{
return ThaumcraftApi.toolMatThaumium.getEnchantability();
@@ -80,6 +81,7 @@ public class ItemThaumiumScoop extends Item implements IRepairable, IToolScoop
/**
* Return the name for this tool's material.
*/
@Optional.Method(modid = CommonProxy.ThaumcraftID)
public String getToolMaterialName()
{
return ThaumcraftApi.toolMatThaumium.toString();
@@ -88,10 +90,10 @@ public class ItemThaumiumScoop extends Item implements IRepairable, IToolScoop
/**
* Return whether this item is repairable in an anvil.
*/
@Optional.Method(modid = CommonProxy.ThaumcraftID)
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return ThaumcraftApi.toolMatThaumium.customCraftingMaterial == par2ItemStack.getItem() ? true : super
.getIsRepairable(par1ItemStack, par2ItemStack);
return ThaumcraftApi.toolMatThaumium.customCraftingMaterial == par2ItemStack.getItem() || super.getIsRepairable(par1ItemStack, par2ItemStack);
}
@Override
@@ -8,6 +8,9 @@ public class CommonProxy
public static final String ITEM_TEXTURE = TEXTURE + "items/";
public static final String MODEL = "model/";
public static final String LANGS = "lang/";
public static final String ForestryID = "forestry";
public static final String ThaumcraftID = "Thaumcraft";
@Deprecated
public static final String RESOURCE_PATH = "/assets/magicbees/";
-3
View File
@@ -367,12 +367,9 @@ public class Config
{
try
{
// Reflecting avoids the need to directly include the Thaumcraft API in the jar. BAM!
Constructor ctor1 = Class.forName("magicbees.item.ItemThaumiumScoop").getConstructor();
thaumiumScoop = new ItemThaumiumScoop();
GameRegistry.registerItem(thaumiumScoop, thaumiumScoop.getUnlocalizedName(), CommonProxy.DOMAIN);
Constructor ctor2 = Class.forName("magicbees.item.ItemThaumiumGrafter").getConstructor();
thaumiumGrafter = new ItemThaumiumGrafter();
GameRegistry.registerItem(thaumiumGrafter, thaumiumGrafter.getUnlocalizedName(), CommonProxy.DOMAIN);
}