mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-26 22:42:41 -08:00
Merge branches '6.0' and 'master' of https://github.com/Anuken/Mindustry into 6.0
# Conflicts: # core/assets/sprites/block_colors.png # core/assets/sprites/sprites.atlas # core/assets/sprites/sprites.png # core/assets/sprites/sprites2.png # core/assets/sprites/sprites3.png # core/assets/sprites/sprites5.png # core/src/io/anuke/mindustry/ctype/ContentType.java # core/src/io/anuke/mindustry/ctype/UnlockableContent.java # core/src/io/anuke/mindustry/io/LegacyMapIO.java # core/src/io/anuke/mindustry/type/WeatherEvent.java # gradle.properties
This commit is contained in:
commit
32d28a4070
269 changed files with 16452 additions and 13926 deletions
|
|
@ -16,7 +16,7 @@ import io.anuke.mindustry.game.Team;
|
|||
import io.anuke.mindustry.io.SaveIO;
|
||||
import io.anuke.mindustry.maps.Map;
|
||||
import io.anuke.mindustry.net.*;
|
||||
import io.anuke.mindustry.type.ContentType;
|
||||
import io.anuke.mindustry.ctype.ContentType;
|
||||
import io.anuke.mindustry.type.Item;
|
||||
import io.anuke.mindustry.world.*;
|
||||
import io.anuke.mindustry.world.blocks.BlockPart;
|
||||
|
|
@ -47,7 +47,7 @@ public class ApplicationTests{
|
|||
net = new Net(null);
|
||||
tree = new FileTree();
|
||||
Vars.init();
|
||||
content.createContent();
|
||||
content.createBaseContent();
|
||||
|
||||
add(logic = new Logic());
|
||||
add(netServer = new NetServer());
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class DirectConsumerTests extends PowerTestFixture{
|
|||
consumerTile.entity.items.add(Items.lead, leadAmount);
|
||||
|
||||
Tile producerTile = createFakeTile(2, 0, createFakeProducerBlock(producedPower));
|
||||
producerTile.<PowerGenerator.GeneratorEntity>entity().productionEfficiency = 1f;
|
||||
producerTile.<PowerGenerator.GeneratorEntity>ent().productionEfficiency = 1f;
|
||||
|
||||
PowerGraph graph = new PowerGraph();
|
||||
graph.add(producerTile);
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public class ItemLiquidGeneratorTests extends PowerTestFixture{
|
|||
};
|
||||
|
||||
tile = createFakeTile(0, 0, generator);
|
||||
entity = tile.entity();
|
||||
entity = tile.ent();
|
||||
}
|
||||
|
||||
/** Tests the consumption and efficiency when being supplied with liquids. */
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class PowerTestFixture{
|
|||
|
||||
}
|
||||
};
|
||||
content.createContent();
|
||||
content.createBaseContent();
|
||||
Log.setUseColors(false);
|
||||
Time.setDeltaProvider(() -> 0.5f);
|
||||
}
|
||||
|
|
@ -91,6 +91,13 @@ public class PowerTestFixture{
|
|||
if(block.hasLiquids) tile.entity.liquids = new LiquidModule();
|
||||
if(block.hasPower){
|
||||
tile.entity.power = new PowerModule();
|
||||
tile.entity.power.graph = new PowerGraph(){
|
||||
//assume there's always something consuming power
|
||||
@Override
|
||||
public float getUsageFraction(){
|
||||
return 1f;
|
||||
}
|
||||
};
|
||||
tile.entity.power.graph.add(tile);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class PowerTests extends PowerTestFixture{
|
|||
|
||||
void simulateDirectConsumption(float producedPower, float requiredPower, float expectedSatisfaction, String parameterDescription){
|
||||
Tile producerTile = createFakeTile(0, 0, createFakeProducerBlock(producedPower));
|
||||
producerTile.<PowerGenerator.GeneratorEntity>entity().productionEfficiency = 1f;
|
||||
producerTile.<PowerGenerator.GeneratorEntity>ent().productionEfficiency = 1f;
|
||||
Tile directConsumerTile = createFakeTile(0, 1, createFakeDirectConsumer(requiredPower));
|
||||
|
||||
PowerGraph powerGraph = new PowerGraph();
|
||||
|
|
@ -91,7 +91,7 @@ public class PowerTests extends PowerTestFixture{
|
|||
|
||||
if(producedPower > 0.0f){
|
||||
Tile producerTile = createFakeTile(0, 0, createFakeProducerBlock(producedPower));
|
||||
producerTile.<PowerGenerator.GeneratorEntity>entity().productionEfficiency = 1f;
|
||||
producerTile.<PowerGenerator.GeneratorEntity>ent().productionEfficiency = 1f;
|
||||
powerGraph.add(producerTile);
|
||||
}
|
||||
Tile directConsumerTile = null;
|
||||
|
|
@ -116,7 +116,7 @@ public class PowerTests extends PowerTestFixture{
|
|||
@Test
|
||||
void directConsumptionStopsWithNoPower(){
|
||||
Tile producerTile = createFakeTile(0, 0, createFakeProducerBlock(10.0f));
|
||||
producerTile.<PowerGenerator.GeneratorEntity>entity().productionEfficiency = 1.0f;
|
||||
producerTile.<PowerGenerator.GeneratorEntity>ent().productionEfficiency = 1.0f;
|
||||
Tile consumerTile = createFakeTile(0, 1, createFakeDirectConsumer(5.0f));
|
||||
|
||||
PowerGraph powerGraph = new PowerGraph();
|
||||
|
|
@ -133,7 +133,7 @@ public class PowerTests extends PowerTestFixture{
|
|||
assertEquals(0.0f, consumerTile.entity.power.status, Mathf.FLOAT_ROUNDING_ERROR);
|
||||
if(consumerTile.block().consumes.hasPower()){
|
||||
ConsumePower consumePower = consumerTile.block().consumes.getPower();
|
||||
assertFalse(consumePower.valid(consumerTile.entity()));
|
||||
assertFalse(consumePower.valid(consumerTile.ent()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue