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
|
package gtnhlanth.common.block;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.init.Blocks;
import net.minecraft.util.IIcon;
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 gtnhlanth.Tags;
public class BlockCasing extends Block {
@SideOnly(Side.CLIENT)
protected IIcon[] texture;
private final String name;
public BlockCasing(String name) {
super(Material.iron);
this.name = name;
this.setBlockTextureName(Tags.MODID + ":casing." + name);
GregTechAPI.registerMachineBlock(this, -1);
}
public BlockCasing(String name, Material material) {
super(material);
this.name = name;
this.setBlockTextureName(Tags.MODID + ":casing." + name);
GregTechAPI.registerMachineBlock(this, -1);
}
@Override
public int damageDropped(int meta) {
return meta;
}
@Override
public String getHarvestTool(int aMeta) {
return "wrench";
}
@Override
public int getHarvestLevel(int aMeta) {
return 2;
}
@Override
public float getBlockHardness(World aWorld, int aX, int aY, int aZ) {
return Blocks.iron_block.getBlockHardness(aWorld, aX, aY, aZ);
}
@Override
public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) {
GregTechAPI.causeMachineUpdate(aWorld, aX, aY, aZ);
super.breakBlock(aWorld, aX, aY, aZ, aBlock, aMetaData);
}
@Override
public void onBlockAdded(World aWorld, int aX, int aY, int aZ) {
super.onBlockAdded(aWorld, aX, aY, aZ);
GregTechAPI.causeMachineUpdate(aWorld, aX, aY, aZ);
}
@Override
public String getUnlocalizedName() {
return "casing." + this.name;
}
@Override
public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) {
return false;
}
}
|