Package net.minecraft.world.server
Class ServerWorld
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<World>
net.minecraft.world.World
net.minecraft.world.server.ServerWorld
- All Implemented Interfaces:
AutoCloseable
,BiomeManager.IBiomeReader
,IWorldGenerationBaseReader
,IWorldGenerationReader
,IBiomeReader
,IBlockDisplayReader
,IBlockReader
,ICollisionReader
,IDayTimeReader
,IEntityReader
,ISeedReader
,IServerWorld
,IWorld
,IWorldReader
,IWorldWriter
,ICapabilityProvider
,IForgeWorld
,IForgeWorldServer
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private final it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet<BlockEventData>
private final ServerTickList<Block>
private WorldCapabilityData
private final ServerChunkProvider
private final List<ISpecialSpawner>
private final DragonFightManager
private int
static final BlockPos
private final it.unimi.dsi.fastutil.ints.Int2ObjectMap<Entity>
private boolean
private final ServerTickList<Fluid>
private static final org.apache.logging.log4j.Logger
private final Set<PathNavigator>
boolean
private final it.unimi.dsi.fastutil.ints.Int2ObjectMap<PartEntity<?>>
private final List<ServerPlayerEntity>
private final Teleporter
protected final RaidManager
private final MinecraftServer
private final IServerWorldInfo
private final StructureManager
(package private) boolean
private final boolean
Fields inherited from class net.minecraft.world.World
addend, blockEntitiesToUnload, blockEntityList, captureBlockSnapshots, capturedBlockSnapshots, END, isClientSide, levelData, NETHER, oRainLevel, oThunderLevel, OVERWORLD, pendingBlockEntities, rainLevel, random, randValue, RESOURCE_KEY_CODEC, restoringBlockSnapshots, thunderLevel, tickableBlockEntities, updatingBlockEntities
-
Constructor Summary
ConstructorDescriptionServerWorld
(MinecraftServer p_i241885_1_, Executor p_i241885_2_, SaveFormat.LevelSave p_i241885_3_, IServerWorldInfo p_i241885_4_, RegistryKey<World> p_i241885_5_, DimensionType p_i241885_6_, IChunkStatusListener p_i241885_7_, ChunkGenerator p_i241885_8_, boolean p_i241885_9_, long p_i241885_10_, List<ISpecialSpawner> p_i241885_12_, boolean p_i241885_13_) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
void
addDuringCommandTeleport
(ServerPlayerEntity p_217446_1_) void
addDuringPortalTeleport
(ServerPlayerEntity p_217447_1_) private boolean
boolean
addFreshEntity
(Entity p_217376_1_) void
addFromAnotherDimension
(Entity p_217460_1_) void
addNewPlayer
(ServerPlayerEntity p_217435_1_) private void
addPlayer
(ServerPlayerEntity p_217448_1_) void
addRespawnedPlayer
(ServerPlayerEntity p_217433_1_) boolean
addWithUUID
(Entity p_217470_1_) void
blockEvent
(BlockPos p_175641_1_, Block p_175641_2_, int p_175641_3_, int p_175641_4_) void
blockUpdated
(BlockPos p_230547_1_, Block p_230547_2_) void
broadcastEntityEvent
(Entity p_72960_1_, byte p_72960_2_) void
clearBlockEvents
(MutableBoundingBox p_229854_1_) void
void
destroyBlockProgress
(int p_175715_1_, BlockPos p_175715_2_, int p_175715_3_) private boolean
doBlockEvent
(BlockEventData p_147485_1_) private void
dumpBlockEntities
(Writer p_225321_1_) private static void
dumpEntities
(Writer p_225320_0_, Iterable<Entity> p_225320_1_) explode
(Entity p_230546_1_, DamageSource p_230546_2_, ExplosionContext p_230546_3_, double p_230546_4_, double p_230546_6_, double p_230546_8_, float p_230546_10_, boolean p_230546_11_, Explosion.Mode p_230546_12_) private Entity
findAddedOrPendingEntity
(UUID p_242105_1_) protected BlockPos
findLightingTargetAround
(BlockPos p_175736_1_) findNearestBiome
(Biome p_241116_1_, BlockPos p_241116_2_, int p_241116_3_, int p_241116_4_) findNearestMapFeature
(Structure<?> p_241117_1_, BlockPos p_241117_2_, int p_241117_3_, boolean p_241117_4_) getEntities
(EntityType<?> p_217482_1_, Predicate<? super Entity> p_217482_2_) getEntity
(int p_73045_1_) it.unimi.dsi.fastutil.longs.LongSet
int
getLevel()
getMapData
(String p_217406_1_) Collection<PartEntity<?>>
All part entities in this world.getPlayers
(Predicate<? super ServerPlayerEntity> p_217490_1_) getRaids()
long
getSeed()
float
float
private static <T> String
getTypeCount
(Collection<T> p_244524_0_, Function<T, ResourceLocation> p_244524_1_) getUncachedNoiseBiome
(int p_225604_1_, int p_225604_2_, int p_225604_3_) void
globalLevelEvent
(int p_175669_1_, BlockPos p_175669_2_, int p_175669_3_) protected void
boolean
isCloseToVillage
(BlockPos p_241119_1_, int p_241119_2_) boolean
isFlat()
boolean
boolean
private boolean
isUUIDUsed
(Entity p_217478_1_) boolean
boolean
isVillage
(SectionPos p_222887_1_) void
levelEvent
(PlayerEntity p_217378_1_, int p_217378_2_, BlockPos p_217378_3_, int p_217378_4_) boolean
loadFromChunk
(Entity p_217440_1_) static void
makeObsidianPlatform
(ServerWorld p_241121_0_) boolean
mayInteract
(PlayerEntity p_175660_1_, BlockPos p_175660_2_) boolean
noSave()
void
onBlockStateChange
(BlockPos p_217393_1_, BlockState p_217393_2_, BlockState p_217393_3_) void
onEntityRemoved
(Entity p_217484_1_) Deprecated.void
onReputationEvent
(IReputationType p_217489_1_, Entity p_217489_2_, IReputationTracking p_217489_3_) players()
void
playSound
(PlayerEntity p_184148_1_, double p_184148_2_, double p_184148_4_, double p_184148_6_, SoundEvent p_184148_8_, SoundCategory p_184148_9_, float p_184148_10_, float p_184148_11_) void
playSound
(PlayerEntity p_217384_1_, Entity p_217384_2_, SoundEvent p_217384_3_, SoundCategory p_217384_4_, float p_217384_5_, float p_217384_6_) void
removeEntity
(Entity p_217467_1_, boolean keepData) void
removeEntityComplete
(Entity p_217484_1_, boolean keepData) private void
removeFromChunk
(Entity p_217454_1_) void
removePlayer
(ServerPlayerEntity p_217434_1_, boolean keepData) void
removePlayerImmediately
(ServerPlayerEntity p_217434_1_) void
private void
void
save
(IProgressUpdate p_217445_1_, boolean p_217445_2_, boolean p_217445_3_) void
saveDebugReport
(Path p_225322_1_) private void
int
sectionsToVillage
(SectionPos p_217486_1_) void
sendBlockUpdated
(BlockPos p_184138_1_, BlockState p_184138_2_, BlockState p_184138_3_, int p_184138_4_) private boolean
sendParticles
(ServerPlayerEntity p_195601_1_, boolean p_195601_2_, double p_195601_3_, double p_195601_5_, double p_195601_7_, IPacket<?> p_195601_9_) <T extends IParticleData>
booleansendParticles
(ServerPlayerEntity p_195600_1_, T p_195600_2_, boolean p_195600_3_, double p_195600_4_, double p_195600_6_, double p_195600_8_, int p_195600_10_, double p_195600_11_, double p_195600_13_, double p_195600_15_, double p_195600_17_) <T extends IParticleData>
intsendParticles
(T p_195598_1_, double p_195598_2_, double p_195598_4_, double p_195598_6_, int p_195598_8_, double p_195598_9_, double p_195598_11_, double p_195598_13_, double p_195598_15_) boolean
setChunkForced
(int p_217458_1_, int p_217458_2_, boolean p_217458_3_) void
setDayTime
(long p_241114_1_) void
setDefaultSpawnPos
(BlockPos p_241124_1_, float p_241124_2_) void
setMapData
(MapData p_217399_1_) void
setWeatherParameters
(int p_241113_1_, int p_241113_2_, boolean p_241113_3_, boolean p_241113_4_) Stream<? extends StructureStart<?>>
startsForFeature
(SectionPos p_241827_1_, Structure<?> p_241827_2_) private void
void
tick
(BooleanSupplier p_72835_1_) private void
tickBlock
(NextTickListEntry<Block> p_205338_1_) void
void
tickCustomSpawners
(boolean p_241123_1_, boolean p_241123_2_) private void
tickLiquid
(NextTickListEntry<Fluid> p_205339_1_) void
tickNonPassenger
(Entity p_217479_1_) void
tickPassenger
(Entity p_217459_1_, Entity p_217459_2_) protected void
tickTime()
toString()
boolean
tryAddFreshEntityWithPassengers
(Entity p_242106_1_) void
void
updateChunkPos
(Entity p_217464_1_) void
private void
Methods inherited from class net.minecraft.world.World
addAllPendingBlockEntities, addAlwaysVisibleParticle, addAlwaysVisibleParticle, addBlockEntity, addParticle, addParticle, blockEntityChanged, close, createFireworks, destroyBlock, dimension, dimensionType, disconnect, explode, explode, fillReportDetails, gatherChunkSourceStats, getBestNeighborSignal, getBiomeManager, getBlockEntity, getBlockRandomPos, getBlockState, getChunk, getChunk, getChunkAt, getChunkForCollisions, getCurrentDifficultyAt, getDayTime, getDirectSignalTo, getEntities, getEntities, getEntitiesOfClass, getFluidState, getGameRules, getGameTime, getHeight, getLevelData, getLightEngine, getLoadedEntitiesOfClass, getMaxEntityRadius, getProfiler, getProfilerSupplier, getRainLevel, getRandom, getSeaLevel, getSignal, getSkyDarken, getSunAngle, getThunderLevel, getWorldBorder, guardEntityTick, hasNeighborSignal, hasSignal, increaseMaxEntityRadius, isClientSide, isDay, isDebug, isHumidAt, isInSpawnableBounds, isInWorldBounds, isLoaded, isNight, isOutsideBuildHeight, isOutsideBuildHeight, isRaining, isRainingAt, isStateAtPosition, isThundering, loadedAndEntityCanStandOn, loadedAndEntityCanStandOnFace, markAndNotifyBlock, neighborChanged, playLocalSound, playSound, prepareWeather, removeBlock, removeBlockEntity, sendPacketToServer, setBlock, setBlock, setBlockAndUpdate, setBlockEntity, setBlocksDirty, setRainLevel, setSkyFlashTime, setSpawnSettings, setThunderLevel, tickBlockEntities, updateNeighborsAt, updateNeighborsAtExceptFromFacing, updateNeighbourForOutputSignal, updateSkyBrightness
Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCaps
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.IBiomeReader
getBiomeName, getEntityCollisions, getHeightmapPos, isUnobstructed
Methods inherited from interface net.minecraft.world.IBlockDisplayReader
canSeeSky, getBrightness, getLightEngine, getRawBrightness
Methods inherited from interface net.minecraft.world.IBlockReader
clip, clipWithInteractionOverride, getBlockEntity, getBlockFloorHeight, getBlockFloorHeight, getBlockState, getBlockStates, getFluidState, getLightEmission, getMaxBuildHeight, getMaxLightLevel
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability, getCapability
Methods inherited from interface net.minecraft.world.ICollisionReader
getBlockCollisions, getBlockCollisions, getCollisions, getEntityCollisions, getWorldBorder, isUnobstructed, isUnobstructed, isUnobstructed, noBlockCollision, noCollision, noCollision, noCollision, noCollision
Methods inherited from interface net.minecraft.world.IDayTimeReader
getMoonBrightness, getMoonPhase, getTimeOfDay
Methods inherited from interface net.minecraft.world.IEntityReader
getEntities, getEntities, getEntitiesOfClass, getEntitiesOfClass, getLoadedEntitiesOfClass, getLoadedEntitiesOfClass, getNearbyEntities, getNearbyPlayers, getNearestEntity, getNearestEntity, getNearestLoadedEntity, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getPlayerByUUID, hasNearbyAlivePlayer
Methods inherited from interface net.minecraftforge.common.extensions.IForgeWorld
getMaxEntityRadius, increaseMaxEntityRadius
Methods inherited from interface net.minecraftforge.common.extensions.IForgeWorldServer
getWorldServer
Methods inherited from interface net.minecraft.world.IServerWorld
addFreshEntityWithPassengers
Methods inherited from interface net.minecraft.world.IWorld
addParticle, dayTime, getCurrentDifficultyAt, getDifficulty, getHeight, getLevelData, getRandom, hasChunk, levelEvent, playSound
Methods inherited from interface net.minecraft.world.gen.IWorldGenerationBaseReader
isStateAtPosition
Methods inherited from interface net.minecraft.world.IWorldReader
canSeeSkyFromBelowWater, containsAnyLiquid, dimensionType, getBiome, getBiomeManager, getBlockStatesIfLoaded, getBlockTint, getBrightness, getChunk, getChunk, getChunk, getChunk, getChunkForCollisions, getDirectSignal, getHeight, getMaxLocalRawBrightness, getMaxLocalRawBrightness, getNoiseBiome, getSeaLevel, getSkyDarken, hasChunkAt, hasChunksAt, hasChunksAt, isAreaLoaded, isClientSide, isEmptyBlock, isWaterAt
Methods inherited from interface net.minecraft.world.IWorldWriter
destroyBlock, destroyBlock, destroyBlock, removeBlock, setBlock, setBlock
-
Field Details
-
END_SPAWN_POINT
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
entitiesById
-
entitiesByUuid
-
toAddAfterTick
-
players
-
chunkSource
-
tickingEntities
boolean tickingEntities -
server
-
serverLevelData
-
noSave
public boolean noSave -
allPlayersSleeping
private boolean allPlayersSleeping -
emptyTime
private int emptyTime -
portalForcer
-
blockTicks
-
liquidTicks
-
raids
-
blockEvents
-
handlingTick
private boolean handlingTick -
customSpawners
-
dragonFight
-
structureFeatureManager
-
tickTime
private final boolean tickTime -
capabilityData
-
partEntities
-
-
Constructor Details
-
ServerWorld
public ServerWorld(MinecraftServer p_i241885_1_, Executor p_i241885_2_, SaveFormat.LevelSave p_i241885_3_, IServerWorldInfo p_i241885_4_, RegistryKey<World> p_i241885_5_, DimensionType p_i241885_6_, IChunkStatusListener p_i241885_7_, ChunkGenerator p_i241885_8_, boolean p_i241885_9_, long p_i241885_10_, List<ISpecialSpawner> p_i241885_12_, boolean p_i241885_13_)
-
-
Method Details
-
setWeatherParameters
public void setWeatherParameters(int p_241113_1_, int p_241113_2_, boolean p_241113_3_, boolean p_241113_4_) -
getUncachedNoiseBiome
- Specified by:
getUncachedNoiseBiome
in interfaceIWorldReader
-
structureFeatureManager
-
tick
-
tickTime
protected void tickTime() -
setDayTime
public void setDayTime(long p_241114_1_) -
tickCustomSpawners
public void tickCustomSpawners(boolean p_241123_1_, boolean p_241123_2_) -
wakeUpAllPlayers
private void wakeUpAllPlayers() -
tickChunk
-
findLightingTargetAround
-
isHandlingTick
public boolean isHandlingTick() -
updateSleepingPlayerList
public void updateSleepingPlayerList() -
getScoreboard
- Specified by:
getScoreboard
in classWorld
-
stopWeather
private void stopWeather() -
resetEmptyTime
public void resetEmptyTime() -
tickLiquid
-
tickBlock
-
tickNonPassenger
-
tickPassenger
-
updateChunkPos
-
mayInteract
- Overrides:
mayInteract
in classWorld
-
save
-
saveLevelData
private void saveLevelData() -
getEntities
public List<Entity> getEntities(@Nullable EntityType<?> p_217482_1_, Predicate<? super Entity> p_217482_2_) -
getDragons
-
getPlayers
-
getRandomPlayer
-
addFreshEntity
- Specified by:
addFreshEntity
in interfaceIWorldWriter
-
addWithUUID
-
addFromAnotherDimension
-
addDuringCommandTeleport
-
addDuringPortalTeleport
-
addNewPlayer
-
addRespawnedPlayer
-
addPlayer
-
addEntity
-
loadFromChunk
-
isUUIDUsed
-
findAddedOrPendingEntity
-
tryAddFreshEntityWithPassengers
-
unload
-
onEntityRemoved
Deprecated. -
removeEntityComplete
-
add
-
despawn
-
removeEntity
-
removeFromChunk
-
removePlayerImmediately
-
removePlayer
-
destroyBlockProgress
- Specified by:
destroyBlockProgress
in classWorld
-
playSound
public void playSound(@Nullable PlayerEntity p_184148_1_, double p_184148_2_, double p_184148_4_, double p_184148_6_, SoundEvent p_184148_8_, SoundCategory p_184148_9_, float p_184148_10_, float p_184148_11_) -
playSound
public void playSound(@Nullable PlayerEntity p_217384_1_, Entity p_217384_2_, SoundEvent p_217384_3_, SoundCategory p_217384_4_, float p_217384_5_, float p_217384_6_) -
globalLevelEvent
- Overrides:
globalLevelEvent
in classWorld
-
levelEvent
public void levelEvent(@Nullable PlayerEntity p_217378_1_, int p_217378_2_, BlockPos p_217378_3_, int p_217378_4_) - Specified by:
levelEvent
in interfaceIWorld
-
sendBlockUpdated
public void sendBlockUpdated(BlockPos p_184138_1_, BlockState p_184138_2_, BlockState p_184138_3_, int p_184138_4_) - Specified by:
sendBlockUpdated
in classWorld
-
broadcastEntityEvent
- Overrides:
broadcastEntityEvent
in classWorld
-
getChunkSource
- Specified by:
getChunkSource
in interfaceIWorld
-
explode
public Explosion explode(@Nullable Entity p_230546_1_, @Nullable DamageSource p_230546_2_, @Nullable ExplosionContext p_230546_3_, double p_230546_4_, double p_230546_6_, double p_230546_8_, float p_230546_10_, boolean p_230546_11_, Explosion.Mode p_230546_12_) -
blockEvent
- Overrides:
blockEvent
in classWorld
-
runBlockEvents
private void runBlockEvents() -
doBlockEvent
-
getBlockTicks
- Specified by:
getBlockTicks
in interfaceIWorld
-
getLiquidTicks
- Specified by:
getLiquidTicks
in interfaceIWorld
-
getServer
-
getPortalForcer
-
getStructureManager
-
sendParticles
public <T extends IParticleData> int sendParticles(T p_195598_1_, double p_195598_2_, double p_195598_4_, double p_195598_6_, int p_195598_8_, double p_195598_9_, double p_195598_11_, double p_195598_13_, double p_195598_15_) -
sendParticles
public <T extends IParticleData> boolean sendParticles(ServerPlayerEntity p_195600_1_, T p_195600_2_, boolean p_195600_3_, double p_195600_4_, double p_195600_6_, double p_195600_8_, int p_195600_10_, double p_195600_11_, double p_195600_13_, double p_195600_15_, double p_195600_17_) -
sendParticles
private boolean sendParticles(ServerPlayerEntity p_195601_1_, boolean p_195601_2_, double p_195601_3_, double p_195601_5_, double p_195601_7_, IPacket<?> p_195601_9_) -
getEntity
-
getEntity
-
findNearestMapFeature
-
findNearestBiome
-
getRecipeManager
- Specified by:
getRecipeManager
in classWorld
-
getTagManager
- Specified by:
getTagManager
in classWorld
-
noSave
public boolean noSave() -
registryAccess
- Specified by:
registryAccess
in interfaceIBiomeReader
-
getDataStorage
-
getMapData
- Specified by:
getMapData
in classWorld
-
setMapData
- Specified by:
setMapData
in classWorld
-
getFreeMapId
public int getFreeMapId()- Specified by:
getFreeMapId
in classWorld
-
setDefaultSpawnPos
-
getForcedChunks
public it.unimi.dsi.fastutil.longs.LongSet getForcedChunks() -
setChunkForced
public boolean setChunkForced(int p_217458_1_, int p_217458_2_, boolean p_217458_3_) -
players
- Specified by:
players
in interfaceIEntityReader
-
onBlockStateChange
public void onBlockStateChange(BlockPos p_217393_1_, BlockState p_217393_2_, BlockState p_217393_3_) - Overrides:
onBlockStateChange
in classWorld
-
getPoiManager
-
isVillage
-
isVillage
-
isCloseToVillage
-
sectionsToVillage
-
getRaids
-
getRaidAt
-
isRaided
-
onReputationEvent
public void onReputationEvent(IReputationType p_217489_1_, Entity p_217489_2_, IReputationTracking p_217489_3_) -
saveDebugReport
- Throws:
IOException
-
dumpEntities
private static void dumpEntities(Writer p_225320_0_, Iterable<Entity> p_225320_1_) throws IOException - Throws:
IOException
-
dumpBlockEntities
- Throws:
IOException
-
clearBlockEvents
-
blockUpdated
- Specified by:
blockUpdated
in interfaceIWorld
-
getShade
- Specified by:
getShade
in interfaceIBlockDisplayReader
-
getAllEntities
-
toString
-
isFlat
public boolean isFlat() -
getSeed
public long getSeed()- Specified by:
getSeed
in interfaceISeedReader
-
dragonFight
-
startsForFeature
public Stream<? extends StructureStart<?>> startsForFeature(SectionPos p_241827_1_, Structure<?> p_241827_2_) - Specified by:
startsForFeature
in interfaceISeedReader
-
getLevel
- Specified by:
getLevel
in interfaceIServerWorld
-
getWatchdogStats
-
getTypeCount
private static <T> String getTypeCount(Collection<T> p_244524_0_, Function<T, ResourceLocation> p_244524_1_) -
makeObsidianPlatform
-
initCapabilities
protected void initCapabilities() -
getEntities
-
getPartEntities
Description copied from interface:IForgeWorld
All part entities in this world. Used when collecting entities in an AABB to fix parts being ignored whose parent entity is in a chunk that does not intersect with the AABB.- Specified by:
getPartEntities
in interfaceIForgeWorld
-