mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-22 21:20:12 +00:00
51 lines
2.1 KiB
Diff
51 lines
2.1 KiB
Diff
--- ../src-base/minecraft/net/minecraft/block/BlockOre.java
|
|
+++ ../src-work/minecraft/net/minecraft/block/BlockOre.java
|
|
@@ -59,34 +59,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.getRandomIntegerInRange(worldIn.rand, 0, 2);
|
|
+ i = MathHelper.getRandomIntegerInRange(rand, 0, 2);
|
|
}
|
|
else if (this == Blocks.diamond_ore)
|
|
{
|
|
- i = MathHelper.getRandomIntegerInRange(worldIn.rand, 3, 7);
|
|
+ i = MathHelper.getRandomIntegerInRange(rand, 3, 7);
|
|
}
|
|
else if (this == Blocks.emerald_ore)
|
|
{
|
|
- i = MathHelper.getRandomIntegerInRange(worldIn.rand, 3, 7);
|
|
+ i = MathHelper.getRandomIntegerInRange(rand, 3, 7);
|
|
}
|
|
else if (this == Blocks.lapis_ore)
|
|
{
|
|
- i = MathHelper.getRandomIntegerInRange(worldIn.rand, 2, 5);
|
|
+ i = MathHelper.getRandomIntegerInRange(rand, 2, 5);
|
|
}
|
|
else if (this == Blocks.quartz_ore)
|
|
{
|
|
- i = MathHelper.getRandomIntegerInRange(worldIn.rand, 2, 5);
|
|
+ i = MathHelper.getRandomIntegerInRange(rand, 2, 5);
|
|
}
|
|
|
|
- this.dropXpOnBlockBreak(worldIn, pos, i);
|
|
+ return i;
|
|
}
|
|
+ return 0;
|
|
}
|
|
|
|
public ItemStack func_185473_a(World p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_)
|