Make gem ore drop experience when mined

This commit is contained in:
Cheeserolls 2015-04-21 19:14:07 +01:00
parent a8687ffb08
commit ace3eb945f
1 changed files with 12 additions and 0 deletions

View File

@ -24,6 +24,10 @@ import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.util.BlockPos;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockGemOre extends Block implements IBOPBlock
{
@ -99,4 +103,12 @@ public class BlockGemOre extends Block implements IBOPBlock
return this.getMetaFromState(state);
}
// Drop some experience when gems are mined
@Override
public int getExpDrop(IBlockAccess world, BlockPos pos, int fortune)
{
Random rand = world instanceof World ? ((World)world).rand : new Random();
return MathHelper.getRandomIntegerInRange(rand, 3, 7);
}
}