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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
package gregtech.common.blocks;
import java.util.List;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.GregTechAPI;
import gregtech.api.items.GTGenericBlock;
public class BlockStorage extends GTGenericBlock {
protected BlockStorage(Class<? extends ItemBlock> aItemClass, String aName, Material aMaterial) {
super(aItemClass, aName, aMaterial);
setStepSound(soundTypeMetal);
setCreativeTab(GregTechAPI.TAB_GREGTECH_MATERIALS);
}
@Override
public String getHarvestTool(int aMeta) {
return "pickaxe";
}
@Override
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
return true;
}
@Override
public int getHarvestLevel(int aMeta) {
return 1;
}
@Override
public float getBlockHardness(World aWorld, int aX, int aY, int aZ) {
return Blocks.iron_block.getBlockHardness(aWorld, aX, aY, aZ);
}
@Override
public float getExplosionResistance(Entity aTNT) {
return Blocks.iron_block.getExplosionResistance(aTNT);
}
@Override
public String getUnlocalizedName() {
return this.mUnlocalizedName;
}
@Override
public String getLocalizedName() {
return StatCollector.translateToLocal(this.mUnlocalizedName + ".name");
}
@Override
public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) {
return false;
}
@Override
public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) {
return true;
}
@Override
public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) {
return true;
}
@Override
public int damageDropped(int metadata) {
return metadata;
}
@Override
public int getDamageValue(World aWorld, int aX, int aY, int aZ) {
return aWorld.getBlockMetadata(aX, aY, aZ);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister aIconRegister) {}
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item aItem, CreativeTabs aCreativeTab, List<ItemStack> aList) {
for (int i = 0; i < 16; i++) {
if (!(new ItemStack(aItem, 1, i).getDisplayName()
.contains(".name"))) aList.add(new ItemStack(aItem, 1, i));
}
}
}
|