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 private String field_82751_h;
029
030 public WorldSettings(long par1, EnumGameType par3EnumGameType, boolean par4, boolean par5, WorldType par6WorldType)
031 {
032 this.field_82751_h = "";
033 this.seed = par1;
034 this.theGameType = par3EnumGameType;
035 this.mapFeaturesEnabled = par4;
036 this.hardcoreEnabled = par5;
037 this.terrainType = par6WorldType;
038 }
039
040 public WorldSettings(WorldInfo par1WorldInfo)
041 {
042 this(par1WorldInfo.getSeed(), par1WorldInfo.getGameType(), par1WorldInfo.isMapFeaturesEnabled(), par1WorldInfo.isHardcoreModeEnabled(), par1WorldInfo.getTerrainType());
043 }
044
045 /**
046 * Enables the bonus chest.
047 */
048 public WorldSettings enableBonusChest()
049 {
050 this.bonusChestEnabled = true;
051 return this;
052 }
053
054 public WorldSettings func_82750_a(String par1Str)
055 {
056 this.field_82751_h = par1Str;
057 return this;
058 }
059
060 @SideOnly(Side.CLIENT)
061
062 /**
063 * Enables Commands (cheats).
064 */
065 public WorldSettings enableCommands()
066 {
067 this.commandsAllowed = true;
068 return this;
069 }
070
071 /**
072 * Returns true if the Bonus Chest is enabled.
073 */
074 public boolean isBonusChestEnabled()
075 {
076 return this.bonusChestEnabled;
077 }
078
079 /**
080 * Returns the seed for the world.
081 */
082 public long getSeed()
083 {
084 return this.seed;
085 }
086
087 /**
088 * Gets the game type.
089 */
090 public EnumGameType getGameType()
091 {
092 return this.theGameType;
093 }
094
095 /**
096 * Returns true if hardcore mode is enabled, otherwise false
097 */
098 public boolean getHardcoreEnabled()
099 {
100 return this.hardcoreEnabled;
101 }
102
103 /**
104 * Get whether the map features (e.g. strongholds) generation is enabled or disabled.
105 */
106 public boolean isMapFeaturesEnabled()
107 {
108 return this.mapFeaturesEnabled;
109 }
110
111 public WorldType getTerrainType()
112 {
113 return this.terrainType;
114 }
115
116 /**
117 * Returns true if Commands (cheats) are allowed.
118 */
119 public boolean areCommandsAllowed()
120 {
121 return this.commandsAllowed;
122 }
123
124 /**
125 * Gets the GameType by ID
126 */
127 public static EnumGameType getGameTypeById(int par0)
128 {
129 return EnumGameType.getByID(par0);
130 }
131
132 public String func_82749_j()
133 {
134 return this.field_82751_h;
135 }
136 }