|
|
|
@ -99,16 +99,16 @@ public class Block { |
|
|
|
|
Block b = SigRenderer.blockGrid.get(key); |
|
|
|
|
if (SigRenderer.blockGrid.containsKey(key)) { |
|
|
|
|
if (b.block instanceof Staircase && block instanceof Staircase) { |
|
|
|
|
neighbors.UP=true; |
|
|
|
|
neighbors.UP=block.triangles.get(Texture.TOP).tex.hasTransparency==b.block.triangles.get(Texture.BOTTOM).tex.hasTransparency&&block.triangles.get(Texture.TOP).tex.hasTranslucency==b.block.triangles.get(Texture.BOTTOM).tex.hasTranslucency; |
|
|
|
|
b.neighbors.DOWN=false; |
|
|
|
|
} else |
|
|
|
|
if ((b.block instanceof Cube && block instanceof Staircase)||(b.block instanceof Staircase && block instanceof Cube)) { |
|
|
|
|
Block staircase = (b.block instanceof Staircase)?b:this; |
|
|
|
|
|
|
|
|
|
if (b.equals(staircase)) { |
|
|
|
|
neighbors.UP=b.neighbors.DOWN=true; |
|
|
|
|
neighbors.UP=b.neighbors.DOWN=block.triangles.get(Texture.TOP).tex.hasTransparency==b.block.triangles.get(Texture.BOTTOM).tex.hasTransparency&&block.triangles.get(Texture.TOP).tex.hasTranslucency==b.block.triangles.get(Texture.BOTTOM).tex.hasTranslucency; |
|
|
|
|
} else { |
|
|
|
|
neighbors.UP=true; |
|
|
|
|
neighbors.UP=block.triangles.get(Texture.TOP).tex.hasTransparency==b.block.triangles.get(Texture.BOTTOM).tex.hasTransparency&&block.triangles.get(Texture.TOP).tex.hasTranslucency==b.block.triangles.get(Texture.BOTTOM).tex.hasTranslucency; |
|
|
|
|
b.neighbors.DOWN=false; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
@ -120,7 +120,7 @@ public class Block { |
|
|
|
|
if (SigRenderer.blockGrid.containsKey(key)) { |
|
|
|
|
if (b.block instanceof Staircase && block instanceof Staircase) { |
|
|
|
|
neighbors.DOWN=false; |
|
|
|
|
b.neighbors.UP=true; |
|
|
|
|
b.neighbors.UP=block.triangles.get(Texture.BOTTOM).tex.hasTransparency==b.block.triangles.get(Texture.TOP).tex.hasTransparency&&block.triangles.get(Texture.BOTTOM).tex.hasTranslucency==b.block.triangles.get(Texture.TOP).tex.hasTranslucency; |
|
|
|
|
} else |
|
|
|
|
if ((b.block instanceof Cube && block instanceof Staircase)||(b.block instanceof Staircase && block instanceof Cube)) { |
|
|
|
|
Block staircase = (b.block instanceof Staircase)?b:this; |
|
|
|
@ -129,7 +129,7 @@ public class Block { |
|
|
|
|
neighbors.DOWN=b.neighbors.UP=false; |
|
|
|
|
} else { |
|
|
|
|
neighbors.DOWN=false; |
|
|
|
|
b.neighbors.UP=true; |
|
|
|
|
b.neighbors.UP=block.triangles.get(Texture.BOTTOM).tex.hasTransparency==b.block.triangles.get(Texture.TOP).tex.hasTransparency&&block.triangles.get(Texture.BOTTOM).tex.hasTranslucency==b.block.triangles.get(Texture.TOP).tex.hasTranslucency; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
neighbors.DOWN=b.neighbors.UP=block.triangles.get(Texture.BOTTOM).tex.hasTransparency==b.block.triangles.get(Texture.TOP).tex.hasTransparency&&block.triangles.get(Texture.BOTTOM).tex.hasTranslucency==b.block.triangles.get(Texture.TOP).tex.hasTranslucency; |
|
|
|
@ -140,17 +140,19 @@ public class Block { |
|
|
|
|
if (SigRenderer.blockGrid.containsKey(key)) { |
|
|
|
|
if (b.block instanceof Staircase && block instanceof Staircase) { |
|
|
|
|
neighbors.LEFT=b.neighbors.RIGHT= |
|
|
|
|
FacingDirection.isFacingAwayFromEachOther(this,b)|| |
|
|
|
|
(FacingDirection.isFacingAwayFromEachOther(this,b)|| |
|
|
|
|
(FacingDirection.isFacingEachOther(this,b)|| |
|
|
|
|
(b.getFacingDirection()==getFacingDirection()&&b.getFacingDirection().ordinal()%2==0)); |
|
|
|
|
(b.getFacingDirection()==getFacingDirection()&&b.getFacingDirection().ordinal()%2==0)))&& |
|
|
|
|
block.triangles.get(Texture.WEST).tex.hasTransparency==b.block.triangles.get(Texture.EAST).tex.hasTransparency&&block.triangles.get(Texture.WEST).tex.hasTranslucency==b.block.triangles.get(Texture.EAST).tex.hasTranslucency;; |
|
|
|
|
} else |
|
|
|
|
if ((b.block instanceof Cube && block instanceof Staircase)||(b.block instanceof Staircase && block instanceof Cube)) { |
|
|
|
|
Block cubeBlock = (b.block instanceof Cube)?b:this; |
|
|
|
|
Block staircase = (b.block instanceof Staircase)?b:this; |
|
|
|
|
|
|
|
|
|
neighbors.LEFT=b.neighbors.RIGHT= |
|
|
|
|
(b.equals(staircase)&&staircase.getFacingDirection()==FacingDirection.EAST)|| |
|
|
|
|
(b.equals(cubeBlock)&&staircase.getFacingDirection()==FacingDirection.WEST); |
|
|
|
|
((b.equals(staircase)&&staircase.getFacingDirection()==FacingDirection.EAST)|| |
|
|
|
|
(b.equals(cubeBlock)&&staircase.getFacingDirection()==FacingDirection.WEST))&& |
|
|
|
|
block.triangles.get(Texture.WEST).tex.hasTransparency==b.block.triangles.get(Texture.EAST).tex.hasTransparency&&block.triangles.get(Texture.WEST).tex.hasTranslucency==b.block.triangles.get(Texture.EAST).tex.hasTranslucency; |
|
|
|
|
} else { |
|
|
|
|
neighbors.LEFT=b.neighbors.RIGHT=block.triangles.get(Texture.WEST).tex.hasTransparency==b.block.triangles.get(Texture.EAST).tex.hasTransparency&&block.triangles.get(Texture.WEST).tex.hasTranslucency==b.block.triangles.get(Texture.EAST).tex.hasTranslucency; |
|
|
|
|
} |
|
|
|
@ -160,17 +162,19 @@ public class Block { |
|
|
|
|
if (SigRenderer.blockGrid.containsKey(key)) { |
|
|
|
|
if (b.block instanceof Staircase && block instanceof Staircase) { |
|
|
|
|
neighbors.RIGHT=b.neighbors.LEFT= |
|
|
|
|
FacingDirection.isFacingAwayFromEachOther(this,b)|| |
|
|
|
|
(FacingDirection.isFacingAwayFromEachOther(this,b)|| |
|
|
|
|
(FacingDirection.isFacingEachOther(this,b)|| |
|
|
|
|
(b.getFacingDirection()==getFacingDirection()&&b.getFacingDirection().ordinal()%2==0)); |
|
|
|
|
(b.getFacingDirection()==getFacingDirection()&&b.getFacingDirection().ordinal()%2==0)))&& |
|
|
|
|
block.triangles.get(Texture.EAST).tex.hasTransparency==b.block.triangles.get(Texture.WEST).tex.hasTransparency&&block.triangles.get(Texture.EAST).tex.hasTranslucency==b.block.triangles.get(Texture.WEST).tex.hasTranslucency; |
|
|
|
|
} else |
|
|
|
|
if ((b.block instanceof Cube && block instanceof Staircase)||(b.block instanceof Staircase && block instanceof Cube)) { |
|
|
|
|
Block cubeBlock = (b.block instanceof Cube)?b:this; |
|
|
|
|
Block staircase = (b.block instanceof Staircase)?b:this; |
|
|
|
|
|
|
|
|
|
neighbors.RIGHT=b.neighbors.LEFT= |
|
|
|
|
(b.equals(staircase)&&staircase.getFacingDirection()==FacingDirection.WEST)|| |
|
|
|
|
(b.equals(cubeBlock)&&staircase.getFacingDirection()==FacingDirection.EAST); |
|
|
|
|
((b.equals(staircase)&&staircase.getFacingDirection()==FacingDirection.WEST)|| |
|
|
|
|
(b.equals(cubeBlock)&&staircase.getFacingDirection()==FacingDirection.EAST))&& |
|
|
|
|
block.triangles.get(Texture.EAST).tex.hasTransparency==b.block.triangles.get(Texture.WEST).tex.hasTransparency&&block.triangles.get(Texture.EAST).tex.hasTranslucency==b.block.triangles.get(Texture.WEST).tex.hasTranslucency; |
|
|
|
|
} else { |
|
|
|
|
neighbors.RIGHT=b.neighbors.LEFT=block.triangles.get(Texture.EAST).tex.hasTransparency==b.block.triangles.get(Texture.WEST).tex.hasTransparency&&block.triangles.get(Texture.EAST).tex.hasTranslucency==b.block.triangles.get(Texture.WEST).tex.hasTranslucency; |
|
|
|
|
} |
|
|
|
@ -180,17 +184,19 @@ public class Block { |
|
|
|
|
if (SigRenderer.blockGrid.containsKey(key)) { |
|
|
|
|
if (b.block instanceof Staircase && block instanceof Staircase) { |
|
|
|
|
neighbors.FORWARD=b.neighbors.BACKWARD= |
|
|
|
|
FacingDirection.isFacingAwayFromEachOther(this,b)|| |
|
|
|
|
(FacingDirection.isFacingAwayFromEachOther(this,b)|| |
|
|
|
|
(FacingDirection.isFacingEachOther(this,b)|| |
|
|
|
|
(b.getFacingDirection()==getFacingDirection()&&b.getFacingDirection().ordinal()%2==1)); |
|
|
|
|
(b.getFacingDirection()==getFacingDirection()&&b.getFacingDirection().ordinal()%2==1)))&& |
|
|
|
|
block.triangles.get(Texture.SOUTH).tex.hasTransparency==b.block.triangles.get(Texture.NORTH).tex.hasTransparency&&block.triangles.get(Texture.SOUTH).tex.hasTranslucency==b.block.triangles.get(Texture.NORTH).tex.hasTranslucency; |
|
|
|
|
} else |
|
|
|
|
if ((b.block instanceof Cube && block instanceof Staircase)||(b.block instanceof Staircase && block instanceof Cube)) { |
|
|
|
|
Block cubeBlock = (b.block instanceof Cube)?b:this; |
|
|
|
|
Block staircase = (b.block instanceof Staircase)?b:this; |
|
|
|
|
|
|
|
|
|
neighbors.FORWARD=b.neighbors.BACKWARD= |
|
|
|
|
(b.equals(staircase)&&staircase.getFacingDirection()==FacingDirection.NORTH)|| |
|
|
|
|
(b.equals(cubeBlock)&&staircase.getFacingDirection()==FacingDirection.SOUTH); |
|
|
|
|
((b.equals(staircase)&&staircase.getFacingDirection()==FacingDirection.NORTH)|| |
|
|
|
|
(b.equals(cubeBlock)&&staircase.getFacingDirection()==FacingDirection.SOUTH))&& |
|
|
|
|
block.triangles.get(Texture.SOUTH).tex.hasTransparency==b.block.triangles.get(Texture.NORTH).tex.hasTransparency&&block.triangles.get(Texture.SOUTH).tex.hasTranslucency==b.block.triangles.get(Texture.NORTH).tex.hasTranslucency; |
|
|
|
|
} else { |
|
|
|
|
neighbors.FORWARD=b.neighbors.BACKWARD=block.triangles.get(Texture.SOUTH).tex.hasTransparency==b.block.triangles.get(Texture.NORTH).tex.hasTransparency&&block.triangles.get(Texture.SOUTH).tex.hasTranslucency==b.block.triangles.get(Texture.NORTH).tex.hasTranslucency; |
|
|
|
|
} |
|
|
|
@ -200,17 +206,19 @@ public class Block { |
|
|
|
|
if (SigRenderer.blockGrid.containsKey(key)) { |
|
|
|
|
if (b.block instanceof Staircase && block instanceof Staircase) { |
|
|
|
|
neighbors.BACKWARD=b.neighbors.FORWARD= |
|
|
|
|
FacingDirection.isFacingAwayFromEachOther(this,b)|| |
|
|
|
|
(FacingDirection.isFacingAwayFromEachOther(this,b)|| |
|
|
|
|
(FacingDirection.isFacingEachOther(this,b)|| |
|
|
|
|
(b.getFacingDirection()==getFacingDirection()&&b.getFacingDirection().ordinal()%2==1)); |
|
|
|
|
(b.getFacingDirection()==getFacingDirection()&&b.getFacingDirection().ordinal()%2==1)))&& |
|
|
|
|
block.triangles.get(Texture.NORTH).tex.hasTransparency==b.block.triangles.get(Texture.SOUTH).tex.hasTransparency&&block.triangles.get(Texture.NORTH).tex.hasTranslucency==b.block.triangles.get(Texture.SOUTH).tex.hasTranslucency; |
|
|
|
|
} else |
|
|
|
|
if ((b.block instanceof Cube && block instanceof Staircase)||(b.block instanceof Staircase && block instanceof Cube)) { |
|
|
|
|
Block cubeBlock = (b.block instanceof Cube)?b:this; |
|
|
|
|
Block staircase = (b.block instanceof Staircase)?b:this; |
|
|
|
|
|
|
|
|
|
neighbors.BACKWARD=b.neighbors.FORWARD= |
|
|
|
|
(b.equals(staircase)&&staircase.getFacingDirection()==FacingDirection.SOUTH)|| |
|
|
|
|
(b.equals(cubeBlock)&&staircase.getFacingDirection()==FacingDirection.NORTH); |
|
|
|
|
((b.equals(staircase)&&staircase.getFacingDirection()==FacingDirection.SOUTH)|| |
|
|
|
|
(b.equals(cubeBlock)&&staircase.getFacingDirection()==FacingDirection.NORTH))&& |
|
|
|
|
block.triangles.get(Texture.NORTH).tex.hasTransparency==b.block.triangles.get(Texture.SOUTH).tex.hasTransparency&&block.triangles.get(Texture.NORTH).tex.hasTranslucency==b.block.triangles.get(Texture.SOUTH).tex.hasTranslucency; |
|
|
|
|
} else { |
|
|
|
|
neighbors.BACKWARD=b.neighbors.FORWARD=block.triangles.get(Texture.NORTH).tex.hasTransparency==b.block.triangles.get(Texture.SOUTH).tex.hasTransparency&&block.triangles.get(Texture.NORTH).tex.hasTranslucency==b.block.triangles.get(Texture.SOUTH).tex.hasTranslucency; |
|
|
|
|
} |
|
|
|
|