package net.minecraft.world.level;

import net.minecraft.world.level.storage.LevelData;
import com.google.gson.JsonObject;
import com.google.gson.JsonElement;

public final class LevelSettings {
    private final long seed;
    private final GameType gameType;
    private final boolean generateMapFeatures;
    private final boolean hardcore;
    private final LevelType levelType;
    private boolean allowCommands;
    private boolean startingBonusItems;
    private JsonElement levelTypeOptions;
    
    public LevelSettings(final long long1, final GameType bjt, final boolean boolean3, final boolean boolean4, final LevelType bkd) {
        this.levelTypeOptions = new JsonObject();
        this.seed = long1;
        this.gameType = bjt;
        this.generateMapFeatures = boolean3;
        this.hardcore = boolean4;
        this.levelType = bkd;
    }
    
    public LevelSettings(final LevelData crm) {
        this(crm.getSeed(), crm.getGameType(), crm.isGenerateMapFeatures(), crm.isHardcore(), crm.getGeneratorType());
    }
    
    public LevelSettings enableStartingBonusItems() {
        this.startingBonusItems = true;
        return this;
    }
    
    public LevelSettings enableSinglePlayerCommands() {
        this.allowCommands = true;
        return this;
    }
    
    public LevelSettings setLevelTypeOptions(final JsonElement jsonElement) {
        this.levelTypeOptions = jsonElement;
        return this;
    }
    
    public boolean hasStartingBonusItems() {
        return this.startingBonusItems;
    }
    
    public long getSeed() {
        return this.seed;
    }
    
    public GameType getGameType() {
        return this.gameType;
    }
    
    public boolean isHardcore() {
        return this.hardcore;
    }
    
    public boolean isGenerateMapFeatures() {
        return this.generateMapFeatures;
    }
    
    public LevelType getLevelType() {
        return this.levelType;
    }
    
    public boolean getAllowCommands() {
        return this.allowCommands;
    }
    
    public JsonElement getLevelTypeOptions() {
        return this.levelTypeOptions;
    }
}
