Grafter & Scoop~!

This commit is contained in:
MysteriousAges committed 2013-03-03 23:50:29 -08:00
1 parent c8be483bf0
commit 29069e7e9f
10 files changed
+232 -53

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 64 KiB

@@ -3,6 +3,7 @@
<properties version="1.0">
<!-- Item names -->
<entry key="item.jellyBabies.name">Handful of Jelly Babies</entry>
<entry key="item.tb.thaumiumScoop.name">Thaumium Scoop</entry>
<!-- Block names -->
<entry key="tile.tb.planks.greatwood.name">Greatwood Planks</entry>
@@ -113,4 +113,24 @@ Like other capsules, they are fragile and are typically single-use. They have pr
<page type="infusioncrafting">VOIDCAPSULE</page>
</project>
<project id="THAUMIUMSCOOP">
<name>Thaumium Scoop</name>
<popupText>Stronger, Faster, Bee-tter</popupText>
<longText>It is possible to improve the durability of the scoop by creating them out of sterner materials. While you're at it, it may be helpful to enable them to be enchanted with restorative magics.</longText>
<page type="text">This improved scoop is more durable than the plain one your non-magical beekeeping friends are liable to use. It is good for three times as long as the average scoop at the cost of using some thaumium instead.
Because the thaumium present in its construction, it is possible to enchant the scoop with a Repairing spell in the usual manner.</page>
<page type="arcanecrafting">THAUMIUMSCOOP</page>
</project>
<project id="THAUMIUMGRAFTER">
<name>Thaumium Grafter</name>
<popupText>The Treesnipper</popupText>
<longText>This improved grafter is more durable than the plain one your non-magical arborist acquaintances tend to use in their exploits. It should be possible to allow them to be enchanted with repairing magic to make them last indefinitely.</longText>
<page type="text">Adding Thaumium to your grafter design has increased its durability significantly - up to two times longer than regular grafters.
It is also possible to enchant them with the Repair enchant, given sufficient experience.</page>
<page type="arcanecrafting">THAUMIUMGRAFTER</page>
</project>
</research>
@@ -1,46 +0,0 @@
package thaumicbees.item;
import thaumcraft.api.IVisRepairable;
import thaumcraft.api.ThaumcraftApi;
import thaumicbees.main.CommonProxy;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.ForgeHooks;
public class ItemReinforcedScoop extends Item implements IVisRepairable
{
public ItemReinforcedScoop(int itemID)
{
super(itemID);
this.setMaxStackSize(1);
this.setMaxDamage(20);
this.setTextureFile(CommonProxy.TCBEES_ITEMS_IMAGE);
}
@Override
public float getStrVsBlock(ItemStack itemStack, Block block)
{
return 1f;
}
@Override
public float getStrVsBlock(ItemStack itemStack, Block block, int metadata)
{
return ForgeHooks.isToolEffective(itemStack, block, metadata) ? 4f : getStrVsBlock(itemStack, block);
}
@Override
public void doRepair(ItemStack stack, Entity e)
{
if (stack.getItemDamage() > 0)
{
if (ThaumcraftApi.decreaseClosestAura(e.worldObj, e.posX, e.posY, e.posZ, 1, true))
{
stack.damageItem(-1, (EntityLiving)e);
}
}
}
}
@@ -0,0 +1,89 @@
package thaumicbees.item;
import thaumcraft.api.IVisRepairable;
import thaumcraft.api.ThaumcraftApi;
import thaumicbees.main.CommonProxy;
import thaumicbees.main.Config;
import thaumicbees.main.utils.compat.ThaumcraftHelper;
import forestry.api.arboriculture.IToolGrafter;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
public class ItemThaumiumGrafter extends Item implements IVisRepairable, IToolGrafter
{
public ItemThaumiumGrafter(int id)
{
super(id);
this.setCreativeTab(forestry.api.core.Tabs.tabArboriculture);
this.setMaxDamage(25);
this.setTextureFile(CommonProxy.TCBEES_ITEMS_IMAGE);
this.setIconIndex(21);
this.setItemName("tb.thaumiumGrafter");
}
@Override
public float getSaplingModifier(ItemStack stack, World world, int x, int y, int z)
{
return 100f;
}
@Override
public float getStrVsBlock(ItemStack itemStack, Block block)
{
return 1f;
}
@Override
public float getStrVsBlock(ItemStack itemStack, Block block, int metadata)
{
return ForgeHooks.isToolEffective(itemStack, block, metadata) ? 4f : getStrVsBlock(itemStack, block);
}
@Override
public boolean onBlockDestroyed(ItemStack itemstack, World world, int id, int x, int y, int z, EntityLiving entityliving) {
itemstack.damageItem(1, entityliving);
return true;
}
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
public int getItemEnchantability()
{
return ThaumcraftApi.toolMatThaumium.getEnchantability();
}
/**
* Return the name for this tool's material.
*/
public String getToolMaterialName()
{
return ThaumcraftApi.toolMatThaumium.toString();
}
/**
* Return whether this item is repairable in an anvil.
*/
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return ThaumcraftApi.toolMatThaumium.getToolCraftingMaterial() == par2ItemStack.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
@Override
public void doRepair(ItemStack stack, Entity e)
{
if (stack.getItemDamage() > 0)
{
if (ThaumcraftApi.decreaseClosestAura(e.worldObj, e.posX, e.posY, e.posZ, 1, true))
{
stack.damageItem(-1, (EntityLiving)e);
}
}
}
}
@@ -0,0 +1,81 @@
package thaumicbees.item;
import thaumcraft.api.IVisRepairable;
import thaumcraft.api.ThaumcraftApi;
import thaumicbees.main.CommonProxy;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemTool;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
public class ItemThaumiumScoop extends Item implements IVisRepairable
{
public ItemThaumiumScoop(int itemID)
{
super(itemID);
this.setMaxStackSize(1);
this.setMaxDamage(30);
this.setIconIndex(20);
this.setTextureFile(CommonProxy.TCBEES_ITEMS_IMAGE);
this.setItemName("tb.thaumiumScoop");
this.setCreativeTab(forestry.api.core.Tabs.tabApiculture);
}
@Override
public float getStrVsBlock(ItemStack itemStack, Block block)
{
return 1f;
}
@Override
public float getStrVsBlock(ItemStack itemStack, Block block, int metadata)
{
return ForgeHooks.isToolEffective(itemStack, block, metadata) ? 4f : getStrVsBlock(itemStack, block);
}
@Override
public boolean onBlockDestroyed(ItemStack itemstack, World world, int i, int j, int k, int l, EntityLiving entityliving) {
itemstack.damageItem(1, entityliving);
return true;
}
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
public int getItemEnchantability()
{
return ThaumcraftApi.toolMatThaumium.getEnchantability();
}
/**
* Return the name for this tool's material.
*/
public String getToolMaterialName()
{
return ThaumcraftApi.toolMatThaumium.toString();
}
/**
* Return whether this item is repairable in an anvil.
*/
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return ThaumcraftApi.toolMatThaumium.getToolCraftingMaterial() == par2ItemStack.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
@Override
public void doRepair(ItemStack stack, Entity e)
{
if (stack.getItemDamage() > 0)
{
if (ThaumcraftApi.decreaseClosestAura(e.worldObj, e.posX, e.posY, e.posZ, 1, true))
{
stack.damageItem(-1, (EntityLiving)e);
}
}
}
}
+7 -3
View File
@@ -13,7 +13,8 @@ import thaumicbees.item.ItemMagicHiveFrame;
import thaumicbees.item.ItemMiscResources;
import thaumicbees.item.ItemPollen;
import thaumicbees.item.ItemPropolis;
import thaumicbees.item.ItemReinforcedScoop;
import thaumicbees.item.ItemThaumiumGrafter;
import thaumicbees.item.ItemThaumiumScoop;
import thaumicbees.item.ItemSolidFlux;
import thaumicbees.item.ItemWax;
import thaumicbees.item.types.CapsuleType;
@@ -73,7 +74,8 @@ public class Config
public static ItemSolidFlux solidFlux;
public static ItemMiscResources miscResources;
public static ItemFood jellyBaby;
public static ItemReinforcedScoop thaumiumScoop;
public static ItemThaumiumScoop thaumiumScoop;
public static ItemThaumiumGrafter thaumiumGrafter;
//----- Liquid Capsules --------------------
public static ItemCapsule magicCapsule;
@@ -244,8 +246,10 @@ public class Config
voidCapsule = new ItemCapsule(CapsuleType.VOID, tbConfig.getItem("voidCapsule", itemIDBase++).getInt(), this.capsuleStackSizeMax);
thaumiumScoop = new ItemReinforcedScoop(tbConfig.getItem("reinforcedScoop", itemIDBase++).getInt());
thaumiumScoop = new ItemThaumiumScoop(tbConfig.getItem("thaumiumScoop", itemIDBase++).getInt());
MinecraftForge.setToolClass(thaumiumScoop, "scoop", 3);
thaumiumGrafter = new ItemThaumiumGrafter(tbConfig.getItem("thaumiumGrafter", itemIDBase++).getInt());
}
private void doMiscConfig()
@@ -415,7 +415,7 @@ public class CompatabilityManager
ObjectTags tags;
tags = new ObjectTags().add(EnumTag.WOOD, 10).add(EnumTag.PLANT, 10).add(EnumTag.INSECT, 10);
ResearchItem startNode = new ResearchItem("TBSTARTNODE", tags, 10, 0, Config.miscResources.getStackForType(ResourceType.RESEARCH_StartNode))
ResearchItem startNode = new ResearchItem("TBSTARTNODE", tags, 10, 1, Config.miscResources.getStackForType(ResourceType.RESEARCH_StartNode))
.setParents(ResearchList.getResearch("UTFT"))
.registerResearchItem();
@@ -474,6 +474,16 @@ public class CompatabilityManager
ResearchItem voidCapsule = new ResearchItem("VOIDCAPSULE", tags, 10, 9, Config.voidCapsule)
.setParents(startNode, ResearchList.getResearch("PORTABLEHOLE")).setHidden()
.registerResearchItem();
tags = new ObjectTags().add(EnumTag.WOOD, 8).add(EnumTag.INSECT, 10).add(EnumTag.TOOL, 6).add(EnumTag.MAGIC, 6);
ResearchItem scoop = new ResearchItem("THAUMIUMSCOOP", tags, 0, -3, Config.thaumiumScoop)
.setParents(ResearchList.getResearch("THAUMIUM"))
.registerResearchItem();
tags = new ObjectTags().add(EnumTag.WOOD, 16).add(EnumTag.PLANT, 20).add(EnumTag.TOOL, 6).add(EnumTag.MAGIC, 6);
ResearchItem grafter = new ResearchItem("THAUMIUMGRAFTER", tags, 0, -4, Config.thaumiumGrafter)
.setParents(scoop)
.registerResearchItem();
}
public static void registerResearch()
@@ -43,7 +43,7 @@ public class CraftingManager
setupCentrifugeRecipes();
setupSqueezerRecipes();
setupCarpenterRecipes();
setupThaumcraftInfusions();
setupThaumcraftCrafting();
registerLiquidContainer(Config.magicCapsule);
registerLiquidContainer(Config.voidCapsule);
@@ -279,11 +279,24 @@ public class CraftingManager
});
}
private static void setupThaumcraftInfusions()
private static void setupThaumcraftCrafting()
{
ItemStack input;
ItemStack output;
ThaumcraftApi.addArcaneCraftingRecipe("THAUMIUMSCOOP", "THAUMIUMSCOOP", 45, new ItemStack(Config.thaumiumScoop), new Object[] {
"sWs", "sTs", " T ",
's', Item.stick,
'W', Block.cloth,
'T', new ItemStack(Config.tcMiscResource, 1, ThaumcraftHelper.MiscResource.THAUMIUM.ordinal())
});
ThaumcraftApi.addArcaneCraftingRecipe("THAUMIUMGRAFTER", "THAUMIUMGRAFTER", 160, new ItemStack(Config.thaumiumGrafter), new Object[] {
" T", " T ", "s ",
's', Item.stick,
'T', new ItemStack(Config.tcMiscResource, 1, ThaumcraftHelper.MiscResource.THAUMIUM.ordinal())
});
output = Config.miscResources.getStackForType(ResourceType.EXTENDED_FERTILIZER);
input = ItemInterface.getItem("apatite");
ObjectTags tags = (new ObjectTags()).add(EnumTag.CROP, 12);
@@ -326,7 +339,7 @@ public class CraftingManager
output = new ItemStack(Config.hiveFrameNecrotic);
tags = new ObjectTags().add(EnumTag.WOOD, 4).add(EnumTag.INSECT, 8).add(EnumTag.EXCHANGE, 12).add(EnumTag.DEATH, 16)
.add(EnumTag.POISON, 4);
.add(EnumTag.POISON, 1);
ThaumcraftApi.addInfusionCraftingRecipe("HIVEFRAMENECRO", "FRAMENECROTIC", 50, tags, output, new Object[] {
" S ", "SxS", " S ",
'S', Item.rottenFlesh,
@@ -107,4 +107,11 @@ public class ThaumcraftHelper
SHIMMERLEAF,
CINDERPEARL;
}
public enum TreeType
{
GREATWOOD,
SILVERWOOD,
;
}
}