Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package brt.block;
- import java.util.Random;
- import net.minecraft.block.Block;
- import net.minecraft.block.material.Material;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.creativetab.CreativeTabs;
- import net.minecraft.init.Blocks;
- import net.minecraft.item.EnumDyeColor;
- import net.minecraft.item.Item;
- import net.minecraft.util.BlockPos;
- import net.minecraft.util.MathHelper;
- import net.minecraft.world.IBlockAccess;
- import net.minecraft.world.World;
- import brt.BedrockTools;
- public class BlockBedrockOre extends Block
- {
- public BlockBedrockOre(Material materialIn)
- {
- super(materialIn);
- this.setCreativeTab(BedrockTools.tabBrt);
- this.setUnlocalizedName("bedrockOre");
- }
- public int quantityDropped(Random random)
- {
- return 1;
- }
- public int quantityDroppedWithBonus(int fortune, Random random)
- {
- if (fortune > 0 && Item.getItemFromBlock(this) != this.getItemDropped((IBlockState)this.getBlockState().getValidStates().iterator().next(), random, fortune))
- {
- int j = random.nextInt(fortune + 2) - 1;
- if (j < 0)
- {
- j = 0;
- }
- return this.quantityDropped(random) * (j + 1);
- }
- else
- {
- return this.quantityDropped(random);
- }
- }
- public Item getItemDropped(IBlockState state, Random rand, int forune)
- {
- return BedrockTools.bedrockShard;
- }
- public int getExpDrop(IBlockAccess world, BlockPos pos, int fortune)
- {
- IBlockState state = world.getBlockState(pos);
- Random rand = world instanceof World ? ((World)world).rand : new Random();
- if (this.getItemDropped(state, rand, fortune) != Item.getItemFromBlock(this))
- {
- return MathHelper.getRandomIntegerInRange(rand, 3, 7);
- }
- return 0;
- }
- public int damageDropped(IBlockState state)
- {
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement