mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-11 11:17:11 +07:00
Fixed some ores not loading in correctly / Conflict check
This commit is contained in:
parent
41f734b04d
commit
aa69af64fb
@ -9,6 +9,7 @@ import io.anuke.arc.graphics.Pixmap;
|
||||
import io.anuke.arc.graphics.Pixmap.Format;
|
||||
import io.anuke.arc.math.Mathf;
|
||||
import io.anuke.arc.util.Pack;
|
||||
import io.anuke.arc.util.Strings;
|
||||
import io.anuke.arc.util.Structs;
|
||||
import io.anuke.mindustry.content.Blocks;
|
||||
import io.anuke.mindustry.game.MappableContent;
|
||||
@ -26,6 +27,7 @@ import io.anuke.mindustry.world.blocks.BlockPart;
|
||||
import io.anuke.mindustry.world.blocks.Floor;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.zip.DeflaterOutputStream;
|
||||
import java.util.zip.InflaterInputStream;
|
||||
|
||||
@ -390,10 +392,10 @@ public class MapIO{
|
||||
block = missingBlocks.get(name);
|
||||
}else if(name.startsWith("ore-")){ //an ore floor combination
|
||||
String[] split = name.split("-");
|
||||
String itemName = split[1], floorName = split[2];
|
||||
String itemName = split[1], floorName = Strings.join("-", Arrays.copyOfRange(split, 2, split.length));
|
||||
Item item = content.getByName(ContentType.item, itemName);
|
||||
Block oreBlock = item == null ? null : content.getByName(ContentType.block, "ore-" + item.name);
|
||||
Block floor = content.getByName(ContentType.block, floorName);
|
||||
Block floor = missingBlocks.get(floorName, content.getByName(ContentType.block, floorName));
|
||||
if(oreBlock != null && floor != null){
|
||||
oreMap.put(id, oreBlock.id);
|
||||
block = floor;
|
||||
|
@ -32,8 +32,7 @@ public class MapsDialog extends FloatingDialog{
|
||||
Map map = MapIO.readMap(file, true);
|
||||
String name = map.tags.get("name", file.nameWithoutExtension());
|
||||
|
||||
//TODO filename conflict, erasure
|
||||
Map conflict = world.maps.byName(name);
|
||||
Map conflict = world.maps.all().find(m -> m.fileName().equals(file.nameWithoutExtension()) || m.name().equals(file.name()));
|
||||
|
||||
if(conflict != null && !conflict.custom){
|
||||
ui.showError(Core.bundle.format("editor.import.exists", name));
|
||||
|
Loading…
Reference in New Issue
Block a user