From 5336da3ceac68d232b0f4f6c6b8962bd746cd968 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 8 Jul 2015 18:34:20 +0200 Subject: [PATCH] Fixed a stupid Bug with the Drill not dropping all items. Whoops! --- .../actuallyadditions/items/ItemCoffee.java | 1 + .../actuallyadditions/items/ItemDrill.java | 18 +++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemCoffee.java b/src/main/java/ellpeck/actuallyadditions/items/ItemCoffee.java index 9905e6bf8..186913f35 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemCoffee.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemCoffee.java @@ -211,6 +211,7 @@ public class ItemCoffee extends ItemFood implements INameableItem{ list.add(StatCollector.translateToLocal(effect.getEffectName())+" "+(effect.getAmplifier()+1)+ " (" + Potion.getDurationString(new PotionEffect(0, effect.getDuration()*20, 0)) + ")"); } } + //TODO else list.add("No Effects"); } else list.add(ItemUtil.shiftForInfo()); diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java b/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java index f1a87f35c..e19119586 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java @@ -222,14 +222,18 @@ public class ItemDrill extends ItemEnergy implements INameableItem{ if(hardness > -1.0F && ((x == xPos && y == yPos && z == zPos) || this.canHarvestBlock(block, stack))){ this.extractEnergy(stack, use, false); - block.harvestBlock(world, player, xPos, yPos, zPos, meta); - if(!EnchantmentHelper.getSilkTouchModifier(player)){ - block.dropXpOnBlockBreak(world, x, y, z, block.getExpDrop(world, meta, EnchantmentHelper.getFortuneModifier(player))); - } + block.onBlockHarvested(world, xPos, yPos, zPos, meta, player); + if(block.removedByPlayer(world, player, xPos, yPos, zPos, true)){ + block.onBlockDestroyedByPlayer(world, xPos, yPos, zPos, meta); + block.harvestBlock(world, player, xPos, yPos, zPos, meta); - world.setBlockToAir(xPos, yPos, zPos); - if(!(xPos == x && yPos == y && zPos == z)){ - world.playAuxSFX(2001, xPos, yPos, zPos, Block.getIdFromBlock(block)+(meta << 12)); + if(!EnchantmentHelper.getSilkTouchModifier(player)){ + block.dropXpOnBlockBreak(world, xPos, yPos, zPos, block.getExpDrop(world, meta, EnchantmentHelper.getFortuneModifier(player))); + } + + if(!(xPos == x && yPos == y && zPos == z)){ + world.playAuxSFX(2001, xPos, yPos, zPos, Block.getIdFromBlock(block)+(meta << 12)); + } } } }