mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-18 23:32:08 -08:00
Restored SolarGenerator and adapted to new power system.
This commit is contained in:
parent
ec631f3499
commit
12ccc10e83
3 changed files with 35 additions and 21 deletions
|
|
@ -42,26 +42,13 @@ public class PowerBlocks extends BlockList implements ContentList{
|
|||
itemDuration = 220f;
|
||||
}};
|
||||
|
||||
// TODO: Maybe reintroduce a class for the initial production efficiency
|
||||
solarPanel = new PowerGenerator("solar-panel"){
|
||||
{
|
||||
powerProduction = 0.0045f;
|
||||
}
|
||||
@Override
|
||||
public void update(Tile tile){
|
||||
tile.<GeneratorEntity>entity().productionEfficiency = 1.0f;
|
||||
}
|
||||
};
|
||||
solarPanel = new SolarGenerator("solar-panel"){{
|
||||
powerProduction = 0.0045f;
|
||||
}};
|
||||
|
||||
largeSolarPanel = new PowerGenerator("solar-panel-large"){
|
||||
{
|
||||
powerProduction = 0.055f;
|
||||
}
|
||||
@Override
|
||||
public void update(Tile tile){
|
||||
tile.<GeneratorEntity>entity().productionEfficiency = 1.0f;
|
||||
}
|
||||
};
|
||||
largeSolarPanel = new PowerGenerator("solar-panel-large"){{
|
||||
powerProduction = 0.055f;
|
||||
}};
|
||||
|
||||
thoriumReactor = new NuclearReactor("thorium-reactor"){{
|
||||
size = 3;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import io.anuke.mindustry.world.blocks.defense.turrets.PowerTurret;
|
|||
import io.anuke.mindustry.world.blocks.defense.turrets.Turret;
|
||||
import io.anuke.mindustry.world.blocks.power.NuclearReactor;
|
||||
import io.anuke.mindustry.world.blocks.power.PowerGenerator;
|
||||
import io.anuke.mindustry.world.blocks.power.SolarGenerator;
|
||||
import io.anuke.mindustry.world.blocks.storage.CoreBlock;
|
||||
import io.anuke.mindustry.world.blocks.storage.StorageBlock;
|
||||
import io.anuke.mindustry.world.blocks.units.UnitFactory;
|
||||
|
|
@ -114,8 +115,7 @@ public class FortressGenerator{
|
|||
seeder.get(PowerBlocks.solarPanel, tile -> tile.block() == PowerBlocks.largeSolarPanel && gen.random.chance(0.3)),
|
||||
|
||||
//coal gens
|
||||
// TODO Verify - This used to be solar panel
|
||||
seeder.get(PowerBlocks.combustionGenerator, tile -> tile.block() instanceof PowerGenerator && gen.random.chance(0.2)),
|
||||
seeder.get(PowerBlocks.combustionGenerator, tile -> tile.block() instanceof SolarGenerator && gen.random.chance(0.2)),
|
||||
|
||||
//water extractors
|
||||
seeder.get(ProductionBlocks.waterExtractor, tile -> tile.block() instanceof NuclearReactor && gen.random.chance(0.5)),
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
package io.anuke.mindustry.world.blocks.power;
|
||||
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.world.BarType;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.meta.BlockBar;
|
||||
import io.anuke.mindustry.world.meta.BlockStat;
|
||||
import io.anuke.mindustry.world.meta.StatUnit;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.util.EnumSet;
|
||||
|
||||
public class SolarGenerator extends PowerGenerator{
|
||||
|
||||
public SolarGenerator(String name){
|
||||
super(name);
|
||||
// Remove the BlockFlag.producer flag to make this a lower priority target than other generators.
|
||||
flags = EnumSet.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity newEntity(){
|
||||
return new PowerGenerator.GeneratorEntity(){{
|
||||
productionEfficiency = 1.0f;
|
||||
}};
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue