Class WorldServer

java.lang.Object
net.minecraft.src.World
net.minecraft.src.WorldServer
All Implemented Interfaces:
IBlockAccess
Direct Known Subclasses:
DemoWorldServer, WorldServerMulti

public class WorldServer extends World
  • Field Details

    • theChunkProviderServer

      public ChunkProviderServer theChunkProviderServer
    • levelSaving

      public boolean levelSaving
      set by CommandServerSave{all,Off,On}
    • dataSyncManager

      public final DataSyncManager dataSyncManager
    • reportInvalidSpawnCreation

      public boolean reportInvalidSpawnCreation
    • chunksToCheckForUnloadList

      protected LinkedList<ChunkCoordIntPair> chunksToCheckForUnloadList
  • Constructor Details

  • Method Details

    • tick

      public void tick()
      Runs a single tick for the world
      Overrides:
      tick in class World
    • spawnRandomCreature

      public SpawnListEntry spawnRandomCreature(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4)
      only spawns creatures allowed by the chunkProvider
    • updateAllPlayersSleepingFlag

      public void updateAllPlayersSleepingFlag()
      Updates the flag that indicates whether or not all players in the world are sleeping.
      Overrides:
      updateAllPlayersSleepingFlag in class World
    • wakeAllPlayers

      protected void wakeAllPlayers()
    • areAllPlayersAsleep

      public boolean areAllPlayersAsleep()
    • setSpawnLocation

      public void setSpawnLocation()
      Sets a new spawn location by finding an uncovered block at a random (x,z) location in the chunk.
      Overrides:
      setSpawnLocation in class World
    • tickBlocksAndAmbiance

      protected void tickBlocksAndAmbiance()
      plays random cave ambient sounds and runs updateTick on random blocks within each chunk in the vacinity of a player
      Overrides:
      tickBlocksAndAmbiance in class World
    • isBlockTickScheduledThisTick

      public boolean isBlockTickScheduledThisTick(int par1, int par2, int par3, int par4)
      Returns true if the given block will receive a scheduled tick in this tick. Args: X, Y, Z, blockID // +++START EDIT+++ FCNOTE: This is actually whether the block is about to be ticked THIS UPDATE. // ---END EDIT---
      Overrides:
      isBlockTickScheduledThisTick in class World
    • scheduleBlockUpdate

      public void scheduleBlockUpdate(int par1, int par2, int par3, int par4, int par5)
      Schedules a tick to a block with a delay (Most commonly the tick rate)
      Overrides:
      scheduleBlockUpdate in class World
    • scheduleBlockUpdateWithPriority

      public void scheduleBlockUpdateWithPriority(int par1, int par2, int par3, int par4, int par5, int par6)
      Overrides:
      scheduleBlockUpdateWithPriority in class World
    • scheduleBlockUpdateFromLoad

      public void scheduleBlockUpdateFromLoad(int par1, int par2, int par3, int par4, int par5, int par6)
      Schedules a block update from the saved information in a chunk. Called when the chunk is loaded.
      Overrides:
      scheduleBlockUpdateFromLoad in class World
    • updateEntities

      public void updateEntities()
      Updates (and cleans up) entities and tile entities
      Overrides:
      updateEntities in class World
    • resetUpdateEntityTick

      public void resetUpdateEntityTick()
      Resets the updateEntityTick field to 0
    • tickUpdates

      public boolean tickUpdates(boolean par1)
      Runs through the list of updates to run and ticks them
      Overrides:
      tickUpdates in class World
    • getPendingBlockUpdates

      public List getPendingBlockUpdates(Chunk par1Chunk, boolean par2)
      Overrides:
      getPendingBlockUpdates in class World
    • updateEntityWithOptionalForce

      public void updateEntityWithOptionalForce(Entity par1Entity, boolean par2)
      Will update the entity in the world if the chunk the entity is in is currently loaded or its forced to update. Args: entity, forceUpdate
      Overrides:
      updateEntityWithOptionalForce in class World
    • createChunkProvider

      protected IChunkProvider createChunkProvider()
      Creates the chunk provider for this world. Called in the constructor. Retrieves provider from worldProvider?
      Specified by:
      createChunkProvider in class World
    • getAllTileEntityInBox

      public List getAllTileEntityInBox(int par1, int par2, int par3, int par4, int par5, int par6)
      pars: min x,y,z , max x,y,z
    • canMineBlock

      public boolean canMineBlock(EntityPlayer par1EntityPlayer, int par2, int par3, int par4)
      Called when checking if a certain block can be mined or not. The 'spawn safe zone' check is located here.
      Overrides:
      canMineBlock in class World
    • initialize

      protected void initialize(WorldSettings par1WorldSettings)
      Overrides:
      initialize in class World
    • createSpawnPosition

      protected void createSpawnPosition(WorldSettings par1WorldSettings)
      creates a spawn position at random within 256 blocks of 0,0
    • createBonusChest

      protected void createBonusChest()
      Creates the bonus chest in the world.
    • getEntrancePortalLocation

      public ChunkCoordinates getEntrancePortalLocation()
      Gets the hard-coded portal location to use when entering this dimension.
    • saveAllChunks

      public void saveAllChunks(boolean par1, IProgressUpdate par2IProgressUpdate) throws MinecraftException
      Saves all chunks to disk while updating progress bar.
      Throws:
      MinecraftException
    • saveChunkData

      public void saveChunkData()
      saves chunk data - currently only called during execution of the Save All command
    • saveLevel

      protected void saveLevel() throws MinecraftException
      Saves the chunks to disk.
      Throws:
      MinecraftException
    • onEntityAdded

      protected void onEntityAdded(Entity par1Entity)
      Overrides:
      onEntityAdded in class World
    • onEntityRemoved

      protected void onEntityRemoved(Entity par1Entity)
      Overrides:
      onEntityRemoved in class World
    • getEntityByID

      public Entity getEntityByID(int par1)
      Returns the Entity with the given ID, or null if it doesn't exist in this World.
      Specified by:
      getEntityByID in class World
    • addWeatherEffect

      public boolean addWeatherEffect(Entity par1Entity)
      adds a lightning bolt to the list of lightning bolts in this world.
      Overrides:
      addWeatherEffect in class World
    • setEntityState

      public void setEntityState(Entity par1Entity, byte par2)
      sends a Packet 38 (Entity Status) to all tracked players of that entity
      Overrides:
      setEntityState in class World
    • newExplosion

      public Explosion newExplosion(Entity par1Entity, double par2, double par4, double par6, float par8, boolean par9, boolean par10)
      returns a new explosion. Does initiation (at time of writing Explosion is not finished)
      Overrides:
      newExplosion in class World
    • addBlockEvent

      public void addBlockEvent(int par1, int par2, int par3, int par4, int par5, int par6)
      Adds a block event with the given Args to the blockEventCache. During the next tick(), the block specified will have its onBlockEvent handler called with the given parameters. Args: X,Y,Z, BlockID, EventID, EventParameter
      Overrides:
      addBlockEvent in class World
    • flush

      public void flush()
      Syncs all changes to disk and wait for completion.
    • getMinecraftServer

      public MinecraftServer getMinecraftServer()
      // +++START EDIT+++ Gets the MinecraftServer.
    • getEntityTracker

      public EntityTracker getEntityTracker()
      Gets the EntityTracker // ---END EDIT---
    • getDefaultTeleporter

      public Teleporter getDefaultTeleporter()
    • modSpecificTick

      public void modSpecificTick()
      Overrides:
      modSpecificTick in class World
    • addChunkToCheckForUnloadList

      public void addChunkToCheckForUnloadList(int iChunkX, int iChunkZ)
    • addChunkRangeToCheckForUnloadList

      public void addChunkRangeToCheckForUnloadList(int iMinChunkX, int iMinChunkZ, int iMaxChunkX, int iMaxChunkZ)
    • isUpdateScheduledForBlock

      public boolean isUpdateScheduledForBlock(int i, int j, int k, int iBlockID)
      Overrides:
      isUpdateScheduledForBlock in class World
    • updateWeather

      protected void updateWeather()
      Overrides:
      updateWeather in class World
    • getAdjustedLightningStrikeLocation

      protected BlockPos getAdjustedLightningStrikeLocation(BlockPos strikePos)
    • getHighestPointForLightningStrike

      protected Optional<BlockPos> getHighestPointForLightningStrike(BlockPos strikePos, int radius, boolean ignoreBiomeCheck)
    • getHighestPointForLightningStrike

      protected Optional<BlockPos> getHighestPointForLightningStrike(BlockPos strikePos, int radius, int blockID, boolean ignoreBiomeCheck)
    • getHighestPointForLightningStrike

      protected Optional<BlockPos> getHighestPointForLightningStrike(BlockPos strikePos, int radius, Set<Integer> blockIDs, boolean ignoreBiomeCheck)
      Looks for the highest point within range around given coordinates.
      Parameters:
      strikePos -
      radius -
      blockIDs - Set containing ids to check. Empty set instead looks for any block
      Returns:
      The position found, or empty if nothing matched the given blockIDs
    • getHighestEntityForLightningStrike

      protected Optional<BlockPos> getHighestEntityForLightningStrike(BlockPos strikePos, int radius)
      Looks for the highest entity within range around given coordinates.
      Parameters:
      strikePos -
      radius -
      Returns:
      The position found, or empty if no entities were higher than the starting point
    • getClampedViewDistanceInChunks

      public int getClampedViewDistanceInChunks()
      Description copied from class: World
      The "view distance" is actually the range at which chunks are loaded, specified as a vanilla server parameter (default is 10 chunks).
      Overrides:
      getClampedViewDistanceInChunks in class World
    • updateActiveChunkMap

      protected void updateActiveChunkMap()
      Overrides:
      updateActiveChunkMap in class World
    • getChunkTracker

      public ChunkTracker getChunkTracker()
    • updateServerIdleState

      protected void updateServerIdleState()
    • isServerIdle

      protected boolean isServerIdle()
    • areAnyPlayersOnServer

      protected boolean areAnyPlayersOnServer()
    • getData

      public <T> T getData(DataEntry.WorldDataEntry<T> entry)
      Specified by:
      getData in class World
    • setData

      public <T> void setData(DataEntry.WorldDataEntry<T> entry, T value)
      Specified by:
      setData in class World
    • saveWorldDataToNBT

      public void saveWorldDataToNBT(File dimensionDirectory)
    • loadWorldDataFromNBT

      public void loadWorldDataFromNBT(File dimensionDirectory)
    • getMinSpeedModifier

      public float getMinSpeedModifier()
    • createSpawnPositionLocked

      public BlockPos createSpawnPositionLocked(WorldSettings par1WorldSettings, int x, int z)