public class WorldServer extends World implements IThreadListener
Modifier and Type | Class and Description |
---|---|
(package private) static class |
WorldServer.ServerBlockEventList |
Modifier and Type | Field and Description |
---|---|
private boolean |
allPlayersSleeping
is false if there are no players
|
private int |
blockEventCacheIndex |
private static java.util.List<WeightedRandomChestContent> |
bonusChestContent |
boolean |
disableLevelSaving
Whether level saving is disabled or not
|
private java.util.Map<java.util.UUID,Entity> |
entitiesByUuid |
private WorldServer.ServerBlockEventList[] |
field_147490_S |
private static org.apache.logging.log4j.Logger |
logger |
private MinecraftServer |
mcServer |
private SpawnerAnimals |
mobSpawner |
private java.util.Set<NextTickListEntry> |
pendingTickListEntriesHashSet |
private java.util.List<NextTickListEntry> |
pendingTickListEntriesThisTick |
private java.util.TreeSet<NextTickListEntry> |
pendingTickListEntriesTreeSet |
ChunkProviderServer |
theChunkProviderServer |
private EntityTracker |
theEntityTracker |
private PlayerManager |
thePlayerManager |
private int |
updateEntityTick |
protected VillageSiege |
villageSiege |
private Teleporter |
worldTeleporter
the teleporter to use when the entity is being transferred into the dimension
|
activeChunkSet, chunkProvider, DIST_HASH_MAGIC, entitiesById, findingSpawnPoint, isRemote, lightUpdateBlockList, loadedEntityList, loadedTileEntityList, mapStorage, playerEntities, prevRainingStrength, prevThunderingStrength, provider, rainingStrength, rand, saveHandler, scheduledUpdatesAreImmediate, spawnHostileMobs, spawnPeacefulMobs, theProfiler, thunderingStrength, tickableTileEntities, unloadedEntityList, updateLCG, villageCollectionObj, weatherEffects, worldAccesses, 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) |
com.google.common.util.concurrent.ListenableFuture<java.lang.Object> |
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() |
boolean |
canCreatureTypeSpawnHere(EnumCreatureType creatureType,
BiomeGenBase.SpawnListEntry spawnListEntry,
BlockPos pos) |
private boolean |
canSpawnAnimals() |
private boolean |
canSpawnNPCs() |
protected void |
createBonusChest()
Creates the bonus chest in the world.
|
protected IChunkProvider |
createChunkProvider()
Creates the chunk provider for this world.
|
private void |
createSpawnPosition(WorldSettings p_73052_1_)
creates a spawn position at random within 256 blocks of 0,0
|
private boolean |
fireBlockEvent(BlockEventData event) |
void |
flush()
Syncs all changes to disk and wait for completion.
|
java.util.List<NextTickListEntry> |
func_175712_a(StructureBoundingBox structureBB,
boolean p_175712_2_) |
Teleporter |
getDefaultTeleporter() |
Entity |
getEntityFromUuid(java.util.UUID uuid) |
EntityTracker |
getEntityTracker()
Gets the EntityTracker
|
MinecraftServer |
getMinecraftServer() |
java.util.List<NextTickListEntry> |
getPendingBlockUpdates(Chunk chunkIn,
boolean p_72920_2_) |
PlayerManager |
getPlayerManager() |
protected int |
getRenderDistanceChunks() |
BlockPos |
getSpawnCoordinate()
Returns null for anything other than the End
|
BiomeGenBase.SpawnListEntry |
getSpawnListEntryForTypeAt(EnumCreatureType creatureType,
BlockPos pos) |
java.util.List<TileEntity> |
getTileEntitiesIn(int minX,
int minY,
int minZ,
int maxX,
int maxY,
int maxZ) |
World |
init() |
void |
initialize(WorldSettings settings) |
boolean |
isBlockModifiable(EntityPlayer player,
BlockPos pos) |
boolean |
isBlockTickPending(BlockPos pos,
Block blockType) |
boolean |
isCallingFromMinecraftThread() |
Explosion |
newExplosion(Entity entityIn,
double x,
double y,
double z,
float strength,
boolean isFlaming,
boolean isSmoking)
returns a new explosion.
|
protected void |
onEntityAdded(Entity entityIn) |
protected void |
onEntityRemoved(Entity entityIn) |
private void |
resetRainAndThunder() |
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) |
private void |
sendQueuedBlockEvents() |
private void |
setDebugWorldSettings() |
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.
|
void |
spawnParticle(EnumParticleTypes particleType,
boolean longDistance,
double xCoord,
double yCoord,
double zCoord,
int numberOfParticles,
double xOffset,
double yOffset,
double zOffset,
double particleSpeed,
int... p_180505_18_)
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 p_175739_9_,
double p_175739_11_,
double p_175739_13_,
double p_175739_15_,
int... p_175739_17_)
Spawns the desired particle and sends the necessary packets to the relevant connected players.
|
void |
tick()
Runs a single tick for the world
|
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)
Will update 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() |
addTileEntities, addTileEntity, addWorldAccess, addWorldInfoToCrashReport, calculateInitialSkylight, calculateInitialWeather, calculateSkylightSubtracted, canBlockBePlaced, canBlockFreeze, canBlockFreezeNoWater, canBlockFreezeWater, canBlockSeeSky, canLightningStrike, canSeeSky, canSnowAt, checkBlockCollision, checkLight, checkLightFor, checkNoEntityCollision, checkNoEntityCollision, checkSessionLock, countEntities, createExplosion, destroyBlock, doesBlockHaveSolidTopSurface, extendedLevelsInChunkCache, extinguishFire, findNearestEntityWithinAABB, forceBlockUpdateTick, func_147461_a, func_181544_b, func_181545_F, getActualHeight, getBiomeGenForCoords, getBlockDensity, getBlockState, getCelestialAngle, getCelestialAngleRadians, getChunkFromBlockCoords, getChunkFromChunkCoords, getChunkProvider, getChunksLowestHorizon, getClosestPlayer, getClosestPlayerToEntity, getCloudColour, getCollidingBoundingBoxes, getCombinedLight, getCurrentDate, getCurrentMoonPhaseFactor, getDebugLoadedEntities, getDifficulty, getDifficultyForLocation, getEntities, getEntitiesInAABBexcluding, getEntitiesWithinAABB, getEntitiesWithinAABB, getEntitiesWithinAABBExcludingEntity, getEntityByID, getFogColor, getGameRules, getGroundAboveSeaLevel, getHeight, getHeight, getHorizon, getLastLightningBolt, getLight, getLight, getLightBrightness, getLightFor, getLightFromNeighbors, getLightFromNeighborsFor, getLoadedEntityList, getMapStorage, getMoonPhase, getPlayerEntityByName, getPlayerEntityByUUID, getPlayers, getPrecipitationHeight, getProviderName, getRainStrength, getRedstonePower, getSaveHandler, getScoreboard, getSeed, getSkyColor, getSkylightSubtracted, getSpawnPoint, getStarBrightness, getStrongholdPos, getStrongPower, getStrongPower, getSunBrightness, getThunderStrength, getTileEntity, getTopSolidOrLiquidBlock, getTotalWorldTime, getUniqueDataId, getVillageCollection, getWorldBorder, getWorldChunkManager, getWorldInfo, getWorldTime, getWorldType, handleMaterialAcceleration, isAABBInMaterial, isAirBlock, isAnyLiquid, isAnyPlayerWithinRangeAt, isAreaLoaded, isAreaLoaded, isAreaLoaded, isAreaLoaded, isAreaLoaded, isAreaLoaded, isBlockFullCube, isBlockIndirectlyGettingPowered, isBlockinHighHumidity, isBlockLoaded, isBlockLoaded, isBlockNormalCube, isBlockPowered, isChunkLoaded, isDaytime, isFindingSpawnPoint, isFlammableWithin, isInsideBorder, isMaterialInBB, isRaining, isSidePowered, isSpawnChunk, isThundering, joinEntityInSurroundings, loadEntities, loadItemData, makeFireworks, markBlockForUpdate, markBlockRangeForRenderUpdate, markBlockRangeForRenderUpdate, markBlocksDirtyVertical, markChunkDirty, markTileEntityForRemoval, notifyBlockOfStateChange, notifyLightSet, notifyNeighborsOfStateChange, notifyNeighborsOfStateExcept, notifyNeighborsRespectDebug, playAuxSFX, playAuxSFXAtEntity, playBroadcastSound, playMoodSoundAndCheckLight, playRecord, playSound, playSoundAtEntity, playSoundEffect, playSoundToNearExcept, rayTraceBlocks, rayTraceBlocks, rayTraceBlocks, removeEntity, removePlayerEntityDangerously, removeTileEntity, removeWorldAccess, sendBlockBreakProgress, sendQuittingDisconnectingPacket, setActivePlayerChunksAndCheckLight, setAllowedSpawnTypes, setBlockState, setBlockState, setBlockToAir, setItemData, setLastLightningBolt, setLightFor, setRainStrength, setRandomSeed, setSkylightSubtracted, setSpawnPoint, setThunderStrength, setTileEntity, setTotalWorldTime, setWorldTime, spawnEntityInWorld, spawnParticle, spawnParticle, unloadEntities, updateComparatorOutputLevel, updateEntity
private static final org.apache.logging.log4j.Logger logger
private final MinecraftServer mcServer
private final EntityTracker theEntityTracker
private final PlayerManager thePlayerManager
private final java.util.Set<NextTickListEntry> pendingTickListEntriesHashSet
private final java.util.TreeSet<NextTickListEntry> pendingTickListEntriesTreeSet
private final java.util.Map<java.util.UUID,Entity> entitiesByUuid
public ChunkProviderServer theChunkProviderServer
public boolean disableLevelSaving
private boolean allPlayersSleeping
private int updateEntityTick
private final Teleporter worldTeleporter
private final SpawnerAnimals mobSpawner
protected final VillageSiege villageSiege
private WorldServer.ServerBlockEventList[] field_147490_S
private int blockEventCacheIndex
private static final java.util.List<WeightedRandomChestContent> bonusChestContent
private java.util.List<NextTickListEntry> pendingTickListEntriesThisTick
public WorldServer(MinecraftServer server, ISaveHandler saveHandlerIn, WorldInfo info, int dimensionId, Profiler profilerIn)
public BiomeGenBase.SpawnListEntry getSpawnListEntryForTypeAt(EnumCreatureType creatureType, BlockPos pos)
public boolean canCreatureTypeSpawnHere(EnumCreatureType creatureType, BiomeGenBase.SpawnListEntry spawnListEntry, BlockPos pos)
public void updateAllPlayersSleepingFlag()
updateAllPlayersSleepingFlag
in class World
protected void wakeAllPlayers()
private void resetRainAndThunder()
public boolean areAllPlayersAsleep()
public void setInitialSpawnLocation()
setInitialSpawnLocation
in class World
protected void updateBlocks()
updateBlocks
in class World
public boolean isBlockTickPending(BlockPos pos, Block blockType)
isBlockTickPending
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
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> func_175712_a(StructureBoundingBox structureBB, boolean p_175712_2_)
func_175712_a
in class World
public void updateEntityWithOptionalForce(Entity entityIn, boolean forceUpdate)
updateEntityWithOptionalForce
in class World
private boolean canSpawnNPCs()
private boolean canSpawnAnimals()
protected IChunkProvider createChunkProvider()
createChunkProvider
in class World
public java.util.List<TileEntity> getTileEntitiesIn(int minX, int minY, int minZ, int maxX, int maxY, int maxZ)
public boolean isBlockModifiable(EntityPlayer player, BlockPos pos)
isBlockModifiable
in class World
public void initialize(WorldSettings settings)
initialize
in class World
private void setDebugWorldSettings()
private void createSpawnPosition(WorldSettings p_73052_1_)
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
protected void onEntityAdded(Entity entityIn)
onEntityAdded
in class World
protected 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 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
private void sendQueuedBlockEvents()
private boolean fireBlockEvent(BlockEventData event)
public void flush()
protected void updateWeather()
updateWeather
in class World
protected int getRenderDistanceChunks()
getRenderDistanceChunks
in class World
public MinecraftServer getMinecraftServer()
public EntityTracker getEntityTracker()
public PlayerManager getPlayerManager()
public Teleporter getDefaultTeleporter()
public void spawnParticle(EnumParticleTypes particleType, double xCoord, double yCoord, double zCoord, int numberOfParticles, double p_175739_9_, double p_175739_11_, double p_175739_13_, double p_175739_15_, int... p_175739_17_)
public void spawnParticle(EnumParticleTypes particleType, boolean longDistance, double xCoord, double yCoord, double zCoord, int numberOfParticles, double xOffset, double yOffset, double zOffset, double particleSpeed, int... p_180505_18_)
public Entity getEntityFromUuid(java.util.UUID uuid)
public com.google.common.util.concurrent.ListenableFuture<java.lang.Object> addScheduledTask(java.lang.Runnable runnableToSchedule)
addScheduledTask
in interface IThreadListener
public boolean isCallingFromMinecraftThread()
isCallingFromMinecraftThread
in interface IThreadListener