public class ChunkRegion extends Object implements ServerWorldAccess
| Modifier and Type | Field and Description |
|---|---|
private BiomeAccess |
biomeAccess |
private TickScheduler<Block> |
blockTickScheduler |
private int |
centerChunkX |
private int |
centerChunkZ |
private List<Chunk> |
chunks |
private DimensionType |
dimension |
private TickScheduler<Fluid> |
fluidTickScheduler |
private WorldProperties |
levelProperties |
private static Logger |
LOGGER |
private ChunkPos |
lowerCorner |
private Random |
random |
private long |
seed |
private ChunkPos |
upperCorner |
private int |
width |
private ServerWorld |
world |
| Constructor and Description |
|---|
ChunkRegion(ServerWorld world,
List<Chunk> chunks) |
| Modifier and Type | Method and Description |
|---|---|
void |
addParticle(ParticleEffect parameters,
double x,
double y,
double z,
double velocityX,
double velocityY,
double velocityZ) |
boolean |
breakBlock(BlockPos blockPos,
boolean bool,
Entity entity,
int int2) |
int |
getAmbientDarkness() |
BiomeAccess |
getBiomeAccess() |
BlockEntity |
getBlockEntity(BlockPos blockPos) |
BlockState |
getBlockState(BlockPos blockPos) |
TickScheduler<Block> |
getBlockTickScheduler() |
float |
getBrightness(Direction direction,
boolean bool) |
int |
getCenterChunkX() |
int |
getCenterChunkZ() |
Chunk |
getChunk(int int2,
int int3) |
Chunk |
getChunk(int int2,
int int3,
ChunkStatus chunkStatus,
boolean bool) |
ChunkManager |
getChunkManager() |
PlayerEntity |
getClosestPlayer(double double2,
double double3,
double double4,
double double5,
Predicate<Entity> predicate) |
DimensionType |
getDimension() |
<T extends Entity> |
getEntitiesByClass(Class<? extends T> class2,
Box box,
Predicate<? super T> predicate)
Computes a list of entities within some box whose runtime Java class is the same as or is
a subclass of the given class.
|
FluidState |
getFluidState(BlockPos blockPos) |
TickScheduler<Fluid> |
getFluidTickScheduler() |
Biome |
getGeneratorStoredBiome(int int2,
int int3,
int int4) |
WorldProperties |
getLevelProperties() |
LightingProvider |
getLightingProvider() |
LocalDifficulty |
getLocalDifficulty(BlockPos pos) |
List<Entity> |
getOtherEntities(Entity entity,
Box box,
Predicate<? super Entity> predicate)
Computes a list of entities within some box, excluding the given entity, that satisfy the given predicate.
|
List<PlayerEntity> |
getPlayers() |
Random |
getRandom() |
int |
getSeaLevel() |
long |
getSeed() |
int |
getTopY(Heightmap.Type type,
int int2,
int int3) |
ServerWorld |
getWorld()
Deprecated.
|
WorldBorder |
getWorldBorder() |
boolean |
isChunkLoaded(int int2,
int int3) |
boolean |
isClient()
Checks if this world view is on the logical client.
|
private void |
markBlockForPostProcessing(BlockPos pos) |
Stream<? extends StructureStart<?>> |
method_30275(ChunkSectionPos chunkSectionPos,
StructureFeature<?> structureFeature) |
void |
playSound(PlayerEntity player,
BlockPos pos,
SoundEvent sound,
SoundCategory category,
float volume,
float pitch) |
boolean |
removeBlock(BlockPos blockPos,
boolean bool) |
boolean |
setBlockState(BlockPos blockPos,
BlockState blockState,
int int2,
int int3)
Updates the block state at a position, calling appropriate callbacks.
|
boolean |
spawnEntity(Entity entity) |
void |
syncWorldEvent(PlayerEntity player,
int eventId,
BlockPos pos,
int data) |
boolean |
testBlockState(BlockPos blockPos,
Predicate<BlockState> predicate) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmethod_30771getDifficulty, getDimensionHeight, method_30271, syncWorldEvent, updateNeighborsgetEntityCollisions, getTopPosition, intersectsEntitiesgetClosestEntity, getClosestEntity, getClosestEntityIncludingUngeneratedChunks, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getEntitiesIncludingUngeneratedChunks, getEntitiesIncludingUngeneratedChunks, getNonSpectatingEntities, getOtherEntities, getPlayerByUuid, getPlayers, getTargets, isPlayerInRangebreakBlock, breakBlock, setBlockStatemethod_30272, method_30273, method_30274containsFluid, getBiome, getBiomeForNoiseGen, getBrightness, getChunk, getChunk, getColor, getExistingChunk, getLightLevel, getLightLevel, getStrongRedstonePower, isAir, isChunkLoaded, isRegionLoaded, isRegionLoaded, isSkyVisibleAllowingSea, isWater, method_29556getBaseLightLevel, getLightLevel, isSkyVisiblecanPlace, doesNotCollide, doesNotCollide, doesNotCollide, doesNotCollide, getBlockCollisions, getCollisions, intersectsEntities, method_30030, method_30635getDismountHeight, getDismountHeight, getHeight, getLuminance, getMaxLightLevel, method_29546, rayTrace, rayTrace, rayTraceBlockprivate static final Logger LOGGER
private final int centerChunkX
private final int centerChunkZ
private final int width
private final ServerWorld world
private final long seed
private final WorldProperties levelProperties
private final Random random
private final DimensionType dimension
private final TickScheduler<Block> blockTickScheduler
private final TickScheduler<Fluid> fluidTickScheduler
private final BiomeAccess biomeAccess
private final ChunkPos lowerCorner
private final ChunkPos upperCorner
public ChunkRegion(ServerWorld world, List<Chunk> chunks)
public int getCenterChunkX()
public int getCenterChunkZ()
@Nullable public Chunk getChunk(int int2, int int3, ChunkStatus chunkStatus, boolean bool)
public boolean isChunkLoaded(int int2,
int int3)
isChunkLoaded in interface WorldAccessisChunkLoaded in interface WorldViewpublic BlockState getBlockState(BlockPos blockPos)
getBlockState in interface BlockViewpublic FluidState getFluidState(BlockPos blockPos)
getFluidState in interface BlockView@Nullable public PlayerEntity getClosestPlayer(double double2, double double3, double double4, double double5, Predicate<Entity> predicate)
getClosestPlayer in interface EntityViewpublic int getAmbientDarkness()
getAmbientDarkness in interface WorldViewpublic BiomeAccess getBiomeAccess()
getBiomeAccess in interface WorldViewpublic Biome getGeneratorStoredBiome(int int2, int int3, int int4)
getGeneratorStoredBiome in interface WorldView@Environment(value=CLIENT) public float getBrightness(Direction direction, boolean bool)
getBrightness in interface BlockRenderViewpublic LightingProvider getLightingProvider()
getLightingProvider in interface BlockRenderViewpublic boolean breakBlock(BlockPos blockPos, boolean bool, @Nullable Entity entity, int int2)
breakBlock in interface ModifiableWorld@Nullable public BlockEntity getBlockEntity(BlockPos blockPos)
getBlockEntity in interface BlockViewpublic boolean setBlockState(BlockPos blockPos, BlockState blockState, int int2, int int3)
ModifiableWorldWhen called on the server, the new block state is stored and propagated to clients and listeners as dictated by the supplied flags. Note that calling this on the client will update the world locally, but may not see the change persisted across loads. It's recommended to check whether this world is client before interacting with the world in this way.
Accepted values of the flags are a bitset combination of the following:
setBlockState in interface ModifiableWorldblockPos - the target positionblockState - the block state to setint2 - the bitwise flag combination, as described aboveint3 - the limit for the cascading block updatesprivate void markBlockForPostProcessing(BlockPos pos)
public boolean spawnEntity(Entity entity)
spawnEntity in interface ModifiableWorldpublic boolean removeBlock(BlockPos blockPos, boolean bool)
removeBlock in interface ModifiableWorldpublic WorldBorder getWorldBorder()
getWorldBorder in interface CollisionViewpublic boolean isClient()
WorldViewIf the value returned is false, it is expected that this world is present on a logical server.
@Deprecated public ServerWorld getWorld()
getWorld in interface class_5425public WorldProperties getLevelProperties()
getLevelProperties in interface WorldAccesspublic LocalDifficulty getLocalDifficulty(BlockPos pos)
getLocalDifficulty in interface WorldAccesspublic ChunkManager getChunkManager()
getChunkManager in interface WorldAccesspublic long getSeed()
getSeed in interface ServerWorldAccesspublic TickScheduler<Block> getBlockTickScheduler()
getBlockTickScheduler in interface WorldAccesspublic TickScheduler<Fluid> getFluidTickScheduler()
getFluidTickScheduler in interface WorldAccesspublic int getSeaLevel()
getSeaLevel in interface WorldViewpublic Random getRandom()
getRandom in interface WorldAccesspublic int getTopY(Heightmap.Type type, int int2, int int3)
public void playSound(@Nullable PlayerEntity player, BlockPos pos, SoundEvent sound, SoundCategory category, float volume, float pitch)
playSound in interface WorldAccesspublic void addParticle(ParticleEffect parameters, double x, double y, double z, double velocityX, double velocityY, double velocityZ)
addParticle in interface WorldAccesspublic void syncWorldEvent(@Nullable PlayerEntity player, int eventId, BlockPos pos, int data)
syncWorldEvent in interface WorldAccesspublic DimensionType getDimension()
getDimension in interface WorldViewpublic boolean testBlockState(BlockPos blockPos, Predicate<BlockState> predicate)
testBlockState in interface TestableWorldpublic <T extends Entity> List<T> getEntitiesByClass(Class<? extends T> class2, Box box, @Nullable Predicate<? super T> predicate)
EntityViewgetEntitiesByClass in interface EntityViewclass2 - the class the list of entities must extendbox - the box in which to search for entitiespredicate - a predicate which entities must satisfy in order to be included in the returned listpublic List<Entity> getOtherEntities(@Nullable Entity entity, Box box, @Nullable Predicate<? super Entity> predicate)
EntityViewgetOtherEntities in interface EntityViewentity - the entity the box logically surrounds. This entity is ignored if it is inside the box.box - the box in which to search for entitiespredicate - a predicate which entities must satisfy in order to be included in the returned list.public List<PlayerEntity> getPlayers()
getPlayers in interface EntityViewpublic Stream<? extends StructureStart<?>> method_30275(ChunkSectionPos chunkSectionPos, StructureFeature<?> structureFeature)
method_30275 in interface ServerWorldAccess