This commit is contained in:
paulevsGitch 2020-09-24 18:49:23 +03:00
parent 34e7c442e4
commit 36ea4b8726
8 changed files with 32 additions and 57 deletions

View file

@ -34,12 +34,11 @@ public class BlockOre extends OreBlock {
this.minCount = minCount;
this.maxCount = maxCount;
}
@Override
public List<ItemStack> getDroppedStacks(BlockState state, LootContext.Builder builder) {
ItemStack tool = builder.get(LootContextParameters.TOOL);
if (tool.isEffectiveOn(state))
{
if (tool != null && tool.isEffectiveOn(state)) {
int fortune = EnchantmentHelper.getLevel(Enchantments.FORTUNE, tool);
int min = MathHelper.clamp(minCount + fortune, 0, maxCount);
if (min == maxCount)