Package net.minecraft.server.level
Class WorldGenRegion
java.lang.Object
net.minecraft.server.level.WorldGenRegion
- All Implemented Interfaces:
BiomeManager.NoiseBiomeSource,BlockAndTintGetter,BlockGetter,CollisionGetter,CommonLevelAccessor,EntityGetter,LevelAccessor,LevelHeightAccessor,LevelReader,LevelSimulatedReader,LevelSimulatedRW,LevelTimeAccess,LevelWriter,ServerLevelAccessor,SignalGetter,WorldGenLevel,IBlockAndTintGetterExtension,IBlockGetterExtension,ILevelReaderExtension
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BiomeManagerprivate final WorldGenTickAccess<Block> private final StaticCache2D<GenerationChunkHolder> private final ChunkAccessprivate final DimensionTypeprivate final WorldGenTickAccess<Fluid> private final ChunkStepprivate final ServerLevelprivate final LevelDataprivate static final org.slf4j.Loggerprivate final RandomSourceprivate final longprivate final AtomicLongprivate static final ResourceLocationFields inherited from interface net.minecraft.world.level.SignalGetter
DIRECTIONS -
Constructor Summary
ConstructorsConstructorDescriptionWorldGenRegion(ServerLevel level, StaticCache2D<GenerationChunkHolder> cache, ChunkStep generatingStep, ChunkAccess center) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddFreshEntity(Entity entity) voidaddParticle(ParticleOptions particleData, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) booleandestroyBlock(BlockPos pos, boolean dropBlock, Entity entity, int recursionLeft) booleanensureCanWrite(BlockPos pos) voidgameEvent(Holder<GameEvent> gameEvent, Vec3 pos, GameEvent.Context context) getBlockEntity(BlockPos pos) getBlockState(BlockPos pos) getChunk(int chunkX, int chunkZ) getChunk(int x, int z, ChunkStatus chunkStatus, boolean requireChunk) getEntities(Entity entity, AABB boundingBox, Predicate<? super Entity> predicate) Gets all entities within the specified AABB excluding the one passed into it.getEntities(EntityTypeTest<Entity, T> entityTypeTest, AABB bounds, Predicate<? super T> predicate) getFluidState(BlockPos pos) intintgetHeight(Heightmap.Types heightmapType, int x, int z) getLevel()Deprecated.intgetNearestPlayer(double x, double y, double z, double distance, Predicate<Entity> predicate) intlonggetSeed()floatintgetUncachedNoiseBiome(int x, int y, int z) booleanhasChunk(int chunkX, int chunkZ) booleanbooleanisFluidAtPosition(BlockPos pos, Predicate<FluidState> predicate) booleanisOldChunkAround(ChunkPos pos, int radius) booleanisStateAtPosition(BlockPos pos, Predicate<BlockState> state) voidlevelEvent(Player player, int type, BlockPos pos, int data) private voidlongplayers()voidplaySound(Player player, BlockPos pos, SoundEvent sound, SoundSource category, float volume, float pitch) Plays a sound.booleanremoveBlock(BlockPos pos, boolean isMoving) booleansetBlock(BlockPos pos, BlockState state, int flags, int recursionLeft) voidsetCurrentlyGenerating(Supplier<String> currentlyGenerating) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.level.BlockAndTintGetter
canSeeSky, getBrightness, getRawBrightnessMethods inherited from interface net.minecraft.world.level.BlockGetter
clip, clipWithInteractionOverride, getBlockFloorHeight, getBlockFloorHeight, getBlockStates, getLightEmission, getMaxLightLevel, isBlockInLineMethods inherited from interface net.minecraft.world.level.CollisionGetter
collidesWithSuffocatingBlock, findFreePosition, findSupportingBlock, getBlockCollisions, getCollisions, getEntityCollisions, isUnobstructed, isUnobstructed, isUnobstructed, noBlockCollision, noCollision, noCollision, noCollisionMethods inherited from interface net.minecraft.world.level.CommonLevelAccessor
getBlockEntity, getEntityCollisions, getHeightmapPos, isUnobstructedMethods inherited from interface net.minecraft.world.level.EntityGetter
getEntities, getEntitiesOfClass, getEntitiesOfClass, getNearbyEntities, getNearbyPlayers, getNearestEntity, getNearestEntity, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getPlayerByUUID, hasNearbyAlivePlayerMethods inherited from interface net.neoforged.neoforge.common.extensions.IBlockAndTintGetterExtension
getShadeMethods inherited from interface net.neoforged.neoforge.common.extensions.IBlockGetterExtension
getAuxLightManager, getAuxLightManager, getModelDataMethods inherited from interface net.neoforged.neoforge.common.extensions.ILevelReaderExtension
holder, holderOrThrow, isAreaLoadedMethods inherited from interface net.minecraft.world.level.LevelAccessor
blockUpdated, dayTime, gameEvent, gameEvent, gameEvent, gameEvent, getDifficulty, levelEvent, neighborShapeChanged, playSound, scheduleTick, scheduleTick, scheduleTick, scheduleTickMethods inherited from interface net.minecraft.world.level.LevelHeightAccessor
getMaxBuildHeight, getMaxSection, getMinSection, getSectionIndex, getSectionIndexFromSectionY, getSectionsCount, getSectionYFromSectionIndex, isOutsideBuildHeight, isOutsideBuildHeightMethods inherited from interface net.minecraft.world.level.LevelReader
canSeeSkyFromBelowWater, containsAnyLiquid, getBiome, getBlockStatesIfLoaded, getBlockTint, getChunk, getChunk, getChunkForCollisions, getLightLevelDependentMagicValue, getMaxLocalRawBrightness, getMaxLocalRawBrightness, getNoiseBiome, getPathfindingCostFromLightLevels, hasChunkAt, hasChunkAt, hasChunksAt, hasChunksAt, hasChunksAt, holderLookup, isEmptyBlock, isWaterAtMethods inherited from interface net.minecraft.world.level.LevelTimeAccess
getMoonBrightness, getMoonPhase, getTimeOfDayMethods inherited from interface net.minecraft.world.level.LevelWriter
destroyBlock, destroyBlock, setBlockMethods inherited from interface net.minecraft.world.level.ServerLevelAccessor
addFreshEntityWithPassengersMethods inherited from interface net.minecraft.world.level.SignalGetter
getBestNeighborSignal, getControlInputSignal, getDirectSignal, getDirectSignalTo, getSignal, hasNeighborSignal, hasSignal
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
cache
-
center
-
level
-
seed
private final long seed -
levelData
-
random
-
dimensionType
-
blockTicks
-
fluidTicks
-
biomeManager
-
generatingStep
-
currentlyGenerating
-
subTickCount
-
WORLDGEN_REGION_RANDOM
-
-
Constructor Details
-
WorldGenRegion
public WorldGenRegion(ServerLevel level, StaticCache2D<GenerationChunkHolder> cache, ChunkStep generatingStep, ChunkAccess center)
-
-
Method Details
-
isOldChunkAround
-
getCenter
-
setCurrentlyGenerating
- Specified by:
setCurrentlyGeneratingin interfaceWorldGenLevel
-
getChunk
- Specified by:
getChunkin interfaceLevelReader
-
getChunk
- Specified by:
getChunkin interfaceLevelReader
-
hasChunk
public boolean hasChunk(int chunkX, int chunkZ) - Specified by:
hasChunkin interfaceLevelAccessor- Specified by:
hasChunkin interfaceLevelReader
-
getBlockState
- Specified by:
getBlockStatein interfaceBlockGetter
-
getFluidState
- Specified by:
getFluidStatein interfaceBlockGetter
-
getNearestPlayer
@Nullable public Player getNearestPlayer(double x, double y, double z, double distance, Predicate<Entity> predicate) - Specified by:
getNearestPlayerin interfaceEntityGetter
-
getSkyDarken
public int getSkyDarken()- Specified by:
getSkyDarkenin interfaceLevelReader
-
getBiomeManager
- Specified by:
getBiomeManagerin interfaceLevelReader
-
getUncachedNoiseBiome
- Specified by:
getUncachedNoiseBiomein interfaceLevelReader
-
getShade
- Specified by:
getShadein interfaceBlockAndTintGetter
-
getLightEngine
- Specified by:
getLightEnginein interfaceBlockAndTintGetter
-
destroyBlock
public boolean destroyBlock(BlockPos pos, boolean dropBlock, @Nullable Entity entity, int recursionLeft) - Specified by:
destroyBlockin interfaceLevelWriter
-
getBlockEntity
- Specified by:
getBlockEntityin interfaceBlockGetter
-
ensureCanWrite
- Specified by:
ensureCanWritein interfaceWorldGenLevel
-
setBlock
- Specified by:
setBlockin interfaceLevelWriter
-
markPosForPostprocessing
-
addFreshEntity
- Specified by:
addFreshEntityin interfaceLevelWriter
-
removeBlock
- Specified by:
removeBlockin interfaceLevelWriter
-
getWorldBorder
- Specified by:
getWorldBorderin interfaceCollisionGetter
-
isClientSide
public boolean isClientSide()- Specified by:
isClientSidein interfaceLevelReader
-
getLevel
Deprecated.- Specified by:
getLevelin interfaceServerLevelAccessor
-
registryAccess
- Specified by:
registryAccessin interfaceLevelReader
-
enabledFeatures
- Specified by:
enabledFeaturesin interfaceLevelReader
-
getLevelData
- Specified by:
getLevelDatain interfaceLevelAccessor
-
getCurrentDifficultyAt
- Specified by:
getCurrentDifficultyAtin interfaceLevelAccessor
-
getServer
- Specified by:
getServerin interfaceLevelAccessor
-
getChunkSource
- Specified by:
getChunkSourcein interfaceLevelAccessor
-
getSeed
public long getSeed()- Specified by:
getSeedin interfaceWorldGenLevel
-
getBlockTicks
- Specified by:
getBlockTicksin interfaceLevelAccessor
-
getFluidTicks
- Specified by:
getFluidTicksin interfaceLevelAccessor
-
getSeaLevel
public int getSeaLevel()- Specified by:
getSeaLevelin interfaceLevelReader
-
getRandom
- Specified by:
getRandomin interfaceLevelAccessor
-
getHeight
- Specified by:
getHeightin interfaceLevelReader
-
playSound
public void playSound(@Nullable Player player, BlockPos pos, SoundEvent sound, SoundSource category, float volume, float pitch) Plays a sound. On the server, the sound is broadcast to all nearby except the given player. On the client, the sound only plays if the given player is the client player. Thus, this method is intended to be called from code running on both sides. The client plays it locally and the server plays it for everyone else.- Specified by:
playSoundin interfaceLevelAccessor
-
addParticle
public void addParticle(ParticleOptions particleData, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) - Specified by:
addParticlein interfaceLevelAccessor
-
levelEvent
- Specified by:
levelEventin interfaceLevelAccessor
-
gameEvent
- Specified by:
gameEventin interfaceLevelAccessor
-
dimensionType
- Specified by:
dimensionTypein interfaceLevelReader
-
isStateAtPosition
- Specified by:
isStateAtPositionin interfaceLevelSimulatedReader
-
isFluidAtPosition
- Specified by:
isFluidAtPositionin interfaceLevelSimulatedReader
-
getEntities
public <T extends Entity> List<T> getEntities(EntityTypeTest<Entity, T> entityTypeTest, AABB bounds, Predicate<? super T> predicate) - Specified by:
getEntitiesin interfaceEntityGetter
-
getEntities
public List<Entity> getEntities(@Nullable Entity entity, AABB boundingBox, @Nullable Predicate<? super Entity> predicate) Gets all entities within the specified AABB excluding the one passed into it.- Specified by:
getEntitiesin interfaceEntityGetter
-
players
- Specified by:
playersin interfaceEntityGetter
-
getMinBuildHeight
public int getMinBuildHeight()- Specified by:
getMinBuildHeightin interfaceLevelHeightAccessor- Specified by:
getMinBuildHeightin interfaceLevelReader
-
getHeight
public int getHeight()- Specified by:
getHeightin interfaceLevelHeightAccessor- Specified by:
getHeightin interfaceLevelReader
-
nextSubTickCount
public long nextSubTickCount()- Specified by:
nextSubTickCountin interfaceLevelAccessor
-