Files
2019-02-24 22:29:41 +08:00

51 lines
1.9 KiB
Diff

--- ../src-base/minecraft/net/minecraft/block/BlockOre.java
+++ ../src-work/minecraft/net/minecraft/block/BlockOre.java
@@ -78,34 +78,39 @@
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
{
super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune);
-
- if (this.getItemDropped(state, worldIn.rand, fortune) != Item.getItemFromBlock(this))
+ }
+ @Override
+ public int getExpDrop(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ Random rand = world instanceof World ? ((World)world).rand : new Random();
+ if (this.getItemDropped(state, rand, fortune) != Item.getItemFromBlock(this))
{
int i = 0;
if (this == Blocks.COAL_ORE)
{
- i = MathHelper.getInt(worldIn.rand, 0, 2);
+ i = MathHelper.getInt(rand, 0, 2);
}
else if (this == Blocks.DIAMOND_ORE)
{
- i = MathHelper.getInt(worldIn.rand, 3, 7);
+ i = MathHelper.getInt(rand, 3, 7);
}
else if (this == Blocks.EMERALD_ORE)
{
- i = MathHelper.getInt(worldIn.rand, 3, 7);
+ i = MathHelper.getInt(rand, 3, 7);
}
else if (this == Blocks.LAPIS_ORE)
{
- i = MathHelper.getInt(worldIn.rand, 2, 5);
+ i = MathHelper.getInt(rand, 2, 5);
}
else if (this == Blocks.QUARTZ_ORE)
{
- i = MathHelper.getInt(worldIn.rand, 2, 5);
+ i = MathHelper.getInt(rand, 2, 5);
}
- this.dropXpOnBlockBreak(worldIn, pos, i);
+ return i;
}
+ return 0;
}
public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state)