diff --git a/core/src/io/anuke/mindustry/content/Blocks.java b/core/src/io/anuke/mindustry/content/Blocks.java index 705949fd1e..922491a965 100644 --- a/core/src/io/anuke/mindustry/content/Blocks.java +++ b/core/src/io/anuke/mindustry/content/Blocks.java @@ -737,7 +737,8 @@ public class Blocks implements ContentList{ requirements(Category.effect, ItemStack.with(Items.graphite, 5)); }}; illuminator = new LightBlock("illuminator"){{ - requirements(Category.effect, ItemStack.with(Items.graphite, 5)); + //disabled until implemented properly + //requirements(Category.effect, ItemStack.with(Items.graphite, 5)); color = Color.valueOf("7d93ff"); brightness = 0.6f; radius = 80f; diff --git a/core/src/io/anuke/mindustry/entities/type/Unit.java b/core/src/io/anuke/mindustry/entities/type/Unit.java index a0c568f6e6..73dec77656 100644 --- a/core/src/io/anuke/mindustry/entities/type/Unit.java +++ b/core/src/io/anuke/mindustry/entities/type/Unit.java @@ -167,6 +167,8 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ } public void writeSave(DataOutput stream, boolean net) throws IOException{ + if(item.item == null) item.item = Items.copper; + stream.writeByte(team.ordinal()); stream.writeBoolean(isDead()); stream.writeFloat(net ? interpolator.target.x : x); diff --git a/core/src/io/anuke/mindustry/game/Rules.java b/core/src/io/anuke/mindustry/game/Rules.java index dbafda9579..4579f330fa 100644 --- a/core/src/io/anuke/mindustry/game/Rules.java +++ b/core/src/io/anuke/mindustry/game/Rules.java @@ -75,7 +75,7 @@ public class Rules{ /** Blocks that cannot be placed. */ public ObjectSet bannedBlocks = new ObjectSet<>(); /** Whether everything is dark. Enables lights. Experimental. */ - public boolean lighting = false; + public boolean lighting = true; /** Ambient light color, used when lighting is enabled. */ public Color ambientLight = new Color(0.01f, 0.01f, 0.04f, 0.99f); diff --git a/core/src/io/anuke/mindustry/graphics/LightRenderer.java b/core/src/io/anuke/mindustry/graphics/LightRenderer.java index 71d5dd6b75..19ab2ff016 100644 --- a/core/src/io/anuke/mindustry/graphics/LightRenderer.java +++ b/core/src/io/anuke/mindustry/graphics/LightRenderer.java @@ -50,9 +50,9 @@ public class LightRenderer{ if(!enabled()) return; add(() -> { - Draw.color(Color.orange, 0.5f); + Draw.color(Color.orange, 0.3f); - float stroke = 10f; + float stroke = 30f; float rot = Mathf.angleExact(x2 - x, y2 - y); TextureRegion ledge = Core.atlas.find("circle-end"), lmid = Core.atlas.find("circle-mid"); diff --git a/core/src/io/anuke/mindustry/world/blocks/power/ThermalGenerator.java b/core/src/io/anuke/mindustry/world/blocks/power/ThermalGenerator.java index 2415a84578..b2d9576718 100644 --- a/core/src/io/anuke/mindustry/world/blocks/power/ThermalGenerator.java +++ b/core/src/io/anuke/mindustry/world/blocks/power/ThermalGenerator.java @@ -1,12 +1,15 @@ package io.anuke.mindustry.world.blocks.power; -import io.anuke.arc.Core; -import io.anuke.arc.math.Mathf; -import io.anuke.mindustry.content.Fx; -import io.anuke.mindustry.entities.Effects; -import io.anuke.mindustry.entities.Effects.Effect; -import io.anuke.mindustry.world.Tile; -import io.anuke.mindustry.world.meta.Attribute; +import io.anuke.arc.*; +import io.anuke.arc.graphics.*; +import io.anuke.arc.math.*; +import io.anuke.mindustry.content.*; +import io.anuke.mindustry.entities.*; +import io.anuke.mindustry.entities.Effects.*; +import io.anuke.mindustry.world.*; +import io.anuke.mindustry.world.meta.*; + +import static io.anuke.mindustry.Vars.renderer; public class ThermalGenerator extends PowerGenerator{ protected Effect generateEffect = Fx.none; @@ -29,6 +32,12 @@ public class ThermalGenerator extends PowerGenerator{ drawPlaceText(Core.bundle.formatFloat("bar.efficiency", sumAttribute(Attribute.heat, x, y) * 100, 1), x, y, valid); } + @Override + public void drawLight(Tile tile){ + GeneratorEntity entity = tile.entity(); + renderer.lights.add(tile.drawx(), tile.drawy(), (40f + Mathf.absin(10f, 5f)) * entity.productionEfficiency * size, Color.scarlet, 0.4f); + } + @Override public void onProximityAdded(Tile tile){ super.onProximityAdded(tile); diff --git a/gradle.properties b/gradle.properties index 7a2bc0d5fe..c108499534 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=68a64d9e8a3016ad433d0959be78f6acdcdaa385 +archash=7f36ea330f592f43ad01b729c4cae77797476ea7 diff --git a/tests/src/test/java/ApplicationTests.java b/tests/src/test/java/ApplicationTests.java index 83f6ed971b..a9ed831fbc 100644 --- a/tests/src/test/java/ApplicationTests.java +++ b/tests/src/test/java/ApplicationTests.java @@ -60,6 +60,7 @@ public class ApplicationTests{ super.init(); begins[0] = true; testMap = maps.loadInternalMap("groundZero"); + Thread.currentThread().interrupt(); } }; @@ -216,15 +217,24 @@ public class ApplicationTests{ } @Test - void loadOldSave(){ + void load77Save(){ resetWorld(); - SaveIO.load(Core.files.internal("build77.msav")); + SaveIO.load(Core.files.internal("77.msav")); //just tests if the map was loaded properly and didn't crash, no validity checks currently assertEquals(276, world.width()); assertEquals(10, world.height()); } + @Test + void load85Save(){ + resetWorld(); + SaveIO.load(Core.files.internal("85.msav")); + + assertEquals(250, world.width()); + assertEquals(300, world.height()); + } + @Test void arrayIterators(){ Array arr = Array.with("a", "b" , "c", "d", "e", "f"); diff --git a/tests/src/test/resources/build77.msav b/tests/src/test/resources/77.msav similarity index 100% rename from tests/src/test/resources/build77.msav rename to tests/src/test/resources/77.msav diff --git a/tests/src/test/resources/85.msav b/tests/src/test/resources/85.msav new file mode 100644 index 0000000000..085f9ec247 Binary files /dev/null and b/tests/src/test/resources/85.msav differ