Class ServerLevel
- All Implemented Interfaces:
AutoCloseable
,BiomeManager.NoiseBiomeSource
,BlockAndTintGetter
,BlockGetter
,CollisionGetter
,CommonLevelAccessor
,EntityGetter
,LevelAccessor
,LevelHeightAccessor
,LevelReader
,LevelSimulatedReader
,LevelSimulatedRW
,LevelTimeAccess
,LevelWriter
,ServerLevelAccessor
,SignalGetter
,WorldGenLevel
,IAttachmentHolder
,IBlockAndTintGetterExtension
,IBlockGetterExtension
,ILevelExtension
,ILevelReaderExtension
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.minecraft.world.level.Level
Level.ExplosionInteraction
Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsField
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet
<BlockEventData> private final List
<BlockEventData> private final LevelTicks
<Block> private final CapabilityListenerHolder
private final ServerChunkCache
private final List
<CustomSpawner> private EndDragonFight
(package private) final it.unimi.dsi.fastutil.ints.Int2ObjectMap
<PartEntity<?>> private static final int
private int
static final BlockPos
private final PersistentEntitySectionManager
<Entity> (package private) final EntityTickList
private final LevelTicks
<Fluid> private final GameEventDispatcher
private boolean
(package private) boolean
private int
private static final org.slf4j.Logger
private static final int
boolean
private final PathTypeCache
(package private) final List
<ServerPlayer> private final PortalForcer
protected final Raids
static final IntProvider
static final IntProvider
private final RandomSequences
private final MinecraftServer
private final ServerLevelData
private final SleepStatus
private final StructureCheck
private final StructureManager
private static final IntProvider
static final IntProvider
private final boolean
Fields 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_DAY
Fields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEY
Fields inherited from interface net.neoforged.neoforge.common.extensions.ILevelExtension
TRANSLATION_PREFIX
Fields 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 TypeMethodDescriptionvoid
addDuringTeleport
(Entity pEntity) private boolean
Called when an entity is spawned in the world.boolean
addFreshEntity
(Entity pEntity) void
addLegacyChunkEntities
(Stream<Entity> pEntities) void
addNewPlayer
(ServerPlayer pPlayer) private void
addPlayer
(ServerPlayer pPlayer) void
addRespawnedPlayer
(ServerPlayer pPlayer) boolean
addWithUUID
(Entity pEntity) Used for "unnatural" ways of entities appearing in the world, e.g. summon command, interdimensional teleportsvoid
addWorldGenChunkEntities
(Stream<Entity> pEntities) private void
private void
boolean
areEntitiesLoaded
(long pChunkPos) void
blockEvent
(BlockPos pPos, Block pBlock, int pEventID, int pEventParam) void
blockUpdated
(BlockPos pPos, Block pBlock) void
broadcastDamageEvent
(Entity pEntity, DamageSource pDamageSource) void
broadcastEntityEvent
(Entity pEntity, byte pState) Sends aClientboundEntityEventPacket
to all tracked players of that entity.boolean
void
Internal method, used to clean capability listeners that are not referenced.void
clearBlockEvents
(BoundingBox pBoundingBox) void
close()
void
destroyBlockProgress
(int pBreakerId, BlockPos pPos, int pProgress) private boolean
doBlockEvent
(BlockEventData pEvent) private void
dumpBlockEntityTickers
(Writer pOutput) private static void
dumpEntities
(Writer pWriter, Iterable<Entity> pEntities) explode
(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>> p_215070_, BlockPos p_215071_, int p_215072_, int p_215073_, int p_215074_) findLightningRod
(BlockPos pPos) protected BlockPos
findNearestMapStructure
(TagKey<Structure> pStructureTag, BlockPos pPos, int pRadius, boolean pSkipExistingChunks) void
gameEvent
(Holder<GameEvent> pGameEvent, Vec3 pPos, GameEvent.Context pContext) float
float
Returns the current ratio between game ticks and clock ticks.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.LongSet
getLevel()
int
getMapData
(MapId pMapId) Collection
<PartEntity<?>> All part entities in this world.getPlayers
(Predicate<? super ServerPlayer> pPredicate) getPlayers
(Predicate<? super ServerPlayer> pPredicate, int pMaxResults) getRaids()
getRandomSequence
(ResourceLocation pLocation) long
getSeed()
float
private static <T> String
getTypeCount
(Iterable<T> pObjects, Function<T, String> pTypeGetter) getUncachedNoiseBiome
(int pX, int pY, int pZ) void
globalLevelEvent
(int pId, BlockPos pPos, int pData) void
Notify all listeners that the capabilities at a specific position might have changed.void
Notify all listeners that the capabilities at all the positions in a chunk might have changed.boolean
isCloseToVillage
(BlockPos pPos, int pSections) boolean
isFlat()
boolean
boolean
boolean
isNaturalSpawningAllowed
(ChunkPos pChunkPos) boolean
private boolean
isPositionTickingWithEntitiesLoaded
(long p_184111_) boolean
boolean
boolean
isVillage
(SectionPos pPos) void
levelEvent
(Player pPlayer, int pType, BlockPos pPos, int pData) boolean
mayInteract
(Player pPlayer, BlockPos pPos) void
neighborChanged
(BlockPos pPos, Block pBlock, BlockPos pFromPos) void
neighborChanged
(BlockState pState, BlockPos pPos, Block pBlock, BlockPos pFromPos, boolean pIsMoving) boolean
noSave()
void
onBlockStateChange
(BlockPos pPos, BlockState pBlockState, BlockState pNewState) void
onReputationEvent
(ReputationEventType pType, Entity pTarget, ReputationEventHandler pHost) void
players()
void
playSeededSound
(Player pPlayer, double pX, double pY, double pZ, Holder<SoundEvent> pSound, SoundSource pCategory, float pVolume, float pPitch, long pSeed) void
playSeededSound
(Player pPlayer, Entity pEntity, Holder<SoundEvent> pSound, SoundSource pCategory, float pVolume, float pPitch, long pSeed) void
registerCapabilityListener
(BlockPos pos, ICapabilityInvalidationListener listener) Register a listener for capability invalidation.void
removePlayerImmediately
(ServerPlayer pPlayer, Entity.RemovalReason pReason) void
void
private void
void
save
(ProgressListener pProgress, boolean pFlush, boolean pSkipSave) void
saveDebugReport
(Path pPath) private void
int
sectionsToVillage
(SectionPos pPos) void
sendBlockUpdated
(BlockPos pPos, BlockState pOldState, BlockState pNewState, int pFlags) Flags are as in setBlockStateprivate boolean
sendParticles
(ServerPlayer pPlayer, boolean pLongDistance, double pPosX, double pPosY, double pPosZ, Packet<?> pPacket) <T extends ParticleOptions>
booleansendParticles
(ServerPlayer pPlayer, T pType, boolean pLongDistance, 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) boolean
setChunkForced
(int pChunkX, int pChunkZ, boolean pAdd) void
setDayTime
(long pTime) void
setDayTimeFraction
(float dayTimeFraction) void
setDayTimePerTick
(float dayTimePerTick) This allows mods to set the rate time flows in a level.void
setDefaultSpawnPos
(BlockPos pPos, float pAngle) void
setDragonFight
(EndDragonFight pDragonFight) Deprecated.void
setMapData
(MapId pMapId, MapItemSavedData pMapData) void
setWeatherParameters
(int pClearTime, int pWeatherTime, boolean pIsRaining, boolean pIsThundering) private boolean
shouldDiscardEntity
(Entity pEntity) boolean
shouldTickBlocksAt
(long pChunkPos) void
startTickingChunk
(LevelChunk pChunk) void
tick
(BooleanSupplier pHasTimeLeft) Runs a single tick for the worldprivate void
void
tickChunk
(LevelChunk pChunk, int pRandomTickSpeed) void
tickCustomSpawners
(boolean pSpawnEnemies, boolean pSpawnFriendlies) private void
void
tickNonPassenger
(Entity p_8648_) private void
tickPassenger
(Entity pRidingEntity, Entity pPassengerEntity) void
tickPrecipitation
(BlockPos pBlockPos) protected void
tickTime()
toString()
boolean
tryAddFreshEntityWithPassengers
(Entity pEntity) Attempts to summon an entity and it's passangers.void
unload
(LevelChunk pChunk) void
updateNeighborsAt
(BlockPos pPos, Block pBlock) void
updateNeighborsAtExceptFromFacing
(BlockPos pPos, Block pBlockType, Direction pSkipSide) void
private void
Methods inherited from class net.minecraft.world.level.Level
addAlwaysVisibleParticle, addAlwaysVisibleParticle, addBlockEntityTicker, addDestroyBlockEffect, addFreshBlockEntities, addParticle, addParticle, advanceDaytime, blockEntityChanged, createFireworks, damageSources, destroyBlock, dimension, dimensionType, dimensionTypeRegistration, disconnect, explode, explode, explode, explode, explode, getBiomeManager, getBlockEntity, getBlockRandomPos, getBlockState, getChunk, getChunk, getChunkAt, getChunkForCollisions, getCurrentDifficultyAt, getDayTime, getEntities, getEntities, getEntities, getEntities, getFluidState, getGameRules, getGameTime, getHeight, getLevelData, getLightEngine, getMaxEntityRadius, getProfiler, getProfilerSupplier, getRainLevel, getRandom, getSeaLevel, getSharedSpawnAngle, getSharedSpawnPos, getSkyDarken, getSunAngle, getThunderLevel, getWorldBorder, guardEntityTick, increaseMaxEntityRadius, isClientSide, isDay, isDebug, isFluidAtPosition, isInSpawnableBounds, isInWorldBounds, isLoaded, isNight, isRaining, isRainingAt, isStateAtPosition, isThundering, loadedAndEntityCanStandOn, loadedAndEntityCanStandOnFace, markAndNotifyBlock, neighborShapeChanged, nextSubTickCount, playLocalSound, playLocalSound, playLocalSound, playSeededSound, playSound, playSound, playSound, playSound, playSound, playSound, prepareWeather, registryAccess, removeBlock, removeBlockEntity, sendPacketToServer, setBlock, setBlock, setBlockAndUpdate, setBlockEntity, setBlocksDirty, setRainLevel, setSkyFlashTime, setSpawnSettings, setThunderLevel, shouldTickBlocksAt, shouldTickDeath, tickBlockEntities, updateNeighbourForOutputSignal, updateSkyBrightness
Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, removeData, serializeAttachments, setData
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.level.BlockAndTintGetter
canSeeSky, getBrightness, getLightEngine, getRawBrightness
Methods inherited from interface net.minecraft.world.level.BlockGetter
clip, clipWithInteractionOverride, getBlockEntity, getBlockFloorHeight, getBlockFloorHeight, getBlockState, getBlockStates, getFluidState, getLightEmission, getMaxLightLevel, isBlockInLine
Methods inherited from interface net.minecraft.world.level.CollisionGetter
collidesWithSuffocatingBlock, findFreePosition, findSupportingBlock, getBlockCollisions, getCollisions, getEntityCollisions, getWorldBorder, isUnobstructed, isUnobstructed, isUnobstructed, noBlockCollision, noCollision, noCollision, noCollision
Methods inherited from interface net.minecraft.world.level.CommonLevelAccessor
getBlockEntity, getEntityCollisions, getHeightmapPos, isUnobstructed
Methods inherited from interface net.minecraft.world.level.EntityGetter
getEntities, getEntities, getEntities, getEntitiesOfClass, getEntitiesOfClass, getNearbyEntities, getNearbyPlayers, getNearestEntity, getNearestEntity, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getNearestPlayer, getPlayerByUUID, hasNearbyAlivePlayer
Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockAndTintGetterExtension
getShade
Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockGetterExtension
getAuxLightManager, getAuxLightManager, getModelData
Methods inherited from interface net.neoforged.neoforge.common.extensions.ILevelExtension
getCapability, getCapability, getCapability, getCapability, getDescription, getDescriptionKey, getModelDataManager
Methods inherited from interface net.neoforged.neoforge.common.extensions.ILevelReaderExtension
holder, holderOrThrow, isAreaLoaded
Methods inherited from interface net.minecraft.world.level.LevelAccessor
addParticle, dayTime, gameEvent, gameEvent, gameEvent, gameEvent, getCurrentDifficultyAt, getDifficulty, getLevelData, getRandom, hasChunk, levelEvent, neighborShapeChanged, nextSubTickCount, playSound, playSound, scheduleTick, scheduleTick, scheduleTick, scheduleTick
Methods inherited from interface net.minecraft.world.level.LevelHeightAccessor
getMaxBuildHeight, getMaxSection, getMinSection, getSectionIndex, getSectionIndexFromSectionY, getSectionsCount, getSectionYFromSectionIndex, isOutsideBuildHeight, isOutsideBuildHeight
Methods inherited from interface net.minecraft.world.level.LevelReader
canSeeSkyFromBelowWater, containsAnyLiquid, dimensionType, getBiome, getBiomeManager, getBlockStatesIfLoaded, getBlockTint, getChunk, getChunk, getChunk, getChunk, getChunkForCollisions, getHeight, getHeight, getLightLevelDependentMagicValue, getMaxLocalRawBrightness, getMaxLocalRawBrightness, getMinBuildHeight, getNoiseBiome, getPathfindingCostFromLightLevels, getSeaLevel, getSkyDarken, hasChunkAt, hasChunkAt, hasChunksAt, hasChunksAt, hasChunksAt, holderLookup, isClientSide, isEmptyBlock, isWaterAt, registryAccess
Methods inherited from interface net.minecraft.world.level.LevelSimulatedReader
isFluidAtPosition, isStateAtPosition
Methods inherited from interface net.minecraft.world.level.LevelTimeAccess
getMoonBrightness, getMoonPhase, getTimeOfDay
Methods inherited from interface net.minecraft.world.level.LevelWriter
destroyBlock, destroyBlock, destroyBlock, removeBlock, setBlock, setBlock
Methods inherited from interface net.minecraft.world.level.ServerLevelAccessor
addFreshEntityWithPassengers
Methods inherited from interface net.minecraft.world.level.SignalGetter
getBestNeighborSignal, getControlInputSignal, getDirectSignal, getDirectSignalTo, getSignal, hasNeighborSignal, hasSignal
Methods 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
-
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:
getUncachedNoiseBiome
in interfaceLevelReader
-
structureManager
-
tick
Runs a single tick for the world -
shouldTickBlocksAt
public boolean shouldTickBlocksAt(long pChunkPos) - Overrides:
shouldTickBlocksAt
in classLevel
-
tickTime
protected void tickTime() -
setDayTime
public void setDayTime(long pTime) -
tickCustomSpawners
public void tickCustomSpawners(boolean pSpawnEnemies, boolean pSpawnFriendlies) -
shouldDiscardEntity
-
wakeUpAllPlayers
private void wakeUpAllPlayers() -
tickChunk
-
tickPrecipitation
-
findLightningRod
-
findLightningTargetAround
-
isHandlingTick
public boolean isHandlingTick() -
canSleepThroughNights
public boolean canSleepThroughNights() -
announceSleepStatus
private void announceSleepStatus() -
updateSleepingPlayerList
public void updateSleepingPlayerList() -
getScoreboard
- Specified by:
getScoreboard
in classLevel
-
advanceWeatherCycle
private void advanceWeatherCycle() -
resetWeatherCycle
public void resetWeatherCycle() -
resetEmptyTime
public void resetEmptyTime() -
tickFluid
-
tickBlock
-
tickNonPassenger
-
tickPassenger
-
mayInteract
- Overrides:
mayInteract
in classLevel
-
save
-
saveLevelData
private void saveLevelData() -
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:
addFreshEntity
in 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 passangers. They will only be summoned if all entities are unique and not already in queue to be summoned. -
unload
-
removePlayerImmediately
-
destroyBlockProgress
- Specified by:
destroyBlockProgress
in classLevel
-
playSeededSound
public void playSeededSound(@Nullable Player pPlayer, double pX, double pY, double pZ, Holder<SoundEvent> pSound, SoundSource pCategory, float pVolume, float pPitch, long pSeed) - Specified by:
playSeededSound
in classLevel
-
playSeededSound
public void playSeededSound(@Nullable Player pPlayer, Entity pEntity, Holder<SoundEvent> pSound, SoundSource pCategory, float pVolume, float pPitch, long pSeed) - Specified by:
playSeededSound
in classLevel
-
globalLevelEvent
- Overrides:
globalLevelEvent
in classLevel
-
levelEvent
- Specified by:
levelEvent
in interfaceLevelAccessor
-
getLogicalHeight
public int getLogicalHeight() -
gameEvent
- Specified by:
gameEvent
in interfaceLevelAccessor
-
sendBlockUpdated
Flags are as in setBlockState- Specified by:
sendBlockUpdated
in classLevel
-
updateNeighborsAt
- Overrides:
updateNeighborsAt
in classLevel
-
updateNeighborsAtExceptFromFacing
- Overrides:
updateNeighborsAtExceptFromFacing
in classLevel
-
neighborChanged
- Overrides:
neighborChanged
in classLevel
-
neighborChanged
public void neighborChanged(BlockState pState, BlockPos pPos, Block pBlock, BlockPos pFromPos, boolean pIsMoving) - Overrides:
neighborChanged
in classLevel
-
broadcastEntityEvent
Sends aClientboundEntityEventPacket
to all tracked players of that entity.- Overrides:
broadcastEntityEvent
in classLevel
-
broadcastDamageEvent
- Overrides:
broadcastDamageEvent
in classLevel
-
getChunkSource
- Specified by:
getChunkSource
in interfaceLevelAccessor
-
explode
public Explosion 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) -
blockEvent
- Overrides:
blockEvent
in classLevel
-
runBlockEvents
private void runBlockEvents() -
doBlockEvent
-
getBlockTicks
- Specified by:
getBlockTicks
in interfaceLevelAccessor
-
getFluidTicks
- Specified by:
getFluidTicks
in interfaceLevelAccessor
-
getServer
- Specified by:
getServer
in interfaceLevelAccessor
- Overrides:
getServer
in 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> boolean sendParticles(ServerPlayer pPlayer, T pType, boolean pLongDistance, double pPosX, double pPosY, double pPosZ, int pParticleCount, double pXOffset, double pYOffset, double pZOffset, double pSpeed) -
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. -
getEntity
-
findNearestMapStructure
-
findClosestBiome3d
-
getRecipeManager
- Specified by:
getRecipeManager
in classLevel
-
tickRateManager
- Specified by:
tickRateManager
in classLevel
-
noSave
public boolean noSave() -
getDataStorage
-
getMapData
- Specified by:
getMapData
in classLevel
-
setMapData
- Specified by:
setMapData
in classLevel
-
getFreeMapId
- Specified by:
getFreeMapId
in classLevel
-
setDefaultSpawnPos
-
getForcedChunks
public it.unimi.dsi.fastutil.longs.LongSet getForcedChunks() -
setChunkForced
public boolean setChunkForced(int pChunkX, int pChunkZ, boolean pAdd) -
players
- Specified by:
players
in interfaceEntityGetter
-
onBlockStateChange
- Overrides:
onBlockStateChange
in 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
-
blockUpdated
- Specified by:
blockUpdated
in interfaceLevelAccessor
-
getShade
- Specified by:
getShade
in interfaceBlockAndTintGetter
-
getAllEntities
-
toString
-
isFlat
public boolean isFlat() -
getSeed
public long getSeed()- Specified by:
getSeed
in interfaceWorldGenLevel
-
getDragonFight
-
getLevel
- Specified by:
getLevel
in interfaceServerLevelAccessor
-
getWatchdogStats
-
getTypeCount
-
getEntities
- Specified by:
getEntities
in classLevel
-
addLegacyChunkEntities
-
addWorldGenChunkEntities
-
startTickingChunk
-
onStructureStartsAvailable
-
getPathTypeCache
-
close
- Specified by:
close
in interfaceAutoCloseable
- Overrides:
close
in classLevel
- Throws:
IOException
-
gatherChunkSourceStats
- Specified by:
gatherChunkSourceStats
in classLevel
-
areEntitiesLoaded
public boolean areEntitiesLoaded(long pChunkPos) -
isPositionTickingWithEntitiesLoaded
private boolean isPositionTickingWithEntitiesLoaded(long p_184111_) -
isPositionEntityTicking
-
isNaturalSpawningAllowed
-
isNaturalSpawningAllowed
-
enabledFeatures
- Specified by:
enabledFeatures
in interfaceLevelReader
-
potionBrewing
- Specified by:
potionBrewing
in classLevel
-
getRandomSequence
-
getRandomSequences
-
fillReportDetails
Adds some basic stats of the world to the given crash report.- Overrides:
fillReportDetails
in classLevel
-
getPartEntities
Description copied from interface:ILevelExtension
All part entities in this world. Used when collecting entities in an AABB to fix parts being ignored whose parent entity is in a chunk that does not intersect with the AABB.- Specified by:
getPartEntities
in interfaceILevelExtension
-
invalidateCapabilities
Description copied from interface:ILevelExtension
Notify 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
ServerLevel
s, but it is safe to call on anyLevel
, without the need for aninstanceof
check.If you already have a block entity at that position, you can call
IBlockEntityExtension.invalidateCapabilities()
instead.- Specified by:
invalidateCapabilities
in interfaceILevelExtension
-
invalidateCapabilities
Description copied from interface:ILevelExtension
Notify 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
ServerLevel
s, but it is safe to call on anyLevel
, without the need for aninstanceof
check.- Specified by:
invalidateCapabilities
in 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:
setDayTimeFraction
in classLevel
-
getDayTimeFraction
@Internal public float getDayTimeFraction()- Specified by:
getDayTimeFraction
in 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:
getDayTimePerTick
in 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_DAY
clock 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:
setDayTimePerTick
in classLevel
-