public class WorldServer extends World implements IThreadListener
Modifier and Type | Field and Description |
---|---|
java.util.List<Teleporter> |
customTeleporters |
boolean |
disableLevelSaving
Whether level saving is disabled or not
|
protected java.util.Set<ChunkPos> |
doneChunks
Stores the recently processed (lighting) chunks
|
protected VillageSiege |
villageSiege |
captureBlockSnapshots, capturedBlockSnapshots, chunkProvider, DIST_HASH_MAGIC, entitiesById, eventListeners, findingSpawnPoint, isRemote, loadedEntityList, loadedTileEntityList, lootTable, mapStorage, MAX_ENTITY_RADIUS, pathListener, perWorldStorage, playerEntities, prevRainingStrength, prevThunderingStrength, provider, rainingStrength, rand, restoringBlockSnapshots, saveHandler, scheduledUpdatesAreImmediate, spawnHostileMobs, spawnPeacefulMobs, theProfiler, thunderingStrength, tickableTileEntities, unloadedEntityList, updateLCG, villageCollectionObj, weatherEffects, worldInfo, worldScoreboard
Constructor and Description |
---|
WorldServer(MinecraftServer server,
ISaveHandler saveHandlerIn,
WorldInfo info,
int dimensionId,
Profiler profilerIn) |
Modifier and Type | Method and Description |
---|---|
void |
addBlockEvent(BlockPos pos,
Block blockIn,
int eventID,
int eventParam) |
<any> |
addScheduledTask(java.lang.Runnable runnableToSchedule) |
boolean |
addWeatherEffect(Entity entityIn)
adds a lightning bolt to the list of lightning bolts in this world.
|
protected BlockPos |
adjustPosToNearbyEntity(BlockPos pos) |
boolean |
areAllPlayersAsleep()
Checks if all players in this world are sleeping.
|
boolean |
canCreatureTypeSpawnHere(EnumCreatureType creatureType,
Biome.SpawnListEntry spawnListEntry,
BlockPos pos) |
boolean |
canMineBlockBody(EntityPlayer player,
BlockPos pos) |
protected void |
createBonusChest()
Creates the bonus chest in the world.
|
protected IChunkProvider |
createChunkProvider()
Creates the chunk provider for this world.
|
BlockPos |
findNearestStructure(java.lang.String p_190528_1_,
BlockPos p_190528_2_,
boolean p_190528_3_) |
void |
flush()
Syncs all changes to disk and wait for completion.
|
ChunkProviderServer |
getChunkProvider()
gets the world's chunk provider
|
java.io.File |
getChunkSaveLocation() |
Teleporter |
getDefaultTeleporter() |
Entity |
getEntityFromUuid(java.util.UUID uuid) |
EntityTracker |
getEntityTracker()
Gets the entity tracker for this server world.
|
MinecraftServer |
getMinecraftServer() |
java.util.List<NextTickListEntry> |
getPendingBlockUpdates(Chunk chunkIn,
boolean p_72920_2_) |
java.util.List<NextTickListEntry> |
getPendingBlockUpdates(StructureBoundingBox structureBB,
boolean p_175712_2_) |
PlayerChunkMap |
getPlayerChunkMap()
Gets the player chunk map for this server world.
|
BlockPos |
getSpawnCoordinate()
Returns null for anything other than the End
|
Biome.SpawnListEntry |
getSpawnListEntryForTypeAt(EnumCreatureType creatureType,
BlockPos pos) |
TemplateManager |
getStructureTemplateManager() |
World |
init() |
void |
initialize(WorldSettings settings) |
boolean |
isBlockModifiable(EntityPlayer player,
BlockPos pos) |
boolean |
isBlockTickPending(BlockPos pos,
Block blockType) |
boolean |
isCallingFromMinecraftThread() |
protected boolean |
isChunkLoaded(int x,
int z,
boolean allowEmpty) |
boolean |
isUpdateScheduled(BlockPos pos,
Block blk)
Returns true if the identified block is scheduled to be updated.
|
void |
loadEntities(java.util.Collection<Entity> entityCollection) |
Explosion |
newExplosion(Entity entityIn,
double x,
double y,
double z,
float strength,
boolean isFlaming,
boolean isSmoking)
returns a new explosion.
|
void |
onEntityAdded(Entity entityIn) |
void |
onEntityRemoved(Entity entityIn) |
protected void |
playerCheckLight() |
void |
resetUpdateEntityTick()
Resets the updateEntityTick field to 0
|
void |
saveAllChunks(boolean p_73044_1_,
IProgressUpdate progressCallback)
Saves all chunks to disk while updating progress bar.
|
void |
saveChunkData()
saves chunk data - currently only called during execution of the Save All command
|
protected void |
saveLevel()
Saves the chunks to disk.
|
void |
scheduleBlockUpdate(BlockPos pos,
Block blockIn,
int delay,
int priority) |
void |
scheduleUpdate(BlockPos pos,
Block blockIn,
int delay) |
void |
setEntityState(Entity entityIn,
byte state)
sends a Packet 38 (Entity Status) to all tracked players of that entity
|
void |
setInitialSpawnLocation()
Sets a new spawn location by finding an uncovered block at a random (x,z) location in the chunk.
|
boolean |
spawnEntity(Entity entityIn)
Called when an entity is spawned in the world.
|
void |
spawnParticle(EntityPlayerMP player,
EnumParticleTypes particle,
boolean longDistance,
double x,
double y,
double z,
int count,
double xOffset,
double yOffset,
double zOffset,
double speed,
int... arguments) |
void |
spawnParticle(EnumParticleTypes particleType,
boolean longDistance,
double xCoord,
double yCoord,
double zCoord,
int numberOfParticles,
double xOffset,
double yOffset,
double zOffset,
double particleSpeed,
int... particleArguments)
Spawns the desired particle and sends the necessary packets to the relevant connected players.
|
void |
spawnParticle(EnumParticleTypes particleType,
double xCoord,
double yCoord,
double zCoord,
int numberOfParticles,
double xOffset,
double yOffset,
double zOffset,
double particleSpeed,
int... particleArguments)
Spawns the desired particle and sends the necessary packets to the relevant connected players.
|
void |
tick()
Runs a single tick for the world
|
protected void |
tickPlayers() |
boolean |
tickUpdates(boolean p_72955_1_)
Runs through the list of updates to run and ticks them
|
void |
updateAllPlayersSleepingFlag()
Updates the flag that indicates whether or not all players in the world are sleeping.
|
protected void |
updateBlocks() |
void |
updateBlockTick(BlockPos pos,
Block blockIn,
int delay,
int priority) |
void |
updateEntities()
Updates (and cleans up) entities and tile entities
|
void |
updateEntityWithOptionalForce(Entity entityIn,
boolean forceUpdate)
Updates the entity in the world if the chunk the entity is in is currently loaded or its forced to update.
|
protected void |
updateWeather()
Updates all weather states.
|
protected void |
wakeAllPlayers() |
addEventListener, addTileEntities, addTileEntity, addWorldInfoToCrashReport, calculateInitialSkylight, calculateInitialWeather, calculateInitialWeatherBody, calculateSkylightSubtracted, canBlockFreeze, canBlockFreezeBody, canBlockFreezeNoWater, canBlockFreezeWater, canBlockSeeSky, canSeeSky, canSnowAt, canSnowAtBody, checkBlockCollision, checkLight, checkLightFor, checkNoEntityCollision, checkNoEntityCollision, checkSessionLock, collidesWithAnyBlock, containsAnyLiquid, countEntities, countEntities, createExplosion, destroyBlock, extinguishFire, findNearestEntityWithinAABB, func_191503_g, getActualHeight, getBiome, getBiomeForCoordsBody, getBiomeProvider, getBlockDensity, getBlockLightOpacity, getBlockState, getCapability, getCelestialAngle, getCelestialAngleRadians, getChunkFromBlockCoords, getChunkFromChunkCoords, getChunksLowestHorizon, getClosestPlayer, getClosestPlayer, getClosestPlayerToEntity, getCloudColorBody, getCloudColour, getCollisionBoxes, getCombinedLight, getCurrentDate, getCurrentMoonPhaseFactor, getCurrentMoonPhaseFactorBody, getDebugLoadedEntities, getDifficulty, getDifficultyForLocation, getEntities, getEntitiesInAABBexcluding, getEntitiesWithinAABB, getEntitiesWithinAABB, getEntitiesWithinAABBExcludingEntity, getEntityByID, getFogColor, getGameRules, getGroundAboveSeaLevel, getHeight, getHeight, getHeight, getHorizon, getLastLightningBolt, getLight, getLight, getLightBrightness, getLightFor, getLightFromNeighbors, getLightFromNeighborsFor, getLoadedEntityList, getLootTableManager, getMapStorage, getMoonPhase, getNearestAttackablePlayer, getNearestAttackablePlayer, getNearestAttackablePlayer, getNearestPlayerNotCreative, getPersistentChunkIterable, getPersistentChunks, getPerWorldStorage, getPlayerEntityByName, getPlayerEntityByUUID, getPlayers, getPrecipitationHeight, getProviderName, getRainStrength, getRedstonePower, getSaveHandler, getScoreboard, getSeaLevel, getSeed, getSkyColor, getSkyColorBody, getSkylightSubtracted, getSpawnPoint, getStarBrightness, getStarBrightnessBody, getStrongPower, getStrongPower, getSunBrightness, getSunBrightnessBody, getSunBrightnessFactor, getThunderStrength, getTileEntity, getTopSolidOrLiquidBlock, getTotalWorldTime, getUniqueDataId, getVillageCollection, getWorldBorder, getWorldInfo, getWorldTime, getWorldType, handleMaterialAcceleration, hasCapability, immediateBlockTick, initCapabilities, isAirBlock, isAnyPlayerWithinRangeAt, isAreaLoaded, isAreaLoaded, isAreaLoaded, isAreaLoaded, isAreaLoaded, isAreaLoaded, isBlockFullCube, isBlockIndirectlyGettingPowered, isBlockinHighHumidity, isBlockLoaded, isBlockLoaded, isBlockNormalCube, isBlockPowered, isChunkGeneratedAt, isDaytime, isFlammableWithin, isMaterialInBB, isOutsideBuildHeight, isRaining, isRainingAt, isSidePowered, isSideSolid, isSideSolid, isSpawnChunk, isThundering, isValid, joinEntityInSurroundings, loadData, makeFireworks, markAndNotifyBlock, markBlockRangeForRenderUpdate, markBlockRangeForRenderUpdate, markBlocksDirtyVertical, markChunkDirty, markTileEntityForRemoval, mayPlace, neighborChanged, notifyBlockUpdate, notifyLightSet, notifyNeighborsOfStateChange, notifyNeighborsOfStateExcept, notifyNeighborsRespectDebug, observedNeighborChanged, playBroadcastSound, playEvent, playEvent, playMoodSoundAndCheckLight, playRecord, playSound, playSound, playSound, rayTraceBlocks, rayTraceBlocks, rayTraceBlocks, removeEntity, removeEntityDangerously, removeEventListener, removeTileEntity, sendBlockBreakProgress, sendPacketToServer, sendQuittingDisconnectingPacket, setAllowedSpawnTypes, setBlockState, setBlockState, setBlockToAir, setData, setLastLightningBolt, setLightFor, setRainStrength, setRandomSeed, setSeaLevel, setSkylightSubtracted, setSpawnPoint, setThunderStrength, setTileEntity, setTotalWorldTime, setWorldTime, spawnAlwaysVisibleParticle, spawnParticle, spawnParticle, unloadEntities, updateComparatorOutputLevel, updateEntity, updateObservingBlocksAt, updateWeatherBody
public boolean disableLevelSaving
protected final VillageSiege villageSiege
protected java.util.Set<ChunkPos> doneChunks
public java.util.List<Teleporter> customTeleporters
public WorldServer(MinecraftServer server, ISaveHandler saveHandlerIn, WorldInfo info, int dimensionId, Profiler profilerIn)
public Biome.SpawnListEntry getSpawnListEntryForTypeAt(EnumCreatureType creatureType, BlockPos pos)
public boolean canCreatureTypeSpawnHere(EnumCreatureType creatureType, Biome.SpawnListEntry spawnListEntry, BlockPos pos)
public void updateAllPlayersSleepingFlag()
updateAllPlayersSleepingFlag
in class World
protected void wakeAllPlayers()
public boolean areAllPlayersAsleep()
public void setInitialSpawnLocation()
setInitialSpawnLocation
in class World
protected boolean isChunkLoaded(int x, int z, boolean allowEmpty)
isChunkLoaded
in class World
protected void playerCheckLight()
protected void updateBlocks()
updateBlocks
in class World
public boolean isBlockTickPending(BlockPos pos, Block blockType)
isBlockTickPending
in class World
public boolean isUpdateScheduled(BlockPos pos, Block blk)
isUpdateScheduled
in class World
public void scheduleUpdate(BlockPos pos, Block blockIn, int delay)
scheduleUpdate
in class World
public void updateBlockTick(BlockPos pos, Block blockIn, int delay, int priority)
updateBlockTick
in class World
public void scheduleBlockUpdate(BlockPos pos, Block blockIn, int delay, int priority)
scheduleBlockUpdate
in class World
public void updateEntities()
updateEntities
in class World
protected void tickPlayers()
tickPlayers
in class World
public void resetUpdateEntityTick()
public boolean tickUpdates(boolean p_72955_1_)
tickUpdates
in class World
public java.util.List<NextTickListEntry> getPendingBlockUpdates(Chunk chunkIn, boolean p_72920_2_)
getPendingBlockUpdates
in class World
public java.util.List<NextTickListEntry> getPendingBlockUpdates(StructureBoundingBox structureBB, boolean p_175712_2_)
getPendingBlockUpdates
in class World
public void updateEntityWithOptionalForce(Entity entityIn, boolean forceUpdate)
updateEntityWithOptionalForce
in class World
protected IChunkProvider createChunkProvider()
createChunkProvider
in class World
public boolean isBlockModifiable(EntityPlayer player, BlockPos pos)
isBlockModifiable
in class World
public boolean canMineBlockBody(EntityPlayer player, BlockPos pos)
canMineBlockBody
in class World
public void initialize(WorldSettings settings)
initialize
in class World
protected void createBonusChest()
public BlockPos getSpawnCoordinate()
public void saveAllChunks(boolean p_73044_1_, IProgressUpdate progressCallback) throws MinecraftException
MinecraftException
public void saveChunkData()
protected void saveLevel() throws MinecraftException
MinecraftException
public boolean spawnEntity(Entity entityIn)
spawnEntity
in class World
public void loadEntities(java.util.Collection<Entity> entityCollection)
loadEntities
in class World
public void onEntityAdded(Entity entityIn)
onEntityAdded
in class World
public void onEntityRemoved(Entity entityIn)
onEntityRemoved
in class World
public boolean addWeatherEffect(Entity entityIn)
addWeatherEffect
in class World
public void setEntityState(Entity entityIn, byte state)
setEntityState
in class World
public ChunkProviderServer getChunkProvider()
getChunkProvider
in class World
public Explosion newExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isFlaming, boolean isSmoking)
newExplosion
in class World
public void addBlockEvent(BlockPos pos, Block blockIn, int eventID, int eventParam)
addBlockEvent
in class World
public void flush()
protected void updateWeather()
updateWeather
in class World
public MinecraftServer getMinecraftServer()
getMinecraftServer
in class World
public EntityTracker getEntityTracker()
public PlayerChunkMap getPlayerChunkMap()
public Teleporter getDefaultTeleporter()
public TemplateManager getStructureTemplateManager()
public void spawnParticle(EnumParticleTypes particleType, double xCoord, double yCoord, double zCoord, int numberOfParticles, double xOffset, double yOffset, double zOffset, double particleSpeed, int... particleArguments)
public void spawnParticle(EnumParticleTypes particleType, boolean longDistance, double xCoord, double yCoord, double zCoord, int numberOfParticles, double xOffset, double yOffset, double zOffset, double particleSpeed, int... particleArguments)
public void spawnParticle(EntityPlayerMP player, EnumParticleTypes particle, boolean longDistance, double x, double y, double z, int count, double xOffset, double yOffset, double zOffset, double speed, int... arguments)
public Entity getEntityFromUuid(java.util.UUID uuid)
public <any> addScheduledTask(java.lang.Runnable runnableToSchedule)
addScheduledTask
in interface IThreadListener
public boolean isCallingFromMinecraftThread()
isCallingFromMinecraftThread
in interface IThreadListener
public BlockPos findNearestStructure(java.lang.String p_190528_1_, BlockPos p_190528_2_, boolean p_190528_3_)
findNearestStructure
in class World
public java.io.File getChunkSaveLocation()