-
Notifications
You must be signed in to change notification settings - Fork 755
/
GravelOre.java
83 lines (72 loc) · 2.17 KB
/
GravelOre.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package tconstruct.world.blocks;
import java.util.List;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import tconstruct.library.TConstructRegistry;
import tconstruct.world.TinkerWorld;
import net.minecraft.block.BlockSand;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
public class GravelOre extends BlockSand
{
public String[] textureNames = new String[] { "iron", "gold", "copper", "tin", "aluminum", "cobalt" };
public IIcon[] icons;
public GravelOre()
{
//super(Material.craftedSnow);
//this.blockMaterial = Material.craftedSnow;
this.setCreativeTab(TConstructRegistry.blockTab);
this.setStepSound(soundTypeGravel);
}
@Override
public void registerBlockIcons (IIconRegister iconRegister)
{
this.icons = new IIcon[textureNames.length];
for (int i = 0; i < this.icons.length; ++i)
{
this.icons[i] = iconRegister.registerIcon("tinker:ore_" + textureNames[i] + "_gravel");
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon (int side, int meta)
{
return icons[meta];
}
public float getBlockHardness (World world, int x, int y, int z)
{
int meta = world.getBlockMetadata(x, y, z);
if (meta == 5)
return 10f;
else
return 3f;
}
@Override
public int damageDropped (int meta)
{
/*if (meta == 1)
return 0;*/
return meta;
}
@Override
public Item getItemDropped (int par1, Random par2Random, int par3)
{
/*if (par1 == 1)
return Item.goldNugget.itemID;*/
return Item.getItemFromBlock(TinkerWorld.oreGravel);
}
@Override
public void getSubBlocks (Item id, CreativeTabs tab, List list)
{
for (int iter = 0; iter < 6; iter++)
{
list.add(new ItemStack(id, 1, iter));
}
}
}