Reimplemented cable and parts rendering.

This commit is contained in:
Sebastian Hartte
2016-08-29 09:47:17 +02:00
parent 0b756708d4
commit 7e027da804
358 changed files with 5964 additions and 1901 deletions
@@ -45,6 +45,7 @@ import appeng.api.util.AECableType;
import appeng.api.util.AEColor;
import appeng.api.util.AEPartLocation;
import appeng.api.util.DimensionalCoord;
import appeng.block.networking.BlockCableBus;
import appeng.helpers.AEMultiTile;
import appeng.helpers.ICustomCollision;
import appeng.hooks.TickHandler;
@@ -89,9 +90,30 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
this.worldObj.checkLight( this.pos );
}
this.updateTileSetting();
return ret;
}
/**
* Changes this tile to the TESR version if any of the parts require dynamic rendering.
*/
protected void updateTileSetting()
{
if( this.getCableBus().isRequiresDynamicRender() )
{
try
{
final TileCableBus tcb = (TileCableBus) BlockCableBus.getTesrTile().newInstance();
tcb.copyFrom( this );
this.getWorld().setTileEntity( pos, tcb );
}
catch( final Throwable ignored )
{
}
}
}
protected void copyFrom( final TileCableBus oldTile )
{
final CableBusContainer tmpCB = this.getCableBus();