Package net.minecraft.world.level
Class Level
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.Level
- All Implemented Interfaces:
AutoCloseable,BiomeManager.NoiseBiomeSource,BlockAndTintGetter,BlockGetter,CollisionGetter,CommonLevelAccessor,EntityGetter,LevelAccessor,LevelHeightAccessor,LevelReader,LevelSimulatedReader,LevelSimulatedRW,LevelTimeAccess,LevelWriter,SignalGetter,IAttachmentHolder,IBlockAndTintGetterExtension,IBlockGetterExtension,ILevelExtension,ILevelReaderExtension
- Direct Known Subclasses:
ClientLevel,ServerLevel
public abstract class Level
extends AttachmentHolder
implements LevelAccessor, AutoCloseable, ILevelExtension
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsField -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprivate final BiomeManagerprotected final List<TickingBlockEntity> booleanprivate final DamageSourcesprivate final ResourceKey<Level> private final Holder<DimensionType> static final ResourceKey<Level> private final ArrayList<BlockEntity> final booleanprivate final booleanprotected final WritableLevelDatastatic final intstatic final intstatic final intstatic final intprivate doublestatic final intprotected final NeighborUpdaterstatic final ResourceKey<Level> floatfloatstatic final ResourceKey<Level> private final List<TickingBlockEntity> private final ArrayList<BlockEntity> private final Supplier<ProfilerFiller> floatfinal RandomSourceprotected intContains the current Linear Congruential Generator seed for block updates.private final RegistryAccessstatic final com.mojang.serialization.Codec<ResourceKey<Level>> booleanstatic final intprivate intprivate longprivate final Threadprivate final RandomSourceDeprecated.floatprivate booleanstatic final intprivate final WorldBorderFields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEYFields inherited from interface net.neoforged.neoforge.common.extensions.ILevelExtension
TRANSLATION_PREFIXFields inherited from interface net.minecraft.world.level.SignalGetter
DIRECTIONS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLevel(WritableLevelData levelData, ResourceKey<Level> dimension, RegistryAccess registryAccess, Holder<DimensionType> dimensionTypeRegistration, Supplier<ProfilerFiller> profiler, boolean isClientSide, boolean isDebug, long biomeZoomSeed, int maxChainedNeighborUpdates) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAlwaysVisibleParticle(ParticleOptions particleData, boolean ignoreRange, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) voidaddAlwaysVisibleParticle(ParticleOptions particleData, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) voidvoidaddDestroyBlockEffect(BlockPos pos, BlockState state) voidaddFreshBlockEntities(Collection<BlockEntity> beList) voidaddParticle(ParticleOptions particleData, boolean forceAlwaysRender, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) voidaddParticle(ParticleOptions particleData, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) protected longvoidvoidblockEvent(BlockPos pos, Block block, int eventID, int eventParam) voidbroadcastDamageEvent(Entity entity, DamageSource damageSource) voidbroadcastEntityEvent(Entity entity, byte state) Sends aClientboundEntityEventPacketto all tracked players of that entity.voidclose()voidcreateFireworks(double x, double y, double z, double xSpeed, double ySpeed, double zSpeed, List<FireworkExplosion> explosions) booleandestroyBlock(BlockPos pos, boolean dropBlock, Entity entity, int recursionLeft) abstract voiddestroyBlockProgress(int breakerId, BlockPos pos, int progress) voidexplode(Entity source, double x, double y, double z, float radius, boolean fire, Level.ExplosionInteraction explosionInteraction) explode(Entity source, double x, double y, double z, float radius, Level.ExplosionInteraction explosionInteraction) explode(Entity source, DamageSource damageSource, ExplosionDamageCalculator damageCalculator, double x, double y, double z, float radius, boolean fire, Level.ExplosionInteraction explosionInteraction) explode(Entity source, DamageSource damageSource, ExplosionDamageCalculator damageCalculator, double x, double y, double z, float radius, boolean fire, Level.ExplosionInteraction explosionInteraction, boolean spawnParticles, ParticleOptions smallExplosionParticles, ParticleOptions largeExplosionParticles, Holder<SoundEvent> explosionSound) explode(Entity source, DamageSource damageSource, ExplosionDamageCalculator damageCalculator, double x, double y, double z, float radius, boolean fire, Level.ExplosionInteraction explosionInteraction, ParticleOptions smallExplosionParticles, ParticleOptions largeExplosionParticles, Holder<SoundEvent> explosionSound) explode(Entity source, DamageSource damageSource, ExplosionDamageCalculator damageCalculator, Vec3 pos, float radius, boolean fire, Level.ExplosionInteraction explosionInteraction) fillReportDetails(CrashReport report) Adds some basic stats of the world to the given crash report.abstract StringgetBlockEntity(BlockPos pos) getBlockRandomPos(int x, int y, int z, int yMask) getBlockState(BlockPos pos) getChunk(int chunkX, int chunkZ) getChunk(int x, int z, ChunkStatus chunkStatus, boolean requireChunk) getChunkAt(BlockPos pos) getChunkForCollisions(int chunkX, int chunkZ) longabstract floatabstract floatReturns the current ratio between game ticks and clock ticks.private Explosion.BlockInteractiongetDestroyType(GameRules.Key<GameRules.BooleanValue> gameRule) protected abstract LevelEntityGetter<Entity> 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) <T extends Entity>
voidgetEntities(EntityTypeTest<Entity, T> entityTypeTest, AABB bounds, Predicate<? super T> predicate, List<? super T> output) <T extends Entity>
voidgetEntities(EntityTypeTest<Entity, T> entityTypeTest, AABB bounds, Predicate<? super T> predicate, List<? super T> output, int maxResults) abstract EntitygetEntity(int id) Returns the Entity with the given ID, or null if it doesn't exist in this Level.getFluidState(BlockPos pos) abstract MapIdlongintgetHeight(Heightmap.Types heightmapType, int x, int z) abstract MapItemSavedDatagetMapData(MapId mapId) doubleThe maximum radius to scan for entities when trying to check bounding boxes.floatgetRainLevel(float delta) Returns rain strength.abstract RecipeManagerabstract ScoreboardintfloatintfloatgetSunAngle(float partialTicks) Return getCelestialAngle()*2*PIfloatgetThunderLevel(float delta) voidglobalLevelEvent(int id, BlockPos pos, int data) <T extends Entity>
voidguardEntityTick(Consumer<T> consumerEntity, T entity) doubleincreaseMaxEntityRadius(double value) Increases the max entity radius, this is safe to call with any value.booleanbooleanisDay()final booleanisDebug()booleanisFluidAtPosition(BlockPos pos, Predicate<FluidState> predicate) static booleanbooleanisInWorldBounds(BlockPos pos) Check if the given BlockPos has valid coordinatesprivate static booleanbooleanbooleanisNight()private static booleanisOutsideSpawnableHeight(int y) booleanbooleanisRainingAt(BlockPos pos) Check if precipitation is currently happening at a positionbooleanisStateAtPosition(BlockPos pos, Predicate<BlockState> state) booleanbooleanloadedAndEntityCanStandOn(BlockPos pos, Entity entity) booleanloadedAndEntityCanStandOnFace(BlockPos pos, Entity entity, Direction direction) voidmarkAndNotifyBlock(BlockPos p_46605_, LevelChunk levelchunk, BlockState blockstate, BlockState p_46606_, int p_46607_, int p_46608_) booleanmayInteract(Player player, BlockPos pos) voidneighborChanged(BlockPos pos, Block block, BlockPos fromPos) voidneighborChanged(BlockState state, BlockPos pos, Block block, BlockPos fromPos, boolean isMoving) voidneighborShapeChanged(Direction direction, BlockState queried, BlockPos pos, BlockPos offsetPos, int flags, int recursionLevel) longbooleannoSave()voidonBlockStateChange(BlockPos pos, BlockState blockState, BlockState newState) voidplayLocalSound(double x, double y, double z, SoundEvent sound, SoundSource category, float volume, float pitch, boolean distanceDelay) voidplayLocalSound(BlockPos pos, SoundEvent sound, SoundSource category, float volume, float pitch, boolean distanceDelay) voidplayLocalSound(Entity entity, SoundEvent sound, SoundSource category, float volume, float pitch) abstract voidplaySeededSound(Player player, double x, double y, double z, Holder<SoundEvent> sound, SoundSource category, float volume, float pitch, long seed) voidplaySeededSound(Player player, double x, double y, double z, SoundEvent sound, SoundSource category, float volume, float pitch, long seed) abstract voidplaySeededSound(Player player, Entity entity, Holder<SoundEvent> sound, SoundSource category, float volume, float pitch, long seed) voidplaySound(Entity entity, BlockPos pos, SoundEvent sound, SoundSource category, float volume, float pitch) voidplaySound(Player player, double x, double y, double z, Holder<SoundEvent> sound, SoundSource category, float volume, float pitch) voidplaySound(Player player, double x, double y, double z, SoundEvent sound, SoundSource category) voidplaySound(Player player, double x, double y, double z, SoundEvent sound, SoundSource category, float volume, float pitch) voidplaySound(Player player, BlockPos pos, SoundEvent sound, SoundSource category, float volume, float pitch) Plays a sound.voidplaySound(Player player, Entity entity, SoundEvent event, SoundSource category, float volume, float pitch) abstract PotionBrewingprotected voidbooleanremoveBlock(BlockPos pos, boolean isMoving) voidabstract voidsendBlockUpdated(BlockPos pos, BlockState oldState, BlockState newState, int flags) Flags are as in setBlockStatevoidsendPacketToServer(Packet<?> packet) booleansetBlock(BlockPos pos, BlockState newState, int flags) Sets a block state into this world.Flags are as follows: 1 will notify neighboring blocks throughupdates.invalid reference
neighborChangedbooleansetBlock(BlockPos pos, BlockState state, int flags, int recursionLeft) booleansetBlockAndUpdate(BlockPos pos, BlockState state) Convenience method to update the block on both the client and servervoidsetBlockEntity(BlockEntity blockEntity) voidsetBlocksDirty(BlockPos blockPos, BlockState oldState, BlockState newState) abstract voidsetDayTimeFraction(float dayTimeFraction) abstract voidsetDayTimePerTick(float dayTimePerTick) DO NOT CALL.abstract voidsetMapData(MapId mapId, MapItemSavedData mapData) voidsetRainLevel(float strength) Sets the strength of the rain.voidsetSkyFlashTime(int timeFlash) voidsetSpawnSettings(boolean hostile, boolean peaceful) First boolean for hostile mobs and second for peaceful mobsvoidsetThunderLevel(float strength) Sets the strength of the thunder.booleanshouldTickBlocksAt(long chunkPos) booleanbooleanshouldTickDeath(Entity entity) protected voidabstract TickRateManagervoidupdateNeighborsAt(BlockPos pos, Block block) voidupdateNeighborsAtExceptFromFacing(BlockPos pos, Block blockType, Direction skipSide) voidupdateNeighbourForOutputSignal(BlockPos pos, Block block) voidMethods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, removeData, serializeAttachments, setDataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.level.BlockAndTintGetter
canSeeSky, getBrightness, getRawBrightness, getShadeMethods inherited from interface net.minecraft.world.level.BlockGetter
clip, clipWithInteractionOverride, getBlockFloorHeight, getBlockFloorHeight, getBlockStates, getLightEmission, getMaxLightLevel, isBlockInLineMethods inherited from interface net.minecraft.world.level.CollisionGetter
collidesWithSuffocatingBlock, findFreePosition, findSupportingBlock, getBlockCollisions, getCollisions, getEntityCollisions, isUnobstructed, isUnobstructed, isUnobstructed, noBlockCollision, noCollision, noCollision, noCollisionMethods inherited from interface net.minecraft.world.level.CommonLevelAccessor
getBlockEntity, getEntityCollisions, getHeightmapPos, isUnobstructedMethods inherited from interface net.minecraft.world.level.EntityGetter
getEntities, getEntitiesOfClass, getEntitiesOfClass, getNearbyEntities, getNearbyPlayers, getNearestEntity, getNearestEntity, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getPlayerByUUID, hasNearbyAlivePlayer, playersMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setDataMethods inherited from interface net.neoforged.neoforge.common.extensions.IBlockAndTintGetterExtension
getShadeMethods inherited from interface net.neoforged.neoforge.common.extensions.IBlockGetterExtension
getAuxLightManager, getAuxLightManager, getModelDataMethods inherited from interface net.neoforged.neoforge.common.extensions.ILevelExtension
getCapability, getCapability, getCapability, getCapability, getDescription, getDescriptionKey, getModelDataManager, getPartEntities, invalidateCapabilities, invalidateCapabilitiesMethods inherited from interface net.neoforged.neoforge.common.extensions.ILevelReaderExtension
holder, holderOrThrow, isAreaLoadedMethods inherited from interface net.minecraft.world.level.LevelAccessor
blockUpdated, dayTime, gameEvent, gameEvent, gameEvent, gameEvent, gameEvent, getBlockTicks, getChunkSource, getDifficulty, getFluidTicks, hasChunk, levelEvent, levelEvent, playSound, scheduleTick, scheduleTick, scheduleTick, scheduleTickMethods inherited from interface net.minecraft.world.level.LevelHeightAccessor
getMaxBuildHeight, getMaxSection, getMinSection, getSectionIndex, getSectionIndexFromSectionY, getSectionsCount, getSectionYFromSectionIndex, isOutsideBuildHeight, isOutsideBuildHeightMethods inherited from interface net.minecraft.world.level.LevelReader
canSeeSkyFromBelowWater, containsAnyLiquid, enabledFeatures, getBiome, getBlockStatesIfLoaded, getBlockTint, getChunk, getChunk, getHeight, getLightLevelDependentMagicValue, getMaxLocalRawBrightness, getMaxLocalRawBrightness, getMinBuildHeight, getNoiseBiome, getPathfindingCostFromLightLevels, getUncachedNoiseBiome, hasChunkAt, hasChunkAt, hasChunksAt, hasChunksAt, hasChunksAt, holderLookup, isEmptyBlock, isWaterAtMethods inherited from interface net.minecraft.world.level.LevelTimeAccess
getMoonBrightness, getMoonPhase, getTimeOfDayMethods inherited from interface net.minecraft.world.level.LevelWriter
addFreshEntity, destroyBlock, destroyBlockMethods inherited from interface net.minecraft.world.level.SignalGetter
getBestNeighborSignal, getControlInputSignal, getDirectSignal, getDirectSignalTo, getSignal, hasNeighborSignal, hasSignal
-
Field Details
-
RESOURCE_KEY_CODEC
-
OVERWORLD
-
NETHER
-
END
-
MAX_LEVEL_SIZE
public static final int MAX_LEVEL_SIZE- See Also:
-
LONG_PARTICLE_CLIP_RANGE
public static final int LONG_PARTICLE_CLIP_RANGE- See Also:
-
SHORT_PARTICLE_CLIP_RANGE
public static final int SHORT_PARTICLE_CLIP_RANGE- See Also:
-
MAX_BRIGHTNESS
public static final int MAX_BRIGHTNESS- See Also:
-
TICKS_PER_DAY
public static final int TICKS_PER_DAY- See Also:
-
MAX_ENTITY_SPAWN_Y
public static final int MAX_ENTITY_SPAWN_Y- See Also:
-
MIN_ENTITY_SPAWN_Y
public static final int MIN_ENTITY_SPAWN_Y- See Also:
-
blockEntityTickers
-
neighborUpdater
-
pendingBlockEntityTickers
-
tickingBlockEntities
private boolean tickingBlockEntities -
thread
-
isDebug
private final boolean isDebug -
skyDarken
private int skyDarken -
randValue
protected int randValueContains the current Linear Congruential Generator seed for block updates. Used with an A value of 3 and a C value of 0x3c6ef35f, producing a highly planar series of values ill-suited for choosing random blocks in a 16x128x16 field. -
addend
protected final int addend- See Also:
-
oRainLevel
public float oRainLevel -
rainLevel
public float rainLevel -
oThunderLevel
public float oThunderLevel -
thunderLevel
public float thunderLevel -
random
-
threadSafeRandom
Deprecated. -
dimensionTypeRegistration
-
levelData
-
profiler
-
isClientSide
public final boolean isClientSide -
worldBorder
-
biomeManager
-
dimension
-
registryAccess
-
damageSources
-
subTickCount
private long subTickCount -
restoringBlockSnapshots
public boolean restoringBlockSnapshots -
captureBlockSnapshots
public boolean captureBlockSnapshots -
capturedBlockSnapshots
-
freshBlockEntities
-
pendingFreshBlockEntities
-
maxEntityRadius
private double maxEntityRadius
-
-
Constructor Details
-
Level
protected Level(WritableLevelData levelData, ResourceKey<Level> dimension, RegistryAccess registryAccess, Holder<DimensionType> dimensionTypeRegistration, Supplier<ProfilerFiller> profiler, boolean isClientSide, boolean isDebug, long biomeZoomSeed, int maxChainedNeighborUpdates)
-
-
Method Details
-
isClientSide
public boolean isClientSide()- Specified by:
isClientSidein interfaceLevelReader
-
getServer
- Specified by:
getServerin interfaceLevelAccessor
-
isInWorldBounds
Check if the given BlockPos has valid coordinates -
isInSpawnableBounds
-
isInWorldBoundsHorizontal
-
isOutsideSpawnableHeight
private static boolean isOutsideSpawnableHeight(int y) -
getChunkAt
-
getChunk
- Specified by:
getChunkin interfaceLevelReader
-
getChunk
- Specified by:
getChunkin interfaceLevelReader
-
setBlock
Sets a block state into this world.Flags are as follows: 1 will notify neighboring blocks throughupdates. 2 will send the change to clients. 4 will prevent the block from being re-rendered. 8 will force any re-renders to run on the main thread instead 16 will prevent neighbor reactions (e.g. fences connecting, observers pulsing). 32 will prevent neighbor reactions from spawning drops. 64 will signify the block is being moved. Flags can be OR-edinvalid reference
neighborChanged- Specified by:
setBlockin interfaceLevelWriter
-
setBlock
- Specified by:
setBlockin interfaceLevelWriter
-
markAndNotifyBlock
public void markAndNotifyBlock(BlockPos p_46605_, @Nullable LevelChunk levelchunk, BlockState blockstate, BlockState p_46606_, int p_46607_, int p_46608_) -
onBlockStateChange
-
removeBlock
- Specified by:
removeBlockin interfaceLevelWriter
-
destroyBlock
public boolean destroyBlock(BlockPos pos, boolean dropBlock, @Nullable Entity entity, int recursionLeft) - Specified by:
destroyBlockin interfaceLevelWriter
-
addDestroyBlockEffect
-
setBlockAndUpdate
Convenience method to update the block on both the client and server -
sendBlockUpdated
public abstract void sendBlockUpdated(BlockPos pos, BlockState oldState, BlockState newState, int flags) Flags are as in setBlockState -
setBlocksDirty
-
updateNeighborsAt
-
updateNeighborsAtExceptFromFacing
-
neighborChanged
-
neighborChanged
public void neighborChanged(BlockState state, BlockPos pos, Block block, BlockPos fromPos, boolean isMoving) -
neighborShapeChanged
public void neighborShapeChanged(Direction direction, BlockState queried, BlockPos pos, BlockPos offsetPos, int flags, int recursionLevel) - Specified by:
neighborShapeChangedin interfaceLevelAccessor- Parameters:
queried- The block state of the current blockpos- The position of the neighbor blockoffsetPos- The position of the current block
-
getHeight
- Specified by:
getHeightin interfaceLevelReader
-
getLightEngine
- Specified by:
getLightEnginein interfaceBlockAndTintGetter
-
getBlockState
- Specified by:
getBlockStatein interfaceBlockGetter
-
getFluidState
- Specified by:
getFluidStatein interfaceBlockGetter
-
isDay
public boolean isDay() -
isNight
public boolean isNight() -
playSound
public void playSound(@Nullable Entity entity, BlockPos pos, SoundEvent sound, SoundSource category, float volume, float pitch) -
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:
playSoundin interfaceLevelAccessor
-
playSeededSound
public abstract void playSeededSound(@Nullable Player player, double x, double y, double z, Holder<SoundEvent> sound, SoundSource category, float volume, float pitch, long seed) -
playSeededSound
public void playSeededSound(@Nullable Player player, double x, double y, double z, SoundEvent sound, SoundSource category, float volume, float pitch, long seed) -
playSeededSound
public abstract void playSeededSound(@Nullable Player player, Entity entity, Holder<SoundEvent> sound, SoundSource category, float volume, float pitch, long seed) -
playSound
public void playSound(@Nullable Player player, double x, double y, double z, SoundEvent sound, SoundSource category) -
playSound
public void playSound(@Nullable Player player, double x, double y, double z, SoundEvent sound, SoundSource category, float volume, float pitch) -
playSound
public void playSound(@Nullable Player player, double x, double y, double z, Holder<SoundEvent> sound, SoundSource category, float volume, float pitch) -
playSound
public void playSound(@Nullable Player player, Entity entity, SoundEvent event, SoundSource category, float volume, float pitch) -
playLocalSound
public void playLocalSound(BlockPos pos, SoundEvent sound, SoundSource category, float volume, float pitch, boolean distanceDelay) -
playLocalSound
public void playLocalSound(Entity entity, SoundEvent sound, SoundSource category, float volume, float pitch) -
playLocalSound
public void playLocalSound(double x, double y, double z, SoundEvent sound, SoundSource category, float volume, float pitch, boolean distanceDelay) -
addParticle
public void addParticle(ParticleOptions particleData, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) - Specified by:
addParticlein interfaceLevelAccessor
-
addParticle
public void addParticle(ParticleOptions particleData, boolean forceAlwaysRender, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) -
addAlwaysVisibleParticle
public void addAlwaysVisibleParticle(ParticleOptions particleData, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) -
addAlwaysVisibleParticle
public void addAlwaysVisibleParticle(ParticleOptions particleData, boolean ignoreRange, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) -
getSunAngle
public float getSunAngle(float partialTicks) Return getCelestialAngle()*2*PI -
addBlockEntityTicker
-
addFreshBlockEntities
-
tickBlockEntities
protected void tickBlockEntities() -
guardEntityTick
-
shouldTickDeath
-
shouldTickBlocksAt
public boolean shouldTickBlocksAt(long chunkPos) -
shouldTickBlocksAt
-
explode
public Explosion explode(@Nullable Entity source, double x, double y, double z, float radius, Level.ExplosionInteraction explosionInteraction) -
explode
public Explosion explode(@Nullable Entity source, double x, double y, double z, float radius, boolean fire, Level.ExplosionInteraction explosionInteraction) -
explode
public Explosion explode(@Nullable Entity source, @Nullable DamageSource damageSource, @Nullable ExplosionDamageCalculator damageCalculator, Vec3 pos, float radius, boolean fire, Level.ExplosionInteraction explosionInteraction) -
explode
public Explosion explode(@Nullable Entity source, @Nullable DamageSource damageSource, @Nullable ExplosionDamageCalculator damageCalculator, double x, double y, double z, float radius, boolean fire, Level.ExplosionInteraction explosionInteraction) -
explode
public Explosion explode(@Nullable Entity source, @Nullable DamageSource damageSource, @Nullable ExplosionDamageCalculator damageCalculator, double x, double y, double z, float radius, boolean fire, Level.ExplosionInteraction explosionInteraction, ParticleOptions smallExplosionParticles, ParticleOptions largeExplosionParticles, Holder<SoundEvent> explosionSound) -
explode
public Explosion explode(@Nullable Entity source, @Nullable DamageSource damageSource, @Nullable ExplosionDamageCalculator damageCalculator, double x, double y, double z, float radius, boolean fire, Level.ExplosionInteraction explosionInteraction, boolean spawnParticles, ParticleOptions smallExplosionParticles, ParticleOptions largeExplosionParticles, Holder<SoundEvent> explosionSound) -
getDestroyType
-
gatherChunkSourceStats
-
getBlockEntity
- Specified by:
getBlockEntityin interfaceBlockGetter
-
setBlockEntity
-
removeBlockEntity
-
isLoaded
-
loadedAndEntityCanStandOnFace
-
loadedAndEntityCanStandOn
-
updateSkyBrightness
public void updateSkyBrightness() -
setSpawnSettings
public void setSpawnSettings(boolean hostile, boolean peaceful) First boolean for hostile mobs and second for peaceful mobs -
prepareWeather
protected void prepareWeather() -
close
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
getChunkForCollisions
- Specified by:
getChunkForCollisionsin interfaceCollisionGetter- Specified by:
getChunkForCollisionsin interfaceLevelReader
-
getEntities
public List<Entity> getEntities(@Nullable Entity entity, AABB boundingBox, Predicate<? super Entity> predicate) Gets all entities within the specified AABB excluding the one passed into it.- Specified by:
getEntitiesin interfaceEntityGetter
-
getEntities
public <T extends Entity> List<T> getEntities(EntityTypeTest<Entity, T> entityTypeTest, AABB bounds, Predicate<? super T> predicate) - Specified by:
getEntitiesin interfaceEntityGetter
-
getEntities
-
getEntities
-
getEntity
Returns the Entity with the given ID, or null if it doesn't exist in this Level. -
blockEntityChanged
-
getSeaLevel
public int getSeaLevel()- Specified by:
getSeaLevelin interfaceLevelReader
-
disconnect
public void disconnect() -
getGameTime
public long getGameTime() -
getDayTime
public long getDayTime() -
mayInteract
-
broadcastEntityEvent
Sends aClientboundEntityEventPacketto all tracked players of that entity. -
broadcastDamageEvent
-
blockEvent
-
getLevelData
- Specified by:
getLevelDatain interfaceLevelAccessor
-
getGameRules
-
tickRateManager
-
getThunderLevel
public float getThunderLevel(float delta) -
setThunderLevel
public void setThunderLevel(float strength) Sets the strength of the thunder. -
getRainLevel
public float getRainLevel(float delta) Returns rain strength. -
setRainLevel
public void setRainLevel(float strength) Sets the strength of the rain. -
isThundering
public boolean isThundering() -
isRaining
public boolean isRaining() -
isRainingAt
Check if precipitation is currently happening at a position -
getMapData
-
setMapData
-
getFreeMapId
-
globalLevelEvent
-
fillReportDetails
Adds some basic stats of the world to the given crash report. -
destroyBlockProgress
-
createFireworks
public void createFireworks(double x, double y, double z, double xSpeed, double ySpeed, double zSpeed, List<FireworkExplosion> explosions) -
getScoreboard
-
updateNeighbourForOutputSignal
-
getCurrentDifficultyAt
- Specified by:
getCurrentDifficultyAtin interfaceLevelAccessor
-
getSkyDarken
public int getSkyDarken()- Specified by:
getSkyDarkenin interfaceLevelReader
-
setSkyFlashTime
public void setSkyFlashTime(int timeFlash) -
getWorldBorder
- Specified by:
getWorldBorderin interfaceCollisionGetter
-
sendPacketToServer
-
dimensionType
- Specified by:
dimensionTypein interfaceLevelReader
-
dimensionTypeRegistration
-
dimension
-
getRandom
- Specified by:
getRandomin interfaceLevelAccessor
-
isStateAtPosition
- Specified by:
isStateAtPositionin interfaceLevelSimulatedReader
-
isFluidAtPosition
- Specified by:
isFluidAtPositionin interfaceLevelSimulatedReader
-
getRecipeManager
-
getBlockRandomPos
-
noSave
public boolean noSave() -
getProfiler
-
getProfilerSupplier
-
getBiomeManager
- Specified by:
getBiomeManagerin interfaceLevelReader
-
getMaxEntityRadius
public double getMaxEntityRadius()Description copied from interface:ILevelExtensionThe 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:
getMaxEntityRadiusin interfaceILevelExtension
-
increaseMaxEntityRadius
public double increaseMaxEntityRadius(double value) Description copied from interface:ILevelExtensionIncreases 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:
increaseMaxEntityRadiusin interfaceILevelExtension- Parameters:
value- New max radius to set.- Returns:
- The new max radius
-
isDebug
public final boolean isDebug() -
getEntities
-
nextSubTickCount
public long nextSubTickCount()- Specified by:
nextSubTickCountin interfaceLevelAccessor
-
registryAccess
- Specified by:
registryAccessin interfaceLevelReader
-
damageSources
-
potionBrewing
-
setDayTimeFraction
@Internal public abstract void setDayTimeFraction(float dayTimeFraction) -
getDayTimeFraction
@Internal public abstract float getDayTimeFraction() -
getDayTimePerTick
public abstract float getDayTimePerTick()Returns the current ratio between game ticks and clock ticks. If this value is negative, no speed has been set and those two are coupled 1:1 (i.e. vanilla mode). -
setDayTimePerTick
public abstract void setDayTimePerTick(float dayTimePerTick) DO NOT CALL.Use
ServerLevel.setDayTimePerTick(float)instead. -
advanceDaytime
@Internal protected long advanceDaytime()
-