diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index b5aabbb0ed..126eae5f17 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -1659,7 +1659,6 @@ public class Blocks implements ContentList{ unitType = UnitTypes.draug; produceTime = 2500; size = 2; - maxSpawn = 1; consumes.power(1.2f); consumes.items(); }}; @@ -1669,7 +1668,6 @@ public class Blocks implements ContentList{ unitType = UnitTypes.spirit; produceTime = 4000; size = 2; - maxSpawn = 1; consumes.power(1.2f); consumes.items(new ItemStack(Items.silicon, 30), new ItemStack(Items.lead, 30)); }}; @@ -1679,7 +1677,6 @@ public class Blocks implements ContentList{ unitType = UnitTypes.phantom; produceTime = 4400; size = 2; - maxSpawn = 1; consumes.power(2.5f); consumes.items(new ItemStack(Items.silicon, 50), new ItemStack(Items.lead, 30), new ItemStack(Items.titanium, 20)); }}; @@ -1705,7 +1702,6 @@ public class Blocks implements ContentList{ unitType = UnitTypes.ghoul; produceTime = 1150; size = 3; - maxSpawn = 2; consumes.power(1.2f); consumes.items(new ItemStack(Items.silicon, 15), new ItemStack(Items.titanium, 10)); }}; @@ -1715,7 +1711,6 @@ public class Blocks implements ContentList{ unitType = UnitTypes.revenant; produceTime = 2000; size = 4; - maxSpawn = 2; consumes.power(3f); consumes.items(new ItemStack(Items.silicon, 40), new ItemStack(Items.titanium, 30)); }}; @@ -1734,7 +1729,6 @@ public class Blocks implements ContentList{ unitType = UnitTypes.crawler; produceTime = 300; size = 2; - maxSpawn = 6; consumes.power(0.5f); consumes.items(new ItemStack(Items.coal, 10)); }}; @@ -1753,7 +1747,6 @@ public class Blocks implements ContentList{ unitType = UnitTypes.fortress; produceTime = 2000; size = 3; - maxSpawn = 3; consumes.power(1.4f); consumes.items(new ItemStack(Items.silicon, 20), new ItemStack(Items.graphite, 10)); }}; diff --git a/core/src/mindustry/type/Weather.java b/core/src/mindustry/type/Weather.java index fac723177b..4a849ea601 100644 --- a/core/src/mindustry/type/Weather.java +++ b/core/src/mindustry/type/Weather.java @@ -1,5 +1,6 @@ package mindustry.type; +import mindustry.annotations.Annotations.*; import mindustry.ctype.*; public abstract class Weather extends MappableContent{ @@ -19,4 +20,9 @@ public abstract class Weather extends MappableContent{ } //TODO implement + + @Component + class WeatherComp{ + Weather weather; + } } diff --git a/core/src/mindustry/world/blocks/units/UnitFactory.java b/core/src/mindustry/world/blocks/units/UnitFactory.java index 45a510718c..63a9c87b05 100644 --- a/core/src/mindustry/world/blocks/units/UnitFactory.java +++ b/core/src/mindustry/world/blocks/units/UnitFactory.java @@ -25,7 +25,6 @@ public class UnitFactory extends Block{ public float produceTime = 1000f; public float launchVelocity = 0f; public TextureRegion topRegion; - public int maxSpawn = 4; public int[] capacities; public UnitFactory(String name){ @@ -38,14 +37,13 @@ public class UnitFactory extends Block{ } @Remote(called = Loc.server) - public static void onUnitFactorySpawn(Tile tile, int spawns){ + public static void onUnitFactorySpawn(Tile tile){ if(!(tile.entity instanceof UnitFactoryEntity) || !(tile.block() instanceof UnitFactory)) return; UnitFactory factory = (UnitFactory)tile.block(); UnitFactoryEntity entity = tile.ent(); entity.buildTime = 0f; - entity.spawned = spawns; Effects.shake(2f, 3f, entity); Fx.producesmoke.at(entity); @@ -83,7 +81,6 @@ public class UnitFactory extends Block{ public void setBars(){ super.setBars(); bars.add("progress", entity -> new Bar("bar.progress", Pal.ammo, () -> ((UnitFactoryEntity)entity).buildTime / produceTime)); - bars.add("spawned", entity -> new Bar(() -> Core.bundle.format("bar.spawned", ((UnitFactoryEntity)entity).spawned, maxSpawn), () -> Pal.command, () -> (float)((UnitFactoryEntity)entity).spawned / maxSpawn)); } @Override @@ -97,7 +94,6 @@ public class UnitFactory extends Block{ stats.remove(BlockStat.itemCapacity); stats.add(BlockStat.productionTime, produceTime / 60f, StatUnit.seconds); - stats.add(BlockStat.maxUnits, maxSpawn, StatUnit.none); } @Override @@ -109,8 +105,7 @@ public class UnitFactory extends Block{ float buildTime; float time; float speedScl; - int spawned; - + //int spawned; @Override public void draw(){ @@ -144,9 +139,6 @@ public class UnitFactory extends Block{ @Override public void updateTile(){ - if(spawned >= maxSpawn){ - return; - } if(consValid() || tile.isEnemyCheat()){ time += delta() * speedScl * Vars.state.rules.unitBuildSpeedMultiplier * efficiency(); @@ -159,7 +151,7 @@ public class UnitFactory extends Block{ if(buildTime >= produceTime){ buildTime = 0f; - Call.onUnitFactorySpawn(tile, spawned + 1); + Call.onUnitFactorySpawn(tile); useContent(unitType); consume(); } @@ -171,22 +163,25 @@ public class UnitFactory extends Block{ } @Override - public boolean shouldConsume(){ - return spawned < maxSpawn; + public byte version(){ + return 1; } @Override public void write(Writes write){ super.write(write); write.f(buildTime); - write.i(spawned); } @Override public void read(Reads read, byte revision){ super.read(read, revision); buildTime = read.f(); - spawned = read.i(); + + if(revision == 0){ + //spawn count + read.i(); + } } } }