Class ServerLevel
- All Implemented Interfaces:
AutoCloseable,ServerEntityGetter,BiomeManager.NoiseBiomeSource,BlockAndTintGetter,BlockGetter,CollisionGetter,CommonLevelAccessor,UUIDLookup<Entity>,EntityGetter,LevelAccessor,LevelHeightAccessor,LevelReader,LevelSimulatedReader,LevelSimulatedRW,LevelTimeAccess,LevelWriter,ScheduledTickAccess,ServerLevelAccessor,SignalGetter,WorldGenLevel,IAttachmentHolder,IBlockAndTintGetterExtension,IBlockGetterExtension,ILevelExtension,ILevelReaderExtension
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.minecraft.world.level.Level
Level.ExplosionInteractionNested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsFieldNested classes/interfaces inherited from interface net.minecraft.world.level.BlockGetter
BlockGetter.BlockStepVisitor -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet<BlockEventData> private final List<BlockEventData> private final LevelTicks<Block> private final CapabilityListenerHolderprivate final ServerChunkCacheprivate final List<CustomSpawner> private EndDragonFight(package private) final it.unimi.dsi.fastutil.ints.Int2ObjectMap<PartEntity<?>> private static final intprivate intstatic final BlockPosprivate final PersistentEntitySectionManager<Entity> (package private) final EntityTickListprivate final LevelTicks<Fluid> private final GameEventDispatcherprivate boolean(package private) booleanprivate intprivate static final org.slf4j.Loggerprivate static final intbooleanprivate final PathTypeCache(package private) final List<ServerPlayer> private final PortalForcerprotected final Raidsstatic final IntProviderstatic final IntProviderprivate final RandomSequencesprivate final MinecraftServerprivate final ServerLevelDataprivate final SleepStatusprivate final StructureCheckprivate final StructureManagerprivate static final IntProviderstatic final IntProviderprivate final booleanprivate final ServerWaypointManagerFields inherited from class net.minecraft.world.level.Level
addend, blockEntityTickers, captureBlockSnapshots, capturedBlockSnapshots, END, isClientSide, levelData, LONG_PARTICLE_CLIP_RANGE, MAX_BRIGHTNESS, MAX_ENTITY_SPAWN_Y, MAX_LEVEL_SIZE, MIN_ENTITY_SPAWN_Y, neighborUpdater, NETHER, oRainLevel, oThunderLevel, OVERWORLD, rainLevel, random, randValue, RESOURCE_KEY_CODEC, restoringBlockSnapshots, SHORT_PARTICLE_CLIP_RANGE, thunderLevel, TICKS_PER_DAYFields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEYFields inherited from interface net.minecraft.world.level.BlockGetter
MAX_BLOCK_ITERATIONS_ALONG_TRAVELFields inherited from interface net.neoforged.neoforge.common.extensions.ILevelExtension
TRANSLATION_PREFIXFields inherited from interface net.minecraft.world.level.SignalGetter
DIRECTIONS -
Constructor Summary
ConstructorsConstructorDescriptionServerLevel(MinecraftServer pServer, Executor pDispatcher, LevelStorageSource.LevelStorageAccess pLevelStorageAccess, ServerLevelData pServerLevelData, ResourceKey<Level> pDimension, LevelStem pLevelStem, ChunkProgressListener pProgressListener, boolean pIsDebug, long pBiomeZoomSeed, List<CustomSpawner> pCustomSpawners, boolean pTickTime, RandomSequences pRandomSequences) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDuringTeleport(Entity pEntity) private booleanCalled when an entity is spawned in the world.booleanaddFreshEntity(Entity pEntity) voidaddLegacyChunkEntities(Stream<Entity> pEntities) voidaddNewPlayer(ServerPlayer pPlayer) private voidaddPlayer(ServerPlayer pPlayer) voidaddRespawnedPlayer(ServerPlayer pPlayer) booleanaddWithUUID(Entity pEntity) Used for "unnatural" ways of entities appearing in the world, e.g. summon command, interdimensional teleportsvoidaddWorldGenChunkEntities(Stream<Entity> pEntities) private voidprivate voidbooleanbooleananyPlayerCloseEnoughForSpawning(ChunkPos pChunkPos) booleanareEntitiesActuallyLoadedAndTicking(ChunkPos pChunkPos) booleanareEntitiesLoaded(long pChunkPos) voidblockEvent(BlockPos pPos, Block pBlock, int pEventID, int pEventParam) voidbroadcastDamageEvent(Entity pEntity, DamageSource pDamageSource) voidbroadcastEntityEvent(Entity pEntity, byte pState) Sends aClientboundEntityEventPacketto all tracked players of that entity.booleanbooleancanSpawnEntitiesInChunk(ChunkPos pChunkPos) voidInternal method, used to clean capability listeners that are not referenced.voidclearBlockEvents(BoundingBox pBoundingBox) voidclose()voiddestroyBlockProgress(int pBreakerId, BlockPos pPos, int pProgress) private booleandoBlockEvent(BlockEventData pEvent) Collection<PartEntity<?>> private voiddumpBlockEntityTickers(Writer pOutput) private static voiddumpEntities(Writer pWriter, Iterable<Entity> pEntities) voidexplode(Entity pSource, DamageSource pDamageSource, ExplosionDamageCalculator pDamageCalculator, double pX, double pY, double pZ, float pRadius, boolean pFire, Level.ExplosionInteraction pExplosionInteraction, ParticleOptions pSmallExplosionParticles, ParticleOptions pLargeExplosionParticles, Holder<SoundEvent> pExplosionSound) fillReportDetails(CrashReport pReport) Adds some basic stats of the world to the given crash report.findClosestBiome3d(Predicate<Holder<Biome>> pBiomePredicate, BlockPos pPos, int pRadius, int pHorizontalStep, int pVerticalStep) findLightningRod(BlockPos pPos) protected BlockPosfindNearestMapStructure(TagKey<Structure> pStructureTag, BlockPos pPos, int pRadius, boolean pSkipExistingChunks) voidgameEvent(Holder<GameEvent> pGameEvent, Vec3 pPos, GameEvent.Context pContext) floatfloatReturns the current ratio between game ticks and clock ticks.private Explosion.BlockInteractiongetDestroyType(GameRules.Key<GameRules.BooleanValue> pDecayGameRule) List<? extends EnderDragon> getEntities(EntityTypeTest<Entity, T> pTypeTest, Predicate<? super T> pPredicate) <T extends Entity>
voidgetEntities(EntityTypeTest<Entity, T> pTypeTest, Predicate<? super T> pPredicate, List<? super T> pOutput) <T extends Entity>
voidgetEntities(EntityTypeTest<Entity, T> pTypeTest, Predicate<? super T> pPredicate, List<? super T> pOutput, int pMaxResults) getEntity(int pId) Returns the Entity with the given ID, or null if it doesn't exist in this World.getEntityOrPart(int pId) Deprecated.it.unimi.dsi.fastutil.longs.LongSetgetLevel()intgetMapData(MapId pMapId) getPlayers(Predicate<? super ServerPlayer> pPredicate) getPlayers(Predicate<? super ServerPlayer> pPredicate, int pMaxResults) getRaids()getRandomSequence(ResourceLocation pLocation) intlonggetSeed()floatprivate static <T> StringgetTypeCount(Iterable<T> pObjects, Function<T, String> pTypeGetter) getUncachedNoiseBiome(int pX, int pY, int pZ) voidglobalLevelEvent(int pId, BlockPos pPos, int pData) voidNotify all listeners that the capabilities at a specific position might have changed.voidNotify all listeners that the capabilities at all the positions in a chunk might have changed.booleanisCloseToVillage(BlockPos pPos, int pSections) booleanisFlat()booleanbooleanbooleanisPositionTickingWithEntitiesLoaded(long p_184111_) booleanbooleanbooleanisVillage(SectionPos pPos) voidlevelEvent(Entity pEntity, int pType, BlockPos pPos, int pData) booleanmayInteract(Entity pEntity, BlockPos pPos) voidneighborChanged(BlockPos pPos, Block pBlock, Orientation pOrientation) voidneighborChanged(BlockState pState, BlockPos pPos, Block pBlock, Orientation pOrientation, boolean pMovedByPiston) booleannoSave()voidonReputationEvent(ReputationEventType pType, Entity pTarget, ReputationEventHandler pHost) voidplayers()voidplaySeededSound(Entity pEntity, double pX, double pY, double pZ, Holder<SoundEvent> pSound, SoundSource pSource, float pVolume, float pPitch, long pSeed) voidplaySeededSound(Entity pEntity, Entity pSourceEntity, Holder<SoundEvent> pSound, SoundSource pSource, float pVolume, float pPitch, long pSeed) voidregisterCapabilityListener(BlockPos pos, ICapabilityInvalidationListener listener) Register a listener for capability invalidation.voidremovePlayerImmediately(ServerPlayer pPlayer, Entity.RemovalReason pReason) voidvoidprivate voidvoidsave(ProgressListener pProgress, boolean pFlush, boolean pSkipSave) voidsaveDebugReport(Path pPath) private voidsaveLevelData(boolean pJoin) intsectionsToVillage(SectionPos pPos) voidsendBlockUpdated(BlockPos pPos, BlockState pOldState, BlockState pNewState, int pFlags) Flags are as in setBlockStateprivate booleansendParticles(ServerPlayer pPlayer, boolean pLongDistance, double pPosX, double pPosY, double pPosZ, Packet<?> pPacket) <T extends ParticleOptions>
booleansendParticles(ServerPlayer pPlayer, T pParticle, boolean pOverrideLimiter, boolean pAlwaysShow, double pPosX, double pPosY, double pPosZ, int pCount, double pXDist, double pYDist, double pZDist, double pMaxSpeed) <T extends ParticleOptions>
intsendParticles(T pType, boolean pOverrideLimiter, boolean pAlwaysShow, double pPosX, double pPosY, double pPosZ, int pParticleCount, double pXOffset, double pYOffset, double pZOffset, double pSpeed) <T extends ParticleOptions>
intsendParticles(T pType, double pPosX, double pPosY, double pPosZ, int pParticleCount, double pXOffset, double pYOffset, double pZOffset, double pSpeed) booleansetChunkForced(int pChunkX, int pChunkZ, boolean pAdd) voidsetDayTime(long pTime) voidsetDayTimeFraction(float dayTimeFraction) voidsetDayTimePerTick(float dayTimePerTick) This allows mods to set the rate time flows in a level.voidsetDefaultSpawnPos(BlockPos pPos, float pAngle) voidsetDragonFight(EndDragonFight pDragonFight) Deprecated.voidsetMapData(MapId pMapId, MapItemSavedData pData) voidsetWeatherParameters(int pClearTime, int pWeatherTime, boolean pIsRaining, boolean pIsThundering) booleanshouldTickBlocksAt(long pChunkPos) voidstartTickingChunk(LevelChunk pChunk) final voidsyncData(AttachmentType<?> type) Syncs a data attachment of the given type with all relevant clients.voidtick(BooleanSupplier pHasTimeLeft) Runs a single tick for the worldprivate voidvoidtickChunk(LevelChunk pChunk, int pRandomTickSpeed) voidtickCustomSpawners(boolean pSpawnEnemies, boolean pSpawnFriendlies) private voidvoidtickNonPassenger(Entity p_8648_) private voidtickPassenger(Entity pRidingEntity, Entity pPassengerEntity) voidtickPrecipitation(BlockPos pBlockPos) voidtickThunder(LevelChunk pChunk) protected voidtickTime()toString()booleantryAddFreshEntityWithPassengers(Entity pEntity) Attempts to summon an entity and it's passengers.voidunload(LevelChunk pChunk) voidupdateNeighborsAt(BlockPos pPos, Block pBlock) voidupdateNeighborsAt(BlockPos pPos, Block pBlock, Orientation pOrientation) voidupdateNeighborsAtExceptFromFacing(BlockPos pPos, Block pBlock, Direction pFacing, Orientation pOrientation) voidupdateNeighboursOnBlockSet(BlockPos pPos, BlockState pState) voidupdatePOIOnBlockStateChange(BlockPos pPos, BlockState pOldState, BlockState pNewState) voidvoidwaitForChunkAndEntities(ChunkPos pChunkPos, int pRadius) private voidMethods inherited from class net.minecraft.world.level.Level
addAlwaysVisibleParticle, addAlwaysVisibleParticle, addBlockEntityTicker, addDestroyBlockEffect, addFreshBlockEntities, addParticle, addParticle, advanceDaytime, blockEntityChanged, createFireworks, damageSources, destroyBlock, dimension, dimensionType, dimensionTypeRegistration, explode, explode, explode, explode, getBiomeManager, getBlockEntity, getBlockRandomPos, getBlockState, getChunk, getChunk, getChunkAt, getChunkForCollisions, getClientLeafTintColor, getCurrentDifficultyAt, getDayTime, getEntities, getEntities, getEntities, getEntities, getEntity, getFluidState, getGameTime, getHeight, getLevelData, getLightEngine, getMaxEntityRadius, getPushableEntities, getRainLevel, getRandom, getSharedSpawnAngle, getSharedSpawnPos, getSkyDarken, getSunAngle, getThunderLevel, getWorldBorder, guardEntityTick, increaseMaxEntityRadius, isBrightOutside, isClientSide, isDarkOutside, isDebug, isFluidAtPosition, isInSpawnableBounds, isInWorldBounds, isLoaded, isMoonVisible, isRaining, isRainingAt, isStateAtPosition, isThundering, loadedAndEntityCanStandOn, loadedAndEntityCanStandOnFace, markAndNotifyBlock, neighborShapeChanged, nextSubTickCount, onBlockEntityAdded, playLocalSound, playLocalSound, playLocalSound, playPlayerSound, playSeededSound, playSound, playSound, playSound, playSound, playSound, precipitationAt, prepareWeather, registryAccess, removeBlock, removeBlockEntity, sendPacketToServer, setBlock, setBlock, setBlockAndUpdate, setBlockEntity, setBlocksDirty, setRainLevel, setSkyFlashTime, setSpawnSettings, setThunderLevel, shouldTickBlocksAt, shouldTickDeath, tickBlockEntities, updateNeighbourForOutputSignal, updateSkyBrightnessMethods 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, wait, wait, waitMethods inherited from interface net.minecraft.world.level.BlockAndTintGetter
canSeeSky, getBrightness, getLightEngine, getRawBrightnessMethods inherited from interface net.minecraft.world.level.BlockGetter
clip, clipWithInteractionOverride, getBlockEntity, getBlockFloorHeight, getBlockFloorHeight, getBlockState, getBlockStates, getFluidState, getLightEmission, isBlockInLineMethods inherited from interface net.minecraft.world.level.CollisionGetter
clipIncludingBorder, collidesWithSuffocatingBlock, findFreePosition, findSupportingBlock, getBlockAndLiquidCollisions, getBlockCollisions, getCollisions, getEntityCollisions, getPreMoveCollisions, getWorldBorder, isUnobstructed, isUnobstructed, isUnobstructed, noBlockCollision, noCollision, noCollision, noCollision, noCollisionMethods inherited from interface net.minecraft.world.level.CommonLevelAccessor
getBlockEntity, getEntityCollisions, getHeightmapPos, isUnobstructedMethods inherited from interface net.minecraft.world.level.EntityGetter
getEntities, getEntities, getEntities, getEntitiesOfClass, getEntitiesOfClass, getNearestPlayer, getNearestPlayer, getNearestPlayer, getPlayerByUUID, hasNearbyAlivePlayerMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncDataMethods 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, getModelDataManagerMethods inherited from interface net.neoforged.neoforge.common.extensions.ILevelReaderExtension
holder, holderOrThrow, isAreaLoadedMethods inherited from interface net.minecraft.world.level.LevelAccessor
addParticle, createTick, createTick, dayTime, gameEvent, gameEvent, gameEvent, gameEvent, getCurrentDifficultyAt, getDifficulty, getLevelData, getRandom, hasChunk, levelEvent, neighborShapeChanged, nextSubTickCount, playSound, playSoundMethods inherited from interface net.minecraft.world.level.LevelHeightAccessor
getMaxSectionY, getMaxY, getMinSectionY, getSectionIndex, getSectionIndexFromSectionY, getSectionsCount, getSectionYFromSectionIndex, isInsideBuildHeight, isOutsideBuildHeight, isOutsideBuildHeightMethods inherited from interface net.minecraft.world.level.LevelReader
canSeeSkyFromBelowWater, containsAnyLiquid, dimensionType, getBiome, getBiomeManager, getBlockStatesIfLoaded, getBlockTint, getChunk, getChunk, getChunk, getChunk, getChunkForCollisions, getHeight, getHeight, getHeight, getLightLevelDependentMagicValue, getMaxLocalRawBrightness, getMaxLocalRawBrightness, getMinY, getNoiseBiome, getPathfindingCostFromLightLevels, getSkyDarken, hasChunkAt, hasChunkAt, hasChunksAt, hasChunksAt, hasChunksAt, holderLookup, isClientSide, isEmptyBlock, isWaterAt, registryAccessMethods inherited from interface net.minecraft.world.level.LevelSimulatedReader
isFluidAtPosition, isStateAtPositionMethods inherited from interface net.minecraft.world.level.LevelTimeAccess
getMoonBrightness, getMoonPhase, getTimeOfDayMethods inherited from interface net.minecraft.world.level.LevelWriter
destroyBlock, destroyBlock, destroyBlock, removeBlock, setBlock, setBlockMethods inherited from interface net.minecraft.world.level.ScheduledTickAccess
scheduleTick, scheduleTick, scheduleTick, scheduleTickMethods inherited from interface net.minecraft.server.level.ServerEntityGetter
getNearbyEntities, getNearbyPlayers, getNearestEntity, getNearestEntity, getNearestPlayer, getNearestPlayer, getNearestPlayerMethods inherited from interface net.minecraft.world.level.ServerLevelAccessor
addFreshEntityWithPassengersMethods inherited from interface net.minecraft.world.level.SignalGetter
getBestNeighborSignal, getControlInputSignal, getDirectSignal, getDirectSignalTo, getSignal, hasNeighborSignal, hasSignalMethods inherited from interface net.minecraft.world.level.WorldGenLevel
ensureCanWrite, setCurrentlyGenerating
-
Field Details
-
END_SPAWN_POINT
-
RAIN_DELAY
-
RAIN_DURATION
-
THUNDER_DELAY
-
THUNDER_DURATION
-
LOGGER
private static final org.slf4j.Logger LOGGER -
EMPTY_TIME_NO_TICK
private static final int EMPTY_TIME_NO_TICK- See Also:
-
MAX_SCHEDULED_TICKS_PER_TICK
private static final int MAX_SCHEDULED_TICKS_PER_TICK- See Also:
-
players
-
chunkSource
-
server
-
serverLevelData
-
lastSpawnChunkRadius
private int lastSpawnChunkRadius -
entityTickList
-
waypointManager
-
entityManager
-
gameEventDispatcher
-
noSave
public boolean noSave -
sleepStatus
-
emptyTime
private int emptyTime -
portalForcer
-
blockTicks
-
fluidTicks
-
pathTypesByPosCache
-
raids
-
blockEvents
-
blockEventsToReschedule
-
handlingTick
private boolean handlingTick -
customSpawners
-
dragonFight
-
dragonParts
-
structureManager
-
structureCheck
-
tickTime
private final boolean tickTime -
randomSequences
-
capListenerHolder
-
-
Constructor Details
-
ServerLevel
public ServerLevel(MinecraftServer pServer, Executor pDispatcher, LevelStorageSource.LevelStorageAccess pLevelStorageAccess, ServerLevelData pServerLevelData, ResourceKey<Level> pDimension, LevelStem pLevelStem, ChunkProgressListener pProgressListener, boolean pIsDebug, long pBiomeZoomSeed, List<CustomSpawner> pCustomSpawners, boolean pTickTime, @Nullable RandomSequences pRandomSequences)
-
-
Method Details
-
setDragonFight
Deprecated. -
setWeatherParameters
public void setWeatherParameters(int pClearTime, int pWeatherTime, boolean pIsRaining, boolean pIsThundering) -
getUncachedNoiseBiome
- Specified by:
getUncachedNoiseBiomein interfaceLevelReader
-
structureManager
-
tick
Runs a single tick for the world -
shouldTickBlocksAt
public boolean shouldTickBlocksAt(long pChunkPos) - Overrides:
shouldTickBlocksAtin classLevel
-
tickTime
protected void tickTime() -
setDayTime
public void setDayTime(long pTime) -
tickCustomSpawners
public void tickCustomSpawners(boolean pSpawnEnemies, boolean pSpawnFriendlies) -
wakeUpAllPlayers
private void wakeUpAllPlayers() -
tickChunk
-
tickThunder
-
tickPrecipitation
-
findLightningRod
-
findLightningTargetAround
-
isHandlingTick
public boolean isHandlingTick() -
canSleepThroughNights
public boolean canSleepThroughNights() -
announceSleepStatus
private void announceSleepStatus() -
updateSleepingPlayerList
public void updateSleepingPlayerList() -
getScoreboard
- Specified by:
getScoreboardin classLevel
-
getWaypointManager
-
advanceWeatherCycle
private void advanceWeatherCycle() -
resetWeatherCycle
public void resetWeatherCycle() -
resetEmptyTime
public void resetEmptyTime() -
tickFluid
-
tickBlock
-
tickNonPassenger
-
tickPassenger
-
updateNeighboursOnBlockSet
-
mayInteract
- Overrides:
mayInteractin classLevel
-
save
-
saveLevelData
private void saveLevelData(boolean pJoin) -
getEntities
public <T extends Entity> List<? extends T> getEntities(EntityTypeTest<Entity, T> pTypeTest, Predicate<? super T> pPredicate) -
getEntities
public <T extends Entity> void getEntities(EntityTypeTest<Entity, T> pTypeTest, Predicate<? super T> pPredicate, List<? super T> pOutput) -
getEntities
public <T extends Entity> void getEntities(EntityTypeTest<Entity, T> pTypeTest, Predicate<? super T> pPredicate, List<? super T> pOutput, int pMaxResults) -
getDragons
-
getPlayers
-
getPlayers
-
getRandomPlayer
-
addFreshEntity
- Specified by:
addFreshEntityin interfaceLevelWriter
-
addWithUUID
Used for "unnatural" ways of entities appearing in the world, e.g. summon command, interdimensional teleports -
addDuringTeleport
-
addNewPlayer
-
addRespawnedPlayer
-
addPlayer
-
addEntity
Called when an entity is spawned in the world. This includes players. -
tryAddFreshEntityWithPassengers
Attempts to summon an entity and it's passengers. They will only be summoned if all entities are unique and not already in queue to be summoned. -
unload
-
removePlayerImmediately
-
destroyBlockProgress
- Specified by:
destroyBlockProgressin classLevel
-
playSeededSound
public void playSeededSound(@Nullable Entity pEntity, double pX, double pY, double pZ, Holder<SoundEvent> pSound, SoundSource pSource, float pVolume, float pPitch, long pSeed) - Specified by:
playSeededSoundin classLevel
-
playSeededSound
public void playSeededSound(@Nullable Entity pEntity, Entity pSourceEntity, Holder<SoundEvent> pSound, SoundSource pSource, float pVolume, float pPitch, long pSeed) - Specified by:
playSeededSoundin classLevel
-
globalLevelEvent
- Overrides:
globalLevelEventin classLevel
-
levelEvent
- Specified by:
levelEventin interfaceLevelAccessor
-
getLogicalHeight
public int getLogicalHeight() -
gameEvent
- Specified by:
gameEventin interfaceLevelAccessor
-
sendBlockUpdated
Flags are as in setBlockState- Specified by:
sendBlockUpdatedin classLevel
-
updateNeighborsAt
- Specified by:
updateNeighborsAtin interfaceLevelAccessor
-
updateNeighborsAt
- Overrides:
updateNeighborsAtin classLevel
-
updateNeighborsAtExceptFromFacing
public void updateNeighborsAtExceptFromFacing(BlockPos pPos, Block pBlock, Direction pFacing, @Nullable Orientation pOrientation) - Overrides:
updateNeighborsAtExceptFromFacingin classLevel
-
neighborChanged
- Overrides:
neighborChangedin classLevel
-
neighborChanged
public void neighborChanged(BlockState pState, BlockPos pPos, Block pBlock, @Nullable Orientation pOrientation, boolean pMovedByPiston) - Overrides:
neighborChangedin classLevel
-
broadcastEntityEvent
Sends aClientboundEntityEventPacketto all tracked players of that entity.- Overrides:
broadcastEntityEventin classLevel
-
broadcastDamageEvent
- Overrides:
broadcastDamageEventin classLevel
-
getChunkSource
- Specified by:
getChunkSourcein interfaceLevelAccessor
-
explode
public void explode(@Nullable Entity pSource, @Nullable DamageSource pDamageSource, @Nullable ExplosionDamageCalculator pDamageCalculator, double pX, double pY, double pZ, float pRadius, boolean pFire, Level.ExplosionInteraction pExplosionInteraction, ParticleOptions pSmallExplosionParticles, ParticleOptions pLargeExplosionParticles, Holder<SoundEvent> pExplosionSound) -
getDestroyType
private Explosion.BlockInteraction getDestroyType(GameRules.Key<GameRules.BooleanValue> pDecayGameRule) -
blockEvent
- Overrides:
blockEventin classLevel
-
runBlockEvents
private void runBlockEvents() -
doBlockEvent
-
getBlockTicks
- Specified by:
getBlockTicksin interfaceScheduledTickAccess
-
getFluidTicks
- Specified by:
getFluidTicksin interfaceScheduledTickAccess
-
getServer
- Specified by:
getServerin interfaceLevelAccessor- Overrides:
getServerin classLevel
-
getPortalForcer
-
getStructureManager
-
sendParticles
public <T extends ParticleOptions> int sendParticles(T pType, double pPosX, double pPosY, double pPosZ, int pParticleCount, double pXOffset, double pYOffset, double pZOffset, double pSpeed) -
sendParticles
public <T extends ParticleOptions> int sendParticles(T pType, boolean pOverrideLimiter, boolean pAlwaysShow, double pPosX, double pPosY, double pPosZ, int pParticleCount, double pXOffset, double pYOffset, double pZOffset, double pSpeed) -
sendParticles
public <T extends ParticleOptions> boolean sendParticles(ServerPlayer pPlayer, T pParticle, boolean pOverrideLimiter, boolean pAlwaysShow, double pPosX, double pPosY, double pPosZ, int pCount, double pXDist, double pYDist, double pZDist, double pMaxSpeed) -
sendParticles
private boolean sendParticles(ServerPlayer pPlayer, boolean pLongDistance, double pPosX, double pPosY, double pPosZ, Packet<?> pPacket) -
getEntity
Returns the Entity with the given ID, or null if it doesn't exist in this World. -
getEntityOrPart
Deprecated. -
dragonParts
- Specified by:
dragonPartsin classLevel
-
findNearestMapStructure
-
findClosestBiome3d
-
recipeAccess
- Specified by:
recipeAccessin classLevel
-
tickRateManager
- Specified by:
tickRateManagerin classLevel
-
noSave
public boolean noSave() -
getDataStorage
-
getMapData
- Specified by:
getMapDatain classLevel
-
setMapData
-
getFreeMapId
-
setDefaultSpawnPos
-
getForceLoadedChunks
public it.unimi.dsi.fastutil.longs.LongSet getForceLoadedChunks() -
setChunkForced
public boolean setChunkForced(int pChunkX, int pChunkZ, boolean pAdd) -
players
- Specified by:
playersin interfaceEntityGetter
-
updatePOIOnBlockStateChange
- Overrides:
updatePOIOnBlockStateChangein classLevel
-
getPoiManager
-
isVillage
-
isVillage
-
isCloseToVillage
-
sectionsToVillage
-
getRaids
-
getRaidAt
-
isRaided
-
onReputationEvent
public void onReputationEvent(ReputationEventType pType, Entity pTarget, ReputationEventHandler pHost) -
saveDebugReport
- Throws:
IOException
-
dumpEntities
- Throws:
IOException
-
dumpBlockEntityTickers
- Throws:
IOException
-
clearBlockEvents
-
getShade
- Specified by:
getShadein interfaceBlockAndTintGetter
-
getAllEntities
-
toString
-
isFlat
public boolean isFlat() -
getSeed
public long getSeed()- Specified by:
getSeedin interfaceWorldGenLevel
-
getDragonFight
-
getLevel
- Specified by:
getLevelin interfaceServerEntityGetter- Specified by:
getLevelin interfaceServerLevelAccessor
-
getWatchdogStats
-
getTypeCount
-
getEntities
- Specified by:
getEntitiesin classLevel
-
addLegacyChunkEntities
-
addWorldGenChunkEntities
-
startTickingChunk
-
onStructureStartsAvailable
-
getPathTypeCache
-
waitForChunkAndEntities
-
close
- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classLevel- Throws:
IOException
-
gatherChunkSourceStats
- Specified by:
gatherChunkSourceStatsin classLevel
-
areEntitiesLoaded
public boolean areEntitiesLoaded(long pChunkPos) -
isPositionTickingWithEntitiesLoaded
public boolean isPositionTickingWithEntitiesLoaded(long p_184111_) -
isPositionEntityTicking
-
areEntitiesActuallyLoadedAndTicking
-
anyPlayerCloseEnoughForSpawning
-
anyPlayerCloseEnoughForSpawning
-
canSpawnEntitiesInChunk
-
enabledFeatures
- Specified by:
enabledFeaturesin interfaceLevelReader
-
potionBrewing
- Specified by:
potionBrewingin classLevel
-
fuelValues
- Specified by:
fuelValuesin classLevel
-
getRandomSequence
-
getRandomSequences
-
getGameRules
-
fillReportDetails
Adds some basic stats of the world to the given crash report.- Overrides:
fillReportDetailsin classLevel
-
getSeaLevel
public int getSeaLevel()- Specified by:
getSeaLevelin interfaceLevelReader
-
syncData
Description copied from interface:IAttachmentHolderSyncs a data attachment of the given type with all relevant clients.If there is currently no attachment of the given type, the removal of the attachment is synced to the client.
- Specified by:
syncDatain interfaceIAttachmentHolder- See Also:
-
invalidateCapabilities
Description copied from interface:ILevelExtensionNotify all listeners that the capabilities at a specific position might have changed. This includes new capabilities becoming available.This method will only do something on
ServerLevels, but it is safe to call on anyLevel, without the need for aninstanceofcheck.If you already have a block entity at that position, you can call
IBlockEntityExtension.invalidateCapabilities()instead.- Specified by:
invalidateCapabilitiesin interfaceILevelExtension
-
invalidateCapabilities
Description copied from interface:ILevelExtensionNotify all listeners that the capabilities at all the positions in a chunk might have changed. This includes new capabilities becoming available.This method will only do something on
ServerLevels, but it is safe to call on anyLevel, without the need for aninstanceofcheck.- Specified by:
invalidateCapabilitiesin interfaceILevelExtension
-
registerCapabilityListener
Register a listener for capability invalidation.- See Also:
-
cleanCapabilityListenerReferences
@Internal public void cleanCapabilityListenerReferences()Internal method, used to clean capability listeners that are not referenced. Do not call. -
setDayTimeFraction
@Internal public void setDayTimeFraction(float dayTimeFraction) - Specified by:
setDayTimeFractionin classLevel
-
getDayTimeFraction
@Internal public float getDayTimeFraction()- Specified by:
getDayTimeFractionin classLevel
-
getDayTimePerTick
public 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).- Specified by:
getDayTimePerTickin classLevel
-
setDayTimePerTick
public void setDayTimePerTick(float dayTimePerTick) This allows mods to set the rate time flows in a level. By default, each game tick the clock time also advances by one tick, withLevel.TICKS_PER_DAYclock ticks (or 20 real-life minutes) forming a Minecraft day.This can be sped up for shorter days by giving a higher number, or slowed down for longer days with a smaller number. A negative value will reset it back to vanilla logic.
This value can also be changed with the command
/neoforge day, where you can set either the speed or a day length in minutes.This has no effect when time progression is stopped.
While this still technically works when vanilla clients are connected, those will desync and experience a time jump once per second.
- Specified by:
setDayTimePerTickin classLevel
-