Package net.minecraft.src
Class WorldServer
java.lang.Object
net.minecraft.src.World
net.minecraft.src.WorldServer
- All Implemented Interfaces:
IBlockAccess
- Direct Known Subclasses:
DemoWorldServer,WorldServerMulti
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected LinkedList<ChunkCoordIntPair>final DataSyncManagerbooleanset by CommandServerSave{all,Off,On}booleanFields inherited from class net.minecraft.src.World
activeChunksCoordsList, activeChunksCoordsMap, chunkProvider, difficultySetting, DIST_HASH_MAGIC, findingSpawnPoint, isRemote, lastLightningBolt, LOADED_CHUNKS_UPDATE_RANGE, loadedEntityList, loadedTileEntityList, mapStorage, playerEntities, prevRainingStrength, prevThunderingStrength, provider, rainingStrength, rand, saveHandler, scheduledUpdatesAreImmediate, skylightSubtracted, spawnHostileMobs, spawnPeacefulMobs, theProfiler, thunderingStrength, unloadedEntityList, updateLCG, villageCollectionObj, weatherEffects, worldAccesses, worldInfo, worldScoreboard -
Constructor Summary
ConstructorsConstructorDescriptionWorldServer(MinecraftServer par1MinecraftServer, ISaveHandler par2ISaveHandler, String par3Str, int par4, WorldSettings par5WorldSettings, Profiler par6Profiler, ILogAgent par7ILogAgent) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBlockEvent(int par1, int par2, int par3, int par4, int par5, int par6) Adds a block event with the given Args to the blockEventCache.voidaddChunkRangeToCheckForUnloadList(int iMinChunkX, int iMinChunkZ, int iMaxChunkX, int iMaxChunkZ) voidaddChunkToCheckForUnloadList(int iChunkX, int iChunkZ) booleanaddWeatherEffect(Entity par1Entity) adds a lightning bolt to the list of lightning bolts in this world.booleanprotected booleanbooleancanMineBlock(EntityPlayer par1EntityPlayer, int par2, int par3, int par4) Called when checking if a certain block can be mined or not.protected voidCreates the bonus chest in the world.protected IChunkProviderCreates the chunk provider for this world.protected voidcreateSpawnPosition(WorldSettings par1WorldSettings) creates a spawn position at random within 256 blocks of 0,0createSpawnPositionLocked(WorldSettings par1WorldSettings, int x, int z) voidflush()Syncs all changes to disk and wait for completion.protected BlockPosgetAdjustedLightningStrikeLocation(BlockPos strikePos) getAllTileEntityInBox(int par1, int par2, int par3, int par4, int par5, int par6) pars: min x,y,z , max x,y,zintThe "view distance" is actually the range at which chunks are loaded, specified as a vanilla server parameter (default is 10 chunks).<T> TgetData(DataEntry.WorldDataEntry<T> entry) getEntityByID(int par1) Returns the Entity with the given ID, or null if it doesn't exist in this World.Gets the EntityTracker // ---END EDIT---Gets the hard-coded portal location to use when entering this dimension.getHighestEntityForLightningStrike(BlockPos strikePos, int radius) Looks for the highest entity within range around given coordinates.getHighestPointForLightningStrike(BlockPos strikePos, int radius, boolean ignoreBiomeCheck) getHighestPointForLightningStrike(BlockPos strikePos, int radius, int blockID, boolean ignoreBiomeCheck) getHighestPointForLightningStrike(BlockPos strikePos, int radius, Set<Integer> blockIDs, boolean ignoreBiomeCheck) Looks for the highest point within range around given coordinates.// +++START EDIT+++ Gets the MinecraftServer.floatgetPendingBlockUpdates(Chunk par1Chunk, boolean par2) protected voidinitialize(WorldSettings par1WorldSettings) booleanisBlockTickScheduledThisTick(int par1, int par2, int par3, int par4) Returns true if the given block will receive a scheduled tick in this tick.protected booleanbooleanisUpdateScheduledForBlock(int i, int j, int k, int iBlockID) voidloadWorldDataFromNBT(File dimensionDirectory) voidnewExplosion(Entity par1Entity, double par2, double par4, double par6, float par8, boolean par9, boolean par10) returns a new explosion.protected voidonEntityAdded(Entity par1Entity) protected voidonEntityRemoved(Entity par1Entity) voidResets the updateEntityTick field to 0voidsaveAllChunks(boolean par1, IProgressUpdate par2IProgressUpdate) Saves all chunks to disk while updating progress bar.voidsaves chunk data - currently only called during execution of the Save All commandprotected voidSaves the chunks to disk.voidsaveWorldDataToNBT(File dimensionDirectory) voidscheduleBlockUpdate(int par1, int par2, int par3, int par4, int par5) Schedules a tick to a block with a delay (Most commonly the tick rate)voidscheduleBlockUpdateFromLoad(int par1, int par2, int par3, int par4, int par5, int par6) Schedules a block update from the saved information in a chunk.voidscheduleBlockUpdateWithPriority(int par1, int par2, int par3, int par4, int par5, int par6) <T> voidsetData(DataEntry.WorldDataEntry<T> entry, T value) voidsetEntityState(Entity par1Entity, byte par2) sends a Packet 38 (Entity Status) to all tracked players of that entityvoidSets a new spawn location by finding an uncovered block at a random (x,z) location in the chunk.spawnRandomCreature(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) only spawns creatures allowed by the chunkProvidervoidtick()Runs a single tick for the worldprotected voidplays random cave ambient sounds and runs updateTick on random blocks within each chunk in the vacinity of a playerbooleantickUpdates(boolean par1) Runs through the list of updates to run and ticks themprotected voidvoidUpdates the flag that indicates whether or not all players in the world are sleeping.voidUpdates (and cleans up) entities and tile entitiesvoidupdateEntityWithOptionalForce(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.protected voidprotected voidprotected voidMethods inherited from class net.minecraft.src.World
addAreaAroundChunkToActiveChunkMap, addEntityToActiveChunkMap, addLoadedEntities, addTileEntity, addToActiveChunkMap, addWorldAccess, addWorldInfoToCrashReport, blockExists, blockGetRenderType, blockHasTileEntity, calculateInitialSkylight, calculateSkylightSubtracted, canBlockFreeze, canBlockSeeTheSky, canBlockSuffocateEntity, canLightningStrikeAt, canLightningStrikeAtPos, canPlaceEntityOnSide, canSnowAt, checkBlockCollision, checkChunksExist, checkLocationForMouseOverRayTrace, checkNoEntityCollision, checkNoEntityCollision, checkSessionLock, chunkExists, clearActiveChunkMap, clip, clip, commandToggleDownfall, computeOverworldSunBrightnessWithMoonPhases, countEntitiesThatApplyToSpawnCap, createExplosion, destroyBlock, destroyBlockInWorldPartially, doChunksNearChunkExist, doesBlockHaveSolidTopSurface, extendedLevelsInChunkCache, extinguishFire, findClosestStructure, findClosestStructureAll, findNearestEntityWithinAABB, func_82738_a, func_82739_e, func_92088_a, func_96440_m, getActiveChunkRangeInChunks, getActiveChunksCoordsList, getActualHeight, getActualTopSolidOrLiquidBlockHeight, getAmbientBeaconEffectAtLocation, getBiomeGenForCoords, getBlockDensity, getBlockId, getBlockLightValue, getBlockLightValue_do, getBlockLightValueNoSky, getBlockMaterial, getBlockMetadata, getBlockNaturalLightValue, getBlockNaturalLightValueMaximum, getBlockPowerInput, getBlockTileEntity, getBrightness, getCelestialAngle, getCelestialAngleRadians, getChunkFromBlockCoords, getChunkFromChunkCoords, getChunkHeightMapMinimum, getChunkProvider, getClosestEntityMatchingCriteriaWithinRange, getClosestPlayer, getClosestPlayerToEntity, getClosestVulnerablePlayer, getClosestVulnerablePlayerToEntity, getCloudColour, getCollidingBlockBounds, getCollidingBoundingBoxes, getCurrentDate, getCurrentMoonPhaseFactor, getDebugLoadedEntities, getDifficultyParameter, getEntitiesWithinAABB, getEntitiesWithinAABBExcludingEntity, getEntitiesWithinAABBExcludingEntity, getEntityPathToXYZ, getFirstUncoveredBlock, getFogColor, getFullBlockLightValue, getGameRules, getHeight, getHeightValue, getHorizon, getIndirectPowerLevelTo, getIndirectPowerOutput, getLightBrightness, getLightBrightnessForSkyBlocks, getLoadedEntityList, getLocationTensionFactor, getMinecartSoundUpdater, getMobSpawnRangeInChunks, getModifiedPlayerTargetingDistance, getMoonPhase, getNaturalLightBrightness, getNumEntitiesThatApplyToSquidPossessionCap, getPathEntityToEntity, getPlayerEntityByName, getPrecipitationHeight, getProviderName, getRainStrength, getSavedLightValue, getSaveHandler, getScoreboard, getSeed, getSkyBlockTypeBrightness, getSkyColor, getSpawnPoint, getStarBrightness, getStrongestIndirectPower, getSunBrightness, getTensionFactorForBlock, getTopSolidOrLiquidBlock, getTotalWorldTime, getUniqueDataId, getWeightedThunderStrength, getWorldChunkManager, getWorldInfo, getWorldLogAgent, getWorldTime, getWorldVec3Pool, handleMaterialAcceleration, installationIntegrityTest, isAABBInMaterial, isAirBlock, isAnyLiquid, isBlockFreezable, isBlockFreezableNaturally, isBlockFullCube, isBlockGettingPowered, isBlockHighHumidity, isBlockIndirectlyGettingPowered, isBlockNormalCube, isBlockNormalCubeDefault, isBlockOpaqueCube, isBlockPosActive, isBlockProvidingPowerTo, isBlockRedstoneConductor, isBoundingBoxBurning, isChunkActive, isDaytime, isMaterialInBB, isPrecipitatingAtPos, isPrecipitatingAtPos, isRaining, isRainingAtPos, isSnowingAtPos, isTheEndNigh, isThundering, isUpdatePendingThisTickForBlock, joinEntityInSurroundings, loadItemData, markBlockForRenderUpdate, markBlockForUpdate, markBlockRangeForRenderUpdate, markBlocksDirtyVertical, markTileEntityChunkModified, markTileEntityForDespawn, moodSoundAndLightCheck, mouseOverRayTrace, newExplosionNoFX, notifyBlockChange, notifyBlockOfNeighborChange, notifyBlocksOfNeighborChange, notifyBlocksOfNeighborChange, notifyNearbyAnimalsOfPlayerBlockAddOrRemove, playAuxSFX, playAuxSFXAtEntity, playRecord, playSound, playSound, playSoundAtEntity, playSoundEffect, playSoundToNearExcept, rayTraceBlocks_do_do, removeBlockTileEntity, removeEntity, removePlayerEntityDangerously, removeWorldAccess, selectEntitiesWithinAABB, sendQuittingDisconnectingPacket, setActivePlayerChunksAndCheckLight, setAllowedSpawnTypes, setBlock, setBlock, setBlockAndMetadata, setBlockAndMetadataWithNotify, setBlockMetadata, setBlockMetadataWithClient, setBlockMetadataWithNotify, setBlockMetadataWithNotify, SetBlockMetadataWithNotify, setBlockMetadataWithNotifyNoClient, setBlockTileEntity, setBlockToAir, setBlockWithNotify, setItemData, setLightValue, setRainStrength, setRandomSeed, setSpawnLocation, setWorldTime, spawnEntityInWorld, spawnParticle, unloadEntities, updateAllLightTypes, updateEntity, updateLightByTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.src.IBlockAccess
editClass
-
Field Details
-
theChunkProviderServer
-
levelSaving
public boolean levelSavingset by CommandServerSave{all,Off,On} -
dataSyncManager
-
reportInvalidSpawnCreation
public boolean reportInvalidSpawnCreation -
chunksToCheckForUnloadList
-
-
Constructor Details
-
WorldServer
public WorldServer(MinecraftServer par1MinecraftServer, ISaveHandler par2ISaveHandler, String par3Str, int par4, WorldSettings par5WorldSettings, Profiler par6Profiler, ILogAgent par7ILogAgent)
-
-
Method Details
-
tick
public void tick()Runs a single tick for the 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:
updateAllPlayersSleepingFlagin classWorld
-
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:
setSpawnLocationin classWorld
-
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:
tickBlocksAndAmbiancein classWorld
-
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:
isBlockTickScheduledThisTickin classWorld
-
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:
scheduleBlockUpdatein classWorld
-
scheduleBlockUpdateWithPriority
public void scheduleBlockUpdateWithPriority(int par1, int par2, int par3, int par4, int par5, int par6) - Overrides:
scheduleBlockUpdateWithPriorityin classWorld
-
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:
scheduleBlockUpdateFromLoadin classWorld
-
updateEntities
public void updateEntities()Updates (and cleans up) entities and tile entities- Overrides:
updateEntitiesin classWorld
-
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:
tickUpdatesin classWorld
-
getPendingBlockUpdates
- Overrides:
getPendingBlockUpdatesin classWorld
-
updateEntityWithOptionalForce
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:
updateEntityWithOptionalForcein classWorld
-
createChunkProvider
Creates the chunk provider for this world. Called in the constructor. Retrieves provider from worldProvider?- Specified by:
createChunkProviderin classWorld
-
getAllTileEntityInBox
pars: min x,y,z , max x,y,z -
canMineBlock
Called when checking if a certain block can be mined or not. The 'spawn safe zone' check is located here.- Overrides:
canMineBlockin classWorld
-
initialize
- Overrides:
initializein classWorld
-
createSpawnPosition
creates a spawn position at random within 256 blocks of 0,0 -
createBonusChest
protected void createBonusChest()Creates the bonus chest in the world. -
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
Saves the chunks to disk.- Throws:
MinecraftException
-
onEntityAdded
- Overrides:
onEntityAddedin classWorld
-
onEntityRemoved
- Overrides:
onEntityRemovedin classWorld
-
getEntityByID
Returns the Entity with the given ID, or null if it doesn't exist in this World.- Specified by:
getEntityByIDin classWorld
-
addWeatherEffect
adds a lightning bolt to the list of lightning bolts in this world.- Overrides:
addWeatherEffectin classWorld
-
setEntityState
sends a Packet 38 (Entity Status) to all tracked players of that entity- Overrides:
setEntityStatein classWorld
-
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:
newExplosionin classWorld
-
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:
addBlockEventin classWorld
-
flush
public void flush()Syncs all changes to disk and wait for completion. -
getMinecraftServer
// +++START EDIT+++ Gets the MinecraftServer. -
getEntityTracker
Gets the EntityTracker // ---END EDIT--- -
getDefaultTeleporter
-
modSpecificTick
public void modSpecificTick()- Overrides:
modSpecificTickin classWorld
-
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:
isUpdateScheduledForBlockin classWorld
-
updateWeather
protected void updateWeather()- Overrides:
updateWeatherin classWorld
-
getAdjustedLightningStrikeLocation
-
getHighestPointForLightningStrike
-
getHighestPointForLightningStrike
-
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
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:WorldThe "view distance" is actually the range at which chunks are loaded, specified as a vanilla server parameter (default is 10 chunks).- Overrides:
getClampedViewDistanceInChunksin classWorld
-
updateActiveChunkMap
protected void updateActiveChunkMap()- Overrides:
updateActiveChunkMapin classWorld
-
getChunkTracker
-
updateServerIdleState
protected void updateServerIdleState() -
isServerIdle
protected boolean isServerIdle() -
areAnyPlayersOnServer
protected boolean areAnyPlayersOnServer() -
getData
-
setData
-
saveWorldDataToNBT
-
loadWorldDataFromNBT
-
getMinSpeedModifier
public float getMinSpeedModifier() -
createSpawnPositionLocked
-