mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 08:48:34 +01:00
parent
55e98e5f14
commit
e3cd20d171
1 changed files with 7 additions and 3 deletions
|
@ -174,8 +174,10 @@ public class ItemDrill extends ItemEnergy{
|
||||||
@Override
|
@Override
|
||||||
public boolean hitEntity(ItemStack stack, EntityLivingBase entity1, EntityLivingBase entity2){
|
public boolean hitEntity(ItemStack stack, EntityLivingBase entity1, EntityLivingBase entity2){
|
||||||
int use = this.getEnergyUsePerBlock(stack);
|
int use = this.getEnergyUsePerBlock(stack);
|
||||||
if(this.getEnergyStored(stack) >= use){
|
if(!(entity2 instanceof EntityPlayer) || !((EntityPlayer)entity2).capabilities.isCreativeMode){
|
||||||
this.extractEnergyInternal(stack, use, false);
|
if(this.getEnergyStored(stack) >= use){
|
||||||
|
this.extractEnergyInternal(stack, use, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -454,7 +456,9 @@ public class ItemDrill extends ItemEnergy{
|
||||||
float hardness = block.getBlockHardness(state, world, pos);
|
float hardness = block.getBlockHardness(state, world, pos);
|
||||||
boolean canHarvest = (ForgeHooks.canHarvestBlock(block, player, world, pos) || this.canHarvestBlock(state, stack)) && (!isExtra || this.getStrVsBlock(stack, world.getBlockState(pos)) > 1.0F);
|
boolean canHarvest = (ForgeHooks.canHarvestBlock(block, player, world, pos) || this.canHarvestBlock(state, stack)) && (!isExtra || this.getStrVsBlock(stack, world.getBlockState(pos)) > 1.0F);
|
||||||
if(hardness >= 0.0F && (!isExtra || (canHarvest && !block.hasTileEntity(world.getBlockState(pos))))){
|
if(hardness >= 0.0F && (!isExtra || (canHarvest && !block.hasTileEntity(world.getBlockState(pos))))){
|
||||||
this.extractEnergyInternal(stack, use, false);
|
if(!player.capabilities.isCreativeMode){
|
||||||
|
this.extractEnergyInternal(stack, use, false);
|
||||||
|
}
|
||||||
//Break the Block
|
//Break the Block
|
||||||
return WorldUtil.playerHarvestBlock(stack, world, player, pos);
|
return WorldUtil.playerHarvestBlock(stack, world, player, pos);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue