public class ServerWorld extends World implements IForgeWorldServer
| Modifier and Type | Field and Description |
|---|---|
private boolean |
allPlayersSleeping |
private it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet<BlockEventData> |
blockEventQueue |
private WorldCapabilityData |
capabilityData |
boolean |
disableLevelSaving |
protected java.util.Set<ChunkPos> |
doneChunks
Stores the recently processed (lighting) chunks
|
private it.unimi.dsi.fastutil.ints.Int2ObjectMap<Entity> |
entitiesById |
private java.util.Map<java.util.UUID,Entity> |
entitiesByUuid |
private java.util.Queue<Entity> |
entitiesToAdd |
private java.util.List<Entity> |
globalEntities |
private boolean |
insideTick |
private static org.apache.logging.log4j.Logger |
LOGGER |
private java.util.Set<PathNavigator> |
navigations |
private ServerTickList<Block> |
pendingBlockTicks |
private ServerTickList<Fluid> |
pendingFluidTicks |
private java.util.List<ServerPlayerEntity> |
players |
protected RaidManager |
raids |
private SaveHandler |
saveHandler |
private MinecraftServer |
server |
(package private) boolean |
tickingEntities |
private int |
updateEntityTick |
private WanderingTraderSpawner |
wanderingTraderSpawner |
private Teleporter |
worldTeleporter |
addedTileEntityList, captureBlockSnapshots, capturedBlockSnapshots, chunkProvider, dimension, DIST_HASH_MAGIC, isRemote, loadedTileEntityList, prevRainingStrength, prevThunderingStrength, processingLoadedTiles, rainingStrength, rand, restoringBlockSnapshots, thunderingStrength, tickableTileEntities, tileEntitiesToBeRemoved, updateLCG, worldInfo| Constructor and Description |
|---|
ServerWorld(MinecraftServer serverIn,
java.util.concurrent.Executor executorIn,
SaveHandler saveHandlerIn,
WorldInfo worldInfoIn,
DimensionType dimType,
IProfiler profilerIn,
IChunkStatusListener listenerIn) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBlockEvent(BlockPos pos,
Block blockIn,
int eventID,
int eventParam) |
void |
addDuringCommandTeleport(ServerPlayerEntity playerIn) |
void |
addDuringPortalTeleport(ServerPlayerEntity playerIn) |
boolean |
addEntity(Entity entityIn) |
private boolean |
addEntity0(Entity entityIn) |
boolean |
addEntityIfNotDuplicate(Entity entityIn) |
void |
addFromAnotherDimension(Entity entityIn) |
void |
addLightningBolt(LightningBoltEntity entityIn) |
void |
addNewPlayer(ServerPlayerEntity player) |
private void |
addPlayer(ServerPlayerEntity player) |
void |
addRespawnedPlayer(ServerPlayerEntity player) |
protected BlockPos |
adjustPosToNearbyEntity(BlockPos pos) |
boolean |
canMineBlockBody(PlayerEntity player,
BlockPos pos) |
void |
checkSessionLock() |
void |
chunkCheck(Entity entityIn) |
void |
clearBlockEvents(MutableBoundingBox boundingBox) |
it.unimi.dsi.fastutil.objects.Object2IntMap<EntityClassification> |
countEntities() |
protected void |
createBonusChest() |
Explosion |
createExplosion(Entity entityIn,
DamageSource damageSourceIn,
double xIn,
double yIn,
double zIn,
float explosionRadius,
boolean causesFire,
Explosion.Mode modeIn) |
void |
createSpawnPosition(WorldSettings settings) |
private void |
dumpBlockEntities(java.io.Writer writerIn) |
private static void |
dumpEntities(java.io.Writer writerIn,
java.lang.Iterable<Entity> entities) |
BlockPos |
findNearestStructure(java.lang.String name,
BlockPos pos,
int radius,
boolean skipExistingChunks) |
Raid |
findRaid(BlockPos pos) |
private boolean |
fireBlockEvent(BlockEventData event) |
boolean |
forceChunk(int chunkX,
int chunkZ,
boolean add) |
ServerChunkProvider |
getChunkProvider() |
Teleporter |
getDefaultTeleporter() |
java.util.List<EnderDragonEntity> |
getDragons() |
java.util.stream.Stream<Entity> |
getEntities() |
java.util.List<Entity> |
getEntities(EntityType<?> entityTypeIn,
java.util.function.Predicate<? super Entity> predicateIn) |
Entity |
getEntityByID(int id) |
Entity |
getEntityByUuid(java.util.UUID uniqueId) |
it.unimi.dsi.fastutil.longs.LongSet |
getForcedChunks() |
MapData |
getMapData(java.lang.String mapName) |
int |
getNextMapId() |
Biome |
getNoiseBiomeRaw(int x,
int y,
int z) |
ServerTickList<Block> |
getPendingBlockTicks() |
ServerTickList<Fluid> |
getPendingFluidTicks() |
java.util.List<ServerPlayerEntity> |
getPlayers() |
java.util.List<ServerPlayerEntity> |
getPlayers(java.util.function.Predicate<? super ServerPlayerEntity> predicateIn) |
PointOfInterestManager |
getPointOfInterestManager() |
RaidManager |
getRaids() |
ServerPlayerEntity |
getRandomPlayer() |
RecipeManager |
getRecipeManager() |
DimensionSavedDataManager |
getSavedData() |
SaveHandler |
getSaveHandler() |
ServerScoreboard |
getScoreboard() |
MinecraftServer |
getServer() |
BlockPos |
getSpawnCoordinate() |
TemplateManager |
getStructureTemplateManager() |
NetworkTagManager |
getTags() |
private boolean |
hasDuplicateEntity(Entity entityIn) |
boolean |
hasRaid(BlockPos pos) |
protected void |
initCapabilities() |
boolean |
isBlockModifiable(PlayerEntity player,
BlockPos pos) |
boolean |
isCloseToVillage(BlockPos pos,
int p_217471_2_) |
boolean |
isInsideTick() |
boolean |
isSaveDisabled() |
boolean |
isVillage(BlockPos pos) |
boolean |
isVillage(SectionPos pos) |
void |
notifyBlockUpdate(BlockPos pos,
BlockState oldState,
BlockState newState,
int flags) |
void |
onBlockStateChange(BlockPos pos,
BlockState blockStateIn,
BlockState newState) |
void |
onChunkUnloading(Chunk chunkIn) |
private void |
onEntityAdded(Entity entityIn) |
void |
onEntityRemoved(Entity entityIn)
Deprecated.
|
void |
playBroadcastSound(int id,
BlockPos pos,
int data) |
void |
playEvent(PlayerEntity player,
int type,
BlockPos pos,
int data) |
void |
playMovingSound(PlayerEntity playerIn,
Entity entityIn,
SoundEvent eventIn,
SoundCategory categoryIn,
float volume,
float pitch) |
void |
playSound(PlayerEntity player,
double x,
double y,
double z,
SoundEvent soundIn,
SoundCategory category,
float volume,
float pitch) |
void |
registerMapData(MapData mapDataIn) |
void |
removeEntity(Entity entityIn) |
void |
removeEntity(Entity entityIn,
boolean keepData) |
void |
removeEntityComplete(Entity entityIn,
boolean keepData) |
private void |
removeFromChunk(Entity entityIn) |
void |
removePlayer(ServerPlayerEntity player) |
void |
removePlayer(ServerPlayerEntity player,
boolean keepData) |
private void |
resetRainAndThunder() |
void |
resetUpdateEntityTick() |
void |
save(IProgressUpdate progress,
boolean flush,
boolean skipSave) |
protected void |
saveLevel() |
int |
sectionsToVillage(SectionPos pos) |
void |
sendBlockBreakProgress(int breakerId,
BlockPos pos,
int progress) |
private boolean |
sendPacketWithinDistance(ServerPlayerEntity player,
boolean longDistance,
double posX,
double posY,
double posZ,
IPacket<?> packet) |
private void |
sendQueuedBlockEvents() |
void |
setEntityState(Entity entityIn,
byte state) |
void |
setGameTime(long worldTime) |
void |
setInitialSpawnLocation() |
void |
setSpawnPoint(BlockPos pos) |
<T extends IParticleData> |
spawnParticle(ServerPlayerEntity player,
T type,
boolean longDistance,
double posX,
double posY,
double posZ,
int particleCount,
double xOffset,
double yOffset,
double zOffset,
double speed) |
<T extends IParticleData> |
spawnParticle(T type,
double posX,
double posY,
double posZ,
int particleCount,
double xOffset,
double yOffset,
double zOffset,
double speed) |
boolean |
summonEntity(Entity entityIn) |
void |
tick(java.util.function.BooleanSupplier hasTimeLeft) |
private void |
tickBlock(NextTickListEntry<Block> blockTickEntry) |
void |
tickEnvironment(Chunk chunkIn,
int randomTickSpeed) |
private void |
tickFluid(NextTickListEntry<Fluid> fluidTickEntry) |
void |
tickPassenger(Entity ridingEntity,
Entity passengerEntity) |
void |
updateAllPlayersSleepingFlag() |
void |
updateEntity(Entity entityIn) |
void |
updateReputation(IReputationType type,
Entity target,
IReputationTracking host) |
private void |
wakeUpAllPlayers() |
void |
writeDebugInfo(java.nio.file.Path pathIn) |
addOptionalParticle, addOptionalParticle, addParticle, addParticle, addTileEntities, addTileEntity, advanceTime, calculateInitialSkylight, calculateInitialWeather, calculateInitialWeatherBody, checkBlockCollision, close, createExplosion, createExplosion, destroyBlock, extinguishFire, fillCrashReport, findBlockstateInArea, getActualHeight, getBiomeManager, getBlockRandomPos, getBlockReader, getBlockState, getCelestialAngleRadians, getChunk, getChunk, getChunkAt, getDayTime, getDifficultyForLocation, getDimension, getEntitiesInAABBexcluding, getEntitiesWithinAABB, getEntitiesWithinAABB, getFluidState, getGameRules, getGameTime, getGroundAboveSeaLevel, getHeight, getLightManager, getLoadedEntitiesWithinAABB, getMaxEntityRadius, getProfiler, getProviderName, getRainStrength, getRandom, getRedstonePower, getRedstonePowerFromNeighbors, getSeaLevel, getSeed, getSkylightSubtracted, getSpawnPoint, getStrongPower, getThunderStrength, getTileEntity, getWorld, getWorldBorder, getWorldInfo, getWorldType, guardEntityTick, hasBlockState, increaseMaxEntityRadius, isBlockinHighHumidity, isBlockPowered, isBlockPresent, isDaytime, isFlammableWithin, isMaterialInBB, isNightTime, isOutsideBuildHeight, isRaining, isRainingAt, isRemote, isSidePowered, isThundering, isTopSolid, isValid, isYOutOfBounds, makeFireworks, markAndNotifyBlock, markBlockRangeForRenderUpdate, markChunkDirty, neighborChanged, notifyNeighbors, notifyNeighborsOfStateChange, notifyNeighborsOfStateExcept, playSound, playSound, removeBlock, removeTileEntity, sendPacketToServer, sendQuittingDisconnectingPacket, setAllowedSpawnTypes, setBlockState, setBlockState, setDayTime, setRainStrength, setThunderStrength, setTileEntity, setTimeLightningFlash, tickBlockEntities, updateComparatorOutputLevelareCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCapsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetWorldServergetMaxEntityRadius, increaseMaxEntityRadiusgetCapability, getCapabilitycheckNoEntityCollision, chunkExists, getCelestialAngle, getCurrentMoonPhaseFactor, getDifficulty, getEmptyCollisionShapes, getHeight, getMoonPhase, playEventfunc_225318_b, getClosestEntity, getClosestEntityWithinAABB, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getEntitiesWithinAABB, getEntitiesWithinAABBExcludingEntity, getLoadedEntitiesWithinAABB, getPlayerByUuid, getTargettableEntitiesWithinAABB, getTargettablePlayersWithinAABB, isPlayerWithincanBlockSeeSky, containsAnyLiquid, getBiome, getBlockColor, getBrightness, getChunk, getChunk, getLight, getNeighborAwareLightSubtracted, getNoiseBiome, getStrongPower, hasWater, isAirBlock, isAreaLoaded, isAreaLoaded, isAreaLoaded, isBlockLoadedcanSeeSky, getLightFor, getLightSubtractedcheckNoEntityCollision, func_226663_a_, getCollisionShapes, getCollisionShapes, hasNoCollisions, hasNoCollisions, hasNoCollisions, hasNoCollisionsfunc_217300_a, getHeight, getLightValue, getMaxLightLevel, rayTraceBlocks, rayTraceBlocksgetMaxHeightdestroyBlockprivate static final org.apache.logging.log4j.Logger LOGGER
private final java.util.List<Entity> globalEntities
private final it.unimi.dsi.fastutil.ints.Int2ObjectMap<Entity> entitiesById
private final java.util.Map<java.util.UUID,Entity> entitiesByUuid
private final java.util.Queue<Entity> entitiesToAdd
private final java.util.List<ServerPlayerEntity> players
boolean tickingEntities
private final MinecraftServer server
private final SaveHandler saveHandler
public boolean disableLevelSaving
private boolean allPlayersSleeping
private int updateEntityTick
private final Teleporter worldTeleporter
private final ServerTickList<Block> pendingBlockTicks
private final ServerTickList<Fluid> pendingFluidTicks
private final java.util.Set<PathNavigator> navigations
protected final RaidManager raids
private final it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet<BlockEventData> blockEventQueue
private boolean insideTick
@Nullable private final WanderingTraderSpawner wanderingTraderSpawner
protected java.util.Set<ChunkPos> doneChunks
private WorldCapabilityData capabilityData
public ServerWorld(MinecraftServer serverIn, java.util.concurrent.Executor executorIn, SaveHandler saveHandlerIn, WorldInfo worldInfoIn, DimensionType dimType, IProfiler profilerIn, IChunkStatusListener listenerIn)
public Biome getNoiseBiomeRaw(int x, int y, int z)
getNoiseBiomeRaw in interface IWorldReaderpublic void tick(java.util.function.BooleanSupplier hasTimeLeft)
private void wakeUpAllPlayers()
public void tickEnvironment(Chunk chunkIn, int randomTickSpeed)
public boolean isInsideTick()
public void updateAllPlayersSleepingFlag()
public ServerScoreboard getScoreboard()
getScoreboard in class Worldprivate void resetRainAndThunder()
public void setInitialSpawnLocation()
setInitialSpawnLocation in class Worldpublic void resetUpdateEntityTick()
private void tickFluid(NextTickListEntry<Fluid> fluidTickEntry)
private void tickBlock(NextTickListEntry<Block> blockTickEntry)
public void updateEntity(Entity entityIn)
public void chunkCheck(Entity entityIn)
public boolean isBlockModifiable(PlayerEntity player, BlockPos pos)
isBlockModifiable in class Worldpublic boolean canMineBlockBody(PlayerEntity player, BlockPos pos)
canMineBlockBody in class Worldpublic void createSpawnPosition(WorldSettings settings)
protected void createBonusChest()
@Nullable public BlockPos getSpawnCoordinate()
public void save(@Nullable
IProgressUpdate progress,
boolean flush,
boolean skipSave)
throws SessionLockException
SessionLockExceptionprotected void saveLevel()
throws SessionLockException
SessionLockExceptionpublic java.util.List<Entity> getEntities(@Nullable EntityType<?> entityTypeIn, java.util.function.Predicate<? super Entity> predicateIn)
public java.util.List<EnderDragonEntity> getDragons()
public java.util.List<ServerPlayerEntity> getPlayers(java.util.function.Predicate<? super ServerPlayerEntity> predicateIn)
@Nullable public ServerPlayerEntity getRandomPlayer()
public it.unimi.dsi.fastutil.objects.Object2IntMap<EntityClassification> countEntities()
public boolean addEntity(Entity entityIn)
addEntity in interface IWorldWriterpublic boolean summonEntity(Entity entityIn)
public void addFromAnotherDimension(Entity entityIn)
public void addDuringCommandTeleport(ServerPlayerEntity playerIn)
public void addDuringPortalTeleport(ServerPlayerEntity playerIn)
public void addNewPlayer(ServerPlayerEntity player)
public void addRespawnedPlayer(ServerPlayerEntity player)
private void addPlayer(ServerPlayerEntity player)
private boolean addEntity0(Entity entityIn)
public boolean addEntityIfNotDuplicate(Entity entityIn)
private boolean hasDuplicateEntity(Entity entityIn)
public void onChunkUnloading(Chunk chunkIn)
@Deprecated public void onEntityRemoved(Entity entityIn)
public void removeEntityComplete(Entity entityIn, boolean keepData)
private void onEntityAdded(Entity entityIn)
public void removeEntity(Entity entityIn)
public void removeEntity(Entity entityIn, boolean keepData)
private void removeFromChunk(Entity entityIn)
public void removePlayer(ServerPlayerEntity player)
public void removePlayer(ServerPlayerEntity player, boolean keepData)
public void addLightningBolt(LightningBoltEntity entityIn)
public void sendBlockBreakProgress(int breakerId,
BlockPos pos,
int progress)
sendBlockBreakProgress in class Worldpublic void playSound(@Nullable
PlayerEntity player,
double x,
double y,
double z,
SoundEvent soundIn,
SoundCategory category,
float volume,
float pitch)
public void playMovingSound(@Nullable
PlayerEntity playerIn,
Entity entityIn,
SoundEvent eventIn,
SoundCategory categoryIn,
float volume,
float pitch)
playMovingSound in class Worldpublic void playBroadcastSound(int id,
BlockPos pos,
int data)
playBroadcastSound in class Worldpublic void playEvent(@Nullable
PlayerEntity player,
int type,
BlockPos pos,
int data)
public void notifyBlockUpdate(BlockPos pos, BlockState oldState, BlockState newState, int flags)
notifyBlockUpdate in class Worldpublic void setEntityState(Entity entityIn, byte state)
setEntityState in class Worldpublic ServerChunkProvider getChunkProvider()
getChunkProvider in interface IWorldgetChunkProvider in class Worldpublic Explosion createExplosion(@Nullable Entity entityIn, @Nullable DamageSource damageSourceIn, double xIn, double yIn, double zIn, float explosionRadius, boolean causesFire, Explosion.Mode modeIn)
createExplosion 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 ServerTickList<Block> getPendingBlockTicks()
getPendingBlockTicks in interface IWorldpublic ServerTickList<Fluid> getPendingFluidTicks()
getPendingFluidTicks in interface IWorld@Nonnull public MinecraftServer getServer()
public Teleporter getDefaultTeleporter()
public TemplateManager getStructureTemplateManager()
public <T extends IParticleData> int spawnParticle(T type, double posX, double posY, double posZ, int particleCount, double xOffset, double yOffset, double zOffset, double speed)
public <T extends IParticleData> boolean spawnParticle(ServerPlayerEntity player, T type, boolean longDistance, double posX, double posY, double posZ, int particleCount, double xOffset, double yOffset, double zOffset, double speed)
private boolean sendPacketWithinDistance(ServerPlayerEntity player, boolean longDistance, double posX, double posY, double posZ, IPacket<?> packet)
@Nullable public Entity getEntityByID(int id)
getEntityByID in class World@Nullable public Entity getEntityByUuid(java.util.UUID uniqueId)
@Nullable public BlockPos findNearestStructure(java.lang.String name, BlockPos pos, int radius, boolean skipExistingChunks)
public RecipeManager getRecipeManager()
getRecipeManager in class Worldpublic NetworkTagManager getTags()
public void setGameTime(long worldTime)
setGameTime in class Worldpublic boolean isSaveDisabled()
isSaveDisabled in class Worldpublic void checkSessionLock()
throws SessionLockException
SessionLockExceptionpublic SaveHandler getSaveHandler()
public DimensionSavedDataManager getSavedData()
@Nullable public MapData getMapData(java.lang.String mapName)
getMapData in class Worldpublic void registerMapData(MapData mapDataIn)
registerMapData in class Worldpublic int getNextMapId()
getNextMapId in class Worldpublic void setSpawnPoint(BlockPos pos)
setSpawnPoint in class Worldpublic it.unimi.dsi.fastutil.longs.LongSet getForcedChunks()
public boolean forceChunk(int chunkX,
int chunkZ,
boolean add)
public java.util.List<ServerPlayerEntity> getPlayers()
getPlayers in interface IEntityReaderpublic void onBlockStateChange(BlockPos pos, BlockState blockStateIn, BlockState newState)
onBlockStateChange in class Worldpublic PointOfInterestManager getPointOfInterestManager()
public boolean isVillage(BlockPos pos)
public boolean isVillage(SectionPos pos)
public boolean isCloseToVillage(BlockPos pos, int p_217471_2_)
public int sectionsToVillage(SectionPos pos)
public RaidManager getRaids()
public boolean hasRaid(BlockPos pos)
public void updateReputation(IReputationType type, Entity target, IReputationTracking host)
public void writeDebugInfo(java.nio.file.Path pathIn)
throws java.io.IOException
java.io.IOExceptionprivate static void dumpEntities(java.io.Writer writerIn,
java.lang.Iterable<Entity> entities)
throws java.io.IOException
java.io.IOExceptionprivate void dumpBlockEntities(java.io.Writer writerIn)
throws java.io.IOException
java.io.IOExceptionpublic void clearBlockEvents(MutableBoundingBox boundingBox)
protected void initCapabilities()
public java.util.stream.Stream<Entity> getEntities()