2013-12-27 23:59:59 +01:00
|
|
|
package appeng.block.networking;
|
|
|
|
|
|
|
|
import java.util.EnumSet;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Random;
|
|
|
|
|
2014-01-29 04:10:23 +01:00
|
|
|
import net.minecraft.block.Block;
|
2013-12-27 23:59:59 +01:00
|
|
|
import net.minecraft.block.material.Material;
|
2014-06-11 07:14:37 +02:00
|
|
|
import net.minecraft.client.particle.EffectRenderer;
|
|
|
|
import net.minecraft.client.particle.EntityDiggingFX;
|
2014-02-09 02:34:52 +01:00
|
|
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
2013-12-27 23:59:59 +01:00
|
|
|
import net.minecraft.creativetab.CreativeTabs;
|
|
|
|
import net.minecraft.entity.Entity;
|
2013-12-28 21:54:05 +01:00
|
|
|
import net.minecraft.entity.EntityLivingBase;
|
2013-12-27 23:59:59 +01:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2014-02-09 02:34:52 +01:00
|
|
|
import net.minecraft.item.Item;
|
2013-12-27 23:59:59 +01:00
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
2014-02-09 02:34:52 +01:00
|
|
|
import net.minecraft.util.IIcon;
|
2013-12-27 23:59:59 +01:00
|
|
|
import net.minecraft.util.MovingObjectPosition;
|
|
|
|
import net.minecraft.util.Vec3;
|
|
|
|
import net.minecraft.world.IBlockAccess;
|
|
|
|
import net.minecraft.world.World;
|
2014-02-09 02:34:52 +01:00
|
|
|
import net.minecraftforge.common.util.ForgeDirection;
|
2014-06-26 04:19:20 +02:00
|
|
|
import powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection;
|
|
|
|
import powercrystals.minefactoryreloaded.api.rednet.connectivity.RedNetConnectionType;
|
2014-06-11 07:14:37 +02:00
|
|
|
import appeng.api.parts.IPart;
|
|
|
|
import appeng.api.parts.IPartHost;
|
2014-01-20 17:41:37 +01:00
|
|
|
import appeng.api.parts.PartItemStack;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.api.parts.SelectedPart;
|
|
|
|
import appeng.block.AEBaseBlock;
|
|
|
|
import appeng.client.render.BaseBlockRender;
|
2014-05-05 02:51:05 +02:00
|
|
|
import appeng.client.render.BusRenderHelper;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.client.render.blocks.RendererCableBus;
|
2014-02-09 02:34:52 +01:00
|
|
|
import appeng.client.texture.ExtraTextures;
|
2014-05-05 02:51:05 +02:00
|
|
|
import appeng.core.AEConfig;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.core.Api;
|
|
|
|
import appeng.core.AppEng;
|
2014-01-20 17:41:37 +01:00
|
|
|
import appeng.core.CommonHelper;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.core.features.AEFeature;
|
|
|
|
import appeng.integration.abstraction.IFMP;
|
2014-01-20 17:41:37 +01:00
|
|
|
import appeng.parts.ICableBusContainer;
|
|
|
|
import appeng.parts.NullCableBusContainer;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.tile.AEBaseTile;
|
|
|
|
import appeng.tile.networking.TileCableBus;
|
2014-05-05 02:51:05 +02:00
|
|
|
import appeng.tile.networking.TileCableBusTESR;
|
2014-06-26 04:19:20 +02:00
|
|
|
import appeng.transformer.annotations.integration.Interface;
|
|
|
|
import appeng.transformer.annotations.integration.Method;
|
2014-01-28 20:27:22 +01:00
|
|
|
import appeng.util.Platform;
|
2014-06-11 07:14:37 +02:00
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
2013-12-27 23:59:59 +01:00
|
|
|
|
2014-06-26 04:19:20 +02:00
|
|
|
@Interface(iface = "powercrystals.minefactoryreloaded.api.rednet.connectivity.IRedNetConnection", iname = "MFR")
|
|
|
|
public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
|
2014-01-20 17:41:37 +01:00
|
|
|
static private ICableBusContainer nullCB = new NullCableBusContainer();
|
2014-05-05 02:51:05 +02:00
|
|
|
static public Class<? extends TileEntity> noTesrTile;
|
|
|
|
static public Class<? extends TileEntity> tesrTile;
|
|
|
|
|
|
|
|
public <T extends TileEntity> T getTileEntity(IBlockAccess w, int x, int y, int z)
|
|
|
|
{
|
|
|
|
TileEntity te = w.getTileEntity( x, y, z );
|
|
|
|
|
|
|
|
if ( noTesrTile.isInstance( te ) )
|
|
|
|
return (T) te;
|
|
|
|
|
2014-05-24 17:29:45 +02:00
|
|
|
if ( tesrTile != null && tesrTile.isInstance( te ) )
|
2014-05-05 02:51:05 +02:00
|
|
|
return (T) te;
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
2014-01-20 17:41:37 +01:00
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
public BlockCableBus() {
|
|
|
|
super( BlockCableBus.class, Material.glass );
|
|
|
|
setfeature( EnumSet.of( AEFeature.Core ) );
|
|
|
|
setLightOpacity( 0 );
|
|
|
|
isFullSize = isOpaque = false;
|
|
|
|
}
|
|
|
|
|
2014-05-05 02:51:05 +02:00
|
|
|
@Override
|
|
|
|
public int getRenderBlockPass()
|
|
|
|
{
|
|
|
|
if ( AEConfig.instance.isFeatureEnabled( AEFeature.AlphaPass ) )
|
|
|
|
return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-06-11 07:14:37 +02:00
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
public boolean addHitEffects(World world, MovingObjectPosition target, EffectRenderer effectRenderer)
|
|
|
|
{
|
|
|
|
Object pobj = cb( world, target.blockX, target.blockY, target.blockZ );
|
|
|
|
if ( pobj instanceof IPartHost )
|
|
|
|
{
|
|
|
|
IPartHost host = (IPartHost) pobj;
|
|
|
|
|
|
|
|
for (ForgeDirection side : ForgeDirection.values())
|
|
|
|
{
|
|
|
|
IPart p = host.getPart( side );
|
|
|
|
IIcon ico = getIcon( p );
|
|
|
|
|
|
|
|
if ( ico == null )
|
|
|
|
continue;
|
|
|
|
|
|
|
|
byte b0 = (byte) (Platform.getRandomInt() % 2 == 0 ? 1 : 0);
|
|
|
|
|
|
|
|
for (int i1 = 0; i1 < b0; ++i1)
|
|
|
|
{
|
|
|
|
for (int j1 = 0; j1 < b0; ++j1)
|
|
|
|
{
|
|
|
|
for (int k1 = 0; k1 < b0; ++k1)
|
|
|
|
{
|
|
|
|
double d0 = (double) target.blockX + ((double) i1 + 0.5D) / (double) b0;
|
|
|
|
double d1 = (double) target.blockY + ((double) j1 + 0.5D) / (double) b0;
|
|
|
|
double d2 = (double) target.blockZ + ((double) k1 + 0.5D) / (double) b0;
|
|
|
|
|
|
|
|
double dd0 = target.hitVec.xCoord;
|
|
|
|
double dd1 = target.hitVec.yCoord;
|
|
|
|
double dd2 = target.hitVec.zCoord;
|
|
|
|
EntityDiggingFX fx = (new EntityDiggingFX( world, dd0, dd1, dd2, d0 - (double) target.blockX - 0.5D, d1 - (double) target.blockY
|
|
|
|
- 0.5D, d2 - (double) target.blockZ - 0.5D, this, 0 )).applyColourMultiplier( target.blockX, target.blockY, target.blockZ );
|
|
|
|
|
|
|
|
fx.setParticleIcon( ico );
|
|
|
|
|
|
|
|
effectRenderer.addEffect( fx );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
public boolean addDestroyEffects(World world, int x, int y, int z, int meta, EffectRenderer effectRenderer)
|
|
|
|
{
|
|
|
|
Object pobj = cb( world, x, y, z );
|
|
|
|
if ( pobj instanceof IPartHost )
|
|
|
|
{
|
|
|
|
IPartHost host = (IPartHost) pobj;
|
|
|
|
|
|
|
|
for (ForgeDirection side : ForgeDirection.values())
|
|
|
|
{
|
|
|
|
IPart p = host.getPart( side );
|
|
|
|
IIcon ico = getIcon( p );
|
|
|
|
|
|
|
|
if ( ico == null )
|
|
|
|
continue;
|
|
|
|
|
|
|
|
byte b0 = 3;
|
|
|
|
|
|
|
|
for (int i1 = 0; i1 < b0; ++i1)
|
|
|
|
{
|
|
|
|
for (int j1 = 0; j1 < b0; ++j1)
|
|
|
|
{
|
|
|
|
for (int k1 = 0; k1 < b0; ++k1)
|
|
|
|
{
|
|
|
|
double d0 = (double) x + ((double) i1 + 0.5D) / (double) b0;
|
|
|
|
double d1 = (double) y + ((double) j1 + 0.5D) / (double) b0;
|
|
|
|
double d2 = (double) z + ((double) k1 + 0.5D) / (double) b0;
|
|
|
|
EntityDiggingFX fx = (new EntityDiggingFX( world, d0, d1, d2, d0 - (double) x - 0.5D, d1 - (double) y - 0.5D, d2 - (double) z
|
|
|
|
- 0.5D, this, meta )).applyColourMultiplier( x, y, z );
|
|
|
|
|
|
|
|
fx.setParticleIcon( ico );
|
|
|
|
|
|
|
|
effectRenderer.addEffect( fx );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
private IIcon getIcon(IPart p)
|
|
|
|
{
|
|
|
|
if ( p == null )
|
|
|
|
return null;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
IIcon ico = p.getBreakingTexture();
|
|
|
|
if ( ico != null )
|
|
|
|
return ico;
|
|
|
|
}
|
|
|
|
catch (Throwable t)
|
|
|
|
{
|
|
|
|
// nothing.
|
|
|
|
}
|
|
|
|
|
|
|
|
ItemStack is = p.getItemStack( PartItemStack.Network );
|
|
|
|
if ( is == null || is.getItem() == null )
|
|
|
|
return null;
|
|
|
|
|
|
|
|
return is.getItem().getIcon( is, 0 );
|
|
|
|
}
|
|
|
|
|
2014-05-05 02:51:05 +02:00
|
|
|
@Override
|
|
|
|
public boolean canRenderInPass(int pass)
|
|
|
|
{
|
|
|
|
BusRenderHelper.instance.setPass( pass );
|
|
|
|
|
|
|
|
if ( AEConfig.instance.isFeatureEnabled( AEFeature.AlphaPass ) )
|
|
|
|
return true;
|
|
|
|
|
|
|
|
return pass == 0;
|
|
|
|
}
|
|
|
|
|
2013-12-28 21:54:05 +01:00
|
|
|
@Override
|
2014-02-09 02:34:52 +01:00
|
|
|
public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity)
|
2013-12-28 21:54:05 +01:00
|
|
|
{
|
2014-05-29 22:01:42 +02:00
|
|
|
return cb( world, x, y, z ).isLadder( entity );
|
2013-12-28 21:54:05 +01:00
|
|
|
}
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
@Override
|
|
|
|
public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour)
|
2014-03-27 04:27:14 +01:00
|
|
|
{
|
|
|
|
return recolourBlock( world, x, y, z, side, colour, null );
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour, EntityPlayer who)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2014-05-29 22:01:42 +02:00
|
|
|
try
|
|
|
|
{
|
|
|
|
return cb( world, x, y, z ).recolourBlock( side, colour, who );
|
|
|
|
}
|
|
|
|
catch (Throwable t)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
return false;
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void randomDisplayTick(World world, int x, int y, int z, Random r)
|
|
|
|
{
|
2014-05-29 22:01:42 +02:00
|
|
|
cb( world, x, y, z ).randomDisplayTick( world, x, y, z, r );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getLightValue(IBlockAccess world, int x, int y, int z)
|
|
|
|
{
|
2014-02-09 02:34:52 +01:00
|
|
|
Block block = world.getBlock( x, y, z );
|
2014-01-29 04:10:23 +01:00
|
|
|
if ( block != null && block != this )
|
|
|
|
{
|
|
|
|
return block.getLightValue( world, x, y, z );
|
|
|
|
}
|
|
|
|
if ( block == null )
|
|
|
|
return 0;
|
2014-05-29 22:01:42 +02:00
|
|
|
return cb( world, x, y, z ).getLightValue();
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
|
|
|
|
{
|
|
|
|
Vec3 v3 = target.hitVec.addVector( -x, -y, -z );
|
|
|
|
SelectedPart sp = cb( world, x, y, z ).selectPart( v3 );
|
2014-01-20 17:41:37 +01:00
|
|
|
|
|
|
|
if ( sp.part != null )
|
2014-02-23 23:50:53 +01:00
|
|
|
return sp.part.getItemStack( PartItemStack.Pick );
|
2014-01-20 17:41:37 +01:00
|
|
|
else if ( sp.facade != null )
|
|
|
|
return sp.facade.getItemStack();
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-02-09 02:34:52 +01:00
|
|
|
public boolean isReplaceable(IBlockAccess world, int x, int y, int z)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2014-05-29 22:01:42 +02:00
|
|
|
return cb( world, x, y, z ).isEmpty();
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
2014-06-29 00:32:20 +02:00
|
|
|
@SuppressWarnings("deprecation")
|
2013-12-27 23:59:59 +01:00
|
|
|
@Override
|
2014-02-09 02:34:52 +01:00
|
|
|
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
if ( player.capabilities.isCreativeMode )
|
|
|
|
{
|
|
|
|
AEBaseTile tile = getTileEntity( world, x, y, z );
|
|
|
|
if ( tile != null )
|
|
|
|
tile.dropItems = false;
|
|
|
|
// maybe ray trace?
|
|
|
|
}
|
2014-02-09 02:34:52 +01:00
|
|
|
return super.removedByPlayer( world, player, x, y, z );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-02-09 02:34:52 +01:00
|
|
|
public IIcon getIcon(IBlockAccess w, int x, int y, int z, int s)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
return getIcon( s, 0 );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-02-09 02:34:52 +01:00
|
|
|
public IIcon getIcon(int direction, int metadata)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2014-02-09 02:34:52 +01:00
|
|
|
IIcon i = super.getIcon( direction, metadata );
|
2013-12-27 23:59:59 +01:00
|
|
|
if ( i != null )
|
|
|
|
return i;
|
|
|
|
|
2014-02-09 02:34:52 +01:00
|
|
|
return ExtraTextures.BlockQuartzGlassB.getIcon();
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected Class<? extends BaseBlockRender> getRenderer()
|
|
|
|
{
|
|
|
|
return RendererCableBus.class;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-02-09 02:34:52 +01:00
|
|
|
public void registerBlockIcons(IIconRegister iconRegistry)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canProvidePower()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-05-29 22:01:42 +02:00
|
|
|
public boolean isSideSolid(IBlockAccess w, int x, int y, int z, ForgeDirection side)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2014-05-29 22:01:42 +02:00
|
|
|
return cb( w, x, y, z ).isSolidOnSide( side );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
2014-06-26 04:19:20 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onNeighborBlockChange(World w, int x, int y, int z, Block meh)
|
|
|
|
{
|
|
|
|
cb( w, x, y, z ).onNeighborChanged();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onNeighborChange(IBlockAccess w, int x, int y, int z, int tileX, int tileY, int tileZ)
|
|
|
|
{
|
|
|
|
cb( w, x, y, z ).onNeighborChanged();
|
|
|
|
}
|
2013-12-27 23:59:59 +01:00
|
|
|
|
2014-01-01 07:30:52 +01:00
|
|
|
@Override
|
2014-02-09 02:34:52 +01:00
|
|
|
public Item getItemDropped(int i, Random r, int k)
|
2014-01-01 07:30:52 +01:00
|
|
|
{
|
2014-02-09 02:34:52 +01:00
|
|
|
return null;
|
2014-01-01 07:30:52 +01:00
|
|
|
}
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
@Override
|
2014-05-29 22:01:42 +02:00
|
|
|
public boolean onActivated(World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2014-06-13 19:42:09 +02:00
|
|
|
return cb( w, x, y, z ).activate( player, Vec3.createVectorHelper( hitX, hitY, hitZ ) );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-05-29 22:01:42 +02:00
|
|
|
public void onEntityCollidedWithBlock(World w, int x, int y, int z, Entity e)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2014-05-29 22:01:42 +02:00
|
|
|
cb( w, x, y, z ).onEntityCollision( e );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-05-29 22:01:42 +02:00
|
|
|
public boolean canConnectRedstone(IBlockAccess w, int x, int y, int z, int side)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2014-05-29 22:01:42 +02:00
|
|
|
switch (side)
|
2014-01-06 07:54:51 +01:00
|
|
|
{
|
2014-05-29 22:01:42 +02:00
|
|
|
case -1:
|
|
|
|
case 4:
|
|
|
|
return cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.UP, ForgeDirection.DOWN ) );
|
|
|
|
case 0:
|
|
|
|
return cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.NORTH ) );
|
|
|
|
case 1:
|
|
|
|
return cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.EAST ) );
|
|
|
|
case 2:
|
|
|
|
return cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.SOUTH ) );
|
|
|
|
case 3:
|
|
|
|
return cb( w, x, y, z ).canConnectRedstone( EnumSet.of( ForgeDirection.WEST ) );
|
2014-01-06 07:54:51 +01:00
|
|
|
}
|
|
|
|
return false;
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-05-29 22:01:42 +02:00
|
|
|
public int isProvidingWeakPower(IBlockAccess w, int x, int y, int z, int side)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2014-05-29 22:01:42 +02:00
|
|
|
return cb( w, x, y, z ).isProvidingWeakPower( ForgeDirection.getOrientation( side ).getOpposite() );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-05-29 22:01:42 +02:00
|
|
|
public int isProvidingStrongPower(IBlockAccess w, int x, int y, int z, int side)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2014-05-29 22:01:42 +02:00
|
|
|
return cb( w, x, y, z ).isProvidingStrongPower( ForgeDirection.getOrientation( side ).getOpposite() );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-02-09 02:34:52 +01:00
|
|
|
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setupTile()
|
|
|
|
{
|
2014-05-05 02:51:05 +02:00
|
|
|
setTileEntiy( noTesrTile = Api.instance.partHelper.getCombinedInstance( TileCableBus.class.getName() ) );
|
2014-01-28 20:27:22 +01:00
|
|
|
if ( Platform.isClient() )
|
2014-05-05 02:51:05 +02:00
|
|
|
{
|
|
|
|
tesrTile = Api.instance.partHelper.getCombinedInstance( TileCableBusTESR.class.getName() );
|
|
|
|
CommonHelper.proxy.bindTileEntitySpecialRenderer( tesrTile, this );
|
|
|
|
}
|
2014-01-20 17:41:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private ICableBusContainer cb(IBlockAccess w, int x, int y, int z)
|
|
|
|
{
|
2014-02-09 02:34:52 +01:00
|
|
|
TileEntity te = w.getTileEntity( x, y, z );
|
2014-05-25 06:55:13 +02:00
|
|
|
ICableBusContainer out = null;
|
|
|
|
|
2014-01-20 17:41:37 +01:00
|
|
|
if ( te instanceof TileCableBus )
|
2014-05-25 06:55:13 +02:00
|
|
|
out = ((TileCableBus) te).cb;
|
2014-01-20 17:41:37 +01:00
|
|
|
|
2014-05-25 06:55:13 +02:00
|
|
|
else if ( AppEng.instance.isIntegrationEnabled( "FMP" ) )
|
|
|
|
out = ((IFMP) AppEng.instance.getIntegration( "FMP" )).getCableContainer( te );
|
2014-01-20 17:41:37 +01:00
|
|
|
|
2014-05-25 06:55:13 +02:00
|
|
|
return out == null ? nullCB : out;
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
2014-03-22 22:51:37 +01:00
|
|
|
/**
|
|
|
|
* Immibis MB Support.
|
|
|
|
*/
|
|
|
|
boolean ImmibisMicroblocks_TransformableBlockMarker = true;
|
|
|
|
|
2014-06-26 04:19:20 +02:00
|
|
|
@Override
|
|
|
|
@Method(iname = "MFR")
|
|
|
|
public RedNetConnectionType getConnectionType(World world, int x, int y, int z, ForgeDirection side)
|
|
|
|
{
|
|
|
|
return cb( world, x, y, z ).canConnectRedstone( EnumSet.allOf( ForgeDirection.class ) ) ? RedNetConnectionType.CableSingle : RedNetConnectionType.None;
|
|
|
|
}
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|