diff --git a/core/src/io/anuke/mindustry/content/blocks/DefenseBlocks.java b/core/src/io/anuke/mindustry/content/blocks/DefenseBlocks.java index 109386ab58..27dfe4a4c6 100644 --- a/core/src/io/anuke/mindustry/content/blocks/DefenseBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/DefenseBlocks.java @@ -80,7 +80,7 @@ public class DefenseBlocks extends BlockList implements ContentList{ shockMine = new ShockMine("shock-mine"){{ health = 40; damage = 11; - tileDamage = 6f; + tileDamage = 7f; length = 10; tendrils = 5; }}; diff --git a/core/src/io/anuke/mindustry/core/Logic.java b/core/src/io/anuke/mindustry/core/Logic.java index dea47a7e3d..e2ef5c2ecf 100644 --- a/core/src/io/anuke/mindustry/core/Logic.java +++ b/core/src/io/anuke/mindustry/core/Logic.java @@ -158,5 +158,9 @@ public class Logic extends Module{ world.pathfinder().update(); } } + + if(threads.isEnabled()){ + netServer.update(); + } } } diff --git a/core/src/io/anuke/mindustry/core/NetClient.java b/core/src/io/anuke/mindustry/core/NetClient.java index 26523f4e59..434b7f258d 100644 --- a/core/src/io/anuke/mindustry/core/NetClient.java +++ b/core/src/io/anuke/mindustry/core/NetClient.java @@ -235,7 +235,7 @@ public class NetClient extends Module{ } //when all chunks have been recieved, begin - if(netClient.recievedChunkCounter >= totalChunks){ + if(netClient.recievedChunkCounter >= totalChunks && netClient.currentSnapshot != null){ snapshot = netClient.currentSnapshot; }else{ return; diff --git a/core/src/io/anuke/mindustry/core/NetServer.java b/core/src/io/anuke/mindustry/core/NetServer.java index 07d46c0587..3b3065398a 100644 --- a/core/src/io/anuke/mindustry/core/NetServer.java +++ b/core/src/io/anuke/mindustry/core/NetServer.java @@ -403,10 +403,12 @@ public class NetServer extends Module{ } public void update(){ + if(threads.isEnabled() && !threads.isOnThread()) return; + if(!headless && !closing && Net.server() && state.is(State.menu)){ closing = true; reset(); - ui.loadfrag.show("$text.server.closing"); + threads.runGraphics(() -> ui.loadfrag.show("$text.server.closing")); Timers.runTask(5f, () -> { Net.closeServer(); ui.loadfrag.hide(); diff --git a/core/src/io/anuke/mindustry/input/MobileInput.java b/core/src/io/anuke/mindustry/input/MobileInput.java index e2ad638d90..b56887d95d 100644 --- a/core/src/io/anuke/mindustry/input/MobileInput.java +++ b/core/src/io/anuke/mindustry/input/MobileInput.java @@ -15,6 +15,7 @@ import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.content.fx.Fx; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.entities.Player; +import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.entities.traits.TargetTrait; @@ -89,13 +90,14 @@ public class MobileInput extends InputHandler implements GestureListener{ Unit unit = Units.getClosestEnemy(player.getTeam(), x, y, 20f, u -> true); if(unit != null){ - player.target = unit; + threads.run(() -> player.target = unit); }else{ Tile tile = world.tileWorld(x, y); if(tile != null) tile = tile.target(); if(tile != null && state.teams.areEnemies(player.getTeam(), tile.getTeam())){ - player.target = tile.entity; + TileEntity entity = tile.entity; + threads.run(() -> player.target = entity); } } } diff --git a/core/src/io/anuke/mindustry/world/blocks/defense/ShockMine.java b/core/src/io/anuke/mindustry/world/blocks/defense/ShockMine.java index 64d07c870d..49b8bd986a 100644 --- a/core/src/io/anuke/mindustry/world/blocks/defense/ShockMine.java +++ b/core/src/io/anuke/mindustry/world/blocks/defense/ShockMine.java @@ -14,7 +14,7 @@ public class ShockMine extends Block{ protected int timerDamage = timers ++; protected float cooldown = 80f; - protected float tileDamage = 4f; + protected float tileDamage = 5f; protected float damage = 10; protected int length = 10; protected int tendrils = 6; diff --git a/core/src/io/anuke/mindustry/world/blocks/distribution/LiquidJunction.java b/core/src/io/anuke/mindustry/world/blocks/distribution/LiquidJunction.java index 82c5b18695..ac779754bc 100644 --- a/core/src/io/anuke/mindustry/world/blocks/distribution/LiquidJunction.java +++ b/core/src/io/anuke/mindustry/world/blocks/distribution/LiquidJunction.java @@ -41,7 +41,7 @@ public class LiquidJunction extends LiquidBlock{ public void handleLiquid(Tile tile, Tile source, Liquid liquid, float amount){ int dir = source.relativeTo(tile.x, tile.y); dir = (dir + 4) % 4; - Tile to = tile.getNearby(dir); + Tile to = tile.getNearby(dir).target(); if(to.block().hasLiquids && to.block().acceptLiquid(to, tile, liquid, Math.min(to.block().liquidCapacity - to.entity.liquids.get(liquid) - 0.00001f, amount))){ to.block().handleLiquid(to, tile, liquid, Math.min(to.block().liquidCapacity - to.entity.liquids.get(liquid) - 0.00001f, amount)); @@ -53,6 +53,8 @@ public class LiquidJunction extends LiquidBlock{ int dir = source.relativeTo(dest.x, dest.y); dir = (dir + 4) % 4; Tile to = dest.getNearby(dir); - return to != null && to.block().hasLiquids && to.block().acceptLiquid(to, dest, liquid, Math.min(to.block().liquidCapacity - to.entity.liquids.get(liquid) - 0.00001f, amount)); + if(to == null) return false; + to = to.target(); + return to != null && to.entity != null && to.block().hasLiquids && to.block().acceptLiquid(to, dest, liquid, Math.min(to.block().liquidCapacity - to.entity.liquids.get(liquid) - 0.00001f, amount)); } }