Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.minecraft.src;
- public class BlockPiggyBank extends Block {
- public BlockPiggyBank(int i, int j) {
- super(i, j, Material.wood);
- }
- public void onEntityWalking(World world, int x, int y, int z, Entity entity){
- //entity.attackEntityFrom(null, 10000);
- }
- public int getBlockTextureFromSideAndMetadata(int i, int j)
- {
- return getBlockTextureFromSide(i);
- }
- public int getBlockTextureFromSide(int i)
- {
- if (i == 0)
- {
- return mod_CoinMod.PiggyBankSide;
- }
- if (i == 1)
- {
- return mod_CoinMod.PiggyBankTop;
- }
- if (i == 3)
- {
- return mod_CoinMod.PiggyBankFace;
- }
- if (i == 2)
- {
- return mod_CoinMod.PiggyBankBack;
- }
- else
- {
- return mod_CoinMod.PiggyBankSide;
- }
- }
- public void onBlockAdded(World par1World, int par2, int par3, int par4)
- {
- super.onBlockAdded(par1World, par2, par3, par4);
- setDefaultDirection(par1World, par2, par3, par4);
- }
- private void setDefaultDirection(World par1World, int par2, int par3, int par4)
- {
- if (par1World.isRemote)
- {
- return;
- }
- int i = par1World.getBlockId(par2, par3, par4 - 1);
- int j = par1World.getBlockId(par2, par3, par4 + 1);
- int k = par1World.getBlockId(par2 - 1, par3, par4);
- int l = par1World.getBlockId(par2 + 1, par3, par4);
- byte byte0 = 3;
- if (Block.opaqueCubeLookup[i] && !Block.opaqueCubeLookup[j])
- {
- byte0 = 3;
- }
- if (Block.opaqueCubeLookup[j] && !Block.opaqueCubeLookup[i])
- {
- byte0 = 2;
- }
- if (Block.opaqueCubeLookup[k] && !Block.opaqueCubeLookup[l])
- {
- byte0 = 5;
- }
- if (Block.opaqueCubeLookup[l] && !Block.opaqueCubeLookup[k])
- {
- byte0 = 4;
- }
- par1World.setBlockMetadataWithNotify(par2, par3, par4, byte0);
- }
- }
Add Comment
Please, Sign In to add comment