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 pLevel, StaticCache2D<GenerationChunkHolder> pCache, ChunkStep pGeneratingStep, ChunkAccess pCenter) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddFreshEntity(Entity pEntity) voidaddParticle(ParticleOptions pParticleData, double pX, double pY, double pZ, double pXSpeed, double pYSpeed, double pZSpeed) booleandestroyBlock(BlockPos pPos, boolean pDropBlock, Entity pEntity, int pRecursionLeft) booleanensureCanWrite(BlockPos pPos) voidgameEvent(Holder<GameEvent> pGameEvent, Vec3 pPos, GameEvent.Context pContext) getBlockEntity(BlockPos pPos) getBlockState(BlockPos pPos) getChunk(int pChunkX, int pChunkZ) getChunk(int pX, int pZ, ChunkStatus pChunkStatus, boolean pRequireChunk) getEntities(Entity pEntity, AABB pBoundingBox, Predicate<? super Entity> pPredicate) Gets all entities within the specified AABB excluding the one passed into it.getEntities(EntityTypeTest<Entity, T> pEntityTypeTest, AABB pBounds, Predicate<? super T> pPredicate) getFluidState(BlockPos pPos) intintgetHeight(Heightmap.Types pHeightmapType, int pX, int pZ) getLevel()Deprecated.intgetNearestPlayer(double pX, double pY, double pZ, double pDistance, Predicate<Entity> pPredicate) intlonggetSeed()floatintgetUncachedNoiseBiome(int pX, int pY, int pZ) booleanhasChunk(int pChunkX, int pChunkZ) booleanbooleanisFluidAtPosition(BlockPos pPos, Predicate<FluidState> pPredicate) booleanisOldChunkAround(ChunkPos pPos, int pRadius) booleanisStateAtPosition(BlockPos pPos, Predicate<BlockState> pState) voidlevelEvent(Player pPlayer, int pType, BlockPos pPos, int pData) private voidlongplayers()voidplaySound(Player pPlayer, BlockPos pPos, SoundEvent pSound, SoundSource pCategory, float pVolume, float pPitch) Plays a sound.booleanremoveBlock(BlockPos pPos, boolean pIsMoving) booleansetBlock(BlockPos pPos, BlockState pState, int pFlags, int pRecursionLeft) voidsetCurrentlyGenerating(Supplier<String> pCurrentlyGenerating) 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 pLevel, StaticCache2D<GenerationChunkHolder> pCache, ChunkStep pGeneratingStep, ChunkAccess pCenter)
-
-
Method Details
-
isOldChunkAround
-
getCenter
-
setCurrentlyGenerating
- Specified by:
setCurrentlyGeneratingin interfaceWorldGenLevel
-
getChunk
- Specified by:
getChunkin interfaceLevelReader
-
getChunk
@Nullable public ChunkAccess getChunk(int pX, int pZ, ChunkStatus pChunkStatus, boolean pRequireChunk) - Specified by:
getChunkin interfaceLevelReader
-
hasChunk
public boolean hasChunk(int pChunkX, int pChunkZ) - Specified by:
hasChunkin interfaceLevelAccessor- Specified by:
hasChunkin interfaceLevelReader
-
getBlockState
- Specified by:
getBlockStatein interfaceBlockGetter
-
getFluidState
- Specified by:
getFluidStatein interfaceBlockGetter
-
getNearestPlayer
@Nullable public Player getNearestPlayer(double pX, double pY, double pZ, double pDistance, Predicate<Entity> pPredicate) - 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 pPos, boolean pDropBlock, @Nullable Entity pEntity, int pRecursionLeft) - 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 pPlayer, BlockPos pPos, SoundEvent pSound, SoundSource pCategory, float pVolume, float pPitch) 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 pParticleData, double pX, double pY, double pZ, double pXSpeed, double pYSpeed, double pZSpeed) - 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> pEntityTypeTest, AABB pBounds, Predicate<? super T> pPredicate) - Specified by:
getEntitiesin interfaceEntityGetter
-
getEntities
public List<Entity> getEntities(@Nullable Entity pEntity, AABB pBoundingBox, @Nullable Predicate<? super Entity> pPredicate) 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
-