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 BiomeManager
private final WorldGenTickAccess
<Block> private final StaticCache2D
<GenerationChunkHolder> private final ChunkAccess
private final DimensionType
private final WorldGenTickAccess
<Fluid> private final ChunkStep
private final ServerLevel
private final LevelData
private static final org.slf4j.Logger
private final RandomSource
private final long
private final AtomicLong
private static final ResourceLocation
Fields 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 TypeMethodDescriptionboolean
addFreshEntity
(Entity pEntity) void
addParticle
(ParticleOptions pParticleData, double pX, double pY, double pZ, double pXSpeed, double pYSpeed, double pZSpeed) boolean
destroyBlock
(BlockPos pPos, boolean pDropBlock, Entity pEntity, int pRecursionLeft) boolean
ensureCanWrite
(BlockPos pPos) void
gameEvent
(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) int
int
getHeight
(Heightmap.Types pHeightmapType, int pX, int pZ) getLevel()
Deprecated.int
getNearestPlayer
(double pX, double pY, double pZ, double pDistance, Predicate<Entity> pPredicate) int
long
getSeed()
float
int
getUncachedNoiseBiome
(int pX, int pY, int pZ) boolean
hasChunk
(int pChunkX, int pChunkZ) boolean
boolean
isFluidAtPosition
(BlockPos pPos, Predicate<FluidState> pPredicate) boolean
isOldChunkAround
(ChunkPos pPos, int pRadius) boolean
isStateAtPosition
(BlockPos pPos, Predicate<BlockState> pState) void
levelEvent
(Player pPlayer, int pType, BlockPos pPos, int pData) private void
long
players()
void
playSound
(Player pPlayer, BlockPos pPos, SoundEvent pSound, SoundSource pCategory, float pVolume, float pPitch) Plays a sound.boolean
removeBlock
(BlockPos pPos, boolean pIsMoving) boolean
setBlock
(BlockPos pPos, BlockState pState, int pFlags, int pRecursionLeft) void
setCurrentlyGenerating
(Supplier<String> pCurrentlyGenerating) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.world.level.BlockAndTintGetter
canSeeSky, getBrightness, getRawBrightness
Methods inherited from interface net.minecraft.world.level.BlockGetter
clip, clipWithInteractionOverride, getBlockFloorHeight, getBlockFloorHeight, getBlockStates, getLightEmission, getMaxLightLevel, isBlockInLine
Methods inherited from interface net.minecraft.world.level.CollisionGetter
collidesWithSuffocatingBlock, findFreePosition, findSupportingBlock, getBlockCollisions, getCollisions, getEntityCollisions, isUnobstructed, isUnobstructed, isUnobstructed, noBlockCollision, noCollision, noCollision, noCollision
Methods inherited from interface net.minecraft.world.level.CommonLevelAccessor
getBlockEntity, getEntityCollisions, getHeightmapPos, isUnobstructed
Methods inherited from interface net.minecraft.world.level.EntityGetter
getEntities, getEntitiesOfClass, getEntitiesOfClass, getNearbyEntities, getNearbyPlayers, getNearestEntity, getNearestEntity, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getPlayerByUUID, hasNearbyAlivePlayer
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockAndTintGetterExtension
getShade
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockGetterExtension
getAuxLightManager, getAuxLightManager, getModelData
Methods inherited from interface net.neoforged.neoforge.common.extensions.ILevelReaderExtension
holder, holderOrThrow, isAreaLoaded
Methods inherited from interface net.minecraft.world.level.LevelAccessor
blockUpdated, dayTime, gameEvent, gameEvent, gameEvent, gameEvent, getDifficulty, levelEvent, neighborShapeChanged, playSound, scheduleTick, scheduleTick, scheduleTick, scheduleTick
Methods inherited from interface net.minecraft.world.level.LevelHeightAccessor
getMaxBuildHeight, getMaxSection, getMinSection, getSectionIndex, getSectionIndexFromSectionY, getSectionsCount, getSectionYFromSectionIndex, isOutsideBuildHeight, isOutsideBuildHeight
Methods 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, isWaterAt
Methods inherited from interface net.minecraft.world.level.LevelTimeAccess
getMoonBrightness, getMoonPhase, getTimeOfDay
Methods inherited from interface net.minecraft.world.level.LevelWriter
destroyBlock, destroyBlock, setBlock
Methods inherited from interface net.minecraft.world.level.ServerLevelAccessor
addFreshEntityWithPassengers
Methods 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:
setCurrentlyGenerating
in interfaceWorldGenLevel
-
getChunk
- Specified by:
getChunk
in interfaceLevelReader
-
getChunk
@Nullable public ChunkAccess getChunk(int pX, int pZ, ChunkStatus pChunkStatus, boolean pRequireChunk) - Specified by:
getChunk
in interfaceLevelReader
-
hasChunk
public boolean hasChunk(int pChunkX, int pChunkZ) - Specified by:
hasChunk
in interfaceLevelAccessor
- Specified by:
hasChunk
in interfaceLevelReader
-
getBlockState
- Specified by:
getBlockState
in interfaceBlockGetter
-
getFluidState
- Specified by:
getFluidState
in interfaceBlockGetter
-
getNearestPlayer
@Nullable public Player getNearestPlayer(double pX, double pY, double pZ, double pDistance, Predicate<Entity> pPredicate) - Specified by:
getNearestPlayer
in interfaceEntityGetter
-
getSkyDarken
public int getSkyDarken()- Specified by:
getSkyDarken
in interfaceLevelReader
-
getBiomeManager
- Specified by:
getBiomeManager
in interfaceLevelReader
-
getUncachedNoiseBiome
- Specified by:
getUncachedNoiseBiome
in interfaceLevelReader
-
getShade
- Specified by:
getShade
in interfaceBlockAndTintGetter
-
getLightEngine
- Specified by:
getLightEngine
in interfaceBlockAndTintGetter
-
destroyBlock
public boolean destroyBlock(BlockPos pPos, boolean pDropBlock, @Nullable Entity pEntity, int pRecursionLeft) - Specified by:
destroyBlock
in interfaceLevelWriter
-
getBlockEntity
- Specified by:
getBlockEntity
in interfaceBlockGetter
-
ensureCanWrite
- Specified by:
ensureCanWrite
in interfaceWorldGenLevel
-
setBlock
- Specified by:
setBlock
in interfaceLevelWriter
-
markPosForPostprocessing
-
addFreshEntity
- Specified by:
addFreshEntity
in interfaceLevelWriter
-
removeBlock
- Specified by:
removeBlock
in interfaceLevelWriter
-
getWorldBorder
- Specified by:
getWorldBorder
in interfaceCollisionGetter
-
isClientSide
public boolean isClientSide()- Specified by:
isClientSide
in interfaceLevelReader
-
getLevel
Deprecated.- Specified by:
getLevel
in interfaceServerLevelAccessor
-
registryAccess
- Specified by:
registryAccess
in interfaceLevelReader
-
enabledFeatures
- Specified by:
enabledFeatures
in interfaceLevelReader
-
getLevelData
- Specified by:
getLevelData
in interfaceLevelAccessor
-
getCurrentDifficultyAt
- Specified by:
getCurrentDifficultyAt
in interfaceLevelAccessor
-
getServer
- Specified by:
getServer
in interfaceLevelAccessor
-
getChunkSource
- Specified by:
getChunkSource
in interfaceLevelAccessor
-
getSeed
public long getSeed()- Specified by:
getSeed
in interfaceWorldGenLevel
-
getBlockTicks
- Specified by:
getBlockTicks
in interfaceLevelAccessor
-
getFluidTicks
- Specified by:
getFluidTicks
in interfaceLevelAccessor
-
getSeaLevel
public int getSeaLevel()- Specified by:
getSeaLevel
in interfaceLevelReader
-
getRandom
- Specified by:
getRandom
in interfaceLevelAccessor
-
getHeight
- Specified by:
getHeight
in 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:
playSound
in interfaceLevelAccessor
-
addParticle
public void addParticle(ParticleOptions pParticleData, double pX, double pY, double pZ, double pXSpeed, double pYSpeed, double pZSpeed) - Specified by:
addParticle
in interfaceLevelAccessor
-
levelEvent
- Specified by:
levelEvent
in interfaceLevelAccessor
-
gameEvent
- Specified by:
gameEvent
in interfaceLevelAccessor
-
dimensionType
- Specified by:
dimensionType
in interfaceLevelReader
-
isStateAtPosition
- Specified by:
isStateAtPosition
in interfaceLevelSimulatedReader
-
isFluidAtPosition
- Specified by:
isFluidAtPosition
in interfaceLevelSimulatedReader
-
getEntities
public <T extends Entity> List<T> getEntities(EntityTypeTest<Entity, T> pEntityTypeTest, AABB pBounds, Predicate<? super T> pPredicate) - Specified by:
getEntities
in 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:
getEntities
in interfaceEntityGetter
-
players
- Specified by:
players
in interfaceEntityGetter
-
getMinBuildHeight
public int getMinBuildHeight()- Specified by:
getMinBuildHeight
in interfaceLevelHeightAccessor
- Specified by:
getMinBuildHeight
in interfaceLevelReader
-
getHeight
public int getHeight()- Specified by:
getHeight
in interfaceLevelHeightAccessor
- Specified by:
getHeight
in interfaceLevelReader
-
nextSubTickCount
public long nextSubTickCount()- Specified by:
nextSubTickCount
in interfaceLevelAccessor
-