From 4d7f5627545a929f5613ad4e4721cde1197ae9a2 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 21 Nov 2015 10:58:28 +0100 Subject: [PATCH] Made Drill harvest very slowly instead of not at all when out of energy (Fixes Ghost Blocks when using an empty Drill in creative) --- .../java/ellpeck/actuallyadditions/items/ItemDrill.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java b/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java index 8aab95559..fccad7fdf 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java @@ -244,18 +244,18 @@ public class ItemDrill extends ItemEnergy{ @Override public Multimap getAttributeModifiers(ItemStack stack){ Multimap map = super.getAttributeModifiers(stack); - map.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Drill Modifier", this.getEnergyStored(stack) >= ConfigIntValues.DRILL_ENERGY_USE.getValue() ? 8.0F : 0.0F, 0)); + map.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Drill Modifier", this.getEnergyStored(stack) >= ConfigIntValues.DRILL_ENERGY_USE.getValue() ? 8.0F : 0.1F, 0)); return map; } @Override public float getDigSpeed(ItemStack stack, Block block, int meta){ - return this.getEnergyStored(stack) >= this.getEnergyUsePerBlock(stack) ? (this.hasExtraWhitelist(block) || block.getHarvestTool(meta) == null || block.getHarvestTool(meta).isEmpty() || this.getToolClasses(stack).contains(block.getHarvestTool(meta)) ? this.getEfficiencyFromUpgrade(stack) : 1.0F) : 0.0F; + return this.getEnergyStored(stack) >= this.getEnergyUsePerBlock(stack) ? (this.hasExtraWhitelist(block) || block.getHarvestTool(meta) == null || block.getHarvestTool(meta).isEmpty() || this.getToolClasses(stack).contains(block.getHarvestTool(meta)) ? this.getEfficiencyFromUpgrade(stack) : 1.0F) : 0.1F; } @Override public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player){ - boolean toReturn = true; + boolean toReturn = false; int use = this.getEnergyUsePerBlock(stack); if(this.getEnergyStored(stack) >= use){ //Enchants the Drill depending on the Upgrades it has