public abstract class World extends CapabilityProvider<World> implements IWorld, java.lang.AutoCloseable, IForgeWorld
Modifier and Type | Field and Description |
---|---|
protected java.util.List<TileEntity> |
addedTileEntityList |
private BiomeManager |
biomeManager |
boolean |
captureBlockSnapshots |
java.util.ArrayList<BlockSnapshot> |
capturedBlockSnapshots |
protected AbstractChunkProvider |
chunkProvider |
Dimension |
dimension |
protected int |
DIST_HASH_MAGIC |
private static Direction[] |
FACING_VALUES |
boolean |
isRemote |
java.util.List<TileEntity> |
loadedTileEntityList |
protected static org.apache.logging.log4j.Logger |
LOGGER |
private java.lang.Thread |
mainThread |
private double |
maxEntityRadius |
float |
prevRainingStrength |
float |
prevThunderingStrength |
protected boolean |
processingLoadedTiles |
private IProfiler |
profiler |
float |
rainingStrength |
java.util.Random |
rand |
boolean |
restoringBlockSnapshots |
private int |
skylightSubtracted |
float |
thunderingStrength |
java.util.List<TileEntity> |
tickableTileEntities |
protected java.util.Set<TileEntity> |
tileEntitiesToBeRemoved |
protected int |
updateLCG |
private WorldBorder |
worldBorder |
protected WorldInfo |
worldInfo |
Modifier | Constructor and Description |
---|---|
protected |
World(WorldInfo info,
DimensionType dimType,
java.util.function.BiFunction<World,Dimension,AbstractChunkProvider> provider,
IProfiler profilerIn,
boolean remote) |
Modifier and Type | Method and Description |
---|---|
void |
addBlockEvent(BlockPos pos,
Block blockIn,
int eventID,
int eventParam) |
void |
addOptionalParticle(IParticleData particleData,
boolean ignoreRange,
double x,
double y,
double z,
double xSpeed,
double ySpeed,
double zSpeed) |
void |
addOptionalParticle(IParticleData particleData,
double x,
double y,
double z,
double xSpeed,
double ySpeed,
double zSpeed) |
void |
addParticle(IParticleData particleData,
boolean forceAlwaysRender,
double x,
double y,
double z,
double xSpeed,
double ySpeed,
double zSpeed) |
void |
addParticle(IParticleData particleData,
double x,
double y,
double z,
double xSpeed,
double ySpeed,
double zSpeed) |
void |
addTileEntities(java.util.Collection<TileEntity> tileEntityCollection) |
boolean |
addTileEntity(TileEntity tile) |
protected void |
advanceTime() |
void |
calculateInitialSkylight() |
protected void |
calculateInitialWeather() |
void |
calculateInitialWeatherBody() |
boolean |
canMineBlockBody(PlayerEntity player,
BlockPos pos) |
boolean |
checkBlockCollision(AxisAlignedBB bb) |
void |
close() |
Explosion |
createExplosion(Entity entityIn,
DamageSource damageSourceIn,
double xIn,
double yIn,
double zIn,
float explosionRadius,
boolean causesFire,
Explosion.Mode modeIn) |
Explosion |
createExplosion(Entity entityIn,
double xIn,
double yIn,
double zIn,
float explosionRadius,
boolean causesFire,
Explosion.Mode modeIn) |
Explosion |
createExplosion(Entity entityIn,
double xIn,
double yIn,
double zIn,
float explosionRadius,
Explosion.Mode modeIn) |
boolean |
destroyBlock(BlockPos p_225521_1_,
boolean p_225521_2_,
Entity p_225521_3_) |
boolean |
extinguishFire(PlayerEntity player,
BlockPos pos,
Direction side) |
CrashReportCategory |
fillCrashReport(CrashReport report) |
BlockState |
findBlockstateInArea(AxisAlignedBB area,
Block blockIn) |
int |
getActualHeight() |
BiomeManager |
getBiomeManager() |
BlockPos |
getBlockRandomPos(int p_217383_1_,
int p_217383_2_,
int p_217383_3_,
int p_217383_4_) |
IBlockReader |
getBlockReader(int chunkX,
int chunkZ) |
BlockState |
getBlockState(BlockPos pos) |
float |
getCelestialAngleRadians(float partialTicks) |
Chunk |
getChunk(int chunkX,
int chunkZ) |
IChunk |
getChunk(int x,
int z,
ChunkStatus requiredStatus,
boolean nonnull) |
Chunk |
getChunkAt(BlockPos pos) |
AbstractChunkProvider |
getChunkProvider() |
long |
getDayTime() |
DifficultyInstance |
getDifficultyForLocation(BlockPos pos) |
Dimension |
getDimension() |
java.util.List<Entity> |
getEntitiesInAABBexcluding(Entity entityIn,
AxisAlignedBB boundingBox,
java.util.function.Predicate<? super Entity> predicate) |
<T extends Entity> |
getEntitiesWithinAABB(java.lang.Class<? extends T> clazz,
AxisAlignedBB aabb,
java.util.function.Predicate<? super T> filter) |
<T extends Entity> |
getEntitiesWithinAABB(EntityType<T> type,
AxisAlignedBB boundingBox,
java.util.function.Predicate<? super T> predicate) |
abstract Entity |
getEntityByID(int id) |
IFluidState |
getFluidState(BlockPos pos) |
GameRules |
getGameRules() |
long |
getGameTime() |
BlockState |
getGroundAboveSeaLevel(BlockPos pos) |
int |
getHeight(Heightmap.Type heightmapType,
int x,
int z) |
WorldLightManager |
getLightManager() |
<T extends Entity> |
getLoadedEntitiesWithinAABB(java.lang.Class<? extends T> p_225316_1_,
AxisAlignedBB p_225316_2_,
java.util.function.Predicate<? super T> p_225316_3_) |
abstract MapData |
getMapData(java.lang.String mapName) |
double |
getMaxEntityRadius()
The maximum radius to scan for entities when trying to check bounding boxes.
|
abstract int |
getNextMapId() |
private TileEntity |
getPendingTileEntityAt(BlockPos pos) |
IProfiler |
getProfiler() |
java.lang.String |
getProviderName() |
float |
getRainStrength(float delta) |
java.util.Random |
getRandom() |
abstract RecipeManager |
getRecipeManager() |
int |
getRedstonePower(BlockPos pos,
Direction facing) |
int |
getRedstonePowerFromNeighbors(BlockPos pos) |
abstract Scoreboard |
getScoreboard() |
int |
getSeaLevel() |
long |
getSeed() |
MinecraftServer |
getServer() |
int |
getSkylightSubtracted() |
BlockPos |
getSpawnPoint() |
int |
getStrongPower(BlockPos pos) |
abstract NetworkTagManager |
getTags() |
float |
getThunderStrength(float delta) |
TileEntity |
getTileEntity(BlockPos pos) |
World |
getWorld() |
WorldBorder |
getWorldBorder() |
WorldInfo |
getWorldInfo() |
WorldType |
getWorldType() |
void |
guardEntityTick(java.util.function.Consumer<Entity> consumerEntity,
Entity entityIn) |
boolean |
hasBlockState(BlockPos p_217375_1_,
java.util.function.Predicate<BlockState> p_217375_2_) |
double |
increaseMaxEntityRadius(double value)
Increases the max entity radius, this is safe to call with any value.
|
boolean |
isBlockinHighHumidity(BlockPos pos) |
boolean |
isBlockModifiable(PlayerEntity player,
BlockPos pos) |
boolean |
isBlockPowered(BlockPos pos) |
boolean |
isBlockPresent(BlockPos pos) |
boolean |
isDaytime() |
boolean |
isFlammableWithin(AxisAlignedBB bb) |
boolean |
isMaterialInBB(AxisAlignedBB bb,
Material materialIn) |
boolean |
isNightTime() |
static boolean |
isOutsideBuildHeight(BlockPos pos) |
boolean |
isRaining() |
boolean |
isRainingAt(BlockPos position) |
boolean |
isRemote() |
boolean |
isSaveDisabled() |
boolean |
isSidePowered(BlockPos pos,
Direction side) |
boolean |
isThundering() |
boolean |
isTopSolid(BlockPos pos,
Entity entityIn) |
static boolean |
isValid(BlockPos pos) |
static boolean |
isYOutOfBounds(int y) |
void |
makeFireworks(double x,
double y,
double z,
double motionX,
double motionY,
double motionZ,
CompoundNBT compound) |
void |
markAndNotifyBlock(BlockPos pos,
Chunk chunk,
BlockState blockstate,
BlockState newState,
int flags) |
void |
markBlockRangeForRenderUpdate(BlockPos blockPosIn,
BlockState oldState,
BlockState newState) |
void |
markChunkDirty(BlockPos pos,
TileEntity unusedTileEntity) |
void |
neighborChanged(BlockPos pos,
Block blockIn,
BlockPos fromPos) |
abstract void |
notifyBlockUpdate(BlockPos pos,
BlockState oldState,
BlockState newState,
int flags) |
void |
notifyNeighbors(BlockPos pos,
Block blockIn) |
void |
notifyNeighborsOfStateChange(BlockPos pos,
Block blockIn) |
void |
notifyNeighborsOfStateExcept(BlockPos pos,
Block blockType,
Direction skipSide) |
void |
onBlockStateChange(BlockPos pos,
BlockState blockStateIn,
BlockState newState) |
void |
playBroadcastSound(int id,
BlockPos pos,
int data) |
abstract void |
playMovingSound(PlayerEntity playerIn,
Entity entityIn,
SoundEvent eventIn,
SoundCategory categoryIn,
float volume,
float pitch) |
void |
playSound(double x,
double y,
double z,
SoundEvent soundIn,
SoundCategory category,
float volume,
float pitch,
boolean distanceDelay) |
void |
playSound(PlayerEntity player,
BlockPos pos,
SoundEvent soundIn,
SoundCategory category,
float volume,
float pitch) |
abstract void |
playSound(PlayerEntity player,
double x,
double y,
double z,
SoundEvent soundIn,
SoundCategory category,
float volume,
float pitch) |
abstract void |
registerMapData(MapData mapDataIn) |
boolean |
removeBlock(BlockPos pos,
boolean isMoving) |
void |
removeTileEntity(BlockPos pos) |
abstract void |
sendBlockBreakProgress(int breakerId,
BlockPos pos,
int progress) |
void |
sendPacketToServer(IPacket<?> packetIn) |
void |
sendQuittingDisconnectingPacket() |
void |
setAllowedSpawnTypes(boolean hostile,
boolean peaceful) |
boolean |
setBlockState(BlockPos pos,
BlockState state) |
boolean |
setBlockState(BlockPos pos,
BlockState newState,
int flags) |
void |
setDayTime(long time) |
void |
setEntityState(Entity entityIn,
byte state) |
void |
setGameTime(long worldTime) |
void |
setInitialSpawnLocation() |
void |
setRainStrength(float strength) |
void |
setSpawnPoint(BlockPos pos) |
void |
setThunderStrength(float strength) |
void |
setTileEntity(BlockPos pos,
TileEntity tileEntityIn) |
void |
setTimeLightningFlash(int timeFlashIn) |
void |
tickBlockEntities() |
void |
updateComparatorOutputLevel(BlockPos pos,
Block blockIn) |
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCaps
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkNoEntityCollision, chunkExists, getCelestialAngle, getCurrentMoonPhaseFactor, getDifficulty, getEmptyCollisionShapes, getHeight, getMoonPhase, getPendingBlockTicks, getPendingFluidTicks, playEvent, playEvent
func_225318_b, getClosestEntity, getClosestEntityWithinAABB, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getClosestPlayer, getEntitiesWithinAABB, getEntitiesWithinAABBExcludingEntity, getLoadedEntitiesWithinAABB, getPlayerByUuid, getPlayers, getTargettableEntitiesWithinAABB, getTargettablePlayersWithinAABB, isPlayerWithin
canBlockSeeSky, containsAnyLiquid, getBiome, getBlockColor, getBrightness, getChunk, getChunk, getLight, getNeighborAwareLightSubtracted, getNoiseBiome, getNoiseBiomeRaw, getStrongPower, hasWater, isAirBlock, isAreaLoaded, isAreaLoaded, isAreaLoaded, isBlockLoaded
canSeeSky, getLightFor, getLightSubtracted
checkNoEntityCollision, func_226663_a_, getCollisionShapes, getCollisionShapes, hasNoCollisions, hasNoCollisions, hasNoCollisions, hasNoCollisions
func_217300_a, getHeight, getLightValue, getMaxLightLevel, rayTraceBlocks, rayTraceBlocks
getMaxHeight
addEntity, destroyBlock
getCapability, getCapability
protected static final org.apache.logging.log4j.Logger LOGGER
private static final Direction[] FACING_VALUES
public final java.util.List<TileEntity> loadedTileEntityList
public final java.util.List<TileEntity> tickableTileEntities
protected final java.util.List<TileEntity> addedTileEntityList
protected final java.util.Set<TileEntity> tileEntitiesToBeRemoved
private final java.lang.Thread mainThread
private int skylightSubtracted
protected int updateLCG
protected final int DIST_HASH_MAGIC
public float prevRainingStrength
public float rainingStrength
public float prevThunderingStrength
public float thunderingStrength
public final java.util.Random rand
public final Dimension dimension
protected final AbstractChunkProvider chunkProvider
protected final WorldInfo worldInfo
private final IProfiler profiler
public final boolean isRemote
protected boolean processingLoadedTiles
private final WorldBorder worldBorder
private final BiomeManager biomeManager
public boolean restoringBlockSnapshots
public boolean captureBlockSnapshots
public java.util.ArrayList<BlockSnapshot> capturedBlockSnapshots
private double maxEntityRadius
protected World(WorldInfo info, DimensionType dimType, java.util.function.BiFunction<World,Dimension,AbstractChunkProvider> provider, IProfiler profilerIn, boolean remote)
public boolean isRemote()
isRemote
in interface IWorldReader
@Nullable public MinecraftServer getServer()
public void setInitialSpawnLocation()
public BlockState getGroundAboveSeaLevel(BlockPos pos)
public static boolean isValid(BlockPos pos)
public static boolean isOutsideBuildHeight(BlockPos pos)
public static boolean isYOutOfBounds(int y)
public Chunk getChunk(int chunkX, int chunkZ)
getChunk
in interface IWorldReader
public IChunk getChunk(int x, int z, ChunkStatus requiredStatus, boolean nonnull)
getChunk
in interface IWorldReader
public boolean setBlockState(BlockPos pos, BlockState newState, int flags)
setBlockState
in interface IWorldWriter
public void markAndNotifyBlock(BlockPos pos, @Nullable Chunk chunk, BlockState blockstate, BlockState newState, int flags)
public void onBlockStateChange(BlockPos pos, BlockState blockStateIn, BlockState newState)
public boolean removeBlock(BlockPos pos, boolean isMoving)
removeBlock
in interface IWorldWriter
public boolean destroyBlock(BlockPos p_225521_1_, boolean p_225521_2_, @Nullable Entity p_225521_3_)
destroyBlock
in interface IWorldWriter
public boolean setBlockState(BlockPos pos, BlockState state)
public abstract void notifyBlockUpdate(BlockPos pos, BlockState oldState, BlockState newState, int flags)
public void notifyNeighbors(BlockPos pos, Block blockIn)
notifyNeighbors
in interface IWorld
public void markBlockRangeForRenderUpdate(BlockPos blockPosIn, BlockState oldState, BlockState newState)
public void notifyNeighborsOfStateExcept(BlockPos pos, Block blockType, Direction skipSide)
public int getHeight(Heightmap.Type heightmapType, int x, int z)
getHeight
in interface IWorldReader
public WorldLightManager getLightManager()
getLightManager
in interface ILightReader
public BlockState getBlockState(BlockPos pos)
getBlockState
in interface IBlockReader
public IFluidState getFluidState(BlockPos pos)
getFluidState
in interface IBlockReader
public boolean isDaytime()
public boolean isNightTime()
public void playSound(@Nullable PlayerEntity player, BlockPos pos, SoundEvent soundIn, SoundCategory category, float volume, float pitch)
public abstract void playSound(@Nullable PlayerEntity player, double x, double y, double z, SoundEvent soundIn, SoundCategory category, float volume, float pitch)
public abstract void playMovingSound(@Nullable PlayerEntity playerIn, Entity entityIn, SoundEvent eventIn, SoundCategory categoryIn, float volume, float pitch)
public void playSound(double x, double y, double z, SoundEvent soundIn, SoundCategory category, float volume, float pitch, boolean distanceDelay)
public void addParticle(IParticleData particleData, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed)
addParticle
in interface IWorld
public void addParticle(IParticleData particleData, boolean forceAlwaysRender, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed)
public void addOptionalParticle(IParticleData particleData, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed)
public void addOptionalParticle(IParticleData particleData, boolean ignoreRange, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed)
public float getCelestialAngleRadians(float partialTicks)
public boolean addTileEntity(TileEntity tile)
public void addTileEntities(java.util.Collection<TileEntity> tileEntityCollection)
public void tickBlockEntities()
public void guardEntityTick(java.util.function.Consumer<Entity> consumerEntity, Entity entityIn)
public boolean checkBlockCollision(AxisAlignedBB bb)
public boolean isFlammableWithin(AxisAlignedBB bb)
@Nullable public BlockState findBlockstateInArea(AxisAlignedBB area, Block blockIn)
public boolean isMaterialInBB(AxisAlignedBB bb, Material materialIn)
public Explosion createExplosion(@Nullable Entity entityIn, double xIn, double yIn, double zIn, float explosionRadius, Explosion.Mode modeIn)
public Explosion createExplosion(@Nullable Entity entityIn, double xIn, double yIn, double zIn, float explosionRadius, boolean causesFire, Explosion.Mode modeIn)
public Explosion createExplosion(@Nullable Entity entityIn, @Nullable DamageSource damageSourceIn, double xIn, double yIn, double zIn, float explosionRadius, boolean causesFire, Explosion.Mode modeIn)
public boolean extinguishFire(@Nullable PlayerEntity player, BlockPos pos, Direction side)
public java.lang.String getProviderName()
@Nullable public TileEntity getTileEntity(BlockPos pos)
getTileEntity
in interface IBlockReader
@Nullable private TileEntity getPendingTileEntityAt(BlockPos pos)
public void setTileEntity(BlockPos pos, @Nullable TileEntity tileEntityIn)
public void removeTileEntity(BlockPos pos)
public boolean isBlockPresent(BlockPos pos)
public void calculateInitialSkylight()
public void setAllowedSpawnTypes(boolean hostile, boolean peaceful)
protected void calculateInitialWeather()
public void calculateInitialWeatherBody()
public void close() throws java.io.IOException
close
in interface java.lang.AutoCloseable
java.io.IOException
@Nullable public IBlockReader getBlockReader(int chunkX, int chunkZ)
getBlockReader
in interface ICollisionReader
getBlockReader
in interface IWorldReader
public java.util.List<Entity> getEntitiesInAABBexcluding(@Nullable Entity entityIn, AxisAlignedBB boundingBox, @Nullable java.util.function.Predicate<? super Entity> predicate)
getEntitiesInAABBexcluding
in interface IEntityReader
public <T extends Entity> java.util.List<T> getEntitiesWithinAABB(@Nullable EntityType<T> type, AxisAlignedBB boundingBox, java.util.function.Predicate<? super T> predicate)
public <T extends Entity> java.util.List<T> getEntitiesWithinAABB(java.lang.Class<? extends T> clazz, AxisAlignedBB aabb, @Nullable java.util.function.Predicate<? super T> filter)
getEntitiesWithinAABB
in interface IEntityReader
public <T extends Entity> java.util.List<T> getLoadedEntitiesWithinAABB(java.lang.Class<? extends T> p_225316_1_, AxisAlignedBB p_225316_2_, @Nullable java.util.function.Predicate<? super T> p_225316_3_)
getLoadedEntitiesWithinAABB
in interface IEntityReader
@Nullable public abstract Entity getEntityByID(int id)
public void markChunkDirty(BlockPos pos, TileEntity unusedTileEntity)
public int getSeaLevel()
getSeaLevel
in interface IWorldReader
public WorldType getWorldType()
public int getStrongPower(BlockPos pos)
public boolean isBlockPowered(BlockPos pos)
public int getRedstonePowerFromNeighbors(BlockPos pos)
public void sendQuittingDisconnectingPacket()
public void setGameTime(long worldTime)
public long getGameTime()
public long getDayTime()
public void setDayTime(long time)
protected void advanceTime()
public BlockPos getSpawnPoint()
getSpawnPoint
in interface IWorld
public void setSpawnPoint(BlockPos pos)
public boolean isBlockModifiable(PlayerEntity player, BlockPos pos)
public boolean canMineBlockBody(PlayerEntity player, BlockPos pos)
public void setEntityState(Entity entityIn, byte state)
public AbstractChunkProvider getChunkProvider()
getChunkProvider
in interface IWorld
public WorldInfo getWorldInfo()
getWorldInfo
in interface IWorld
public GameRules getGameRules()
public float getThunderStrength(float delta)
public void setThunderStrength(float strength)
public float getRainStrength(float delta)
public void setRainStrength(float strength)
public boolean isThundering()
public boolean isRaining()
public boolean isRainingAt(BlockPos position)
public boolean isBlockinHighHumidity(BlockPos pos)
@Nullable public abstract MapData getMapData(java.lang.String mapName)
public abstract void registerMapData(MapData mapDataIn)
public abstract int getNextMapId()
public void playBroadcastSound(int id, BlockPos pos, int data)
public int getActualHeight()
public CrashReportCategory fillCrashReport(CrashReport report)
public abstract void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress)
public void makeFireworks(double x, double y, double z, double motionX, double motionY, double motionZ, @Nullable CompoundNBT compound)
public abstract Scoreboard getScoreboard()
public DifficultyInstance getDifficultyForLocation(BlockPos pos)
getDifficultyForLocation
in interface IWorld
public int getSkylightSubtracted()
getSkylightSubtracted
in interface IWorldReader
public void setTimeLightningFlash(int timeFlashIn)
public WorldBorder getWorldBorder()
getWorldBorder
in interface ICollisionReader
public void sendPacketToServer(IPacket<?> packetIn)
public Dimension getDimension()
getDimension
in interface IWorldReader
public boolean hasBlockState(BlockPos p_217375_1_, java.util.function.Predicate<BlockState> p_217375_2_)
hasBlockState
in interface IWorldGenerationBaseReader
public abstract RecipeManager getRecipeManager()
public abstract NetworkTagManager getTags()
public BlockPos getBlockRandomPos(int p_217383_1_, int p_217383_2_, int p_217383_3_, int p_217383_4_)
public boolean isSaveDisabled()
public IProfiler getProfiler()
public BiomeManager getBiomeManager()
getBiomeManager
in interface IWorldReader
public double getMaxEntityRadius()
IForgeWorld
getMaxEntityRadius
in interface IForgeWorld
public double increaseMaxEntityRadius(double value)
IForgeWorld
increaseMaxEntityRadius
in interface IForgeWorld
value
- New max radius to set.