This commit is contained in:
thatsIch 2014-11-05 19:55:00 +01:00
commit a1b15da87a
2 changed files with 59 additions and 3 deletions

View file

@ -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;
}
}
}

View file

@ -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 <http://www.gnu.org/licenses/lgpl>.
*/
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<ItemStack> 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 );
}
}
}
}