Start on hammer

This commit is contained in:
Gig 2015-05-17 02:16:40 +01:00
parent cfc71d48b2
commit ca98541d70
3 changed files with 77 additions and 0 deletions

View file

@ -27,6 +27,7 @@ import techreborn.items.armor.ItemLapotronPack;
import techreborn.items.armor.ItemLithiumBatpack;
import techreborn.items.tools.ItemAdvancedDrill;
import techreborn.items.tools.ItemFluidbucket;
import techreborn.items.tools.ItemHammer;
import techreborn.items.tools.ItemOmniTool;
import techreborn.items.tools.ItemRockCutter;
import techreborn.items.tools.ItemTechPda;
@ -80,6 +81,9 @@ public class ModItems {
public static Item bucketSodiumpersulfate;
public static Item bucketTritium;
public static Item bucketWolframium;
public static Item hammerIron;
public static Item hammerDiamond;
@ -126,6 +130,14 @@ public class ModItems {
uuMatter = new ItemUUmatter();
GameRegistry.registerItem(uuMatter, "uumatter");
hammerIron = new ItemHammer(80);
hammerIron.setUnlocalizedName("hammerIron").setContainerItem(hammerIron);
GameRegistry.registerItem(hammerIron, "hammerIron");
hammerDiamond = new ItemHammer(200);
hammerDiamond.setUnlocalizedName("hammerDiamond").setContainerItem(hammerDiamond);
GameRegistry.registerItem(hammerDiamond, "hammerDiamond");
// buckets
bucketBerylium = new ItemFluidbucket(ModFluids.BlockFluidBerylium);
bucketBerylium.setUnlocalizedName("bucketberylium").setContainerItem(Items.bucket);

View file

@ -1,5 +1,8 @@
package techreborn.init;
import java.util.Arrays;
import java.util.List;
import cpw.mods.fml.common.registry.GameRegistry;
import ic2.api.item.IC2Items;
import net.minecraft.init.Blocks;
@ -37,6 +40,7 @@ public class ModRecipes {
addMachineRecipes();
addAlloySmelterRecipes();
addUUrecipes();
addHammerRecipes();
}
public static void addShappedRecipes()
@ -222,6 +226,17 @@ public class ModRecipes {
LogHelper.info("Machine Recipes Added");
}
public static void addHammerRecipes(){
ItemStack hammerIron = new ItemStack(ModItems.hammerIron, 1, OreDictionary.WILDCARD_VALUE);
ItemStack hammerDiamond = new ItemStack(ModItems.hammerDiamond, 1, OreDictionary.WILDCARD_VALUE);
// :( I cant do this
// List<ItemStack> anyhammer = Arrays.asList(hammerIron, hammerDiamond);
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.plate, 1, 13), hammerIron, new ItemStack(Items.iron_ingot));
}
public static void addAlloySmelterRecipes(){
//Bronze

View file

@ -0,0 +1,50 @@
package techreborn.items.tools;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import techreborn.items.ItemTR;
public class ItemHammer extends ItemTR{
private String iconName;
public ItemHammer(int MaxDamage){
setUnlocalizedName("techreborn.hammer");
setMaxDamage(MaxDamage);
}
@Override
public Item setUnlocalizedName(String par1Str) {
iconName = par1Str;
return super.setUnlocalizedName(par1Str);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister) {
this.itemIcon = par1IconRegister.registerIcon("techreborn:hammer/" + iconName);
}
@Override
public boolean getShareTag(){
return true;
}
@Override
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack) {
return false;
}
@Override
public ItemStack getContainerItem(ItemStack itemStack){
ItemStack copiedStack = itemStack.copy();
copiedStack.setItemDamage(copiedStack.getItemDamage() + 1);
copiedStack.stackSize = 1;
return copiedStack;
}
}