This fixes all the bugs I got while playtesting
This commit is contained in:
		| @@ -79,7 +79,7 @@ public class GuiController extends GuiBase { | ||||
|         TileMachine machineHovering = null; | ||||
|  | ||||
|         for (int i = 0; i < 4; ++i) { | ||||
|             if (slot < machines.size()) { | ||||
|             if (slot < machines.size() && machines.get(slot) != null && machines.get(slot).getWorld() != null) { | ||||
|                 TileMachine machine = machines.get(slot); | ||||
|                 IBlockState machineState = machine.getWorld().getBlockState(machine.getPos()); | ||||
|                 Block machineBlock = machineState.getBlock(); | ||||
|   | ||||
| @@ -4,6 +4,7 @@ import io.netty.buffer.ByteBuf; | ||||
| import net.minecraft.block.Block; | ||||
| import net.minecraft.block.state.IBlockState; | ||||
| import net.minecraft.inventory.IInventory; | ||||
| import net.minecraft.item.Item; | ||||
| import net.minecraft.item.ItemStack; | ||||
| import net.minecraft.nbt.NBTTagCompound; | ||||
| import net.minecraft.util.math.BlockPos; | ||||
| @@ -39,7 +40,7 @@ public class TileDestructor extends TileMachine implements ICompareSetting, IMod | ||||
|             IBlockState frontBlockState = worldObj.getBlockState(front); | ||||
|             Block frontBlock = frontBlockState.getBlock(); | ||||
|  | ||||
|             if (!frontBlock.isAir(frontBlockState, worldObj, front)) { | ||||
|             if (Item.getItemFromBlock(frontBlock) != null && !frontBlock.isAir(frontBlockState, worldObj, front)) { | ||||
|                 if (ModeSettingUtils.doesNotViolateMode(inventory, this, compare, new ItemStack(frontBlock, 1, frontBlock.getMetaFromState(frontBlockState)))) { | ||||
|                     List<ItemStack> drops = frontBlock.getDrops(worldObj, front, frontBlockState, 0); | ||||
|  | ||||
|   | ||||
| @@ -80,11 +80,16 @@ public class TileImporter extends TileMachine implements ICompareSetting, IModeS | ||||
|                     ItemStack toTake = stack.copy(); | ||||
|                     toTake.stackSize = 1; | ||||
|  | ||||
|                     // If we can't import and/ or push, move on (otherwise we stay on the same slot forever) | ||||
|                     if (canImport(toTake)) { | ||||
|                         if (getController().push(toTake)) { | ||||
|                             inventory.decrStackSize(currentSlot, 1); | ||||
|                             inventory.markDirty(); | ||||
|                         } else { | ||||
|                             currentSlot++; | ||||
|                         } | ||||
|                     } else { | ||||
|                         currentSlot++; | ||||
|                     } | ||||
|                 } | ||||
|             } else { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Raoul Van den Berge
					Raoul Van den Berge