mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-20 12:09:39 +00:00
Don't drop xp orbs into world directly
This commit is contained in:
1 parent
54a9da917d
commit
b0bc8429ac
1 file changed
+7
-5
@@ -10,6 +10,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.core.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
@@ -59,14 +61,14 @@ public class BlockResourceOre extends Block implements IItemModelRegister, IBloc
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropBlockAsItemWithChance(World world, BlockPos pos, IBlockState state, float chance, int fortune) {
|
||||
super.dropBlockAsItemWithChance(world, pos, state, chance, fortune);
|
||||
|
||||
public int getExpDrop(IBlockState state, IBlockAccess world, BlockPos pos, int fortune) {
|
||||
Random rand = world instanceof World ? ((World) world).rand : new Random();
|
||||
if (state.getValue(ORE_RESOURCES) == EnumResourceType.APATITE) {
|
||||
this.dropXpOnBlockBreak(world, pos, MathHelper.getInt(world.rand, 1, 4));
|
||||
return MathHelper.getInt(rand, 1, 4);
|
||||
}
|
||||
return super.getExpDrop(state, world, pos, fortune);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
EnumResourceType type = state.getValue(ORE_RESOURCES);
|
||||
|
||||
Reference in new issue
Block a user