Optimized shadows
This commit is contained in:
@@ -181,7 +181,7 @@ public class Renderer extends RendererModule{
|
||||
if(World.tile(worldx, worldy) != null){
|
||||
Tile tile = World.tile(worldx, worldy);
|
||||
if(l == 0){
|
||||
if(tile.block() != Blocks.air){
|
||||
if(tile.block() != Blocks.air && World.isAccessible(worldx, worldy)){
|
||||
Draw.rect(tile.block().shadow, worldx * tilesize, worldy * tilesize);
|
||||
}
|
||||
}else if(l == 1){
|
||||
|
||||
@@ -41,6 +41,15 @@ public class World{
|
||||
return tile == null || tile.block().solid || (tile.floor().solid && (tile.block() == Blocks.air));
|
||||
}
|
||||
|
||||
public static boolean wallSolid(int x, int y){
|
||||
Tile tile = tile(x, y);
|
||||
return tile == null || tile.block().solid;
|
||||
}
|
||||
|
||||
public static boolean isAccessible(int x, int y){
|
||||
return !wallSolid(x, y-1) || !wallSolid(x, y+1) || !wallSolid(x-1, y) ||!wallSolid(x+1, y);
|
||||
}
|
||||
|
||||
public static int getMap(){
|
||||
return currentMap;
|
||||
}
|
||||
|
||||
@@ -117,9 +117,12 @@ public class ProductionBlocks{
|
||||
{
|
||||
formalName = "coal extractor";
|
||||
input = Item.stone;
|
||||
inputAmount = 5;
|
||||
inputLiquid = Liquid.water;
|
||||
liquidAmount = 19.99f;
|
||||
output = Item.coal;
|
||||
health = 50;
|
||||
purifyTime = 80;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,7 +17,7 @@ public class Purifier extends Conduit{
|
||||
public Liquid inputLiquid = null;
|
||||
public float liquidAmount = 19.99f;
|
||||
public Item output = null;
|
||||
public int itemCapacity = 100;
|
||||
public int itemCapacity = 90;
|
||||
public int purifyTime = 80;
|
||||
|
||||
public Purifier(String name) {
|
||||
|
||||
Reference in New Issue
Block a user