aboutsummaryrefslogtreecommitdiff
path: root/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java
blob: fa04e4902463af92eaf0f0e0622808f3a0ea2292 (plain)
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
package gregtech.common.blocks;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.GregTech_API;
import gregtech.api.items.GT_Generic_Block;
import gregtech.api.util.GT_LanguageManager;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
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;

public abstract class GT_Block_Casings_Abstract
  extends GT_Generic_Block
{
  public GT_Block_Casings_Abstract(Class<? extends ItemBlock> aItemClass, String aName, Material aMaterial)
  {
    super(aItemClass, aName, aMaterial);
    setStepSound(soundTypeMetal);
    setCreativeTab(GregTech_API.TAB_GREGTECH);
    GregTech_API.registerMachineBlock(this, -1);
    GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + 32767 + ".name", "Any Sub Block of this");
  }
  
  public String getHarvestTool(int aMeta)
  {
    return "wrench";
  }
  
  public int getHarvestLevel(int aMeta)
  {
    return 2;
  }
  
  public float getBlockHardness(World aWorld, int aX, int aY, int aZ)
  {
    return Blocks.iron_block.getBlockHardness(aWorld, aX, aY, aZ);
  }
  
  public float getExplosionResistance(Entity aTNT)
  {
    return Blocks.iron_block.getExplosionResistance(aTNT);
  }
  
  protected boolean canSilkHarvest()
  {
    return false;
  }
  
  public void onBlockAdded(World aWorld, int aX, int aY, int aZ)
  {
    if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) {
      GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
    }
  }
  
  public String getUnlocalizedName()
  {
    return this.mUnlocalizedName;
  }
  
  public String getLocalizedName()
  {
    return StatCollector.translateToLocal(this.mUnlocalizedName + ".name");
  }
  
  public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ)
  {
    return false;
  }
  
  public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ)
  {
    return true;
  }
  
  public boolean renderAsNormalBlock()
  {
    return true;
  }
  
  public boolean isOpaqueCube()
  {
    return true;
  }
  
  public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData)
  {
    if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) {
      GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
    }
  }
  
  public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z)
  {
    return false;
  }
  
  public int damageDropped(int par1)
  {
    return par1;
  }
  
  public int getDamageValue(World par1World, int par2, int par3, int par4)
  {
    return par1World.getBlockMetadata(par2, par3, par4);
  }
  
  public int quantityDropped(Random par1Random)
  {
    return 1;
  }
  
  public Item getItemDropped(int par1, Random par2Random, int par3)
  {
    return Item.getItemFromBlock(this);
  }
  
  @SideOnly(Side.CLIENT)
  public void registerBlockIcons(IIconRegister aIconRegister) {}
  
  @SideOnly(Side.CLIENT)
  public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList)
  {
    for (int i = 0; i < 16; i++) {
      aList.add(new ItemStack(aItem, 1, i));
    }
  }
}



/* Location:           F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar

 * Qualified Name:     gregtech.common.blocks.GT_Block_Casings_Abstract

 * JD-Core Version:    0.7.0.1

 */