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 |
private int |
blockEventCacheIndex |
private WorldServer.ServerBlockEventList[] |
blockEventQueue |
java.util.List<Teleporter> |
customTeleporters |
boolean |
disableLevelSaving |
protected java.util.Set<ChunkPos> |
doneChunks
Stores the recently processed (lighting) chunks
|
private java.util.Map<java.util.UUID,Entity> |
entitiesByUuid |
private WorldEntitySpawner |
entitySpawner |
private EntityTracker |
entityTracker |
private static org.apache.logging.log4j.Logger |
LOGGER |
private MinecraftServer |
mcServer |
private java.util.Set<NextTickListEntry> |
pendingTickListEntriesHashSet |
private java.util.List<NextTickListEntry> |
pendingTickListEntriesThisTick |
private java.util.TreeSet<NextTickListEntry> |
pendingTickListEntriesTreeSet |
private PlayerChunkMap |
playerChunkMap |
private int |
updateEntityTick |
protected VillageSiege |
villageSiege |
private Teleporter |
worldTeleporter |
advancementManager, captureBlockSnapshots, capturedBlockSnapshots, chunkProvider, DIST_HASH_MAGIC, entitiesById, eventListeners, findingSpawnPoint, functionManager, isRemote, lightUpdateBlockList, loadedEntityList, loadedTileEntityList, lootTable, mapStorage, MAX_ENTITY_RADIUS, pathListener, perWorldStorage, playerEntities, prevRainingStrength, prevThunderingStrength, profiler, provider, rainingStrength, rand, restoringBlockSnapshots, saveHandler, scheduledUpdatesAreImmediate, spawnHostileMobs, spawnPeacefulMobs, thunderingStrength, tickableTileEntities, unloadedEntityList, updateLCG, villageCollection, 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) |
com.google.common.util.concurrent.ListenableFuture<java.lang.Object> |
addScheduledTask(java.lang.Runnable runnableToSchedule) |
boolean |
addWeatherEffect(Entity entityIn) |
protected BlockPos |
adjustPosToNearbyEntity(BlockPos pos) |
boolean |
areAllPlayersAsleep() |
private boolean |
canAddEntity(Entity entityIn) |
boolean |
canCreatureTypeSpawnHere(EnumCreatureType creatureType,
Biome.SpawnListEntry spawnListEntry,
BlockPos pos) |
boolean |
canMineBlockBody(EntityPlayer player,
BlockPos pos) |
private boolean |
canSpawnAnimals() |
private boolean |
canSpawnNPCs() |
protected void |
createBonusChest() |
protected IChunkProvider |
createChunkProvider() |
private void |
createSpawnPosition(WorldSettings settings) |
BlockPos |
findNearestStructure(java.lang.String p_190528_1_,
BlockPos p_190528_2_,
boolean p_190528_3_) |
private boolean |
fireBlockEvent(BlockEventData event) |
void |
flush() |
void |
flushToDisk() |
AdvancementManager |
getAdvancementManager() |
ChunkProviderServer |
getChunkProvider() |
java.io.File |
getChunkSaveLocation() |
Teleporter |
getDefaultTeleporter() |
Entity |
getEntityFromUuid(java.util.UUID uuid) |
EntityTracker |
getEntityTracker() |
FunctionManager |
getFunctionManager() |
MinecraftServer |
getMinecraftServer() |
java.util.List<NextTickListEntry> |
getPendingBlockUpdates(Chunk chunkIn,
boolean remove) |
java.util.List<NextTickListEntry> |
getPendingBlockUpdates(StructureBoundingBox structureBB,
boolean remove) |
PlayerChunkMap |
getPlayerChunkMap() |
BlockPos |
getSpawnCoordinate() |
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) |
void |
loadEntities(java.util.Collection<Entity> entityCollection) |
Explosion |
newExplosion(Entity entityIn,
double x,
double y,
double z,
float strength,
boolean isFlaming,
boolean isSmoking) |
void |
onEntityAdded(Entity entityIn) |
void |
onEntityRemoved(Entity entityIn) |
protected void |
playerCheckLight() |
private void |
resetRainAndThunder() |
void |
resetUpdateEntityTick() |
void |
saveAllChunks(boolean all,
IProgressUpdate progressCallback) |
protected void |
saveLevel() |
void |
scheduleBlockUpdate(BlockPos pos,
Block blockIn,
int delay,
int priority) |
void |
scheduleUpdate(BlockPos pos,
Block blockIn,
int delay) |
private void |
sendPacketWithinDistance(EntityPlayerMP player,
boolean longDistance,
double x,
double y,
double z,
Packet<?> packetIn) |
private void |
sendQueuedBlockEvents() |
private void |
setDebugWorldSettings() |
void |
setEntityState(Entity entityIn,
byte state) |
void |
setInitialSpawnLocation() |
boolean |
spawnEntity(Entity entityIn) |
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) |
void |
spawnParticle(EnumParticleTypes particleType,
double xCoord,
double yCoord,
double zCoord,
int numberOfParticles,
double xOffset,
double yOffset,
double zOffset,
double particleSpeed,
int... particleArguments) |
void |
tick() |
protected void |
tickPlayers() |
boolean |
tickUpdates(boolean runAllPending) |
void |
updateAllPlayersSleepingFlag() |
protected void |
updateBlocks() |
void |
updateBlockTick(BlockPos pos,
Block blockIn,
int delay,
int priority) |
void |
updateEntities() |
void |
updateEntityWithOptionalForce(Entity entityIn,
boolean forceUpdate) |
protected void |
updateWeather() |
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, 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, isInsideWorldBorder, isMaterialInBB, isOutsideBuildHeight, isRaining, isRainingAt, isSidePowered, isSideSolid, isSideSolid, isSpawnChunk, isThundering, isValid, joinEntityInSurroundings, loadData, makeFireworks, markAndNotifyBlock, markBlockRangeForRenderUpdate, markBlockRangeForRenderUpdate, markBlocksDirtyVertical, markChunkDirty, markTileEntitiesInChunkForRemoval, 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, updateWeatherBodyprivate static final org.apache.logging.log4j.Logger LOGGER
private final MinecraftServer mcServer
private final EntityTracker entityTracker
private final PlayerChunkMap playerChunkMap
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 boolean disableLevelSaving
private boolean allPlayersSleeping
private int updateEntityTick
private final Teleporter worldTeleporter
private final WorldEntitySpawner entitySpawner
protected final VillageSiege villageSiege
private final WorldServer.ServerBlockEventList[] blockEventQueue
private int blockEventCacheIndex
private final java.util.List<NextTickListEntry> pendingTickListEntriesThisTick
protected java.util.Set<ChunkPos> doneChunks
public java.util.List<Teleporter> customTeleporters
public WorldServer(MinecraftServer server, ISaveHandler saveHandlerIn, WorldInfo info, int dimensionId, Profiler profilerIn)
@Nullable public Biome.SpawnListEntry getSpawnListEntryForTypeAt(EnumCreatureType creatureType, BlockPos pos)
public boolean canCreatureTypeSpawnHere(EnumCreatureType creatureType, Biome.SpawnListEntry spawnListEntry, BlockPos pos)
public void updateAllPlayersSleepingFlag()
updateAllPlayersSleepingFlag in class Worldprotected void wakeAllPlayers()
private void resetRainAndThunder()
public boolean areAllPlayersAsleep()
public void setInitialSpawnLocation()
setInitialSpawnLocation in class Worldprotected boolean isChunkLoaded(int x,
int z,
boolean allowEmpty)
isChunkLoaded in class Worldprotected void playerCheckLight()
protected void updateBlocks()
updateBlocks in class Worldpublic boolean isBlockTickPending(BlockPos pos, Block blockType)
isBlockTickPending in class Worldpublic boolean isUpdateScheduled(BlockPos pos, Block blk)
isUpdateScheduled in class Worldpublic void scheduleUpdate(BlockPos pos, Block blockIn, int delay)
scheduleUpdate in class Worldpublic void updateBlockTick(BlockPos pos, Block blockIn, int delay, int priority)
updateBlockTick in class Worldpublic void scheduleBlockUpdate(BlockPos pos, Block blockIn, int delay, int priority)
scheduleBlockUpdate in class Worldpublic void updateEntities()
updateEntities in class Worldprotected void tickPlayers()
tickPlayers in class Worldpublic void resetUpdateEntityTick()
public boolean tickUpdates(boolean runAllPending)
tickUpdates in class World@Nullable public java.util.List<NextTickListEntry> getPendingBlockUpdates(Chunk chunkIn, boolean remove)
getPendingBlockUpdates in class World@Nullable public java.util.List<NextTickListEntry> getPendingBlockUpdates(StructureBoundingBox structureBB, boolean remove)
getPendingBlockUpdates in class Worldpublic void updateEntityWithOptionalForce(Entity entityIn, boolean forceUpdate)
updateEntityWithOptionalForce in class Worldprivate boolean canSpawnNPCs()
private boolean canSpawnAnimals()
protected IChunkProvider createChunkProvider()
createChunkProvider in class Worldpublic boolean isBlockModifiable(EntityPlayer player, BlockPos pos)
isBlockModifiable in class Worldpublic boolean canMineBlockBody(EntityPlayer player, BlockPos pos)
canMineBlockBody in class Worldpublic void initialize(WorldSettings settings)
initialize in class Worldprivate void setDebugWorldSettings()
private void createSpawnPosition(WorldSettings settings)
protected void createBonusChest()
@Nullable public BlockPos getSpawnCoordinate()
public void saveAllChunks(boolean all,
@Nullable
IProgressUpdate progressCallback)
throws MinecraftException
MinecraftExceptionpublic void flushToDisk()
protected void saveLevel()
throws MinecraftException
MinecraftExceptionpublic boolean spawnEntity(Entity entityIn)
spawnEntity in class Worldpublic void loadEntities(java.util.Collection<Entity> entityCollection)
loadEntities in class Worldprivate boolean canAddEntity(Entity entityIn)
public void onEntityAdded(Entity entityIn)
onEntityAdded in class Worldpublic void onEntityRemoved(Entity entityIn)
onEntityRemoved in class Worldpublic boolean addWeatherEffect(Entity entityIn)
addWeatherEffect in class Worldpublic void setEntityState(Entity entityIn, byte state)
setEntityState in class Worldpublic ChunkProviderServer getChunkProvider()
getChunkProvider in class Worldpublic Explosion newExplosion(@Nullable Entity entityIn, double x, double y, double z, float strength, boolean isFlaming, boolean isSmoking)
newExplosion in class Worldpublic void addBlockEvent(BlockPos pos, Block blockIn, int eventID, int eventParam)
addBlockEvent in class Worldprivate void sendQueuedBlockEvents()
private boolean fireBlockEvent(BlockEventData event)
public void flush()
protected void updateWeather()
updateWeather in class World@Nullable public MinecraftServer getMinecraftServer()
getMinecraftServer in class Worldpublic 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)
private void sendPacketWithinDistance(EntityPlayerMP player, boolean longDistance, double x, double y, double z, Packet<?> packetIn)
@Nullable 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 IThreadListenerpublic boolean isCallingFromMinecraftThread()
isCallingFromMinecraftThread in interface IThreadListener@Nullable public BlockPos findNearestStructure(java.lang.String p_190528_1_, BlockPos p_190528_2_, boolean p_190528_3_)
findNearestStructure in class Worldpublic AdvancementManager getAdvancementManager()
public FunctionManager getFunctionManager()
public java.io.File getChunkSaveLocation()