Merge branches '6.0' and 'splinterface-impl' of https://github.com/Anuken/Mindustry into splinterface-impl

# Conflicts:
#	core/assets/sprites/block_colors.png
#	core/assets/sprites/sprites.atlas
#	core/assets/sprites/sprites.png
#	core/assets/sprites/sprites3.png
#	core/assets/sprites/sprites5.png
#	core/src/mindustry/Vars.java
#	core/src/mindustry/entities/traits/SaveTrait.java
#	core/src/mindustry/maps/generators/MapGenerator.java
#	core/src/mindustry/ui/dialogs/DeployDialog.java
#	core/src/mindustry/world/blocks/Floor.java
#	desktop/src/mindustry/desktop/DesktopLauncher.java
#	gradle.properties
This commit is contained in:
Anuken 2020-02-04 12:25:18 -05:00
commit be50997f94
82 changed files with 1708 additions and 502 deletions

View file

@ -109,14 +109,10 @@ public class ApplicationTests{
@Test
void createMap(){
Tile[][] tiles = world.createTiles(8, 8);
Tiles tiles = world.resize(8, 8);
world.beginMapLoad();
for(int x = 0; x < tiles.length; x++){
for(int y = 0; y < tiles[0].length; y++){
tiles[x][y] = new Tile(x, y);
}
}
tiles.fill();
world.endMapLoad();
}
@ -379,29 +375,29 @@ public class ApplicationTests{
@Test
void allBlockTest(){
Tile[][] tiles = world.createTiles(256*2 + 20, 10);
Tiles tiles = world.resize(256*2 + 20, 10);
world.beginMapLoad();
for(int x = 0; x < tiles.length; x++){
for(int y = 0; y < tiles[0].length; y++){
tiles[x][y] = new Tile(x, y, Blocks.stone.id, (byte)0, (byte)0);
for(int x = 0; x < tiles.width(); x++){
for(int y = 0; y < tiles.height(); y++){
tiles.set(x, y, new Tile(x, y, Blocks.stone, Blocks.air, Blocks.air));
}
}
int i = 0;
for(int x = 5; x < tiles.length && i < content.blocks().size; ){
for(int x = 5; x < tiles.width() && i < content.blocks().size; ){
Block block = content.block(i++);
if(block.isBuildable()){
x += block.size;
tiles[x][5].setBlock(block);
tiles.get(x, 5).setBlock(block);
x += block.size;
}
}
world.endMapLoad();
for(int x = 0; x < tiles.length; x++){
for(int y = 0; y < tiles[0].length; y++){
Tile tile = world.tile(x, y);
for(int x = 0; x < tiles.width(); x++){
for(int y = 0; y < tiles.height(); y++){
Tile tile = world.rawTile(x, y);
if(tile.entity != null){
try{
tile.entity.update();
@ -429,7 +425,7 @@ public class ApplicationTests{
void depositTest(Block block, Item item){
BaseUnit unit = UnitTypes.spirit.create(Team.derelict);
Tile tile = new Tile(0, 0, Blocks.air.id, (byte)0, block.id);
Tile tile = new Tile(0, 0, Blocks.air, Blocks.air, block);
int capacity = tile.block().itemCapacity;
assertNotNull(tile.entity, "Tile should have an entity, but does not: " + tile);

View file

@ -32,12 +32,14 @@ public class ZoneTests{
Array<DynamicTest> out = new Array<>();
if(world == null) world = new World();
fail("Zone validity tests need to be refactored!");
for(Zone zone : content.zones()){
out.add(dynamicTest(zone.name, () -> {
zone.generator.init(zone.loadout);
logic.reset();
try{
world.loadGenerator(zone.generator);
//world.loadGenerator(zone.generator);
}catch(SaveException e){
e.printStackTrace();
return;