001 package net.minecraft.world.storage; 002 003 import cpw.mods.fml.relauncher.Side; 004 import cpw.mods.fml.relauncher.SideOnly; 005 import net.minecraft.nbt.NBTTagCompound; 006 import net.minecraft.world.EnumGameType; 007 import net.minecraft.world.GameRules; 008 import net.minecraft.world.WorldType; 009 010 public class DerivedWorldInfo extends WorldInfo 011 { 012 /** Instance of WorldInfo. */ 013 private final WorldInfo theWorldInfo; 014 015 public DerivedWorldInfo(WorldInfo par1WorldInfo) 016 { 017 this.theWorldInfo = par1WorldInfo; 018 } 019 020 /** 021 * Gets the NBTTagCompound for the worldInfo 022 */ 023 public NBTTagCompound getNBTTagCompound() 024 { 025 return this.theWorldInfo.getNBTTagCompound(); 026 } 027 028 /** 029 * Creates a new NBTTagCompound for the world, with the given NBTTag as the "Player" 030 */ 031 public NBTTagCompound cloneNBTCompound(NBTTagCompound par1NBTTagCompound) 032 { 033 return this.theWorldInfo.cloneNBTCompound(par1NBTTagCompound); 034 } 035 036 /** 037 * Returns the seed of current world. 038 */ 039 public long getSeed() 040 { 041 return this.theWorldInfo.getSeed(); 042 } 043 044 /** 045 * Returns the x spawn position 046 */ 047 public int getSpawnX() 048 { 049 return this.theWorldInfo.getSpawnX(); 050 } 051 052 /** 053 * Return the Y axis spawning point of the player. 054 */ 055 public int getSpawnY() 056 { 057 return this.theWorldInfo.getSpawnY(); 058 } 059 060 /** 061 * Returns the z spawn position 062 */ 063 public int getSpawnZ() 064 { 065 return this.theWorldInfo.getSpawnZ(); 066 } 067 068 public long getWorldTotalTime() 069 { 070 return this.theWorldInfo.getWorldTotalTime(); 071 } 072 073 /** 074 * Get current world time 075 */ 076 public long getWorldTime() 077 { 078 return this.theWorldInfo.getWorldTime(); 079 } 080 081 @SideOnly(Side.CLIENT) 082 public long getSizeOnDisk() 083 { 084 return this.theWorldInfo.getSizeOnDisk(); 085 } 086 087 /** 088 * Returns the player's NBTTagCompound to be loaded 089 */ 090 public NBTTagCompound getPlayerNBTTagCompound() 091 { 092 return this.theWorldInfo.getPlayerNBTTagCompound(); 093 } 094 095 public int getDimension() 096 { 097 return this.theWorldInfo.getDimension(); 098 } 099 100 /** 101 * Get current world name 102 */ 103 public String getWorldName() 104 { 105 return this.theWorldInfo.getWorldName(); 106 } 107 108 /** 109 * Returns the save version of this world 110 */ 111 public int getSaveVersion() 112 { 113 return this.theWorldInfo.getSaveVersion(); 114 } 115 116 @SideOnly(Side.CLIENT) 117 118 /** 119 * Return the last time the player was in this world. 120 */ 121 public long getLastTimePlayed() 122 { 123 return this.theWorldInfo.getLastTimePlayed(); 124 } 125 126 /** 127 * Returns true if it is thundering, false otherwise. 128 */ 129 public boolean isThundering() 130 { 131 return this.theWorldInfo.isThundering(); 132 } 133 134 /** 135 * Returns the number of ticks until next thunderbolt. 136 */ 137 public int getThunderTime() 138 { 139 return this.theWorldInfo.getThunderTime(); 140 } 141 142 /** 143 * Returns true if it is raining, false otherwise. 144 */ 145 public boolean isRaining() 146 { 147 return this.theWorldInfo.isRaining(); 148 } 149 150 /** 151 * Return the number of ticks until rain. 152 */ 153 public int getRainTime() 154 { 155 return this.theWorldInfo.getRainTime(); 156 } 157 158 /** 159 * Gets the GameType. 160 */ 161 public EnumGameType getGameType() 162 { 163 return this.theWorldInfo.getGameType(); 164 } 165 166 @SideOnly(Side.CLIENT) 167 168 /** 169 * Set the x spawn position to the passed in value 170 */ 171 public void setSpawnX(int par1) {} 172 173 @SideOnly(Side.CLIENT) 174 175 /** 176 * Sets the y spawn position 177 */ 178 public void setSpawnY(int par1) {} 179 180 public void incrementTotalWorldTime(long par1) {} 181 182 @SideOnly(Side.CLIENT) 183 184 /** 185 * Set the z spawn position to the passed in value 186 */ 187 public void setSpawnZ(int par1) {} 188 189 /** 190 * Set current world time 191 */ 192 public void setWorldTime(long par1) {} 193 194 /** 195 * Sets the spawn zone position. Args: x, y, z 196 */ 197 public void setSpawnPosition(int par1, int par2, int par3) {} 198 199 public void setWorldName(String par1Str) {} 200 201 /** 202 * Sets the save version of the world 203 */ 204 public void setSaveVersion(int par1) {} 205 206 /** 207 * Sets whether it is thundering or not. 208 */ 209 public void setThundering(boolean par1) {} 210 211 /** 212 * Defines the number of ticks until next thunderbolt. 213 */ 214 public void setThunderTime(int par1) {} 215 216 /** 217 * Sets whether it is raining or not. 218 */ 219 public void setRaining(boolean par1) {} 220 221 /** 222 * Sets the number of ticks until rain. 223 */ 224 public void setRainTime(int par1) {} 225 226 /** 227 * Get whether the map features (e.g. strongholds) generation is enabled or disabled. 228 */ 229 public boolean isMapFeaturesEnabled() 230 { 231 return this.theWorldInfo.isMapFeaturesEnabled(); 232 } 233 234 /** 235 * Returns true if hardcore mode is enabled, otherwise false 236 */ 237 public boolean isHardcoreModeEnabled() 238 { 239 return this.theWorldInfo.isHardcoreModeEnabled(); 240 } 241 242 public WorldType getTerrainType() 243 { 244 return this.theWorldInfo.getTerrainType(); 245 } 246 247 public void setTerrainType(WorldType par1WorldType) {} 248 249 /** 250 * Returns true if commands are allowed on this World. 251 */ 252 public boolean areCommandsAllowed() 253 { 254 return this.theWorldInfo.areCommandsAllowed(); 255 } 256 257 /** 258 * Returns true if the World is initialized. 259 */ 260 public boolean isInitialized() 261 { 262 return this.theWorldInfo.isInitialized(); 263 } 264 265 /** 266 * Sets the initialization status of the World. 267 */ 268 public void setServerInitialized(boolean par1) {} 269 270 /** 271 * Gets the GameRules class Instance. 272 */ 273 public GameRules getGameRulesInstance() 274 { 275 return this.theWorldInfo.getGameRulesInstance(); 276 } 277 }