mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 07:13:28 +01:00
Make the miner have the drill's harvest level
This commit is contained in:
parent
794032870a
commit
1e70dd8e49
2 changed files with 3 additions and 2 deletions
|
@ -56,7 +56,7 @@ import java.util.Set;
|
||||||
public class ItemDrill extends ItemEnergy{
|
public class ItemDrill extends ItemEnergy{
|
||||||
|
|
||||||
private static final int ENERGY_USE = 100;
|
private static final int ENERGY_USE = 100;
|
||||||
private static final int HARVEST_LEVEL = 4;
|
public static final int HARVEST_LEVEL = 4;
|
||||||
|
|
||||||
public ItemDrill(String name){
|
public ItemDrill(String name){
|
||||||
super(500000, 5000, name);
|
super(500000, 5000, name);
|
||||||
|
|
|
@ -14,6 +14,7 @@ import cofh.api.energy.EnergyStorage;
|
||||||
import cofh.api.energy.IEnergyReceiver;
|
import cofh.api.energy.IEnergyReceiver;
|
||||||
import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
|
import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
|
||||||
import de.ellpeck.actuallyadditions.mod.config.values.ConfigStringListValues;
|
import de.ellpeck.actuallyadditions.mod.config.values.ConfigStringListValues;
|
||||||
|
import de.ellpeck.actuallyadditions.mod.items.ItemDrill;
|
||||||
import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor;
|
import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
|
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
|
||||||
|
@ -106,7 +107,7 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyR
|
||||||
Block block = state.getBlock();
|
Block block = state.getBlock();
|
||||||
int meta = PosUtil.getMetadata(pos, this.worldObj);
|
int meta = PosUtil.getMetadata(pos, this.worldObj);
|
||||||
if(!block.isAir(this.worldObj.getBlockState(pos), this.worldObj, pos)){
|
if(!block.isAir(this.worldObj.getBlockState(pos), this.worldObj, pos)){
|
||||||
if(block.getHarvestLevel(this.worldObj.getBlockState(pos)) <= 3F && state.getBlockHardness(this.worldObj, pos) >= 0F && !(block instanceof BlockLiquid) && !(block instanceof IFluidBlock) && this.isMinable(block, meta)){
|
if(block.getHarvestLevel(this.worldObj.getBlockState(pos)) <= ItemDrill.HARVEST_LEVEL && state.getBlockHardness(this.worldObj, pos) >= 0F && !(block instanceof BlockLiquid) && !(block instanceof IFluidBlock) && this.isMinable(block, meta)){
|
||||||
List<ItemStack> drops = block.getDrops(this.worldObj, pos, this.worldObj.getBlockState(pos), 0);
|
List<ItemStack> drops = block.getDrops(this.worldObj, pos, this.worldObj.getBlockState(pos), 0);
|
||||||
float chance = ForgeEventFactory.fireBlockHarvesting(drops, this.worldObj, pos, this.worldObj.getBlockState(pos), 0, 1, false, null);
|
float chance = ForgeEventFactory.fireBlockHarvesting(drops, this.worldObj, pos, this.worldObj.getBlockState(pos), 0, 1, false, null);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue