Class SingleBlockFakeLevel
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.Level>
net.minecraft.world.level.Level
com.ldtteam.structurize.client.fakelevel.FakeLevel
com.ldtteam.structurize.client.fakelevel.SingleBlockFakeLevel
- All Implemented Interfaces:
AutoCloseable,net.minecraft.world.level.biome.BiomeManager.NoiseBiomeSource,net.minecraft.world.level.BlockAndTintGetter,net.minecraft.world.level.BlockGetter,net.minecraft.world.level.CollisionGetter,net.minecraft.world.level.CommonLevelAccessor,net.minecraft.world.level.EntityGetter,net.minecraft.world.level.LevelAccessor,net.minecraft.world.level.LevelHeightAccessor,net.minecraft.world.level.LevelReader,net.minecraft.world.level.LevelSimulatedReader,net.minecraft.world.level.LevelSimulatedRW,net.minecraft.world.level.LevelTimeAccess,net.minecraft.world.level.LevelWriter,net.minecraft.world.level.SignalGetter,net.minecraftforge.client.extensions.IForgeBlockAndTintGetter,net.minecraftforge.common.capabilities.ICapabilityProvider,net.minecraftforge.common.capabilities.ICapabilityProviderImpl<net.minecraft.world.level.Level>,net.minecraftforge.common.extensions.IForgeBlockGetter,net.minecraftforge.common.extensions.IForgeLevel
Simple implementation of
IFakeLevelBlockGetter mostly for usage in methods where Level is needed for virtual
BE/entities etc.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classNested classes/interfaces inherited from class net.minecraft.world.level.Level
net.minecraft.world.level.Level.ExplosionInteractionNested classes/interfaces inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
net.minecraftforge.common.capabilities.CapabilityProvider.AsField<B extends net.minecraftforge.common.capabilities.ICapabilityProviderImpl<B>> -
Field Summary
Fields inherited from class com.ldtteam.structurize.client.fakelevel.FakeLevel
blockEntities, chunkSource, levelEntityGetter, levelSource, lightEngine, lightProvider, overrideBeLevel, realLevel, scoreboard, worldPosFields 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 interface net.minecraft.world.level.SignalGetter
DIRECTIONS -
Constructor Summary
ConstructorsConstructorDescriptionSingleBlockFakeLevel(net.minecraft.world.level.Level realLevel) Creates simple fakeLevel instance -
Method Summary
Modifier and TypeMethodDescriptionvoidprepare(net.minecraft.world.level.block.state.BlockState blockState, @Nullable net.minecraft.world.level.block.entity.BlockEntity blockEntity, net.minecraft.world.level.Level realLevel) Do not forget to unset to prevent potential memory leaksvoidunset(@Nullable net.minecraft.world.level.block.entity.BlockEntity blockEntity) <T> TuseFakeLevelContext(net.minecraft.world.level.block.state.BlockState blockState, @Nullable net.minecraft.world.level.block.entity.BlockEntity blockEntity, net.minecraft.world.level.Level realLevel, Function<net.minecraft.world.level.Level, T> action) See related methods for more information.voidwithFakeLevelContext(net.minecraft.world.level.block.state.BlockState blockState, @Nullable net.minecraft.world.level.block.entity.BlockEntity blockEntity, net.minecraft.world.level.Level realLevel, Consumer<net.minecraft.world.level.Level> action) See related methods for more information.Methods inherited from class com.ldtteam.structurize.client.fakelevel.FakeLevel
addBlockEntityTicker, addFreshBlockEntities, blockEvent, clientLevel, close, damageSources, destroyBlock, destroyBlockProgress, dimension, dimensionType, dimensionTypeRegistration, enabledFeatures, explode, fillReportDetails, gameEvent, gatherChunkSourceStats, getBiome, getBiomeManager, getBlockEntity, getBlockState, getBlockTicks, getBrightness, getCapability, getChunk, getChunkSource, getEntities, getEntity, getExistingBlockEntity, getFluidState, getFluidTicks, getFreeMapId, getHeight, getHeight, getLightEngine, getMapData, getMinBuildHeight, getNoiseBiome, getProfiler, getProfilerSupplier, getRainLevel, getRawBrightness, getRecipeManager, getScoreboard, getSeaLevel, getShade, getSkyDarken, getThunderLevel, getUncachedNoiseBiome, getWorldBorder, getWorldPos, hasChunk, invalidateCaps, isDay, isInWorldBounds, isLoaded, isRainingAt, levelEvent, markAndNotifyBlock, mayInteract, neighborShapeChanged, noSave, players, playSeededSound, playSeededSound, realLevel, registryAccess, removeBlock, reviveCaps, sendBlockUpdated, setBlock, setBlockEntities, setEntities, setLevelSource, setMapData, setRainLevel, setRealLevel, setSpawnSettings, setThunderLevel, setWorldPos, shouldTickBlocksAt, shouldTickDeath, tickBlockEntities, updateNeighborsAt, updateSkyBrightnessMethods inherited from class net.minecraft.world.level.Level
addAlwaysVisibleParticle, addAlwaysVisibleParticle, addDestroyBlockEffect, addParticle, addParticle, blockEntityChanged, broadcastDamageEvent, broadcastEntityEvent, createFireworks, dimensionTypeId, disconnect, explode, explode, explode, explode, getBlockRandomPos, getChunk, getChunkAt, getChunkForCollisions, getCurrentDifficultyAt, getDayTime, getEntities, getEntities, getEntities, getEntities, getGameRules, getGameTime, getLevelData, getMaxEntityRadius, getRandom, getServer, getSharedSpawnAngle, getSharedSpawnPos, getSunAngle, globalLevelEvent, guardEntityTick, increaseMaxEntityRadius, isClientSide, isDebug, isFluidAtPosition, isInSpawnableBounds, isNight, isRaining, isStateAtPosition, isThundering, loadedAndEntityCanStandOn, loadedAndEntityCanStandOnFace, neighborChanged, neighborChanged, nextSubTickCount, onBlockStateChange, playLocalSound, playLocalSound, playSeededSound, playSound, playSound, playSound, playSound, prepareWeather, removeBlockEntity, sendPacketToServer, setBlock, setBlockAndUpdate, setBlockEntity, setBlocksDirty, setSkyFlashTime, shouldTickBlocksAt, updateNeighborsAtExceptFromFacing, updateNeighbourForOutputSignalMethods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, serializeCapsMethods 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
canSeeSkyMethods 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, 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, hasNearbyAlivePlayerMethods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapabilityMethods inherited from interface net.minecraftforge.client.extensions.IForgeBlockAndTintGetter
getShadeMethods inherited from interface net.minecraftforge.common.extensions.IForgeBlockGetter
getModelDataManagerMethods inherited from interface net.minecraftforge.common.extensions.IForgeLevel
getPartEntitiesMethods inherited from interface net.minecraft.world.level.LevelAccessor
blockUpdated, dayTime, gameEvent, gameEvent, gameEvent, getDifficulty, 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, getBlockStatesIfLoaded, getBlockTint, getChunk, getChunk, getLightLevelDependentMagicValue, getMaxLocalRawBrightness, getMaxLocalRawBrightness, getPathfindingCostFromLightLevels, hasChunkAt, hasChunkAt, hasChunksAt, hasChunksAt, hasChunksAt, holderLookup, isAreaLoaded, 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
-
Constructor Details
-
SingleBlockFakeLevel
public SingleBlockFakeLevel(net.minecraft.world.level.Level realLevel) Creates simple fakeLevel instance- Parameters:
realLevel- actual valid vanilla instance to provide eg. registries
-
-
Method Details
-
getLevelSource
- Overrides:
getLevelSourcein classFakeLevel- Returns:
- current data source
-
prepare
public void prepare(net.minecraft.world.level.block.state.BlockState blockState, @Nullable @Nullable net.minecraft.world.level.block.entity.BlockEntity blockEntity, net.minecraft.world.level.Level realLevel) Do not forget to unset to prevent potential memory leaks- Parameters:
blockState- related to blockEntityblockEntity- related to blockStaterealLevel- actual valid vanilla instance to provide eg. registries- See Also:
-
#unset(FakeLevel, BlockEntity)FakeLevel#setEntities(Collection) if you want to add entities, do not forget to reset
-
unset
public void unset(@Nullable @Nullable net.minecraft.world.level.block.entity.BlockEntity blockEntity) - Parameters:
blockEntity- to unlink level if needed- See Also:
-
#prepare(FakeLevel, BlockState, BlockEntity, Level)
-
withFakeLevelContext
public void withFakeLevelContext(net.minecraft.world.level.block.state.BlockState blockState, @Nullable @Nullable net.minecraft.world.level.block.entity.BlockEntity blockEntity, net.minecraft.world.level.Level realLevel, Consumer<net.minecraft.world.level.Level> action) See related methods for more information.- Parameters:
blockState- related to blockEntityblockEntity- related to blockStaterealLevel- actual valid vanilla instance to provide eg. registriesaction- context action- See Also:
-
#prepare(FakeLevel, BlockState, BlockEntity, Level)#unset(FakeLevel, BlockEntity)
-
useFakeLevelContext
public <T> T useFakeLevelContext(net.minecraft.world.level.block.state.BlockState blockState, @Nullable @Nullable net.minecraft.world.level.block.entity.BlockEntity blockEntity, net.minecraft.world.level.Level realLevel, Function<net.minecraft.world.level.Level, T> action) See related methods for more information.- Parameters:
blockState- related to blockEntityblockEntity- related to blockStaterealLevel- actual valid vanilla instance to provide eg. registriesaction- context action- See Also:
-
#prepare(FakeLevel, BlockState, BlockEntity, Level)#unset(FakeLevel, BlockEntity)
-