    001    package net.minecraft.src;
    002
    003    import cpw.mods.fml.common.Side;
    004    import cpw.mods.fml.common.asm.SideOnly;
    005
    006    public final class WorldSettings
    007    {
    008        /** The seed for the map. */
    009        private final long seed;
    010
    011        /** The EnumGameType. */
    012        private final EnumGameType theGameType;
    013
    014        /**
    015         * Switch for the map features. 'true' for enabled, 'false' for disabled.
    016         */
    017        private final boolean mapFeaturesEnabled;
    018
    019        /** True if hardcore mode is enabled */
    020        private final boolean hardcoreEnabled;
    021        private final WorldType terrainType;
    022
    023        /** True if Commands (cheats) are allowed. */
    024        private boolean commandsAllowed;
    025
    026        /** True if the Bonus Chest is enabled. */
    027        private boolean bonusChestEnabled;
    028
    029        public WorldSettings(long par1, EnumGameType par3EnumGameType, boolean par4, boolean par5, WorldType par6WorldType)
    030        {
    031            this.seed = par1;
    032            this.theGameType = par3EnumGameType;
    033            this.mapFeaturesEnabled = par4;
    034            this.hardcoreEnabled = par5;
    035            this.terrainType = par6WorldType;
    036        }
    037
    038        public WorldSettings(WorldInfo par1WorldInfo)
    039        {
    040            this(par1WorldInfo.getSeed(), par1WorldInfo.getGameType(), par1WorldInfo.isMapFeaturesEnabled(), par1WorldInfo.isHardcoreModeEnabled(), par1WorldInfo.getTerrainType());
    041        }
    042
    043        /**
    044         * Enables the bonus chest.
    045         */
    046        public WorldSettings enableBonusChest()
    047        {
    048            this.bonusChestEnabled = true;
    049            return this;
    050        }
    051
    052        @SideOnly(Side.CLIENT)
    053
    054        /**
    055         * Enables Commands (cheats).
    056         */
    057        public WorldSettings enableCommands()
    058        {
    059            this.commandsAllowed = true;
    060            return this;
    061        }
    062
    063        /**
    064         * Returns true if the Bonus Chest is enabled.
    065         */
    066        public boolean isBonusChestEnabled()
    067        {
    068            return this.bonusChestEnabled;
    069        }
    070
    071        /**
    072         * Returns the seed for the world.
    073         */
    074        public long getSeed()
    075        {
    076            return this.seed;
    077        }
    078
    079        /**
    080         * Gets the game type.
    081         */
    082        public EnumGameType getGameType()
    083        {
    084            return this.theGameType;
    085        }
    086
    087        /**
    088         * Returns true if hardcore mode is enabled, otherwise false
    089         */
    090        public boolean getHardcoreEnabled()
    091        {
    092            return this.hardcoreEnabled;
    093        }
    094
    095        /**
    096         * Get whether the map features (e.g. strongholds) generation is enabled or disabled.
    097         */
    098        public boolean isMapFeaturesEnabled()
    099        {
    100            return this.mapFeaturesEnabled;
    101        }
    102
    103        public WorldType getTerrainType()
    104        {
    105            return this.terrainType;
    106        }
    107
    108        /**
    109         * Returns true if Commands (cheats) are allowed.
    110         */
    111        public boolean areCommandsAllowed()
    112        {
    113            return this.commandsAllowed;
    114        }
    115
    116        /**
    117         * Gets the GameType by ID
    118         */
    119        public static EnumGameType getGameTypeById(int par0)
    120        {
    121            return EnumGameType.getByID(par0);
    122        }
    123    }