From b98b9a98e34289e33357ad6c89047c8304525932 Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 22 Oct 2019 18:55:15 -0400 Subject: [PATCH] Cleanup --- .../anuke/mindustry/core/ContentLoader.java | 36 +++++++++---------- .../io/anuke/mindustry/game/EventType.java | 6 ++-- .../io/anuke/mindustry/game/GlobalData.java | 2 +- .../io/anuke/mindustry/io/SaveVersion.java | 21 ++++++----- .../maps/generators/MapGenerator.java | 3 ++ .../io/anuke/mindustry/mod/ContentParser.java | 34 ++++++++++-------- .../{ProxySound.java => ModLoadingSound.java} | 2 +- core/src/io/anuke/mindustry/mod/Mods.java | 20 +++++------ core/src/io/anuke/mindustry/type/Weapon.java | 4 +-- core/src/io/anuke/mindustry/type/Zone.java | 4 +++ .../mindustry/ui/dialogs/DatabaseDialog.java | 31 ++++++++-------- core/src/io/anuke/mindustry/world/Block.java | 5 ++- 12 files changed, 89 insertions(+), 79 deletions(-) rename core/src/io/anuke/mindustry/mod/{ProxySound.java => ModLoadingSound.java} (98%) diff --git a/core/src/io/anuke/mindustry/core/ContentLoader.java b/core/src/io/anuke/mindustry/core/ContentLoader.java index 90b56bc213..94fa56d0cc 100644 --- a/core/src/io/anuke/mindustry/core/ContentLoader.java +++ b/core/src/io/anuke/mindustry/core/ContentLoader.java @@ -5,7 +5,7 @@ import io.anuke.arc.function.*; import io.anuke.arc.graphics.*; import io.anuke.arc.util.*; import io.anuke.mindustry.content.*; -import io.anuke.mindustry.ctype.MappableContent; +import io.anuke.mindustry.ctype.*; import io.anuke.mindustry.entities.bullet.*; import io.anuke.mindustry.type.*; import io.anuke.mindustry.world.*; @@ -20,11 +20,11 @@ import static io.anuke.mindustry.Vars.mods; @SuppressWarnings("unchecked") public class ContentLoader{ private boolean loaded = false; - private ObjectMap[] contentNameMap = new ObjectMap[ContentType.values().length]; - private Array[] contentMap = new Array[ContentType.values().length]; - private io.anuke.mindustry.ctype.MappableContent[][] temporaryMapper; - private ObjectSet> initialization = new ObjectSet<>(); - private io.anuke.mindustry.ctype.ContentList[] content = { + private ObjectMap[] contentNameMap = new ObjectMap[ContentType.values().length]; + private Array[] contentMap = new Array[ContentType.values().length]; + private MappableContent[][] temporaryMapper; + private ObjectSet> initialization = new ObjectSet<>(); + private ContentList[] content = { new Fx(), new Items(), new StatusEffects(), @@ -62,7 +62,7 @@ public class ContentLoader{ contentNameMap[type.ordinal()] = new ObjectMap<>(); } - for(io.anuke.mindustry.ctype.ContentList list : content){ + for(ContentList list : content){ list.load(); } @@ -71,7 +71,7 @@ public class ContentLoader{ } //check up ID mapping, make sure it's linear - for(Array arr : contentMap){ + for(Array arr : contentMap){ for(int i = 0; i < arr.size; i++){ int id = arr.get(i).id; if(id != i){ @@ -95,20 +95,20 @@ public class ContentLoader{ /** Calls Content#init() on everything. Use only after all modules have been created.*/ public void init(){ - initialize(io.anuke.mindustry.ctype.Content::init); + initialize(Content::init); } /** Calls Content#load() on everything. Use only after all modules have been created on the client.*/ public void load(){ - initialize(io.anuke.mindustry.ctype.Content::load); + initialize(Content::load); } /** Initializes all content with the specified function. */ - private void initialize(Consumer callable){ + private void initialize(Consumer callable){ if(initialization.contains(callable)) return; for(ContentType type : ContentType.values()){ - for(io.anuke.mindustry.ctype.Content content : contentMap[type.ordinal()]){ + for(Content content : contentMap[type.ordinal()]){ try{ callable.accept(content); }catch(Throwable e){ @@ -144,23 +144,23 @@ public class ContentLoader{ //clear all content, currently not used } - public void handleContent(io.anuke.mindustry.ctype.Content content){ + public void handleContent(Content content){ contentMap[content.getContentType().ordinal()].add(content); } - public void handleMappableContent(io.anuke.mindustry.ctype.MappableContent content){ + public void handleMappableContent(MappableContent content){ if(contentNameMap[content.getContentType().ordinal()].containsKey(content.name)){ throw new IllegalArgumentException("Two content objects cannot have the same name! (issue: '" + content.name + "')"); } contentNameMap[content.getContentType().ordinal()].put(content.name, content); } - public void setTemporaryMapper(io.anuke.mindustry.ctype.MappableContent[][] temporaryMapper){ + public void setTemporaryMapper(MappableContent[][] temporaryMapper){ this.temporaryMapper = temporaryMapper; } - public Array[] getContentMap(){ + public Array[] getContentMap(){ return contentMap; } @@ -171,7 +171,7 @@ public class ContentLoader{ return (T)contentNameMap[type.ordinal()].get(name); } - public T getByID(ContentType type, int id){ + public T getByID(ContentType type, int id){ if(temporaryMapper != null && temporaryMapper[type.ordinal()] != null && temporaryMapper[type.ordinal()].length != 0){ //-1 = invalid content @@ -190,7 +190,7 @@ public class ContentLoader{ return (T)contentMap[type.ordinal()].get(id); } - public Array getBy(ContentType type){ + public Array getBy(ContentType type){ return (Array)contentMap[type.ordinal()]; } diff --git a/core/src/io/anuke/mindustry/game/EventType.java b/core/src/io/anuke/mindustry/game/EventType.java index 2b7a9adfe1..fef2556d35 100644 --- a/core/src/io/anuke/mindustry/game/EventType.java +++ b/core/src/io/anuke/mindustry/game/EventType.java @@ -174,15 +174,15 @@ public class EventType{ } public static class UnlockEvent{ - public final io.anuke.mindustry.ctype.UnlockableContent content; + public final UnlockableContent content; - public UnlockEvent(io.anuke.mindustry.ctype.UnlockableContent content){ + public UnlockEvent(UnlockableContent content){ this.content = content; } } public static class ResearchEvent{ - public final io.anuke.mindustry.ctype.UnlockableContent content; + public final UnlockableContent content; public ResearchEvent(UnlockableContent content){ this.content = content; diff --git a/core/src/io/anuke/mindustry/game/GlobalData.java b/core/src/io/anuke/mindustry/game/GlobalData.java index 1eec0e2cda..6e0eb34873 100644 --- a/core/src/io/anuke/mindustry/game/GlobalData.java +++ b/core/src/io/anuke/mindustry/game/GlobalData.java @@ -132,7 +132,7 @@ public class GlobalData{ } /** Returns whether or not this piece of content is unlocked yet. */ - public boolean isUnlocked(io.anuke.mindustry.ctype.UnlockableContent content){ + public boolean isUnlocked(UnlockableContent content){ return content.alwaysUnlocked() || unlocked.getOr(content.getContentType(), ObjectSet::new).contains(content.name); } diff --git a/core/src/io/anuke/mindustry/io/SaveVersion.java b/core/src/io/anuke/mindustry/io/SaveVersion.java index d2505ca793..b02fc92fa7 100644 --- a/core/src/io/anuke/mindustry/io/SaveVersion.java +++ b/core/src/io/anuke/mindustry/io/SaveVersion.java @@ -3,15 +3,14 @@ package io.anuke.mindustry.io; import io.anuke.arc.collection.*; import io.anuke.arc.util.*; import io.anuke.arc.util.io.*; -import io.anuke.mindustry.core.Version; -import io.anuke.mindustry.ctype.MappableContent; +import io.anuke.mindustry.core.*; +import io.anuke.mindustry.ctype.*; import io.anuke.mindustry.entities.*; import io.anuke.mindustry.entities.traits.*; import io.anuke.mindustry.game.*; import io.anuke.mindustry.game.Teams.*; import io.anuke.mindustry.maps.*; import io.anuke.mindustry.type.*; -import io.anuke.mindustry.type.TypeID; import io.anuke.mindustry.world.*; import java.io.*; @@ -283,12 +282,12 @@ public abstract class SaveVersion extends SaveFileReader{ public void readContentHeader(DataInput stream) throws IOException{ byte mapped = stream.readByte(); - io.anuke.mindustry.ctype.MappableContent[][] map = new io.anuke.mindustry.ctype.MappableContent[ContentType.values().length][0]; + MappableContent[][] map = new MappableContent[ContentType.values().length][0]; for(int i = 0; i < mapped; i++){ ContentType type = ContentType.values()[stream.readByte()]; short total = stream.readShort(); - map[type.ordinal()] = new io.anuke.mindustry.ctype.MappableContent[total]; + map[type.ordinal()] = new MappableContent[total]; for(int j = 0; j < total; j++){ String name = stream.readUTF(); @@ -300,21 +299,21 @@ public abstract class SaveVersion extends SaveFileReader{ } public void writeContentHeader(DataOutput stream) throws IOException{ - Array[] map = content.getContentMap(); + Array[] map = content.getContentMap(); int mappable = 0; - for(Array arr : map){ - if(arr.size > 0 && arr.first() instanceof io.anuke.mindustry.ctype.MappableContent){ + for(Array arr : map){ + if(arr.size > 0 && arr.first() instanceof MappableContent){ mappable++; } } stream.writeByte(mappable); - for(Array arr : map){ - if(arr.size > 0 && arr.first() instanceof io.anuke.mindustry.ctype.MappableContent){ + for(Array arr : map){ + if(arr.size > 0 && arr.first() instanceof MappableContent){ stream.writeByte(arr.first().getContentType().ordinal()); stream.writeShort(arr.size); - for(io.anuke.mindustry.ctype.Content c : arr){ + for(Content c : arr){ stream.writeUTF(((MappableContent)c).name); } } diff --git a/core/src/io/anuke/mindustry/maps/generators/MapGenerator.java b/core/src/io/anuke/mindustry/maps/generators/MapGenerator.java index 08092e7fdb..a42940138b 100644 --- a/core/src/io/anuke/mindustry/maps/generators/MapGenerator.java +++ b/core/src/io/anuke/mindustry/maps/generators/MapGenerator.java @@ -39,6 +39,9 @@ public class MapGenerator extends Generator{ this.decorations.addAll(decor); return this; } + public void removePrefix(String name){ + this.mapName = name.substring(name.length() + 1); + } { decor(new Decoration(Blocks.snow, Blocks.snowrock, 0.01), new Decoration(Blocks.ignarock, Blocks.pebbles, 0.03f)); diff --git a/core/src/io/anuke/mindustry/mod/ContentParser.java b/core/src/io/anuke/mindustry/mod/ContentParser.java index f1d3922cdc..ea2a656ae3 100644 --- a/core/src/io/anuke/mindustry/mod/ContentParser.java +++ b/core/src/io/anuke/mindustry/mod/ContentParser.java @@ -16,7 +16,7 @@ import io.anuke.arc.util.serialization.Json.*; import io.anuke.mindustry.*; import io.anuke.mindustry.content.*; import io.anuke.mindustry.content.TechTree.*; -import io.anuke.mindustry.ctype.UnlockableContent; +import io.anuke.mindustry.ctype.*; import io.anuke.mindustry.entities.Effects.*; import io.anuke.mindustry.entities.bullet.*; import io.anuke.mindustry.entities.type.*; @@ -54,7 +54,7 @@ public class ContentParser{ if(fieldOpt(Sounds.class, data) != null) return fieldOpt(Sounds.class, data); String path = "sounds/" + data.asString() + (Vars.ios ? ".mp3" : ".ogg"); - ProxySound sound = new ProxySound(); + ModLoadingSound sound = new ModLoadingSound(); Core.assets.load(path, Sound.class).loaded = result -> { sound.sound = (Sound)result; }; @@ -67,13 +67,19 @@ public class ContentParser{ readFields(obj, data); return obj; }); + put(Weapon.class, (type, data) -> { + Weapon weapon = new Weapon(); + readFields(weapon, data); + weapon.name = currentMod.name + "-" + weapon.name; + return weapon; + }); }}; /** Stores things that need to be parsed fully, e.g. reading fields of content. * This is done to accomodate binding of content names first.*/ private Array reads = new Array<>(); private Array postreads = new Array<>(); private LoadedMod currentMod; - private io.anuke.mindustry.ctype.Content currentContent; + private Content currentContent; private Json parser = new Json(){ @Override @@ -93,7 +99,7 @@ public class ContentParser{ } } - if(io.anuke.mindustry.ctype.Content.class.isAssignableFrom(type)){ + if(Content.class.isAssignableFrom(type)){ ContentType ctype = contentTypes.getThrow(type, () -> new IllegalArgumentException("No content type for class: " + type.getSimpleName())); String prefix = currentMod != null ? currentMod.name + "-" : ""; T one = (T)Vars.content.getByName(ctype, prefix + jsonData.asString()); @@ -213,14 +219,14 @@ public class ContentParser{ ContentType.zone, parser(ContentType.zone, Zone::new) ); - private T find(ContentType type, String name){ - io.anuke.mindustry.ctype.Content c = Vars.content.getByName(type, name); + private T find(ContentType type, String name){ + Content c = Vars.content.getByName(type, name); if(c == null) c = Vars.content.getByName(type, currentMod.name + "-" + name); if(c == null) throw new IllegalArgumentException("No " + type + " found with name '" + name + "'"); return (T)c; } - private TypeParser parser(ContentType type, Function constructor){ + private TypeParser parser(ContentType type, Function constructor){ return (mod, name, value) -> { T item; if(Vars.content.getByName(type, name) != null){ @@ -237,7 +243,7 @@ public class ContentParser{ } private void readBundle(ContentType type, String name, JsonValue value){ - io.anuke.mindustry.ctype.UnlockableContent cont = Vars.content.getByName(type, name) instanceof io.anuke.mindustry.ctype.UnlockableContent ? + UnlockableContent cont = Vars.content.getByName(type, name) instanceof UnlockableContent ? Vars.content.getByName(type, name) : null; String entryName = cont == null ? type + "." + currentMod.name + "-" + name + "." : type + "." + cont.name + "."; @@ -259,7 +265,7 @@ public class ContentParser{ /** Call to read a content's extra info later.*/ private void read(Runnable run){ - io.anuke.mindustry.ctype.Content cont = currentContent; + Content cont = currentContent; LoadedMod mod = currentMod; reads.add(() -> { this.currentMod = mod; @@ -270,11 +276,11 @@ public class ContentParser{ private void init(){ for(ContentType type : ContentType.all){ - Array arr = Vars.content.getBy(type); + Array arr = Vars.content.getBy(type); if(!arr.isEmpty()){ Class c = arr.first().getClass(); //get base content class, skipping intermediates - while(!(c.getSuperclass() == io.anuke.mindustry.ctype.Content.class || c.getSuperclass() == UnlockableContent.class || Modifier.isAbstract(c.getSuperclass().getModifiers()))){ + while(!(c.getSuperclass() == Content.class || c.getSuperclass() == UnlockableContent.class || Modifier.isAbstract(c.getSuperclass().getModifiers()))){ c = c.getSuperclass(); } @@ -302,7 +308,7 @@ public class ContentParser{ * @param file file that this content is being parsed from * @return the content that was parsed */ - public io.anuke.mindustry.ctype.Content parse(LoadedMod mod, String name, String json, FileHandle file, ContentType type) throws Exception{ + public Content parse(LoadedMod mod, String name, String json, FileHandle file, ContentType type) throws Exception{ if(contentTypes.isEmpty()){ init(); } @@ -314,7 +320,7 @@ public class ContentParser{ currentMod = mod; boolean exists = Vars.content.getByName(type, name) != null; - io.anuke.mindustry.ctype.Content c = parsers.get(type).parse(mod.name, name, value); + Content c = parsers.get(type).parse(mod.name, name, value); if(!exists){ c.sourceFile = file; c.mod = mod; @@ -454,7 +460,7 @@ public class ContentParser{ Object parse(Class type, JsonValue value) throws Exception; } - private interface TypeParser{ + private interface TypeParser{ T parse(String mod, String name, JsonValue value) throws Exception; } diff --git a/core/src/io/anuke/mindustry/mod/ProxySound.java b/core/src/io/anuke/mindustry/mod/ModLoadingSound.java similarity index 98% rename from core/src/io/anuke/mindustry/mod/ProxySound.java rename to core/src/io/anuke/mindustry/mod/ModLoadingSound.java index a71e77e2c6..43d30f4617 100644 --- a/core/src/io/anuke/mindustry/mod/ProxySound.java +++ b/core/src/io/anuke/mindustry/mod/ModLoadingSound.java @@ -5,7 +5,7 @@ import io.anuke.arc.audio.mock.*; import io.anuke.arc.math.geom.*; import io.anuke.arc.util.ArcAnnotate.*; -public class ProxySound implements Sound{ +public class ModLoadingSound implements Sound{ public @NonNull Sound sound = new MockSound(); @Override diff --git a/core/src/io/anuke/mindustry/mod/Mods.java b/core/src/io/anuke/mindustry/mod/Mods.java index 4fb68605a8..474cdeb9f8 100644 --- a/core/src/io/anuke/mindustry/mod/Mods.java +++ b/core/src/io/anuke/mindustry/mod/Mods.java @@ -14,8 +14,8 @@ import io.anuke.arc.util.ArcAnnotate.*; import io.anuke.arc.util.*; import io.anuke.arc.util.io.*; import io.anuke.arc.util.serialization.*; -import io.anuke.mindustry.core.Version; -import io.anuke.mindustry.ctype.UnlockableContent; +import io.anuke.mindustry.core.*; +import io.anuke.mindustry.ctype.*; import io.anuke.mindustry.game.EventType.*; import io.anuke.mindustry.gen.*; import io.anuke.mindustry.plugin.*; @@ -130,10 +130,10 @@ public class Mods implements Loadable{ packer.updateTextureAtlas(Core.atlas, filter, filter, false); //generate new icons - for(Array arr : content.getContentMap()){ + for(Array arr : content.getContentMap()){ arr.each(c -> { - if(c instanceof io.anuke.mindustry.ctype.UnlockableContent && c.mod != null){ - io.anuke.mindustry.ctype.UnlockableContent u = (io.anuke.mindustry.ctype.UnlockableContent)c; + if(c instanceof UnlockableContent && c.mod != null){ + UnlockableContent u = (UnlockableContent)c; u.createIcons(packer, editorPacker); } }); @@ -285,9 +285,9 @@ public class Mods implements Loadable{ if(file.extension().equals("json")){ try{ //this binds the content but does not load it entirely - io.anuke.mindustry.ctype.Content loaded = parser.parse(mod, file.nameWithoutExtension(), file.readString("UTF-8"), file, type); + Content loaded = parser.parse(mod, file.nameWithoutExtension(), file.readString("UTF-8"), file, type); Log.info("[{0}] Loaded '{1}'.", mod.meta.name, - (loaded instanceof io.anuke.mindustry.ctype.UnlockableContent ? ((UnlockableContent)loaded).localizedName : loaded)); + (loaded instanceof UnlockableContent ? ((UnlockableContent)loaded).localizedName : loaded)); }catch(Exception e){ throw new RuntimeException("Failed to parse content file '" + file + "' for mod '" + mod.meta.name + "'.", e); } @@ -362,7 +362,7 @@ public class Mods implements Loadable{ public void handleError(Throwable t, LoadedMod mod){ Array causes = Strings.getCauses(t); - io.anuke.mindustry.ctype.Content content = null; + Content content = null; for(Throwable e : causes){ if(e instanceof ModLoadException && ((ModLoadException) e).content != null){ content = ((ModLoadException) e).content; @@ -553,14 +553,14 @@ public class Mods implements Loadable{ /** Thrown when an error occurs while loading a mod.*/ public static class ModLoadException extends RuntimeException{ - public io.anuke.mindustry.ctype.Content content; + public Content content; public LoadedMod mod; public ModLoadException(String message, Throwable cause){ super(message, cause); } - public ModLoadException(String message, @Nullable io.anuke.mindustry.ctype.Content content, Throwable cause){ + public ModLoadException(String message, @Nullable Content content, Throwable cause){ super(message, cause); this.content = content; if(content != null){ diff --git a/core/src/io/anuke/mindustry/type/Weapon.java b/core/src/io/anuke/mindustry/type/Weapon.java index de70c5f3d3..2163cb8c23 100644 --- a/core/src/io/anuke/mindustry/type/Weapon.java +++ b/core/src/io/anuke/mindustry/type/Weapon.java @@ -20,7 +20,7 @@ import io.anuke.mindustry.gen.*; import static io.anuke.mindustry.Vars.net; public class Weapon{ - public final String name; + public String name; /** minimum cursor distance from player, fixes 'cross-eyed' shooting. */ protected static float minPlayerDist = 20f; @@ -64,7 +64,7 @@ public class Weapon{ this.name = name; } - protected Weapon(){ + public Weapon(){ //no region this.name = ""; } diff --git a/core/src/io/anuke/mindustry/type/Zone.java b/core/src/io/anuke/mindustry/type/Zone.java index 5aa230a9bc..b4088b24e6 100644 --- a/core/src/io/anuke/mindustry/type/Zone.java +++ b/core/src/io/anuke/mindustry/type/Zone.java @@ -172,6 +172,10 @@ public class Zone extends UnlockableContent{ @Override public void init(){ + if(generator instanceof MapGenerator && mod != null){ + ((MapGenerator)generator).removePrefix(mod.name); + } + generator.init(loadout); resources.sort(); diff --git a/core/src/io/anuke/mindustry/ui/dialogs/DatabaseDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/DatabaseDialog.java index 962a859530..faa3f6f39a 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/DatabaseDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/DatabaseDialog.java @@ -1,20 +1,19 @@ package io.anuke.mindustry.ui.dialogs; -import io.anuke.arc.Core; -import io.anuke.arc.collection.Array; -import io.anuke.arc.graphics.Color; -import io.anuke.arc.scene.event.ClickListener; -import io.anuke.arc.scene.event.HandCursorListener; +import io.anuke.arc.*; +import io.anuke.arc.collection.*; +import io.anuke.arc.graphics.*; +import io.anuke.arc.scene.event.*; import io.anuke.arc.scene.ui.*; -import io.anuke.arc.scene.ui.layout.Table; -import io.anuke.arc.util.Time; -import io.anuke.mindustry.Vars; -import io.anuke.mindustry.core.GameState.State; -import io.anuke.mindustry.ctype.UnlockableContent; +import io.anuke.arc.scene.ui.layout.*; +import io.anuke.arc.util.*; +import io.anuke.mindustry.*; +import io.anuke.mindustry.core.GameState.*; +import io.anuke.mindustry.ctype.*; import io.anuke.mindustry.gen.*; -import io.anuke.mindustry.graphics.Pal; -import io.anuke.mindustry.type.ContentType; -import io.anuke.mindustry.ui.Cicon; +import io.anuke.mindustry.graphics.*; +import io.anuke.mindustry.type.*; +import io.anuke.mindustry.ui.*; public class DatabaseDialog extends FloatingDialog{ @@ -34,12 +33,12 @@ public class DatabaseDialog extends FloatingDialog{ table.margin(20); ScrollPane pane = new ScrollPane(table); - Array[] allContent = Vars.content.getContentMap(); + Array[] allContent = Vars.content.getContentMap(); for(int j = 0; j < allContent.length; j++){ ContentType type = ContentType.values()[j]; - Array array = allContent[j].select(c -> c instanceof io.anuke.mindustry.ctype.UnlockableContent && !((io.anuke.mindustry.ctype.UnlockableContent)c).isHidden()); + Array array = allContent[j].select(c -> c instanceof UnlockableContent && !((UnlockableContent)c).isHidden()); if(array.size == 0) continue; table.add("$content." + type.name() + ".name").growX().left().color(Pal.accent); @@ -54,7 +53,7 @@ public class DatabaseDialog extends FloatingDialog{ int count = 0; for(int i = 0; i < array.size; i++){ - io.anuke.mindustry.ctype.UnlockableContent unlock = (io.anuke.mindustry.ctype.UnlockableContent)array.get(i); + UnlockableContent unlock = (UnlockableContent)array.get(i); Image image = unlocked(unlock) ? new Image(unlock.icon(Cicon.medium)) : new Image(Icon.lockedSmall, Pal.gray); list.add(image).size(8*4).pad(3); diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index 327f0c6e17..7d2964c5b9 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -17,7 +17,7 @@ import io.anuke.arc.scene.ui.layout.*; import io.anuke.arc.util.*; import io.anuke.arc.util.ArcAnnotate.*; import io.anuke.arc.util.pooling.*; -import io.anuke.mindustry.ctype.UnlockableContent; +import io.anuke.mindustry.ctype.*; import io.anuke.mindustry.entities.*; import io.anuke.mindustry.entities.effect.*; import io.anuke.mindustry.entities.traits.BuilderTrait.*; @@ -26,7 +26,6 @@ import io.anuke.mindustry.gen.*; import io.anuke.mindustry.graphics.*; import io.anuke.mindustry.type.*; import io.anuke.mindustry.ui.*; -import io.anuke.mindustry.ui.Cicon; import io.anuke.mindustry.world.blocks.*; import io.anuke.mindustry.world.blocks.power.*; import io.anuke.mindustry.world.consumers.*; @@ -697,7 +696,7 @@ public class Block extends BlockStorage{ } - public void drawRequestConfigCenter(BuildRequest req, io.anuke.mindustry.ctype.Content content, String region){ + public void drawRequestConfigCenter(BuildRequest req, Content content, String region){ Color color = content instanceof Item ? ((Item)content).color : content instanceof Liquid ? ((Liquid)content).color : null; if(color == null) return;