@@ -0,0 +1,3087 @@
+/*%0A * Silent Lib%0A * Copyright (C) 2018 SilentChaos512%0A *%0A * This library is free software; you can redistribute it and/or%0A * modify it under the terms of the GNU Lesser General Public%0A * License as published by the Free Software Foundation version 3%0A * of the License.%0A *%0A * This library is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU%0A * Lesser General Public License for more details.%0A *%0A * You should have received a copy of the GNU Lesser General Public License%0A * along with this program.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A */%0A%0Apackage net.silentchaos512.lib.block;%0A%0Aimport net.minecraft.block.BlockOre;%0Aimport net.minecraft.block.SoundType;%0Aimport net.minecraft.block.state.IBlockState;%0Aimport net.minecraft.item.Item;%0Aimport net.minecraft.util.math.BlockPos;%0Aimport net.minecraft.util.math.MathHelper;%0Aimport net.minecraft.world.IBlockAccess;%0A%0Aimport java.util.Random;%0A%0A/**%0A * A simple ore block that allows setting basic quantity/XP amounts without the need to override any%0A * methods. The %7B@link #quantityDroppedWithBonus(int, Random)%7D method clamps the value to %5B0,64%5D and%0A * calls a new method, %7B@link #bonusAmount(int, Random)%7D. Overriding bonusAmount should be easier.%0A */%0Apublic class BlockOreSL extends BlockOre %7B%0A%0A    private final Item droppedItem;%0A    private final int quantityMin, quantityMax;%0A    private final int xpMin, xpMax;%0A%0A    public BlockOreSL(Item droppedItem, int harvestLevel, int quantityMin, int quantityMax, int xpMin, int xpMax) %7B%0A        this.droppedItem = droppedItem;%0A        this.quantityMin = quantityMin;%0A        this.quantityMax = quantityMax;%0A        this.xpMin = xpMin;%0A        this.xpMax = xpMax;%0A%0A        setHardness(3f);%0A        setResistance(15f);%0A        setSoundType(SoundType.STONE);%0A        setHarvestLevel(%22pickaxe%22, harvestLevel);%0A    %7D%0A%0A    @Override%0A    public Item getItemDropped(IBlockState state, Random rand, int fortune) %7B%0A        return droppedItem;%0A    %7D%0A%0A    @Override%0A    public int quantityDropped(Random random) %7B%0A        return quantityMin + random.nextInt(quantityMax - quantityMin + 1);%0A    %7D%0A%0A    @Override%0A    public int quantityDroppedWithBonus(int fortune, Random random) %7B%0A        int quantity = quantityDropped(random);%0A        if (fortune %3E 0 && getItemDropped(getDefaultState(), random, fortune) != Item.getItemFromBlock(this)) %7B%0A            float bonus = bonusAmount(fortune, random);%0A            if (bonus %3C 0) bonus = 0;%0A            quantity = Math.round(quantity * (bonus + 1));%0A        %7D%0A        return MathHelper.clamp(quantity, 0, 64);%0A    %7D%0A%0A    public float bonusAmount(int fortune, Random random) %7B%0A        return random.nextInt(fortune + 2) - 1;%0A    %7D%0A%0A    @Override%0A    public int getExpDrop(IBlockState state, IBlockAccess world, BlockPos pos, int fortune) %7B%0A        Item item = getItemDropped(world.getBlockState(pos), RANDOM, fortune);%0A        return item != Item.getItemFromBlock(this) ? xpMin + RANDOM.nextInt(xpMax - xpMin + 1) : 0;%0A    %7D%0A%7D%0A

Add BlockOreSL