Fixed destructor not being able to destroy some blocks, fixes #89
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
- Fixed buggy reequip animation on wireless grid
|
- Fixed buggy reequip animation on wireless grid
|
||||||
- Fixed solderer not supporting ore dictionary
|
- Fixed solderer not supporting ore dictionary
|
||||||
- Fixed recipes not supporting ore dictionary
|
- Fixed recipes not supporting ore dictionary
|
||||||
|
- Fixed destructor not being able to destroy some blocks
|
||||||
|
|
||||||
**Features**
|
**Features**
|
||||||
- Added the Stack Upgrade
|
- Added the Stack Upgrade
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import net.minecraft.block.Block;
|
|||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.inventory.InventoryHelper;
|
import net.minecraft.inventory.InventoryHelper;
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
@@ -53,11 +52,11 @@ public class TileDestructor extends TileMachine implements ICompareConfig, IMode
|
|||||||
BlockPos front = pos.offset(getDirection());
|
BlockPos front = pos.offset(getDirection());
|
||||||
|
|
||||||
IBlockState frontBlockState = worldObj.getBlockState(front);
|
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 (frontStack != null) {
|
||||||
if (ModeFilter.respectsMode(filters, this, compare, new ItemStack(frontBlock, 1, frontBlock.getMetaFromState(frontBlockState)))) {
|
if (ModeFilter.respectsMode(filters, this, compare, frontStack)) {
|
||||||
List<ItemStack> drops = frontBlock.getDrops(worldObj, front, frontBlockState, 0);
|
List<ItemStack> drops = frontBlockState.getBlock().getDrops(worldObj, front, frontBlockState, 0);
|
||||||
|
|
||||||
worldObj.playEvent(null, 2001, front, Block.getStateId(frontBlockState));
|
worldObj.playEvent(null, 2001, front, Block.getStateId(frontBlockState));
|
||||||
worldObj.setBlockToAir(front);
|
worldObj.setBlockToAir(front);
|
||||||
|
|||||||
Reference in New Issue
Block a user