Removed debug mode / Added source blocks to sandbox

This commit is contained in:
Anuken
2018-09-10 17:46:32 -04:00
parent 2da0862cb2
commit 4af0fbf553
22 changed files with 54 additions and 198 deletions

View File

@@ -9,8 +9,6 @@ import io.anuke.mindustry.type.ContentType;
import io.anuke.ucore.core.Events;
import io.anuke.ucore.core.Settings;
import static io.anuke.mindustry.Vars.debug;
public class ContentDatabase{
/** Maps unlockable type names to a set of unlocked content.*/
private ObjectMap<ContentType, ObjectSet<String>> unlocked = new ObjectMap<>();
@@ -23,7 +21,7 @@ public class ContentDatabase{
/** Returns whether or not this piece of content is unlocked yet.*/
public boolean isUnlocked(UnlockableContent content){
if(debug) return true;
if(content.alwaysUnlocked()) return true;
if(!unlocked.containsKey(content.getContentType())){
unlocked.put(content.getContentType(), new ObjectSet<>());

View File

@@ -24,6 +24,11 @@ public abstract class UnlockableContent extends MappableContent{
return false;
}
/**Override to make content always unlocked.*/
public boolean alwaysUnlocked(){
return false;
}
/**Lists the content that must be unlocked in order for this specific content to become unlocked. May return null.*/
public UnlockableContent[] getDependencies(){
return null;