changing facades now updates the world render.
This commit is contained in:
@@ -49,6 +49,8 @@ public class FacadeContainer implements IFacadeContainer
|
|||||||
{
|
{
|
||||||
int facadeSides = out.readByte();
|
int facadeSides = out.readByte();
|
||||||
|
|
||||||
|
boolean changed = false;
|
||||||
|
|
||||||
int ids[] = new int[2];
|
int ids[] = new int[2];
|
||||||
for (int x = 0; x < facades.length; x++)
|
for (int x = 0; x < facades.length; x++)
|
||||||
{
|
{
|
||||||
@@ -64,6 +66,7 @@ public class FacadeContainer implements IFacadeContainer
|
|||||||
if ( isBC && AppEng.instance.isIntegrationEnabled( "BC" ) )
|
if ( isBC && AppEng.instance.isIntegrationEnabled( "BC" ) )
|
||||||
{
|
{
|
||||||
IBC bc = (IBC) AppEng.instance.getIntegration( "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 );
|
facades[x] = bc.createFacadePart( (Block) Block.blockRegistry.getObjectById( ids[0] ), ids[1], side );
|
||||||
}
|
}
|
||||||
else if ( !isBC )
|
else if ( !isBC )
|
||||||
@@ -71,13 +74,20 @@ public class FacadeContainer implements IFacadeContainer
|
|||||||
ItemFacade ifa = (ItemFacade) AEApi.instance().items().itemFacade.item();
|
ItemFacade ifa = (ItemFacade) AEApi.instance().items().itemFacade.item();
|
||||||
ItemStack facade = ifa.createFromInts( ids );
|
ItemStack facade = ifa.createFromInts( ids );
|
||||||
if ( facade != null )
|
if ( facade != null )
|
||||||
|
{
|
||||||
|
changed = changed || facades[x] == null;
|
||||||
facades[x] = ifa.createPartFromItemStack( facade, side );
|
facades[x] = ifa.createPartFromItemStack( facade, side );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
changed = changed || facades[x] != null;
|
||||||
facades[x] = null;
|
facades[x] = null;
|
||||||
}
|
}
|
||||||
return false;
|
}
|
||||||
|
|
||||||
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void readFromNBT(NBTTagCompound c)
|
public void readFromNBT(NBTTagCompound c)
|
||||||
@@ -160,4 +170,20 @@ public class FacadeContainer implements IFacadeContainer
|
|||||||
return false;
|
return false;
|
||||||
return true;
|
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];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,6 +79,23 @@ public class CableBusContainer implements AEMultiTile, ICableBusContainer
|
|||||||
return sides[side.ordinal()];
|
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()
|
public void updateDynamicRender()
|
||||||
{
|
{
|
||||||
requiresDynamicRender = false;
|
requiresDynamicRender = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user