diff --git a/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java b/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java index ee29604f6..a3d2e40eb 100644 --- a/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java +++ b/src/main/java/appeng/client/render/blocks/RenderBlockCraftingCPU.java @@ -4,6 +4,7 @@ import java.util.EnumSet; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraftforge.common.util.ForgeDirection; @@ -22,8 +23,8 @@ import appeng.tile.crafting.TileCraftingTile; public class RenderBlockCraftingCPU extends BaseBlockRender { - protected RenderBlockCraftingCPU(boolean useTesr, int range) { - super( useTesr, range ); + protected RenderBlockCraftingCPU(boolean useTESR, int range) { + super( useTESR, range ); } public RenderBlockCraftingCPU() { @@ -303,6 +304,16 @@ public class RenderBlockCraftingCPU extends BaseBlockRender private boolean isConnected(IBlockAccess w, int x, int y, int z, ForgeDirection side) { - return w.getTileEntity( x + side.offsetX, y + side.offsetY, z + side.offsetZ ) instanceof TileCraftingTile; + final int tileYPos = y + side.offsetY; + if ( 0 <= tileYPos && tileYPos <= 255) + { + final TileEntity tile = w.getTileEntity( x + side.offsetX, tileYPos, z + side.offsetZ ); + + return tile instanceof TileCraftingTile; + } + else + { + return false; + } } } diff --git a/src/main/java/appeng/tile/storage/TileIOPort.java b/src/main/java/appeng/tile/storage/TileIOPort.java index 3d64e6ce2..08c3ccf47 100644 --- a/src/main/java/appeng/tile/storage/TileIOPort.java +++ b/src/main/java/appeng/tile/storage/TileIOPort.java @@ -1,8 +1,27 @@ +/* + * This file is part of Applied Energistics 2. + * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. + * + * Applied Energistics 2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Applied Energistics 2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Applied Energistics 2. If not, see . + */ + package appeng.tile.storage; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import appeng.api.AEApi; import appeng.api.config.Actionable; @@ -45,6 +64,8 @@ import appeng.util.InventoryAdaptor; import appeng.util.Platform; import appeng.util.inv.WrapperInventoryRange; +import java.util.ArrayList; + public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IConfigManagerHost, IGridTickable { @@ -419,4 +440,28 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC return false; } + /** + * Adds the items in the upgrade slots to the drop list. + * + * @param w world + * @param x x pos of tile entity + * @param y y pos of tile entity + * @param z z pos of tile entity + * @param drops drops of tile entity + */ + @Override + public void getDrops( World w, int x, int y, int z, ArrayList drops ) + { + super.getDrops( w, x, y, z, drops ); + + for (int upgradeIndex = 0; upgradeIndex < this.upgrades.getSizeInventory(); upgradeIndex++) + { + ItemStack stackInSlot = this.upgrades.getStackInSlot(upgradeIndex); + + if ( stackInSlot != null ) + { + drops.add( stackInSlot ); + } + } + } }