diff --git a/core/src/io/anuke/mindustry/core/Control.java b/core/src/io/anuke/mindustry/core/Control.java index 43b8eef8c4..96f20b1715 100644 --- a/core/src/io/anuke/mindustry/core/Control.java +++ b/core/src/io/anuke/mindustry/core/Control.java @@ -123,7 +123,7 @@ public class Control implements ApplicationListener{ } }); - //autohost for pvp sectors + //autohost for pvp maps Events.on(WorldLoadEvent.class, event -> { if(state.rules.pvp && !Net.active()){ try{ diff --git a/core/src/io/anuke/mindustry/core/World.java b/core/src/io/anuke/mindustry/core/World.java index 9b84e1c38c..1645d4b70b 100644 --- a/core/src/io/anuke/mindustry/core/World.java +++ b/core/src/io/anuke/mindustry/core/World.java @@ -85,13 +85,11 @@ public class World implements ApplicationListener{ return tiles == null ? 0 : tiles[0].length; } - public @Nullable - Tile tile(int pos){ + public @Nullable Tile tile(int pos){ return tiles == null ? null : tile(Pos.x(pos), Pos.y(pos)); } - public @Nullable - Tile tile(int x, int y){ + public @Nullable Tile tile(int x, int y){ if(tiles == null){ return null; } @@ -103,8 +101,7 @@ public class World implements ApplicationListener{ return tiles[x][y]; } - public @Nullable - Tile tileWorld(float x, float y){ + public @Nullable Tile tileWorld(float x, float y){ return tile(Math.round(x / tilesize), Math.round(y / tilesize)); } diff --git a/core/src/io/anuke/mindustry/entities/traits/Entity.java b/core/src/io/anuke/mindustry/entities/traits/Entity.java index dad04a15d6..a98257cf77 100644 --- a/core/src/io/anuke/mindustry/entities/traits/Entity.java +++ b/core/src/io/anuke/mindustry/entities/traits/Entity.java @@ -21,7 +21,9 @@ public interface Entity extends MoveTrait{ @SuppressWarnings("unchecked") default void add(){ - targetGroup().add(this); + if(targetGroup() != null){ + targetGroup().add(this); + } } @SuppressWarnings("unchecked") diff --git a/core/src/io/anuke/mindustry/net/CrashSender.java b/core/src/io/anuke/mindustry/net/CrashSender.java index 50c2ad059d..b6e37c0dec 100644 --- a/core/src/io/anuke/mindustry/net/CrashSender.java +++ b/core/src/io/anuke/mindustry/net/CrashSender.java @@ -122,7 +122,6 @@ public class CrashSender{ } } - private static String parseException(Throwable e){ StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); diff --git a/core/src/io/anuke/mindustry/world/modules/PowerModule.java b/core/src/io/anuke/mindustry/world/modules/PowerModule.java index a51e469064..ad82a5aedb 100644 --- a/core/src/io/anuke/mindustry/world/modules/PowerModule.java +++ b/core/src/io/anuke/mindustry/world/modules/PowerModule.java @@ -1,10 +1,11 @@ package io.anuke.mindustry.world.modules; -import io.anuke.annotations.Annotations.NonNull; import io.anuke.arc.collection.IntArray; import io.anuke.mindustry.world.blocks.power.PowerGraph; -import java.io.*; +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; public class PowerModule extends BlockModule{ /** @@ -13,10 +14,7 @@ public class PowerModule extends BlockModule{ * In case of buffered consumers, this is the percentage of power stored in relation to the maximum capacity. */ public float satisfaction = 0.0f; - /** Specifies power which is required additionally, e.g. while a force projector is being shot at. */ - public float extraUse = 0f; - public @NonNull - PowerGraph graph = new PowerGraph(); + public PowerGraph graph = new PowerGraph(); public IntArray links = new IntArray(); @Override diff --git a/server/src/io/anuke/mindustry/server/ServerControl.java b/server/src/io/anuke/mindustry/server/ServerControl.java index a0c739692c..939eac3aa2 100644 --- a/server/src/io/anuke/mindustry/server/ServerControl.java +++ b/server/src/io/anuke/mindustry/server/ServerControl.java @@ -46,13 +46,13 @@ public class ServerControl implements ApplicationListener{ public ServerControl(String[] args){ Core.settings.defaults( - "shufflemode", "normal", - "bans", "", - "admins", "", - "shuffle", true, - "crashreport", false, - "port", port, - "logging", true + "shufflemode", "normal", + "bans", "", + "admins", "", + "shuffle", true, + "crashreport", false, + "port", port, + "logging", true ); Log.setLogger(new LogHandler(){ @@ -90,10 +90,8 @@ public class ServerControl implements ApplicationListener{ }); Time.setDeltaProvider(() -> Core.graphics.getDeltaTime() * 60f); - Effects.setScreenShakeProvider((a, b) -> { - }); - Effects.setEffectProvider((a, b, c, d, e, f) -> { - }); + Effects.setScreenShakeProvider((a, b) -> {}); + Effects.setEffectProvider((a, b, c, d, e, f) -> {}); registerCommands(); diff --git a/tests/src/test/java/power/ItemLiquidGeneratorTests.java b/tests/src/test/java/power/ItemLiquidGeneratorTests.java index 19342611fc..b56e914fd4 100644 --- a/tests/src/test/java/power/ItemLiquidGeneratorTests.java +++ b/tests/src/test/java/power/ItemLiquidGeneratorTests.java @@ -27,7 +27,7 @@ public class ItemLiquidGeneratorTests extends PowerTestFixture{ private ItemLiquidGenerator generator; private Tile tile; private ItemLiquidGenerator.ItemLiquidGeneratorEntity entity; - private final float fakeItemDuration = 60f; // 60 ticks + private final float fakeItemDuration = 60f; //ticks private final float maximumLiquidUsage = 0.5f; public void createGenerator(InputType inputType){