changing facades now updates the world render.

This commit is contained in:
AlgorithmX2 2014-05-11 11:30:00 -05:00
parent 9ad9c7b370
commit f7e638c172
2 changed files with 44 additions and 1 deletions

View file

@ -49,6 +49,8 @@ public class FacadeContainer implements IFacadeContainer
{
int facadeSides = out.readByte();
boolean changed = false;
int ids[] = new int[2];
for (int x = 0; x < facades.length; x++)
{
@ -64,6 +66,7 @@ public class FacadeContainer implements IFacadeContainer
if ( isBC && AppEng.instance.isIntegrationEnabled( "BC" ) )
{
IBC bc = (IBC) AppEng.instance.getIntegration( "BC" );
changed = changed || facades[x] == null;
facades[x] = bc.createFacadePart( (Block) Block.blockRegistry.getObjectById( ids[0] ), ids[1], side );
}
else if ( !isBC )
@ -71,13 +74,20 @@ public class FacadeContainer implements IFacadeContainer
ItemFacade ifa = (ItemFacade) AEApi.instance().items().itemFacade.item();
ItemStack facade = ifa.createFromInts( ids );
if ( facade != null )
{
changed = changed || facades[x] == null;
facades[x] = ifa.createPartFromItemStack( facade, side );
}
}
}
else
{
changed = changed || facades[x] != null;
facades[x] = null;
}
}
return false;
return changed;
}
public void readFromNBT(NBTTagCompound c)
@ -160,4 +170,20 @@ public class FacadeContainer implements IFacadeContainer
return false;
return true;
}
public void rotateLeft()
{
IFacadePart newfacades[] = new FacadePart[6];
newfacades[ForgeDirection.UP.ordinal()] = facades[ForgeDirection.UP.ordinal()];
newfacades[ForgeDirection.DOWN.ordinal()] = facades[ForgeDirection.DOWN.ordinal()];
newfacades[ForgeDirection.EAST.ordinal()] = facades[ForgeDirection.NORTH.ordinal()];
newfacades[ForgeDirection.SOUTH.ordinal()] = facades[ForgeDirection.EAST.ordinal()];
newfacades[ForgeDirection.WEST.ordinal()] = facades[ForgeDirection.SOUTH.ordinal()];
newfacades[ForgeDirection.NORTH.ordinal()] = facades[ForgeDirection.WEST.ordinal()];
for (int x = 0; x < facades.length; x++)
facades[x] = newfacades[x];
}
}

View file

@ -79,6 +79,23 @@ public class CableBusContainer implements AEMultiTile, ICableBusContainer
return sides[side.ordinal()];
}
public void rotateLeft()
{
IPart newSides[] = new IPart[6];
newSides[ForgeDirection.UP.ordinal()] = sides[ForgeDirection.UP.ordinal()];
newSides[ForgeDirection.DOWN.ordinal()] = sides[ForgeDirection.DOWN.ordinal()];
newSides[ForgeDirection.EAST.ordinal()] = sides[ForgeDirection.NORTH.ordinal()];
newSides[ForgeDirection.SOUTH.ordinal()] = sides[ForgeDirection.EAST.ordinal()];
newSides[ForgeDirection.WEST.ordinal()] = sides[ForgeDirection.SOUTH.ordinal()];
newSides[ForgeDirection.NORTH.ordinal()] = sides[ForgeDirection.WEST.ordinal()];
sides = newSides;
fc.rotateLeft();
}
public void updateDynamicRender()
{
requiresDynamicRender = false;