Fixed destructor not being able to destroy some blocks, fixes #89

This commit is contained in:
Raoul Van den Berge
2016-06-03 23:08:22 +02:00
parent 446568a9d1
commit 937e0815eb
2 changed files with 5 additions and 5 deletions

View File

@@ -5,6 +5,7 @@
- Fixed buggy reequip animation on wireless grid
- Fixed solderer not supporting ore dictionary
- Fixed recipes not supporting ore dictionary
- Fixed destructor not being able to destroy some blocks
**Features**
- Added the Stack Upgrade

View File

@@ -5,7 +5,6 @@ import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.InventoryHelper;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
@@ -53,11 +52,11 @@ public class TileDestructor extends TileMachine implements ICompareConfig, IMode
BlockPos front = pos.offset(getDirection());
IBlockState frontBlockState = worldObj.getBlockState(front);
Block frontBlock = frontBlockState.getBlock();
ItemStack frontStack = frontBlockState.getBlock().getItem(worldObj, front, frontBlockState);
if (Item.getItemFromBlock(frontBlock) != null && !frontBlock.isAir(frontBlockState, worldObj, front)) {
if (ModeFilter.respectsMode(filters, this, compare, new ItemStack(frontBlock, 1, frontBlock.getMetaFromState(frontBlockState)))) {
List<ItemStack> drops = frontBlock.getDrops(worldObj, front, frontBlockState, 0);
if (frontStack != null) {
if (ModeFilter.respectsMode(filters, this, compare, frontStack)) {
List<ItemStack> drops = frontBlockState.getBlock().getDrops(worldObj, front, frontBlockState, 0);
worldObj.playEvent(null, 2001, front, Block.getStateId(frontBlockState));
worldObj.setBlockToAir(front);