Merge pull request #511 from thatsIch/b-361-assembler
Try to catch assemblers being build too high or low for ChunkCache
This commit is contained in:
commit
9fae9d1ec0
1 changed files with 17 additions and 11 deletions
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
package appeng.client.render.blocks;
|
package appeng.client.render.blocks;
|
||||||
|
|
||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.RenderBlocks;
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
|
@ -28,6 +29,7 @@ import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
|
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
import appeng.api.networking.IGridHost;
|
import appeng.api.networking.IGridHost;
|
||||||
import appeng.api.parts.IBoxProvider;
|
import appeng.api.parts.IBoxProvider;
|
||||||
import appeng.api.parts.IPart;
|
import appeng.api.parts.IPart;
|
||||||
|
@ -48,9 +50,12 @@ import appeng.util.Platform;
|
||||||
public class RenderBlockAssembler extends BaseBlockRender implements IBoxProvider
|
public class RenderBlockAssembler extends BaseBlockRender implements IBoxProvider
|
||||||
{
|
{
|
||||||
|
|
||||||
IIcon getConnectedCable(IBlockAccess world, int x, int y, int z, ForgeDirection d, boolean covered)
|
IIcon getConnectedCable(IBlockAccess world, int x, int y, int z, ForgeDirection side, boolean covered)
|
||||||
{
|
{
|
||||||
TileEntity ne = world.getTileEntity( x + d.offsetX, y + d.offsetY, z + d.offsetZ );
|
final int tileYPos = y + side.offsetY;
|
||||||
|
if ( -1 < tileYPos && tileYPos < 256 )
|
||||||
|
{
|
||||||
|
TileEntity ne = world.getTileEntity( x + side.offsetX, tileYPos, z + side.offsetZ );
|
||||||
if ( ne instanceof IGridHost && ne instanceof IPartHost )
|
if ( ne instanceof IGridHost && ne instanceof IPartHost )
|
||||||
{
|
{
|
||||||
IPartHost ph = (IPartHost) ne;
|
IPartHost ph = (IPartHost) ne;
|
||||||
|
@ -58,7 +63,7 @@ public class RenderBlockAssembler extends BaseBlockRender implements IBoxProvide
|
||||||
if ( pcx instanceof PartCable )
|
if ( pcx instanceof PartCable )
|
||||||
{
|
{
|
||||||
PartCable pc = (PartCable) pcx;
|
PartCable pc = (PartCable) pcx;
|
||||||
if ( pc.isConnected( d.getOpposite() ) )
|
if ( pc.isConnected( side.getOpposite() ) )
|
||||||
{
|
{
|
||||||
if ( covered )
|
if ( covered )
|
||||||
return pc.getCoveredTexture( pc.getCableColor() );
|
return pc.getCoveredTexture( pc.getCableColor() );
|
||||||
|
@ -66,6 +71,7 @@ public class RenderBlockAssembler extends BaseBlockRender implements IBoxProvide
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue