Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.josh.gomc.blocks;
- import java.util.Random;
- import net.minecraft.block.Block;
- import net.minecraft.block.material.Material;
- import net.minecraft.item.Item;
- public class BlockDropItem extends Block {
- private Item drop;
- private int least_quantity;
- private int most_quantity;
- public BlockDropItem(Material mat, Item drop, int least_quantity, int most_quantity, float hard, float res, int HL) {
- super(mat);
- this.drop = drop;
- this.least_quantity = least_quantity;
- this.most_quantity = most_quantity;
- this.setHardness(hard);
- this.setResistance(res);
- this.setHarvestLevel("pickaxe", HL);
- this.setStepSound(soundTypeStone);
- // TODO Auto-generated constructor stub
- }
- @Override
- public Item getItemDropped(int meta, Random random, int fortune) {
- return this.drop;
- }
- @Override
- public int quantityDropped(int meta, int fortune, Random random) {
- if (this.least_quantity >= this.most_quantity)
- return this.least_quantity;
- return this.least_quantity + random.nextInt(this.most_quantity - this.least_quantity + fortune + 1);
- }
- }
Add Comment
Please, Sign In to add comment