Class Level

java.lang.Object
cn.nukkit.level.Level
All Implemented Interfaces:
ChunkManager, Metadatable

public class Level extends Object implements ChunkManager, Metadatable
Author:
MagicDroidX (Nukkit Project)
  • Field Details

    • EMPTY_ARRAY

      @PowerNukkitOnly @Since("1.4.0.0-PN") public static final Level[] EMPTY_ARRAY
    • BLOCK_UPDATE_NORMAL

      public static final int BLOCK_UPDATE_NORMAL
      See Also:
    • BLOCK_UPDATE_RANDOM

      public static final int BLOCK_UPDATE_RANDOM
      See Also:
    • BLOCK_UPDATE_SCHEDULED

      public static final int BLOCK_UPDATE_SCHEDULED
      See Also:
    • BLOCK_UPDATE_WEAK

      public static final int BLOCK_UPDATE_WEAK
      See Also:
    • BLOCK_UPDATE_TOUCH

      public static final int BLOCK_UPDATE_TOUCH
      See Also:
    • BLOCK_UPDATE_REDSTONE

      public static final int BLOCK_UPDATE_REDSTONE
      See Also:
    • BLOCK_UPDATE_TICK

      public static final int BLOCK_UPDATE_TICK
      See Also:
    • BLOCK_UPDATE_MOVED

      @PowerNukkitOnly @Since("1.4.0.0-PN") public static final int BLOCK_UPDATE_MOVED
    • TIME_DAY

      public static final int TIME_DAY
      See Also:
    • TIME_NOON

      public static final int TIME_NOON
      See Also:
    • TIME_SUNSET

      public static final int TIME_SUNSET
      See Also:
    • TIME_NIGHT

      public static final int TIME_NIGHT
      See Also:
    • TIME_MIDNIGHT

      public static final int TIME_MIDNIGHT
      See Also:
    • TIME_SUNRISE

      public static final int TIME_SUNRISE
      See Also:
    • TIME_FULL

      public static final int TIME_FULL
      See Also:
    • DIMENSION_OVERWORLD

      public static final int DIMENSION_OVERWORLD
      See Also:
    • DIMENSION_NETHER

      public static final int DIMENSION_NETHER
      See Also:
    • DIMENSION_THE_END

      public static final int DIMENSION_THE_END
      See Also:
    • MAX_BLOCK_CACHE

      public static final int MAX_BLOCK_CACHE
      See Also:
    • COMPRESSION_LEVEL

      public static int COMPRESSION_LEVEL
    • updateEntities

      public final it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<Entity> updateEntities
    • stopTime

      public boolean stopTime
    • skyLightSubtracted

      public float skyLightSubtracted
    • sleepTicks

      public int sleepTicks
    • timings

      public LevelTimings timings
    • tickRateTime

      public int tickRateTime
    • tickRateCounter

      public int tickRateCounter
    • tickRateOptDelay

      public int tickRateOptDelay
      当tps过低的时候,tps优化延迟会上升,计算密集型任务应当每隔此tick才运行一次
    • gameRules

      public GameRules gameRules
  • Constructor Details

  • Method Details

    • canRandomTick

      @PowerNukkitOnly @Since("1.4.0.0-PN") public static boolean canRandomTick(int blockId)
    • setCanRandomTick

      @PowerNukkitOnly @Since("1.4.0.0-PN") public static void setCanRandomTick(int blockId, boolean newValue)
    • chunkHash

      public static long chunkHash(int x, int z)
    • blockHash

      @Deprecated(since="1.6.0.0-PNX") @Since("1.6.0.0-PNX") public static long blockHash(int x, int y, int z)
      Deprecated.
    • blockHash

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public static long blockHash(int x, int y, int z, Level level)
    • localBlockHash

      public static int localBlockHash(double x, double y, double z, Level level)
    • localBlockHash

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public static int localBlockHash(int x, int y, int z, int layer, Level level)
    • getBlockXYZ

      public static Vector3 getBlockXYZ(long chunkHash, int blockHash, Level level)
    • chunkBlockHash

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public static int chunkBlockHash(int x, int y, int z)
    • getHashX

      public static int getHashX(long hash)
    • getHashZ

      public static int getHashZ(long hash)
    • getBlockXYZ

      public static Vector3 getBlockXYZ(BlockVector3 hash)
    • getChunkXZ

      public static Chunk.Entry getChunkXZ(long hash)
    • generateChunkLoaderId

      public static int generateChunkLoaderId(ChunkLoader loader)
    • addAntiXrayTransparentBlock

      @PowerNukkitXOnly @Since("1.19.21-r1") public static void addAntiXrayTransparentBlock(@NotNull Block block)
    • getRawTransparentBlockRuntimeIds

      @PowerNukkitXOnly @Since("1.19.21-r1") public static it.unimi.dsi.fastutil.ints.IntSet getRawTransparentBlockRuntimeIds()
    • getTickRate

      public int getTickRate()
    • setTickRate

      public void setTickRate(int tickRate)
    • getTickRateTime

      public int getTickRateTime()
    • recalcTickOptDelay

      public int recalcTickOptDelay()
    • isAntiXrayEnabled

      @PowerNukkitXOnly @Since("1.19.21-r1") public boolean isAntiXrayEnabled()
    • setAntiXrayEnabled

      @PowerNukkitXOnly @Since("1.19.21-r1") public void setAntiXrayEnabled(boolean antiXrayEnabled)
    • getFakeOreDenominator

      @PowerNukkitXOnly @Since("1.19.21-r1") public int getFakeOreDenominator()
    • setFakeOreDenominator

      @PowerNukkitXOnly @Since("1.19.21-r1") public void setFakeOreDenominator(int fakeOreDenominator)
    • isPreDeObfuscate

      @PowerNukkitXOnly @Since("1.19.21-r1") public boolean isPreDeObfuscate()
    • setPreDeObfuscate

      @PowerNukkitXOnly @Since("1.19.21-r1") public void setPreDeObfuscate(boolean preDeObfuscate)
    • addAntiXrayOreBlock

      @PowerNukkitXOnly @Since("1.19.21-r1") public void addAntiXrayOreBlock(@NotNull Block oreBlock, @NotNull Block replaceWith)
    • removeAntiXrayOreBlock

      @PowerNukkitXOnly @Since("1.19.21-r1") public void removeAntiXrayOreBlock(@NotNull Block oreBlock, @NotNull Block replaceWith)
    • getRawRealOreToReplacedRuntimeIdMap

      @PowerNukkitXInternal @PowerNukkitXOnly @Since("1.19.21-r1") public it.unimi.dsi.fastutil.ints.Int2IntMap getRawRealOreToReplacedRuntimeIdMap()
    • addAntiXrayFakeBlock

      @PowerNukkitXOnly @Since("1.19.21-r1") public void addAntiXrayFakeBlock(@NotNull Block originBlock, @NotNull Collection<Block> fakeBlocks)
    • removeAntiXrayFakeBlock

      @PowerNukkitXOnly @Since("1.19.21-r1") public void removeAntiXrayFakeBlock(@NotNull Block originBlock, @NotNull Collection<Block> fakeBlocks)
    • getRawFakeOreToPutRuntimeIdMap

      @PowerNukkitXInternal @PowerNukkitXOnly @Since("1.19.21-r1") public it.unimi.dsi.fastutil.ints.Int2ObjectMap<it.unimi.dsi.fastutil.ints.IntList> getRawFakeOreToPutRuntimeIdMap()
    • reinitAntiXray

      @PowerNukkitXOnly @Since("1.19.21-r1") public void reinitAntiXray(boolean global)
    • isHighLightChunk

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public boolean isHighLightChunk(int chunkX, int chunkZ)
    • initLevel

      @PowerNukkitXOnly @Since("1.19.20-r3") public void initLevel()
    • initLevel

      @PowerNukkitXDifference(since="1.19.20-r3") public void initLevel(@Nullable DimensionData givenDimensionData)
    • getGenerator

      public Generator getGenerator()
    • getBlockMetadata

      public BlockMetadataStore getBlockMetadata()
    • getServer

      public Server getServer()
    • getProvider

      public final LevelProvider getProvider()
    • requireProvider

      @PowerNukkitOnly @Since("1.4.0.0-PN") @Nonnull public final LevelProvider requireProvider()
      Returns the level provider if it exists. Tries to close and unregister the level and then throw an exception if it doesn't.
      Throws:
      LevelException - If the level is already closed
    • getId

      public final int getId()
    • close

      public void close()
    • addSound

      public void addSound(Vector3 pos, Sound sound)
    • addSound

      public void addSound(Vector3 pos, Sound sound, float volume, float pitch)
    • addSound

      public void addSound(Vector3 pos, Sound sound, float volume, float pitch, Collection<Player> players)
    • addSound

      public void addSound(Vector3 pos, Sound sound, float volume, float pitch, Player... players)
    • addLevelEvent

      @PowerNukkitOnly public void addLevelEvent(int type, int data)
    • addLevelEvent

      @PowerNukkitOnly public void addLevelEvent(int type, int data, Vector3 pos)
    • addLevelEvent

      @PowerNukkitOnly public void addLevelEvent(int type, int data, float x, float y, float z)
    • addLevelEvent

      public void addLevelEvent(Vector3 pos, int event)
    • addLevelEvent

      @Since("1.4.0.0-PN") public void addLevelEvent(Vector3 pos, int event, int data)
    • addLevelSoundEvent

      @PowerNukkitDifference(info="Default sound method changed to addSound", since="1.4.0.0-PN") @Deprecated @DeprecationDetails(reason="Old method, use addSound(pos, Sound.<SOUND_VALUE>).", since="1.4.0.0-PN") public void addLevelSoundEvent(Vector3 pos, int type, int data, int entityType)
      Deprecated.
    • addLevelSoundEvent

      @PowerNukkitDifference(info="Default sound method changed to addSound", since="1.4.0.0-PN") @Deprecated @DeprecationDetails(reason="Old method, use addSound(pos, Sound.<SOUND_VALUE>).", since="1.4.0.0-PN") public void addLevelSoundEvent(Vector3 pos, int type, int data, int entityType, boolean isBaby, boolean isGlobal)
      Deprecated.
    • addLevelSoundEvent

      @PowerNukkitDifference(info="Default sound method changed to addSound", since="1.4.0.0-PN") @Deprecated @DeprecationDetails(reason="Old method, use addSound(pos, Sound.<SOUND_VALUE>).", since="1.4.0.0-PN") public void addLevelSoundEvent(Vector3 pos, int type)
      Deprecated.
    • addLevelSoundEvent

      @PowerNukkitDifference(info="Default sound method changed to addSound", since="1.4.0.0-PN") @Deprecated @DeprecationDetails(reason="Old method, use addSound(pos, Sound.<SOUND_VALUE>).", since="1.4.0.0-PN") public void addLevelSoundEvent(Vector3 pos, int type, int data)
      Deprecated.
      Broadcasts sound to players
      Parameters:
      pos - position where sound should be played
      type - ID of the sound from LevelSoundEventPacket
      data - generic data that can affect sound
    • addLevelSoundEvent

      @PowerNukkitDifference(info="Default sound method changed to addSound", since="1.4.0.0-PN") @Deprecated @DeprecationDetails(reason="Old method, use addSound(pos, Sound.<SOUND_VALUE>).", since="1.4.0.0-PN") public void addLevelSoundEvent(Vector3 pos, int type, int data, String identifier, boolean isBaby, boolean isGlobal)
      Deprecated.
    • addParticle

      public void addParticle(Particle particle)
    • addParticle

      public void addParticle(Particle particle, Player player)
    • addParticle

      public void addParticle(Particle particle, Player[] players)
    • addParticle

      public void addParticle(Particle particle, Collection<Player> players)
    • addParticleEffect

      public void addParticleEffect(Vector3 pos, ParticleEffect particleEffect)
    • addParticleEffect

      public void addParticleEffect(Vector3 pos, ParticleEffect particleEffect, long uniqueEntityId)
    • addParticleEffect

      public void addParticleEffect(Vector3 pos, ParticleEffect particleEffect, long uniqueEntityId, int dimensionId)
    • addParticleEffect

      public void addParticleEffect(Vector3 pos, ParticleEffect particleEffect, long uniqueEntityId, int dimensionId, Collection<Player> players)
    • addParticleEffect

      public void addParticleEffect(Vector3 pos, ParticleEffect particleEffect, long uniqueEntityId, int dimensionId, Player... players)
    • addParticleEffect

      public void addParticleEffect(Vector3f pos, String identifier, long uniqueEntityId, int dimensionId, Player... players)
    • getAutoSave

      public boolean getAutoSave()
    • setAutoSave

      public void setAutoSave(boolean autoSave)
    • unload

      public boolean unload()
    • unload

      public boolean unload(boolean force)
    • getChunkPlayers

      public Map<Integer,Player> getChunkPlayers(int chunkX, int chunkZ)
    • getChunkLoaders

      public ChunkLoader[] getChunkLoaders(int chunkX, int chunkZ)
    • addChunkPacket

      public void addChunkPacket(int chunkX, int chunkZ, DataPacket packet)
    • registerChunkLoader

      public void registerChunkLoader(ChunkLoader loader, int chunkX, int chunkZ)
    • registerChunkLoader

      public void registerChunkLoader(ChunkLoader loader, int chunkX, int chunkZ, boolean autoLoad)
    • unregisterChunkLoader

      public void unregisterChunkLoader(ChunkLoader loader, int chunkX, int chunkZ)
    • checkTime

      public void checkTime()
    • sendTime

      public void sendTime(Player... players)
    • sendTime

      public void sendTime()
    • getGameRules

      public GameRules getGameRules()
    • releaseTickCachedBlocks

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public void releaseTickCachedBlocks()
    • doTick

      public void doTick(int currentTick)
    • adjustPosToNearbyEntity

      public Vector3 adjustPosToNearbyEntity(Vector3 pos)
    • checkSleep

      public void checkSleep()
    • sendBlockExtraData

      public void sendBlockExtraData(int x, int y, int z, int id, int data)
    • sendBlockExtraData

      public void sendBlockExtraData(int x, int y, int z, int id, int data, Collection<Player> players)
    • sendBlockExtraData

      public void sendBlockExtraData(int x, int y, int z, int id, int data, Player[] players)
    • sendBlocks

      public void sendBlocks(Player[] target, Vector3[] blocks)
    • sendBlocks

      public void sendBlocks(Player[] target, Vector3[] blocks, int flags)
    • sendBlocks

      public void sendBlocks(Player[] target, Vector3[] blocks, int flags, boolean optimizeRebuilds)
    • sendBlocks

      public void sendBlocks(Player[] target, Vector3[] blocks, int flags, int dataLayer)
    • sendBlocks

      public void sendBlocks(Player[] target, Vector3[] blocks, int flags, int dataLayer, boolean optimizeRebuilds)
    • save

      public boolean save()
    • save

      public boolean save(boolean force)
    • saveChunks

      public void saveChunks()
    • updateAroundRedstone

      @Deprecated @DeprecationDetails(reason="Was moved to RedstoneComponent", since="1.4.0.0-PN", replaceWith="RedstoneComponent#updateAroundRedstone", by="PowerNukkit") public void updateAroundRedstone(Vector3 pos, BlockFace face)
      Deprecated.
    • updateComparatorOutputLevel

      public void updateComparatorOutputLevel(Vector3 v)
    • updateComparatorOutputLevelSelective

      @PowerNukkitOnly @Since("1.4.0.0-PN") public void updateComparatorOutputLevelSelective(Vector3 v, boolean observer)
    • updateAround

      public void updateAround(Vector3 pos)
    • updateAround

      public void updateAround(int x, int y, int z)
    • scheduleUpdate

      public void scheduleUpdate(Block pos, int delay)
    • scheduleUpdate

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public void scheduleUpdate(Block pos, int delay, boolean checkBlockWhenUpdate)
    • scheduleUpdate

      public void scheduleUpdate(Block block, Vector3 pos, int delay)
    • scheduleUpdate

      public void scheduleUpdate(Block block, Vector3 pos, int delay, int priority)
    • scheduleUpdate

      public void scheduleUpdate(Block block, Vector3 pos, int delay, int priority, boolean checkArea)
    • scheduleUpdate

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public void scheduleUpdate(Block block, Vector3 pos, int delay, int priority, boolean checkArea, boolean checkBlockWhenUpdate)
    • cancelSheduledUpdate

      public boolean cancelSheduledUpdate(Vector3 pos, Block block)
    • isUpdateScheduled

      public boolean isUpdateScheduled(Vector3 pos, Block block)
    • isBlockTickPending

      public boolean isBlockTickPending(Vector3 pos, Block block)
    • getPendingBlockUpdates

      public Set<BlockUpdateEntry> getPendingBlockUpdates(FullChunk chunk)
    • getPendingBlockUpdates

      public Set<BlockUpdateEntry> getPendingBlockUpdates(AxisAlignedBB boundingBox)
    • scanBlocks

      @PowerNukkitOnly @Since("1.4.0.0-PN") public List<Block> scanBlocks(@Nonnull AxisAlignedBB bb, @Nonnull BiPredicate<BlockVector3,BlockState> condition)
    • getCollisionBlocks

      public Block[] getCollisionBlocks(AxisAlignedBB bb)
    • getCollisionBlocks

      public Block[] getCollisionBlocks(AxisAlignedBB bb, boolean targetFirst)
    • getCollisionBlocks

      @PowerNukkitOnly public Block[] getCollisionBlocks(AxisAlignedBB bb, boolean targetFirst, boolean ignoreCollidesCheck)
    • getCollisionBlocks

      @PowerNukkitOnly public Block[] getCollisionBlocks(AxisAlignedBB bb, boolean targetFirst, boolean ignoreCollidesCheck, Predicate<Block> condition)
    • isFullBlock

      public boolean isFullBlock(Vector3 pos)
    • getTickCachedCollisionBlocks

      @PowerNukkitXOnly @Since("1.19.21-r3") public Block[] getTickCachedCollisionBlocks(AxisAlignedBB bb)
    • getTickCachedCollisionBlocks

      @PowerNukkitXOnly @Since("1.19.21-r3") public Block[] getTickCachedCollisionBlocks(AxisAlignedBB bb, boolean targetFirst)
    • getTickCachedCollisionBlocks

      @PowerNukkitXOnly @Since("1.19.21-r3") public Block[] getTickCachedCollisionBlocks(AxisAlignedBB bb, boolean targetFirst, boolean ignoreCollidesCheck)
    • getTickCachedCollisionBlocks

      @PowerNukkitXOnly @Since("1.19.21-r3") public Block[] getTickCachedCollisionBlocks(AxisAlignedBB bb, boolean targetFirst, boolean ignoreCollidesCheck, Predicate<Block> condition)
    • getCollisionCubes

      public AxisAlignedBB[] getCollisionCubes(Entity entity, AxisAlignedBB bb)
    • getCollisionCubes

      public AxisAlignedBB[] getCollisionCubes(Entity entity, AxisAlignedBB bb, boolean entities)
    • getCollisionCubes

      public AxisAlignedBB[] getCollisionCubes(Entity entity, AxisAlignedBB bb, boolean entities, boolean solidEntities)
    • fastCollisionCubes

      public List<AxisAlignedBB> fastCollisionCubes(Entity entity, AxisAlignedBB bb)
    • fastCollisionCubes

      public List<AxisAlignedBB> fastCollisionCubes(Entity entity, AxisAlignedBB bb, boolean entities)
    • fastCollisionCubes

      public List<AxisAlignedBB> fastCollisionCubes(Entity entity, AxisAlignedBB bb, boolean entities, boolean solidEntities)
    • hasCollision

      @PowerNukkitDifference(since="1.4.0.0-PN", info="Rounds the AABB to have precision 4 before checking for collision, fix PowerNukkit#506") public boolean hasCollision(Entity entity, AxisAlignedBB bb, boolean entities)
    • getFullLight

      public int getFullLight(Vector3 pos)
    • calculateSkylightSubtracted

      @PowerNukkitXDifference(since="1.19.20-r3") public int calculateSkylightSubtracted(float tickDiff)
    • getRainStrength

      @PowerNukkitOnly public float getRainStrength(float tickDiff)
    • getThunderStrength

      @PowerNukkitOnly public float getThunderStrength(float tickDiff)
    • getCelestialAngle

      @PowerNukkitOnly public float getCelestialAngle(float tickDiff)
    • calculateCelestialAngle

      public float calculateCelestialAngle(int time, float tickDiff)
    • getMoonPhase

      public int getMoonPhase(long worldTime)
    • getFullBlock

      @Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.3.0.0-PN") public int getFullBlock(int x, int y, int z)
      Deprecated.
    • getFullBlock

      @Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.3.0.0-PN") @PowerNukkitOnly public int getFullBlock(int x, int y, int z, int layer)
      Deprecated.
    • getBlockRuntimeId

      @PowerNukkitOnly @Since("1.3.0.0-PN") public int getBlockRuntimeId(int x, int y, int z)
    • getBlockRuntimeId

      @PowerNukkitOnly @Since("1.3.0.0-PN") public int getBlockRuntimeId(int x, int y, int z, int layer)
    • getBlockAround

      @PowerNukkitXDifference(since="1.19.20-r3", info="Allow parallel gets.") public Set<Block> getBlockAround(Vector3 pos)
    • getTickCachedBlock

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public Block getTickCachedBlock(Vector3 pos)
    • getTickCachedBlock

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public Block getTickCachedBlock(Vector3 pos, int layer)
    • getTickCachedBlock

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public Block getTickCachedBlock(Vector3 pos, boolean load)
    • getTickCachedBlock

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public Block getTickCachedBlock(Vector3 pos, int layer, boolean load)
    • getTickCachedBlock

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public Block getTickCachedBlock(int x, int y, int z)
    • getTickCachedBlock

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public Block getTickCachedBlock(int x, int y, int z, int layer)
    • getTickCachedBlock

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public Block getTickCachedBlock(int x, int y, int z, boolean load)
    • getTickCachedBlock

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public Block getTickCachedBlock(int x, int y, int z, int layer, boolean load)
    • getBlock

      public Block getBlock(Vector3 pos)
    • getBlock

      @PowerNukkitOnly public Block getBlock(Vector3 pos, int layer)
    • getBlock

      public Block getBlock(Vector3 pos, boolean load)
    • getBlock

      @PowerNukkitOnly public Block getBlock(Vector3 pos, int layer, boolean load)
    • getBlock

      public Block getBlock(int x, int y, int z)
    • getBlock

      @PowerNukkitOnly public Block getBlock(int x, int y, int z, int layer)
    • getBlock

      public Block getBlock(int x, int y, int z, boolean load)
    • getBlock

      @PowerNukkitOnly public Block getBlock(int x, int y, int z, int layer, boolean load)
    • updateAllLight

      public void updateAllLight(Vector3 pos)
    • updateBlockSkyLight

      public void updateBlockSkyLight(int x, int y, int z)
    • getHighestAdjacentBlockSkyLight

      @PowerNukkitOnly public int getHighestAdjacentBlockSkyLight(int x, int y, int z)
      Returns the highest block skylight level available in the positions adjacent to the specified block coordinates.
    • updateBlockLight

      public void updateBlockLight(Map<Long,Map<Integer,Object>> map)
    • addLightUpdate

      public void addLightUpdate(int x, int y, int z)
    • setBlockFullIdAt

      @Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.4.0.0-PN") public void setBlockFullIdAt(int x, int y, int z, int fullId)
      Deprecated.
      Specified by:
      setBlockFullIdAt in interface ChunkManager
    • setBlockFullIdAt

      @Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.4.0.0-PN") @PowerNukkitOnly public void setBlockFullIdAt(int x, int y, int z, int layer, int fullId)
      Deprecated.
      Specified by:
      setBlockFullIdAt in interface ChunkManager
    • setBlock

      public boolean setBlock(Vector3 pos, Block block)
    • setBlock

      @PowerNukkitOnly public boolean setBlock(Vector3 pos, int layer, Block block)
    • setBlock

      public boolean setBlock(Vector3 pos, Block block, boolean direct)
    • setBlock

      @PowerNukkitOnly public boolean setBlock(Vector3 pos, int layer, Block block, boolean direct)
    • setBlock

      public boolean setBlock(Vector3 pos, Block block, boolean direct, boolean update)
    • setBlock

      @PowerNukkitOnly public boolean setBlock(Vector3 pos, int layer, Block block, boolean direct, boolean update)
    • setBlock

      public boolean setBlock(int x, int y, int z, Block block, boolean direct, boolean update)
    • setBlock

      @PowerNukkitOnly public boolean setBlock(int x, int y, int z, int layer, Block block, boolean direct, boolean update)
    • dropItem

      public void dropItem(Vector3 source, Item item)
    • dropItem

      public void dropItem(Vector3 source, Item item, Vector3 motion)
    • dropItem

      public void dropItem(Vector3 source, Item item, Vector3 motion, int delay)
    • dropItem

      public void dropItem(Vector3 source, Item item, Vector3 motion, boolean dropAround, int delay)
    • dropAndGetItem

      @Since("1.4.0.0-PN") @Nullable public EntityItem dropAndGetItem(@Nonnull Vector3 source, @Nonnull Item item)
    • dropAndGetItem

      @Since("1.4.0.0-PN") @Nullable public EntityItem dropAndGetItem(@Nonnull Vector3 source, @Nonnull Item item, @Nullable Vector3 motion)
    • dropAndGetItem

      @Since("1.4.0.0-PN") @Nullable public EntityItem dropAndGetItem(@Nonnull Vector3 source, @Nonnull Item item, @Nullable Vector3 motion, int delay)
    • dropAndGetItem

      @Since("1.4.0.0-PN") @Nullable public EntityItem dropAndGetItem(@Nonnull Vector3 source, @Nonnull Item item, @Nullable Vector3 motion, boolean dropAround, int delay)
    • useBreakOn

      public Item useBreakOn(Vector3 vector)
    • useBreakOn

      public Item useBreakOn(Vector3 vector, Item item)
    • useBreakOn

      public Item useBreakOn(Vector3 vector, Item item, Player player)
    • useBreakOn

      public Item useBreakOn(Vector3 vector, Item item, Player player, boolean createParticles)
    • useBreakOn

      public Item useBreakOn(Vector3 vector, BlockFace face, Item item, Player player, boolean createParticles)
    • useBreakOn

      @PowerNukkitOnly public Item useBreakOn(Vector3 vector, BlockFace face, Item item, Player player, boolean createParticles, boolean setBlockDestroy)
    • useBreakOn

      @PowerNukkitOnly public Item useBreakOn(Vector3 vector, int layer, BlockFace face, Item item, Player player, boolean createParticles, boolean setBlockDestroy)
    • dropExpOrb

      public void dropExpOrb(Vector3 source, int exp)
    • dropExpOrb

      public void dropExpOrb(Vector3 source, int exp, Vector3 motion)
    • dropExpOrb

      public void dropExpOrb(Vector3 source, int exp, Vector3 motion, int delay)
    • dropExpOrbAndGetEntities

      @PowerNukkitOnly @Since("1.4.0.0-PN") public List<EntityXPOrb> dropExpOrbAndGetEntities(Vector3 source, int exp)
    • dropExpOrbAndGetEntities

      @PowerNukkitOnly @Since("1.4.0.0-PN") public List<EntityXPOrb> dropExpOrbAndGetEntities(Vector3 source, int exp, Vector3 motion)
    • dropExpOrbAndGetEntities

      @PowerNukkitOnly @Since("1.4.0.0-PN") public List<EntityXPOrb> dropExpOrbAndGetEntities(Vector3 source, int exp, Vector3 motion, int delay)
    • useItemOn

      public Item useItemOn(Vector3 vector, Item item, BlockFace face, float fx, float fy, float fz)
    • useItemOn

      public Item useItemOn(Vector3 vector, Item item, BlockFace face, float fx, float fy, float fz, Player player)
    • useItemOn

      @PowerNukkitXDifference(info="Fixed issue#790", since="1.19.50-r1") @PowerNukkitDifference(info="PowerNukkit#403",since="1.3.1.2-PN") @PowerNukkitDifference(info="Fixed PowerNukkit#716, block stops placing when towering up",since="1.4.0.0-PN") public Item useItemOn(Vector3 vector, Item item, BlockFace face, float fx, float fy, float fz, Player player, boolean playSound)
    • isInSpawnRadius

      public boolean isInSpawnRadius(Vector3 vector3)
    • getEntity

      public Entity getEntity(long entityId)
    • getEntities

      public Entity[] getEntities()
    • getCollidingEntities

      public Entity[] getCollidingEntities(AxisAlignedBB bb)
    • getCollidingEntities

      public Entity[] getCollidingEntities(AxisAlignedBB bb, Entity entity)
    • fastCollidingEntities

      public List<Entity> fastCollidingEntities(AxisAlignedBB bb)
    • fastCollidingEntities

      public List<Entity> fastCollidingEntities(AxisAlignedBB bb, Entity entity)
    • streamCollidingEntities

      public Stream<Entity> streamCollidingEntities(AxisAlignedBB bb, Entity entity)
    • getNearbyEntities

      public Entity[] getNearbyEntities(AxisAlignedBB bb)
    • getNearbyEntities

      public Entity[] getNearbyEntities(AxisAlignedBB bb, Entity entity)
    • getNearbyEntities

      public Entity[] getNearbyEntities(AxisAlignedBB bb, Entity entity, boolean loadChunks)
    • fastNearbyEntities

      public List<Entity> fastNearbyEntities(AxisAlignedBB bb)
    • fastNearbyEntities

      public List<Entity> fastNearbyEntities(AxisAlignedBB bb, Entity entity)
    • fastNearbyEntities

      public List<Entity> fastNearbyEntities(AxisAlignedBB bb, Entity entity, boolean loadChunks)
    • getBlockEntities

      public Map<Long,BlockEntity> getBlockEntities()
    • getBlockEntityById

      public BlockEntity getBlockEntityById(long blockEntityId)
    • getPlayers

      public Map<Long,Player> getPlayers()
    • getLoaders

      public Map<Integer,ChunkLoader> getLoaders()
    • getBlockEntity

      public BlockEntity getBlockEntity(Vector3 pos)
    • getBlockEntity

      @PowerNukkitOnly public BlockEntity getBlockEntity(BlockVector3 pos)
    • getBlockEntityIfLoaded

      public BlockEntity getBlockEntityIfLoaded(Vector3 pos)
    • getChunkEntities

      public Map<Long,Entity> getChunkEntities(int X, int Z)
    • getChunkEntities

      public Map<Long,Entity> getChunkEntities(int X, int Z, boolean loadChunks)
    • getChunkBlockEntities

      public Map<Long,BlockEntity> getChunkBlockEntities(int X, int Z)
    • getBlockStateAt

      @PowerNukkitOnly public BlockState getBlockStateAt(int x, int y, int z, int layer)
      Specified by:
      getBlockStateAt in interface ChunkManager
    • getBlockIdAt

      public int getBlockIdAt(int x, int y, int z)
      Specified by:
      getBlockIdAt in interface ChunkManager
    • getBlockIdAt

      @PowerNukkitOnly public int getBlockIdAt(int x, int y, int z, int layer)
      Specified by:
      getBlockIdAt in interface ChunkManager
    • setBlockIdAt

      public void setBlockIdAt(int x, int y, int z, int id)
      Specified by:
      setBlockIdAt in interface ChunkManager
    • setBlockIdAt

      @PowerNukkitOnly public void setBlockIdAt(int x, int y, int z, int layer, int id)
      Specified by:
      setBlockIdAt in interface ChunkManager
    • setBlockAt

      @Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.4.0.0-PN") public void setBlockAt(int x, int y, int z, int id, int data)
      Deprecated.
      Specified by:
      setBlockAt in interface ChunkManager
    • setBlockAtLayer

      @Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.4.0.0-PN") @PowerNukkitOnly public boolean setBlockAtLayer(int x, int y, int z, int layer, int id, int data)
      Deprecated.
      Specified by:
      setBlockAtLayer in interface ChunkManager
    • setBlockStateAt

      @PowerNukkitOnly @Since("1.4.0.0-PN") public boolean setBlockStateAt(int x, int y, int z, int layer, BlockState state)
      Specified by:
      setBlockStateAt in interface ChunkManager
    • getBlockDataAt

      @Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.4.0.0-PN") public int getBlockDataAt(int x, int y, int z)
      Deprecated.
      Specified by:
      getBlockDataAt in interface ChunkManager
    • getBlockExtraDataAt

      public int getBlockExtraDataAt(int x, int y, int z)
    • setBlockExtraDataAt

      public void setBlockExtraDataAt(int x, int y, int z, int id, int data)
    • getBlockDataAt

      @Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.4.0.0-PN") @PowerNukkitOnly public int getBlockDataAt(int x, int y, int z, int layer)
      Deprecated.
      Specified by:
      getBlockDataAt in interface ChunkManager
    • setBlockDataAt

      @Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.4.0.0-PN") public void setBlockDataAt(int x, int y, int z, int data)
      Deprecated.
      Specified by:
      setBlockDataAt in interface ChunkManager
    • setBlockDataAt

      @Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.4.0.0-PN") @PowerNukkitOnly public void setBlockDataAt(int x, int y, int z, int layer, int data)
      Deprecated.
      Specified by:
      setBlockDataAt in interface ChunkManager
    • getBlockSkyLightAt

      public int getBlockSkyLightAt(int x, int y, int z)
    • setBlockSkyLightAt

      public void setBlockSkyLightAt(int x, int y, int z, int level)
    • getBlockLightAt

      public int getBlockLightAt(int x, int y, int z)
    • setBlockLightAt

      public void setBlockLightAt(int x, int y, int z, int level)
    • getBiomeId

      public int getBiomeId(int x, int z)
    • setBiomeId

      public void setBiomeId(int x, int z, byte biomeId)
    • getBiomeId

      @PowerNukkitXOnly @Since("1.19.20-r3") public int getBiomeId(int x, int y, int z)
    • setBiomeId

      @PowerNukkitXOnly @Since("1.19.20-r3") public void setBiomeId(int x, int y, int z, byte biomeId)
    • getHeightMap

      public int getHeightMap(int x, int z)
    • setHeightMap

      public void setHeightMap(int x, int z, int value)
    • getChunks

      public Map<Long,? extends FullChunk> getChunks()
    • getChunk

      public BaseFullChunk getChunk(int chunkX, int chunkZ)
      Specified by:
      getChunk in interface ChunkManager
    • getChunk

      public BaseFullChunk getChunk(int chunkX, int chunkZ, boolean create)
    • getChunkIfLoaded

      public BaseFullChunk getChunkIfLoaded(int chunkX, int chunkZ)
    • generateChunkCallback

      public void generateChunkCallback(int x, int z, BaseFullChunk chunk)
    • generateChunkCallback

      public void generateChunkCallback(int x, int z, BaseFullChunk chunk, boolean isPopulated)
    • setChunk

      public void setChunk(int chunkX, int chunkZ)
      Specified by:
      setChunk in interface ChunkManager
    • setChunk

      public void setChunk(int chunkX, int chunkZ, BaseFullChunk chunk)
      Specified by:
      setChunk in interface ChunkManager
    • setChunk

      public void setChunk(int chunkX, int chunkZ, BaseFullChunk chunk, boolean unload)
    • getHighestBlockAt

      public int getHighestBlockAt(int x, int z)
    • getMapColorAt

      public BlockColor getMapColorAt(int x, int z)
    • isChunkLoaded

      public boolean isChunkLoaded(int x, int z)
    • isChunkGenerated

      public boolean isChunkGenerated(int x, int z)
    • isChunkPopulated

      public boolean isChunkPopulated(int x, int z)
    • getSpawnLocation

      public Position getSpawnLocation()
    • setSpawnLocation

      public void setSpawnLocation(Vector3 pos)
    • getFuzzySpawnLocation

      @PowerNukkitOnly public Position getFuzzySpawnLocation()
    • requestChunk

      public void requestChunk(int x, int z, Player player)
    • chunkRequestCallback

      public void chunkRequestCallback(long timestamp, int x, int z, int subChunkCount, byte[] payload)
    • removeEntity

      public void removeEntity(Entity entity)
    • addEntity

      public void addEntity(Entity entity)
    • addBlockEntity

      public void addBlockEntity(BlockEntity blockEntity)
    • scheduleBlockEntityUpdate

      public void scheduleBlockEntityUpdate(BlockEntity entity)
    • removeBlockEntity

      public void removeBlockEntity(BlockEntity entity)
    • isChunkInUse

      public boolean isChunkInUse(int x, int z)
    • isChunkInUse

      public boolean isChunkInUse(long hash)
    • loadChunk

      public boolean loadChunk(int x, int z)
    • loadChunk

      public boolean loadChunk(int x, int z, boolean generate)
    • unloadChunkRequest

      public boolean unloadChunkRequest(int x, int z)
    • unloadChunkRequest

      public boolean unloadChunkRequest(int x, int z, boolean safe)
    • cancelUnloadChunkRequest

      public void cancelUnloadChunkRequest(int x, int z)
    • cancelUnloadChunkRequest

      public void cancelUnloadChunkRequest(long hash)
    • unloadChunk

      public boolean unloadChunk(int x, int z)
    • unloadChunk

      public boolean unloadChunk(int x, int z, boolean safe)
    • unloadChunk

      public boolean unloadChunk(int x, int z, boolean safe, boolean trySave)
    • isSpawnChunk

      public boolean isSpawnChunk(int X, int Z)
    • getSafeSpawn

      public Position getSafeSpawn()
    • getSafeSpawn

      public Position getSafeSpawn(Vector3 spawn)
    • getSafeSpawn

      public Position getSafeSpawn(Vector3 spawn, int horizontalMaxOffset)
    • getSafeSpawn

      public Position getSafeSpawn(Vector3 spawn, int horizontalMaxOffset, boolean allowWaterUnder)
    • standable

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public boolean standable(Vector3 vec)
    • standable

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public boolean standable(Vector3 vec, boolean allowWaterUnder)
    • getTime

      public int getTime()
    • setTime

      public void setTime(int time)
    • isDaytime

      public boolean isDaytime()
    • getCurrentTick

      public long getCurrentTick()
    • getName

      public String getName()
    • getFolderName

      public String getFolderName()
    • stopTime

      public void stopTime()
    • startTime

      public void startTime()
    • getSeed

      public long getSeed()
      Specified by:
      getSeed in interface ChunkManager
    • setSeed

      public void setSeed(int seed)
    • populateChunk

      public boolean populateChunk(int x, int z)
    • populateChunk

      public boolean populateChunk(int x, int z, boolean force)
    • generateChunk

      public void generateChunk(int x, int z)
    • generateChunk

      public void generateChunk(int x, int z, boolean force)
    • regenerateChunk

      public void regenerateChunk(int x, int z)
    • asyncChunkGarbageCollection

      public List<CompletableFuture<Void>> asyncChunkGarbageCollection()
    • doChunkGarbageCollection

      @Deprecated @DeprecationDetails(since="1.19.50-r1", reason="Should be async", replaceWith="asyncChunkGarbageCollection") public void doChunkGarbageCollection()
      Deprecated.
    • doGarbageCollection

      public void doGarbageCollection(long allocatedTime)
    • unloadChunks

      public void unloadChunks()
    • unloadChunks

      public void unloadChunks(boolean force)
    • unloadChunks

      public void unloadChunks(int maxUnload, boolean force)
    • setMetadata

      public void setMetadata(String metadataKey, MetadataValue newMetadataValue) throws Exception
      Specified by:
      setMetadata in interface Metadatable
      Throws:
      Exception
    • getMetadata

      public List<MetadataValue> getMetadata(String metadataKey) throws Exception
      Specified by:
      getMetadata in interface Metadatable
      Throws:
      Exception
    • hasMetadata

      public boolean hasMetadata(String metadataKey) throws Exception
      Specified by:
      hasMetadata in interface Metadatable
      Throws:
      Exception
    • removeMetadata

      public void removeMetadata(String metadataKey, Plugin owningPlugin) throws Exception
      Specified by:
      removeMetadata in interface Metadatable
      Throws:
      Exception
    • addPlayerMovement

      public void addPlayerMovement(Entity entity, double x, double y, double z, double yaw, double pitch, double headYaw)
    • addEntityMovement

      @PowerNukkitDifference(since="1.6.0.0-PNX", info="use MoveEntityDeltaPacket instead of MoveEntityAbsolutePacket to implement headYaw") public void addEntityMovement(Entity entity, double x, double y, double z, double yaw, double pitch, double headYaw)
    • isRaining

      public boolean isRaining()
    • setRaining

      public boolean setRaining(boolean raining)
    • getRainTime

      public int getRainTime()
    • setRainTime

      public void setRainTime(int rainTime)
    • isThundering

      public boolean isThundering()
    • setThundering

      public boolean setThundering(boolean thundering)
    • getThunderTime

      public int getThunderTime()
    • setThunderTime

      public void setThunderTime(int thunderTime)
    • sendWeather

      public void sendWeather(Player[] players)
    • sendWeather

      public void sendWeather(Player player)
    • sendWeather

      public void sendWeather(Collection<Player> players)
    • getDimensionData

      public DimensionData getDimensionData()
    • getDimension

      public int getDimension()
    • isOverWorld

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public final boolean isOverWorld()
    • isNether

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public final boolean isNether()
    • isTheEnd

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public final boolean isTheEnd()
    • isYInRange

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public final boolean isYInRange(int y)
    • canBlockSeeSky

      public boolean canBlockSeeSky(Vector3 pos)
    • getMinHeight

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public int getMinHeight()
      Returns:
      最低高度
    • getMaxHeight

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public int getMaxHeight()
      最大高度,请注意此y值不能放置方块
      Returns:
      最大高度
    • getStrongPower

      public int getStrongPower(Vector3 pos, BlockFace direction)
    • getStrongPower

      @PowerNukkitDifference(info="Check if the block to check is a piston, then return 0.", since="1.4.0.0-PN") public int getStrongPower(Vector3 pos)
    • isSidePowered

      public boolean isSidePowered(Vector3 pos, BlockFace face)
    • getRedstonePower

      public int getRedstonePower(Vector3 pos, BlockFace face)
    • isBlockPowered

      public boolean isBlockPowered(Vector3 pos)
    • isBlockIndirectlyGettingPowered

      public int isBlockIndirectlyGettingPowered(Vector3 pos)
    • isAreaLoaded

      public boolean isAreaLoaded(AxisAlignedBB bb)
    • getUpdateLCG

      public int getUpdateLCG()
    • createPortal

      @PowerNukkitDifference(info="Using new method to play sounds", since="1.4.0.0-PN") public boolean createPortal(Block target)
    • getVibrationManager

      @PowerNukkitXOnly @Since("1.19.21-r3") public VibrationManager getVibrationManager()
    • toString

      public String toString()
      Overrides:
      toString in class Object