Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.dannydobbi.realmsofcaltrice.food;
- **IMPORTS HERE YADAYADAYADA**
- public class BlockBerryBush extends BlockFlower
- {
- public int growth;
- public BlockBerryBush(int par1, Material plants)
- {
- super(par1);
- this.setCreativeTab(ModTab.tabCaltrice);
- this.setStepSound(Block.soundTypeGrass);
- this.setHardness(0.3F);
- float f = 0.375F;
- float f1 = f / 2.0F;
- this.setBlockBounds(0.5F - f1, 0.0F, 0.5F - f1, 0.5F + f1, f, 0.5F + f1);
- }
- public BlockBerryBush(int par1)
- {
- this(par1, Material.plants);
- }
- @Override
- public boolean canSilkHarvest()
- {
- return true;
- }
- @Override
- public Item getItemDropped(int par1, Random par2Random, int par3)
- {
- if(this == CaltriceBlocks.BlueBerryBush)
- {
- return CaltriceItems.BlueBerry;
- }
- if(this == CaltriceBlocks.RaspBerryBush)
- {
- return CaltriceItems.RaspBerry;
- }
- if(this == CaltriceBlocks.StrawBerryBush)
- {
- return CaltriceItems.StrawBerry;
- }
- return Item.getItemFromBlock(null);
- }
- public void registerIcons(IIconRegister i)
- {
- if(blockIcon == CaltriceBlocks.BerryBush)
- {
- this.blockIcon = i.registerIcon(ModInfo.MODID + ":" + "BerryBush");
- }
- if(blockIcon == CaltriceBlocks.RaspBerryBush)
- {
- this.blockIcon = i.registerIcon(ModInfo.MODID + ":" + "RaspberryBush");
- }
- if(blockIcon == CaltriceBlocks.BlueBerryBush)
- {
- this.blockIcon = i.registerIcon(ModInfo.MODID + ":" + "BlueberryBush");
- }
- if(blockIcon == CaltriceBlocks.StrawBerryBush)
- {
- this.blockIcon = i.registerIcon(ModInfo.MODID + ":" + "StrawberryBush");
- }
- }
- @Override
- public boolean isOpaqueCube()
- {
- return false;
- }
- @Override
- public boolean renderAsNormalBlock()
- {
- return false;
- }
- @Override
- public int getRenderType()
- {
- return 0;
- }
- @Override
- public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int meta)
- {
- if(blockIcon == CaltriceBlocks.BerryBush)
- {
- world.setBlockToAir(x, y, z);
- }
- if(blockIcon == CaltriceBlocks.BlueBerryBush)
- {
- world.setBlock(x, y, z, CaltriceBlocks.BerryBush, meta, meta);
- }
- if(blockIcon == CaltriceBlocks.RaspBerryBush)
- {
- world.setBlock(x, y, z, CaltriceBlocks.BerryBush, meta, meta);
- }
- if(blockIcon == CaltriceBlocks.StrawBerryBush)
- {
- world.setBlock(x, y, z, CaltriceBlocks.BerryBush, meta, meta);
- }
- }
- @Override
- public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
- {
- return null;
- }
- protected boolean canPlaceBlockOn(Block block)
- {
- if(this == CaltriceBlocks.BlueBerryBush || this == CaltriceBlocks.RaspBerryBush || this == CaltriceBlocks.StrawBerryBush)
- {
- return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland;
- }
- else
- {
- return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement