This commit is contained in:
Anuken
2020-03-05 18:05:59 -05:00
parent 2dfbbdfd5b
commit 5a0d079a78
62 changed files with 1296 additions and 1352 deletions

View File

@@ -13,7 +13,6 @@ import mindustry.game.EventType.*;
import mindustry.game.Teams.*;
import mindustry.ui.*;
import mindustry.world.*;
import mindustry.world.blocks.*;
import static arc.Core.camera;
import static mindustry.Vars.*;
@@ -199,15 +198,14 @@ public class BlockRenderer implements Disposable{
for(int y = miny; y <= maxy; y++){
boolean expanded = (Math.abs(x - avgx) > rangex || Math.abs(y - avgy) > rangey);
Tile tile = world.rawTile(x, y);
if(tile == null) continue; //how is this possible?
Block block = tile.block();
if(block != Blocks.air && block.cacheLayer == CacheLayer.normal){
if(block != Blocks.air && tile.isCenter() && block.cacheLayer == CacheLayer.normal){
if(!expanded){
addRequest(tile, Layer.block);
}
if(state.rules.lighting && tile.block().synthetic() && !(tile.block() instanceof BlockPart)){
if(state.rules.lighting && tile.block().synthetic()){
addRequest(tile, Layer.lights);
}

View File

@@ -143,7 +143,7 @@ public class OverlayRenderer{
Draw.reset();
Tile tile = world.ltileWorld(v.x, v.y);
if(tile != null && tile.interactable(player.team()) && tile.block().acceptStack(player.unit().item(), player.unit().stack().amount, tile, player.unit()) > 0){
if(tile != null && tile.interactable(player.team()) && tile.block().acceptStack(tile, player.unit().item(), player.unit().stack().amount, player.unit()) > 0){
Lines.stroke(3f, Pal.gray);
Lines.square(tile.drawx(), tile.drawy(), tile.block().size * tilesize / 2f + 3 + Mathf.absin(Time.time(), 5f, 1f));
Lines.stroke(1f, Pal.place);