Fixes #3478: Changes the way xp drops from Certus Ore blocks
This commit is contained in:
@@ -27,6 +27,7 @@ import net.minecraft.item.Item;
|
|||||||
import net.minecraft.util.BlockRenderLayer;
|
import net.minecraft.util.BlockRenderLayer;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import appeng.api.AEApi;
|
import appeng.api.AEApi;
|
||||||
@@ -76,16 +77,15 @@ public class BlockQuartzOre extends AEBaseBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dropBlockAsItemWithChance( final World w, final BlockPos pos, final IBlockState state, final float chance, final int fortune )
|
public int getExpDrop( IBlockState state, IBlockAccess world, BlockPos pos, int fortune )
|
||||||
{
|
{
|
||||||
super.dropBlockAsItemWithChance( w, pos, state, chance, fortune );
|
Random rand = world instanceof World ? ( (World) world ).rand : new Random();
|
||||||
|
|
||||||
if( this.getItemDropped( state, w.rand, fortune ) != Item.getItemFromBlock( this ) )
|
if( this.getItemDropped( state, rand, fortune ) != Item.getItemFromBlock( this ) )
|
||||||
{
|
{
|
||||||
final int xp = MathHelper.getInt( w.rand, 2, 5 );
|
return MathHelper.getInt( rand, 2, 5 );
|
||||||
|
|
||||||
this.dropXpOnBlockBreak( w, pos, xp );
|
|
||||||
}
|
}
|
||||||
|
return super.getExpDrop( state, world, pos, fortune );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user