diff --git a/core/src/io/anuke/mindustry/graphics/BlockRenderer.java b/core/src/io/anuke/mindustry/graphics/BlockRenderer.java index 299e249553..ca3aadd9c9 100644 --- a/core/src/io/anuke/mindustry/graphics/BlockRenderer.java +++ b/core/src/io/anuke/mindustry/graphics/BlockRenderer.java @@ -60,7 +60,7 @@ public class BlockRenderer{ public void drawShadows(){ if(disableShadows) return; - if(shadows.getWidth() != Core.graphics.getWidth() || shadows.getHeight() != Core.graphics.getHeight()){ + if(!Core.graphics.isHidden() && (shadows.getWidth() != Core.graphics.getWidth() || shadows.getHeight() != Core.graphics.getHeight())){ shadows.resize(Core.graphics.getWidth(), Core.graphics.getHeight()); } diff --git a/core/src/io/anuke/mindustry/input/InputHandler.java b/core/src/io/anuke/mindustry/input/InputHandler.java index c5b54dcb7d..64deb53103 100644 --- a/core/src/io/anuke/mindustry/input/InputHandler.java +++ b/core/src/io/anuke/mindustry/input/InputHandler.java @@ -130,14 +130,6 @@ public abstract class InputHandler implements InputProcessor{ return Core.input.mouseY(); } - public void resetCursor(){ - - } - - public boolean isCursorVisible(){ - return false; - } - public void buildUI(Table table){ } @@ -162,7 +154,7 @@ public abstract class InputHandler implements InputProcessor{ boolean tileTapped(Tile tile){ tile = tile.target(); - boolean consumed = false, showedInventory = false, showedConsume = false; + boolean consumed = false, showedInventory = false; //check if tapped block is configurable if(tile.block().configurable && tile.getTeam() == player.getTeam()){ @@ -329,12 +321,8 @@ public abstract class InputHandler implements InputProcessor{ } public boolean validPlace(int x, int y, Block type, int rotation){ - for(Tile tile : state.teams.get(player.getTeam()).cores){ - return Build.validPlace(player.getTeam(), x, y, type, rotation) && - Mathf.dst(player.x, player.y, x * tilesize, y * tilesize) < Player.placeDistance; - } - - return false; + return Build.validPlace(player.getTeam(), x, y, type, rotation) && + Mathf.dst(player.x, player.y, x * tilesize, y * tilesize) < Player.placeDistance; } public boolean validBreak(int x, int y){ diff --git a/core/src/io/anuke/mindustry/type/Item.java b/core/src/io/anuke/mindustry/type/Item.java index b4e461d4ff..47bf130f3e 100644 --- a/core/src/io/anuke/mindustry/type/Item.java +++ b/core/src/io/anuke/mindustry/type/Item.java @@ -30,7 +30,7 @@ public class Item extends UnlockableContent implements Comparable{ public float fluxiness = 0f; /**drill hardness of the item*/ public int hardness = 0; - /**the burning color of this item*/ + /**the burning color of this item. TODO unused; implement*/ public Color flameColor = Palette.darkFlame.cpy(); /** * base material cost of this item, used for calculating place times @@ -49,7 +49,7 @@ public class Item extends UnlockableContent implements Comparable{ if(!Core.bundle.has("item." + this.name + ".name")){ Log.err("Warning: item '" + name + "' is missing a localized name. Add the following to bundle.properties:"); - Log.err("item." + this.name + ".name=" + Strings.capitalize(name.replace('-', '_'))); + Log.err("item." + this.name + ".name = " + Strings.capitalize(name.replace('-', '_'))); } } @@ -97,11 +97,8 @@ public class Item extends UnlockableContent implements Comparable{ return ContentType.item; } + /**Allocates a new array containing all items the generate ores.*/ public static Array getAllOres(){ - Array arr = new Array<>(); - for(Item item : Vars.content.items()){ - if(item.genOre) arr.add(item); - } - return arr; + return Vars.content.items().select(i -> i.genOre); } }