Package net.minecraft.world
Class World
- All Implemented Interfaces:
AutoCloseable
,BiomeManager.IBiomeReader
,IWorldGenerationBaseReader
,IWorldGenerationReader
,IBiomeReader
,IBlockDisplayReader
,IBlockReader
,ICollisionReader
,IDayTimeReader
,IEntityReader
,IWorld
,IWorldReader
,IWorldWriter
,ICapabilityProvider
,IForgeWorld
- Direct Known Subclasses:
ClientWorld
,ServerWorld
public abstract class World
extends CapabilityProvider<World>
implements IWorld, AutoCloseable, IForgeWorld
-
Field Summary
Modifier and TypeFieldDescriptionprotected final int
private final BiomeManager
protected final Set<TileEntity>
final List<TileEntity>
boolean
private final RegistryKey<World>
private final DimensionType
private static final Direction[]
static final RegistryKey<World>
final boolean
private final boolean
protected final ISpawnWorldInfo
protected static final org.apache.logging.log4j.Logger
private double
static final RegistryKey<World>
float
float
static final RegistryKey<World>
protected final List<TileEntity>
float
final Random
protected int
static final com.mojang.serialization.Codec<RegistryKey<World>>
boolean
private int
private final Thread
float
final List<TileEntity>
protected boolean
private final WorldBorder
-
Constructor Summary
ModifierConstructorDescriptionprotected
World
(ISpawnWorldInfo p_i241925_1_, RegistryKey<World> p_i241925_2_, DimensionType p_i241925_3_, Supplier<IProfiler> p_i241925_4_, boolean p_i241925_5_, boolean p_i241925_6_, long p_i241925_7_) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAllPendingBlockEntities
(Collection<TileEntity> p_147448_1_) void
addAlwaysVisibleParticle
(IParticleData p_217404_1_, boolean p_217404_2_, double p_217404_3_, double p_217404_5_, double p_217404_7_, double p_217404_9_, double p_217404_11_, double p_217404_13_) void
addAlwaysVisibleParticle
(IParticleData p_195589_1_, double p_195589_2_, double p_195589_4_, double p_195589_6_, double p_195589_8_, double p_195589_10_, double p_195589_12_) boolean
addBlockEntity
(TileEntity p_175700_1_) void
addParticle
(IParticleData p_195590_1_, boolean p_195590_2_, double p_195590_3_, double p_195590_5_, double p_195590_7_, double p_195590_9_, double p_195590_11_, double p_195590_13_) void
addParticle
(IParticleData p_195594_1_, double p_195594_2_, double p_195594_4_, double p_195594_6_, double p_195594_8_, double p_195594_10_, double p_195594_12_) void
blockEntityChanged
(BlockPos p_175646_1_, TileEntity p_175646_2_) void
blockEvent
(BlockPos p_175641_1_, Block p_175641_2_, int p_175641_3_, int p_175641_4_) void
broadcastEntityEvent
(Entity p_72960_1_, byte p_72960_2_) void
close()
void
createFireworks
(double p_92088_1_, double p_92088_3_, double p_92088_5_, double p_92088_7_, double p_92088_9_, double p_92088_11_, CompoundNBT p_92088_13_) boolean
destroyBlock
(BlockPos p_241212_1_, boolean p_241212_2_, Entity p_241212_3_, int p_241212_4_) abstract void
destroyBlockProgress
(int p_175715_1_, BlockPos p_175715_2_, int p_175715_3_) void
explode
(Entity p_217398_1_, double p_217398_2_, double p_217398_4_, double p_217398_6_, float p_217398_8_, boolean p_217398_9_, Explosion.Mode p_217398_10_) explode
(Entity p_217385_1_, double p_217385_2_, double p_217385_4_, double p_217385_6_, float p_217385_8_, Explosion.Mode p_217385_9_) explode
(Entity p_230546_1_, DamageSource p_230546_2_, ExplosionContext p_230546_3_, double p_230546_4_, double p_230546_6_, double p_230546_8_, float p_230546_10_, boolean p_230546_11_, Explosion.Mode p_230546_12_) fillReportDetails
(CrashReport p_72914_1_) int
getBestNeighborSignal
(BlockPos p_175687_1_) getBlockEntity
(BlockPos p_175625_1_) getBlockRandomPos
(int p_217383_1_, int p_217383_2_, int p_217383_3_, int p_217383_4_) getBlockState
(BlockPos p_180495_1_) getChunk
(int p_212866_1_, int p_212866_2_) getChunk
(int p_217353_1_, int p_217353_2_, ChunkStatus p_217353_3_, boolean p_217353_4_) getChunkAt
(BlockPos p_175726_1_) getChunkForCollisions
(int p_225522_1_, int p_225522_2_) getCurrentDifficultyAt
(BlockPos p_175649_1_) long
int
getDirectSignalTo
(BlockPos p_175676_1_) getEntities
(Entity p_175674_1_, AxisAlignedBB p_175674_2_, Predicate<? super Entity> p_175674_3_) getEntities
(EntityType<T> p_217394_1_, AxisAlignedBB p_217394_2_, Predicate<? super T> p_217394_3_) getEntitiesOfClass
(Class<? extends T> p_175647_1_, AxisAlignedBB p_175647_2_, Predicate<? super T> p_175647_3_) abstract Entity
getEntity
(int p_73045_1_) getFluidState
(BlockPos p_204610_1_) abstract int
long
int
getHeight
(Heightmap.Type p_201676_1_, int p_201676_2_, int p_201676_3_) getLoadedEntitiesOfClass
(Class<? extends T> p_225316_1_, AxisAlignedBB p_225316_2_, Predicate<? super T> p_225316_3_) abstract MapData
getMapData
(String p_217406_1_) double
The maximum radius to scan for entities when trying to check bounding boxes.private TileEntity
getPendingBlockEntityAt
(BlockPos p_189508_1_) float
getRainLevel
(float p_72867_1_) abstract RecipeManager
abstract Scoreboard
int
int
int
float
getSunAngle
(float p_72929_1_) abstract ITagCollectionSupplier
float
getThunderLevel
(float p_72819_1_) void
globalLevelEvent
(int p_175669_1_, BlockPos p_175669_2_, int p_175669_3_) void
guardEntityTick
(Consumer<Entity> p_217390_1_, Entity p_217390_2_) boolean
hasNeighborSignal
(BlockPos p_175640_1_) boolean
double
increaseMaxEntityRadius
(double value) Increases the max entity radius, this is safe to call with any value.boolean
boolean
isDay()
final boolean
isDebug()
boolean
static boolean
isInSpawnableBounds
(BlockPos p_234935_0_) static boolean
isInWorldBounds
(BlockPos p_175701_0_) private static boolean
isInWorldBoundsHorizontal
(BlockPos p_234934_0_) boolean
boolean
isNight()
static boolean
isOutsideBuildHeight
(int p_217405_0_) static boolean
isOutsideBuildHeight
(BlockPos p_189509_0_) private static boolean
isOutsideSpawnableHeight
(int p_234933_0_) boolean
boolean
isRainingAt
(BlockPos p_175727_1_) boolean
isStateAtPosition
(BlockPos p_217375_1_, Predicate<BlockState> p_217375_2_) boolean
boolean
loadedAndEntityCanStandOn
(BlockPos p_217400_1_, Entity p_217400_2_) boolean
loadedAndEntityCanStandOnFace
(BlockPos p_234929_1_, Entity p_234929_2_, Direction p_234929_3_) void
markAndNotifyBlock
(BlockPos p_241211_1_, Chunk chunk, BlockState blockstate, BlockState p_241211_2_, int p_241211_3_, int p_241211_4_) boolean
mayInteract
(PlayerEntity p_175660_1_, BlockPos p_175660_2_) void
neighborChanged
(BlockPos p_190524_1_, Block p_190524_2_, BlockPos p_190524_3_) boolean
noSave()
void
onBlockStateChange
(BlockPos p_217393_1_, BlockState p_217393_2_, BlockState p_217393_3_) void
playLocalSound
(double p_184134_1_, double p_184134_3_, double p_184134_5_, SoundEvent p_184134_7_, SoundCategory p_184134_8_, float p_184134_9_, float p_184134_10_, boolean p_184134_11_) abstract void
playSound
(PlayerEntity p_184148_1_, double p_184148_2_, double p_184148_4_, double p_184148_6_, SoundEvent p_184148_8_, SoundCategory p_184148_9_, float p_184148_10_, float p_184148_11_) abstract void
playSound
(PlayerEntity p_217384_1_, Entity p_217384_2_, SoundEvent p_217384_3_, SoundCategory p_217384_4_, float p_217384_5_, float p_217384_6_) void
playSound
(PlayerEntity p_184133_1_, BlockPos p_184133_2_, SoundEvent p_184133_3_, SoundCategory p_184133_4_, float p_184133_5_, float p_184133_6_) protected void
boolean
removeBlock
(BlockPos p_217377_1_, boolean p_217377_2_) void
removeBlockEntity
(BlockPos p_175713_1_) abstract void
sendBlockUpdated
(BlockPos p_184138_1_, BlockState p_184138_2_, BlockState p_184138_3_, int p_184138_4_) void
sendPacketToServer
(IPacket<?> p_184135_1_) boolean
setBlock
(BlockPos p_180501_1_, BlockState p_180501_2_, int p_180501_3_) boolean
setBlock
(BlockPos p_241211_1_, BlockState p_241211_2_, int p_241211_3_, int p_241211_4_) boolean
setBlockAndUpdate
(BlockPos p_175656_1_, BlockState p_175656_2_) void
setBlockEntity
(BlockPos p_175690_1_, TileEntity p_175690_2_) void
setBlocksDirty
(BlockPos p_225319_1_, BlockState p_225319_2_, BlockState p_225319_3_) abstract void
setMapData
(MapData p_217399_1_) void
setRainLevel
(float p_72894_1_) void
setSkyFlashTime
(int p_225605_1_) void
setSpawnSettings
(boolean p_72891_1_, boolean p_72891_2_) void
setThunderLevel
(float p_147442_1_) void
void
updateNeighborsAt
(BlockPos p_195593_1_, Block p_195593_2_) void
updateNeighborsAtExceptFromFacing
(BlockPos p_175695_1_, Block p_175695_2_, Direction p_175695_3_) void
updateNeighbourForOutputSignal
(BlockPos p_175666_1_, Block p_175666_2_) void
Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCaps
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.IBiomeReader
getBiomeName, getEntityCollisions, getHeightmapPos, isUnobstructed, registryAccess
Methods inherited from interface net.minecraft.world.IBlockDisplayReader
canSeeSky, getBrightness, getRawBrightness, getShade
Methods inherited from interface net.minecraft.world.IBlockReader
clip, clipWithInteractionOverride, getBlockFloorHeight, getBlockFloorHeight, getBlockStates, getLightEmission, getMaxBuildHeight, getMaxLightLevel
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability, getCapability
Methods inherited from interface net.minecraft.world.ICollisionReader
getBlockCollisions, getBlockCollisions, getCollisions, getEntityCollisions, isUnobstructed, isUnobstructed, isUnobstructed, noBlockCollision, noCollision, noCollision, noCollision, noCollision
Methods inherited from interface net.minecraft.world.IDayTimeReader
getMoonBrightness, getMoonPhase, getTimeOfDay
Methods inherited from interface net.minecraft.world.IEntityReader
getEntities, getEntitiesOfClass, getLoadedEntitiesOfClass, getNearbyEntities, getNearbyPlayers, getNearestEntity, getNearestEntity, getNearestLoadedEntity, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getPlayerByUUID, hasNearbyAlivePlayer, players
Methods inherited from interface net.minecraftforge.common.extensions.IForgeWorld
getPartEntities
Methods inherited from interface net.minecraft.world.IWorld
blockUpdated, dayTime, getBlockTicks, getChunkSource, getDifficulty, getHeight, getLiquidTicks, hasChunk, levelEvent, levelEvent
Methods inherited from interface net.minecraft.world.IWorldReader
canSeeSkyFromBelowWater, containsAnyLiquid, getBiome, getBlockStatesIfLoaded, getBlockTint, getBrightness, getChunk, getChunk, getDirectSignal, getMaxLocalRawBrightness, getMaxLocalRawBrightness, getNoiseBiome, getUncachedNoiseBiome, hasChunkAt, hasChunksAt, hasChunksAt, isAreaLoaded, isEmptyBlock, isWaterAt
Methods inherited from interface net.minecraft.world.IWorldWriter
addFreshEntity, destroyBlock, destroyBlock
-
Field Details
-
LOGGER
protected static final org.apache.logging.log4j.Logger LOGGER -
RESOURCE_KEY_CODEC
-
OVERWORLD
-
NETHER
-
END
-
DIRECTIONS
-
blockEntityList
-
tickableBlockEntities
-
pendingBlockEntities
-
blockEntitiesToUnload
-
thread
-
isDebug
private final boolean isDebug -
skyDarken
private int skyDarken -
randValue
protected int randValue -
addend
protected final int addend- See Also:
-
oRainLevel
public float oRainLevel -
rainLevel
public float rainLevel -
oThunderLevel
public float oThunderLevel -
thunderLevel
public float thunderLevel -
random
-
dimensionType
-
levelData
-
profiler
-
isClientSide
public final boolean isClientSide -
updatingBlockEntities
protected boolean updatingBlockEntities -
worldBorder
-
biomeManager
-
dimension
-
restoringBlockSnapshots
public boolean restoringBlockSnapshots -
captureBlockSnapshots
public boolean captureBlockSnapshots -
capturedBlockSnapshots
-
maxEntityRadius
private double maxEntityRadius
-
-
Constructor Details
-
World
protected World(ISpawnWorldInfo p_i241925_1_, RegistryKey<World> p_i241925_2_, DimensionType p_i241925_3_, Supplier<IProfiler> p_i241925_4_, boolean p_i241925_5_, boolean p_i241925_6_, long p_i241925_7_)
-
-
Method Details
-
isClientSide
public boolean isClientSide()- Specified by:
isClientSide
in interfaceIWorldReader
-
getServer
-
isInWorldBounds
-
isInSpawnableBounds
-
isInWorldBoundsHorizontal
-
isOutsideSpawnableHeight
private static boolean isOutsideSpawnableHeight(int p_234933_0_) -
isOutsideBuildHeight
-
isOutsideBuildHeight
public static boolean isOutsideBuildHeight(int p_217405_0_) -
getChunkAt
-
getChunk
- Specified by:
getChunk
in interfaceIWorldReader
-
getChunk
public IChunk getChunk(int p_217353_1_, int p_217353_2_, ChunkStatus p_217353_3_, boolean p_217353_4_) - Specified by:
getChunk
in interfaceIWorldReader
-
setBlock
- Specified by:
setBlock
in interfaceIWorldWriter
-
setBlock
public boolean setBlock(BlockPos p_241211_1_, BlockState p_241211_2_, int p_241211_3_, int p_241211_4_) - Specified by:
setBlock
in interfaceIWorldWriter
-
markAndNotifyBlock
public void markAndNotifyBlock(BlockPos p_241211_1_, @Nullable Chunk chunk, BlockState blockstate, BlockState p_241211_2_, int p_241211_3_, int p_241211_4_) -
onBlockStateChange
public void onBlockStateChange(BlockPos p_217393_1_, BlockState p_217393_2_, BlockState p_217393_3_) -
removeBlock
- Specified by:
removeBlock
in interfaceIWorldWriter
-
destroyBlock
public boolean destroyBlock(BlockPos p_241212_1_, boolean p_241212_2_, @Nullable Entity p_241212_3_, int p_241212_4_) - Specified by:
destroyBlock
in interfaceIWorldWriter
-
setBlockAndUpdate
-
sendBlockUpdated
public abstract void sendBlockUpdated(BlockPos p_184138_1_, BlockState p_184138_2_, BlockState p_184138_3_, int p_184138_4_) -
setBlocksDirty
-
updateNeighborsAt
-
updateNeighborsAtExceptFromFacing
-
neighborChanged
-
getHeight
- Specified by:
getHeight
in interfaceIWorldReader
-
getLightEngine
- Specified by:
getLightEngine
in interfaceIBlockDisplayReader
-
getBlockState
- Specified by:
getBlockState
in interfaceIBlockReader
-
getFluidState
- Specified by:
getFluidState
in interfaceIBlockReader
-
isDay
public boolean isDay() -
isNight
public boolean isNight() -
playSound
public void playSound(@Nullable PlayerEntity p_184133_1_, BlockPos p_184133_2_, SoundEvent p_184133_3_, SoundCategory p_184133_4_, float p_184133_5_, float p_184133_6_) -
playSound
public abstract void playSound(@Nullable PlayerEntity p_184148_1_, double p_184148_2_, double p_184148_4_, double p_184148_6_, SoundEvent p_184148_8_, SoundCategory p_184148_9_, float p_184148_10_, float p_184148_11_) -
playSound
public abstract void playSound(@Nullable PlayerEntity p_217384_1_, Entity p_217384_2_, SoundEvent p_217384_3_, SoundCategory p_217384_4_, float p_217384_5_, float p_217384_6_) -
playLocalSound
public void playLocalSound(double p_184134_1_, double p_184134_3_, double p_184134_5_, SoundEvent p_184134_7_, SoundCategory p_184134_8_, float p_184134_9_, float p_184134_10_, boolean p_184134_11_) -
addParticle
public void addParticle(IParticleData p_195594_1_, double p_195594_2_, double p_195594_4_, double p_195594_6_, double p_195594_8_, double p_195594_10_, double p_195594_12_) - Specified by:
addParticle
in interfaceIWorld
-
addParticle
public void addParticle(IParticleData p_195590_1_, boolean p_195590_2_, double p_195590_3_, double p_195590_5_, double p_195590_7_, double p_195590_9_, double p_195590_11_, double p_195590_13_) -
addAlwaysVisibleParticle
public void addAlwaysVisibleParticle(IParticleData p_195589_1_, double p_195589_2_, double p_195589_4_, double p_195589_6_, double p_195589_8_, double p_195589_10_, double p_195589_12_) -
addAlwaysVisibleParticle
public void addAlwaysVisibleParticle(IParticleData p_217404_1_, boolean p_217404_2_, double p_217404_3_, double p_217404_5_, double p_217404_7_, double p_217404_9_, double p_217404_11_, double p_217404_13_) -
getSunAngle
public float getSunAngle(float p_72929_1_) -
addBlockEntity
-
addAllPendingBlockEntities
-
tickBlockEntities
public void tickBlockEntities() -
guardEntityTick
-
explode
public Explosion explode(@Nullable Entity p_217385_1_, double p_217385_2_, double p_217385_4_, double p_217385_6_, float p_217385_8_, Explosion.Mode p_217385_9_) -
explode
public Explosion explode(@Nullable Entity p_217398_1_, double p_217398_2_, double p_217398_4_, double p_217398_6_, float p_217398_8_, boolean p_217398_9_, Explosion.Mode p_217398_10_) -
explode
public Explosion explode(@Nullable Entity p_230546_1_, @Nullable DamageSource p_230546_2_, @Nullable ExplosionContext p_230546_3_, double p_230546_4_, double p_230546_6_, double p_230546_8_, float p_230546_10_, boolean p_230546_11_, Explosion.Mode p_230546_12_) -
gatherChunkSourceStats
-
getBlockEntity
- Specified by:
getBlockEntity
in interfaceIBlockReader
-
getPendingBlockEntityAt
-
setBlockEntity
-
removeBlockEntity
-
isLoaded
-
loadedAndEntityCanStandOnFace
-
loadedAndEntityCanStandOn
-
updateSkyBrightness
public void updateSkyBrightness() -
setSpawnSettings
public void setSpawnSettings(boolean p_72891_1_, boolean p_72891_2_) -
prepareWeather
protected void prepareWeather() -
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-
getChunkForCollisions
- Specified by:
getChunkForCollisions
in interfaceICollisionReader
- Specified by:
getChunkForCollisions
in interfaceIWorldReader
-
getEntities
public List<Entity> getEntities(@Nullable Entity p_175674_1_, AxisAlignedBB p_175674_2_, @Nullable Predicate<? super Entity> p_175674_3_) - Specified by:
getEntities
in interfaceIEntityReader
-
getEntities
public <T extends Entity> List<T> getEntities(@Nullable EntityType<T> p_217394_1_, AxisAlignedBB p_217394_2_, Predicate<? super T> p_217394_3_) -
getEntitiesOfClass
public <T extends Entity> List<T> getEntitiesOfClass(Class<? extends T> p_175647_1_, AxisAlignedBB p_175647_2_, @Nullable Predicate<? super T> p_175647_3_) - Specified by:
getEntitiesOfClass
in interfaceIEntityReader
-
getLoadedEntitiesOfClass
public <T extends Entity> List<T> getLoadedEntitiesOfClass(Class<? extends T> p_225316_1_, AxisAlignedBB p_225316_2_, @Nullable Predicate<? super T> p_225316_3_) - Specified by:
getLoadedEntitiesOfClass
in interfaceIEntityReader
-
getEntity
-
blockEntityChanged
-
getSeaLevel
public int getSeaLevel()- Specified by:
getSeaLevel
in interfaceIWorldReader
-
getDirectSignalTo
-
hasSignal
-
getSignal
-
hasNeighborSignal
-
getBestNeighborSignal
-
disconnect
public void disconnect() -
getGameTime
public long getGameTime() -
getDayTime
public long getDayTime() -
mayInteract
-
broadcastEntityEvent
-
blockEvent
-
getLevelData
- Specified by:
getLevelData
in interfaceIWorld
-
getGameRules
-
getThunderLevel
public float getThunderLevel(float p_72819_1_) -
setThunderLevel
public void setThunderLevel(float p_147442_1_) -
getRainLevel
public float getRainLevel(float p_72867_1_) -
setRainLevel
public void setRainLevel(float p_72894_1_) -
isThundering
public boolean isThundering() -
isRaining
public boolean isRaining() -
isRainingAt
-
isHumidAt
-
getMapData
-
setMapData
-
getFreeMapId
public abstract int getFreeMapId() -
globalLevelEvent
-
fillReportDetails
-
destroyBlockProgress
-
createFireworks
public void createFireworks(double p_92088_1_, double p_92088_3_, double p_92088_5_, double p_92088_7_, double p_92088_9_, double p_92088_11_, @Nullable CompoundNBT p_92088_13_) -
getScoreboard
-
updateNeighbourForOutputSignal
-
getCurrentDifficultyAt
- Specified by:
getCurrentDifficultyAt
in interfaceIWorld
-
getSkyDarken
public int getSkyDarken()- Specified by:
getSkyDarken
in interfaceIWorldReader
-
setSkyFlashTime
public void setSkyFlashTime(int p_225605_1_) -
getWorldBorder
- Specified by:
getWorldBorder
in interfaceICollisionReader
-
sendPacketToServer
-
dimensionType
- Specified by:
dimensionType
in interfaceIWorldReader
-
dimension
-
getRandom
-
isStateAtPosition
- Specified by:
isStateAtPosition
in interfaceIWorldGenerationBaseReader
-
getRecipeManager
-
getTagManager
-
getBlockRandomPos
public BlockPos getBlockRandomPos(int p_217383_1_, int p_217383_2_, int p_217383_3_, int p_217383_4_) -
noSave
public boolean noSave() -
getProfiler
-
getProfilerSupplier
-
getBiomeManager
- Specified by:
getBiomeManager
in interfaceIWorldReader
-
getMaxEntityRadius
public double getMaxEntityRadius()Description copied from interface:IForgeWorld
The maximum radius to scan for entities when trying to check bounding boxes. Vanilla's default is 2.0D But mods that add larger entities may increase this.- Specified by:
getMaxEntityRadius
in interfaceIForgeWorld
-
increaseMaxEntityRadius
public double increaseMaxEntityRadius(double value) Description copied from interface:IForgeWorld
Increases the max entity radius, this is safe to call with any value. The setter will verify the input value is larger then the current setting.- Specified by:
increaseMaxEntityRadius
in interfaceIForgeWorld
- Parameters:
value
- New max radius to set.- Returns:
- The new max radius
-
isDebug
public final boolean isDebug()
-