diff --git a/core/src/io/anuke/mindustry/content/UnitTypes.java b/core/src/io/anuke/mindustry/content/UnitTypes.java index c96509e21c..71c855625d 100644 --- a/core/src/io/anuke/mindustry/content/UnitTypes.java +++ b/core/src/io/anuke/mindustry/content/UnitTypes.java @@ -34,6 +34,30 @@ public class UnitTypes implements ContentList{ }}; }}; + phantom = new UnitType("phantom", Phantom.class, Phantom::new){{ + isFlying = true; + drag = 0.01f; + mass = 2f; + speed = 0.45f; + maxVelocity = 1.9f; + range = 70f; + itemCapacity = 70; + health = 220; + buildPower = 0.9f; + minePower = 1.1f; + engineOffset = 6.5f; + toMine = ObjectSet.with(Items.lead, Items.copper, Items.titanium); + weapon = new Weapon("heal-blaster"){{ + length = 1.5f; + reload = 20f; + width = 0.5f; + roundrobin = true; + ejectEffect = Fx.none; + recoil = 2f; + bullet = Bullets.healBullet; + }}; + }}; + dagger = new UnitType("dagger", Dagger.class, Dagger::new){{ maxVelocity = 1.1f; speed = 0.2f; @@ -213,30 +237,6 @@ public class UnitTypes implements ContentList{ }}; }}; - phantom = new UnitType("phantom", Phantom.class, Phantom::new){{ - isFlying = true; - drag = 0.01f; - mass = 2f; - speed = 0.45f; - maxVelocity = 1.9f; - range = 70f; - itemCapacity = 70; - health = 220; - buildPower = 0.9f; - minePower = 1.1f; - engineOffset = 6.5f; - toMine = ObjectSet.with(Items.lead, Items.copper, Items.titanium); - weapon = new Weapon("heal-blaster"){{ - length = 1.5f; - reload = 20f; - width = 0.5f; - roundrobin = true; - ejectEffect = Fx.none; - recoil = 2f; - bullet = Bullets.healBullet; - }}; - }}; - revenant = new UnitType("revenant", Revenant.class, Revenant::new){{ health = 1000; mass = 5f; diff --git a/tests/src/test/java/ApplicationTests.java b/tests/src/test/java/ApplicationTests.java index 875ae50e6c..f10c88272f 100644 --- a/tests/src/test/java/ApplicationTests.java +++ b/tests/src/test/java/ApplicationTests.java @@ -1,4 +1,4 @@ -import io.anuke.arc.ApplicationCore; +import io.anuke.arc.*; import io.anuke.arc.backends.headless.HeadlessApplication; import io.anuke.arc.collection.Array; import io.anuke.arc.math.geom.Point2; @@ -215,6 +215,15 @@ public class ApplicationTests{ assertTrue(state.teams.get(defaultTeam).cores.size > 0); } + @Test + void loadOldSave(){ + resetWorld(); + SaveIO.load(Core.files.internal("build77.msav")); + + assertEquals(50, world.width()); + assertEquals(50, world.height()); + } + @Test void inventoryDeposit(){ depositTest(Blocks.surgeSmelter, Items.copper);