Fixes #663 NPE on disabled Facades

This commit is contained in:
thatsIch
2014-12-30 22:42:25 +01:00
parent 97dabc4a5c
commit ada69b9a95
2 changed files with 34 additions and 18 deletions
@@ -55,7 +55,7 @@ public class FacadeContainer implements IFacadeContainer
for (int x = 0; x < this.facades; x++)
{
if ( this.getFacade( ForgeDirection.getOrientation( x ) ) != null )
facadeSides = facadeSides | (1 << x);
facadeSides |= ( 1 << x );
}
out.writeByte( (byte) facadeSides );
@@ -79,7 +79,7 @@ public class FacadeContainer implements IFacadeContainer
boolean changed = false;
int ids[] = new int[2];
int[] ids = new int[2];
for (int x = 0; x < this.facades; x++)
{
ForgeDirection side = ForgeDirection.getOrientation( x );
@@ -205,7 +205,7 @@ public class FacadeContainer implements IFacadeContainer
@Override
public void rotateLeft()
{
IFacadePart newFacades[] = new FacadePart[6];
IFacadePart[] newFacades = new FacadePart[6];
newFacades[ForgeDirection.UP.ordinal()] = this.storage.getFacade( ForgeDirection.UP.ordinal() );
newFacades[ForgeDirection.DOWN.ordinal()] = this.storage.getFacade( ForgeDirection.DOWN.ordinal() );