123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- package me.km.blocks.campfire;
- import java.util.Random;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.init.Items;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.util.EnumFacing;
- import net.minecraft.util.EnumHand;
- import net.minecraft.util.NonNullList;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.world.IBlockAccess;
- import net.minecraft.world.World;
- public class BlockCampFireBurnt extends BlockCampFire
- {
- public BlockCampFireBurnt(String name, String local)
- {
- super(name, local);
- }
-
- @Override
- public boolean onBlockActivated(World w, BlockPos pos, IBlockState state, EntityPlayer p, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
- {
- return false;
- }
-
- @Override
- public Item getItemDropped(IBlockState state, Random rand, int fortune)
- {
- return Items.STICK;
- }
-
- @Override
- public int quantityDropped(Random r)
- {
- return r.nextInt(3) + 1;
- }
- @Override
- public void getDrops(NonNullList<ItemStack> drops, IBlockAccess w, BlockPos pos, IBlockState state, int fortune)
- {
- super.getDrops(drops, w, pos, state, 0);
- Random rand = w instanceof World ? ((World) w).rand : new Random();
- if(rand.nextBoolean())
- {
- drops.add(new ItemStack(Items.COAL, 1, 1));
- }
- }
- }
|