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 level, StaticCache2D<GenerationChunkHolder> cache, ChunkStep generatingStep, ChunkAccess center) -
Method Summary
Modifier and TypeMethodDescriptionboolean
addFreshEntity
(Entity entity) void
addParticle
(ParticleOptions particleData, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) boolean
destroyBlock
(BlockPos pos, boolean dropBlock, Entity entity, int recursionLeft) boolean
ensureCanWrite
(BlockPos pos) void
gameEvent
(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) int
int
getHeight
(Heightmap.Types heightmapType, int x, int z) getLevel()
Deprecated.int
getNearestPlayer
(double x, double y, double z, double distance, Predicate<Entity> predicate) int
long
getSeed()
float
int
getUncachedNoiseBiome
(int x, int y, int z) boolean
hasChunk
(int chunkX, int chunkZ) boolean
boolean
isFluidAtPosition
(BlockPos pos, Predicate<FluidState> predicate) boolean
isOldChunkAround
(ChunkPos pos, int radius) boolean
isStateAtPosition
(BlockPos pos, Predicate<BlockState> state) void
levelEvent
(Player player, int type, BlockPos pos, int data) private void
long
players()
void
playSound
(Player player, BlockPos pos, SoundEvent sound, SoundSource category, float volume, float pitch) Plays a sound.boolean
removeBlock
(BlockPos pos, boolean isMoving) boolean
setBlock
(BlockPos pos, BlockState state, int flags, int recursionLeft) void
setCurrentlyGenerating
(Supplier<String> currentlyGenerating) 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 level, StaticCache2D<GenerationChunkHolder> cache, ChunkStep generatingStep, ChunkAccess center)
-
-
Method Details
-
isOldChunkAround
-
getCenter
-
setCurrentlyGenerating
- Specified by:
setCurrentlyGenerating
in interfaceWorldGenLevel
-
getChunk
- Specified by:
getChunk
in interfaceLevelReader
-
getChunk
- Specified by:
getChunk
in interfaceLevelReader
-
hasChunk
public boolean hasChunk(int chunkX, int chunkZ) - 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 x, double y, double z, double distance, Predicate<Entity> predicate) - 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 pos, boolean dropBlock, @Nullable Entity entity, int recursionLeft) - 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 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:
playSound
in interfaceLevelAccessor
-
addParticle
public void addParticle(ParticleOptions particleData, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) - 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> entityTypeTest, AABB bounds, Predicate<? super T> predicate) - Specified by:
getEntities
in 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:
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
-