Package cn.nukkit.level
Class Level
java.lang.Object
cn.nukkit.level.Level
- All Implemented Interfaces:
ChunkManager
,Metadatable
- Author:
- MagicDroidX (Nukkit Project)
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static int
static final int
static final int
static final int
static final Level[]
static final int
float
int
boolean
int
int
当tps过低的时候,tps优化延迟会上升,计算密集型任务应当每隔此tick才运行一次int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
final it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<Entity>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAntiXrayFakeBlock
(Block originBlock, Collection<Block> fakeBlocks) void
addAntiXrayOreBlock
(Block oreBlock, Block replaceWith) static void
addAntiXrayTransparentBlock
(Block block) void
addBlockEntity
(BlockEntity blockEntity) void
addChunkPacket
(int chunkX, int chunkZ, DataPacket packet) void
void
addEntityMovement
(Entity entity, double x, double y, double z, double yaw, double pitch, double headYaw) void
addLevelEvent
(int type, int data) void
addLevelEvent
(int type, int data, float x, float y, float z) void
addLevelEvent
(int type, int data, Vector3 pos) void
addLevelEvent
(Vector3 pos, int event) void
addLevelEvent
(Vector3 pos, int event, int data) void
addLevelSoundEvent
(Vector3 pos, int type) Deprecated.void
addLevelSoundEvent
(Vector3 pos, int type, int data) Deprecated.void
addLevelSoundEvent
(Vector3 pos, int type, int data, int entityType) Deprecated.void
addLevelSoundEvent
(Vector3 pos, int type, int data, int entityType, boolean isBaby, boolean isGlobal) Deprecated.void
addLevelSoundEvent
(Vector3 pos, int type, int data, String identifier, boolean isBaby, boolean isGlobal) Deprecated.void
addLightUpdate
(int x, int y, int z) void
addParticle
(Particle particle) void
addParticle
(Particle particle, Player player) void
addParticle
(Particle particle, Player[] players) void
addParticle
(Particle particle, Collection<Player> players) void
addParticleEffect
(Vector3f pos, String identifier, long uniqueEntityId, int dimensionId, Player... players) void
addParticleEffect
(Vector3 pos, ParticleEffect particleEffect) void
addParticleEffect
(Vector3 pos, ParticleEffect particleEffect, long uniqueEntityId) void
addParticleEffect
(Vector3 pos, ParticleEffect particleEffect, long uniqueEntityId, int dimensionId) void
addParticleEffect
(Vector3 pos, ParticleEffect particleEffect, long uniqueEntityId, int dimensionId, Player... players) void
addParticleEffect
(Vector3 pos, ParticleEffect particleEffect, long uniqueEntityId, int dimensionId, Collection<Player> players) void
addPlayerMovement
(Entity entity, double x, double y, double z, double yaw, double pitch, double headYaw) void
void
void
void
addSound
(Vector3 pos, Sound sound, float volume, float pitch, Collection<Player> players) static long
blockHash
(int x, int y, int z) Deprecated.static long
float
calculateCelestialAngle
(int time, float tickDiff) int
calculateSkylightSubtracted
(float tickDiff) boolean
canBlockSeeSky
(Vector3 pos) boolean
cancelSheduledUpdate
(Vector3 pos, Block block) void
cancelUnloadChunkRequest
(int x, int z) void
cancelUnloadChunkRequest
(long hash) static boolean
canRandomTick
(int blockId) void
void
static int
chunkBlockHash
(int x, int y, int z) static long
chunkHash
(int x, int z) void
chunkRequestCallback
(long timestamp, int x, int z, int subChunkCount, byte[] payload) void
close()
boolean
createPortal
(Block target) void
Deprecated.void
doGarbageCollection
(long allocatedTime) void
doTick
(int currentTick) dropAndGetItem
(Vector3 source, Item item) dropAndGetItem
(Vector3 source, Item item, Vector3 motion) dropAndGetItem
(Vector3 source, Item item, Vector3 motion, boolean dropAround, int delay) dropAndGetItem
(Vector3 source, Item item, Vector3 motion, int delay) void
dropExpOrb
(Vector3 source, int exp) void
dropExpOrb
(Vector3 source, int exp, Vector3 motion) void
dropExpOrb
(Vector3 source, int exp, Vector3 motion, int delay) dropExpOrbAndGetEntities
(Vector3 source, int exp) dropExpOrbAndGetEntities
(Vector3 source, int exp, Vector3 motion) dropExpOrbAndGetEntities
(Vector3 source, int exp, Vector3 motion, int delay) void
void
void
void
fastCollidingEntities
(AxisAlignedBB bb, Entity entity) fastCollisionCubes
(Entity entity, AxisAlignedBB bb) fastCollisionCubes
(Entity entity, AxisAlignedBB bb, boolean entities) fastCollisionCubes
(Entity entity, AxisAlignedBB bb, boolean entities, boolean solidEntities) fastNearbyEntities
(AxisAlignedBB bb, Entity entity) fastNearbyEntities
(AxisAlignedBB bb, Entity entity, boolean loadChunks) void
generateChunk
(int x, int z) void
generateChunk
(int x, int z, boolean force) void
generateChunkCallback
(int x, int z, BaseFullChunk chunk) void
generateChunkCallback
(int x, int z, BaseFullChunk chunk, boolean isPopulated) static int
generateChunkLoaderId
(ChunkLoader loader) boolean
int
getBiomeId
(int x, int z) int
getBiomeId
(int x, int y, int z) getBlock
(int x, int y, int z) getBlock
(int x, int y, int z, boolean load) getBlock
(int x, int y, int z, int layer) getBlock
(int x, int y, int z, int layer, boolean load) getBlockAround
(Vector3 pos) int
getBlockDataAt
(int x, int y, int z) Deprecated.int
getBlockDataAt
(int x, int y, int z, int layer) Deprecated.getBlockEntity
(Vector3 pos) getBlockEntityById
(long blockEntityId) int
getBlockExtraDataAt
(int x, int y, int z) int
getBlockIdAt
(int x, int y, int z) int
getBlockIdAt
(int x, int y, int z, int layer) int
getBlockLightAt
(int x, int y, int z) int
getBlockRuntimeId
(int x, int y, int z) int
getBlockRuntimeId
(int x, int y, int z, int layer) int
getBlockSkyLightAt
(int x, int y, int z) getBlockStateAt
(int x, int y, int z, int layer) static Vector3
getBlockXYZ
(long chunkHash, int blockHash, Level level) static Vector3
getBlockXYZ
(BlockVector3 hash) float
getCelestialAngle
(float tickDiff) getChunk
(int chunkX, int chunkZ) getChunk
(int chunkX, int chunkZ, boolean create) getChunkBlockEntities
(int X, int Z) getChunkEntities
(int X, int Z) getChunkEntities
(int X, int Z, boolean loadChunks) getChunkIfLoaded
(int chunkX, int chunkZ) getChunkLoaders
(int chunkX, int chunkZ) getChunkPlayers
(int chunkX, int chunkZ) static Chunk.Entry
getChunkXZ
(long hash) Entity[]
Entity[]
getCollidingEntities
(AxisAlignedBB bb, Entity entity) Block[]
Block[]
getCollisionBlocks
(AxisAlignedBB bb, boolean targetFirst) Block[]
getCollisionBlocks
(AxisAlignedBB bb, boolean targetFirst, boolean ignoreCollidesCheck) Block[]
getCollisionBlocks
(AxisAlignedBB bb, boolean targetFirst, boolean ignoreCollidesCheck, Predicate<Block> condition) getCollisionCubes
(Entity entity, AxisAlignedBB bb) getCollisionCubes
(Entity entity, AxisAlignedBB bb, boolean entities) getCollisionCubes
(Entity entity, AxisAlignedBB bb, boolean entities, boolean solidEntities) long
int
Entity[]
getEntity
(long entityId) int
int
getFullBlock
(int x, int y, int z) Deprecated.int
getFullBlock
(int x, int y, int z, int layer) Deprecated.int
getFullLight
(Vector3 pos) static int
getHashX
(long hash) static int
getHashZ
(long hash) int
getHeightMap
(int x, int z) int
getHighestAdjacentBlockSkyLight
(int x, int y, int z) Returns the highest block skylight level available in the positions adjacent to the specified block coordinates.int
getHighestBlockAt
(int x, int z) final int
getId()
getMapColorAt
(int x, int z) int
最大高度,请注意此y值不能放置方块getMetadata
(String metadataKey) int
int
getMoonPhase
(long worldTime) getName()
Entity[]
Entity[]
getNearbyEntities
(AxisAlignedBB bb, Entity entity) Entity[]
getNearbyEntities
(AxisAlignedBB bb, Entity entity, boolean loadChunks) getPendingBlockUpdates
(FullChunk chunk) getPendingBlockUpdates
(AxisAlignedBB boundingBox) final LevelProvider
float
getRainStrength
(float tickDiff) int
it.unimi.dsi.fastutil.ints.Int2ObjectMap<it.unimi.dsi.fastutil.ints.IntList>
it.unimi.dsi.fastutil.ints.Int2IntMap
static it.unimi.dsi.fastutil.ints.IntSet
int
getRedstonePower
(Vector3 pos, BlockFace face) getSafeSpawn
(Vector3 spawn) getSafeSpawn
(Vector3 spawn, int horizontalMaxOffset) getSafeSpawn
(Vector3 spawn, int horizontalMaxOffset, boolean allowWaterUnder) long
getSeed()
int
getStrongPower
(Vector3 pos) int
getStrongPower
(Vector3 pos, BlockFace direction) float
getThunderStrength
(float tickDiff) int
getTickCachedBlock
(int x, int y, int z) getTickCachedBlock
(int x, int y, int z, boolean load) getTickCachedBlock
(int x, int y, int z, int layer) getTickCachedBlock
(int x, int y, int z, int layer, boolean load) getTickCachedBlock
(Vector3 pos, boolean load) getTickCachedBlock
(Vector3 pos, int layer) getTickCachedBlock
(Vector3 pos, int layer, boolean load) Block[]
Block[]
getTickCachedCollisionBlocks
(AxisAlignedBB bb, boolean targetFirst) Block[]
getTickCachedCollisionBlocks
(AxisAlignedBB bb, boolean targetFirst, boolean ignoreCollidesCheck) Block[]
getTickCachedCollisionBlocks
(AxisAlignedBB bb, boolean targetFirst, boolean ignoreCollidesCheck, Predicate<Block> condition) int
int
int
getTime()
int
boolean
hasCollision
(Entity entity, AxisAlignedBB bb, boolean entities) boolean
hasMetadata
(String metadataKey) void
void
initLevel
(DimensionData givenDimensionData) boolean
boolean
int
boolean
isBlockPowered
(Vector3 pos) boolean
isBlockTickPending
(Vector3 pos, Block block) boolean
isChunkGenerated
(int x, int z) boolean
isChunkInUse
(int x, int z) boolean
isChunkInUse
(long hash) boolean
isChunkLoaded
(int x, int z) boolean
isChunkPopulated
(int x, int z) boolean
boolean
isFullBlock
(Vector3 pos) boolean
isHighLightChunk
(int chunkX, int chunkZ) boolean
isInSpawnRadius
(Vector3 vector3) final boolean
isNether()
final boolean
boolean
boolean
boolean
isSidePowered
(Vector3 pos, BlockFace face) boolean
isSpawnChunk
(int X, int Z) final boolean
isTheEnd()
boolean
boolean
isUpdateScheduled
(Vector3 pos, Block block) final boolean
isYInRange
(int y) boolean
loadChunk
(int x, int z) boolean
loadChunk
(int x, int z, boolean generate) static int
localBlockHash
(double x, double y, double z, Level level) static int
localBlockHash
(int x, int y, int z, int layer, Level level) boolean
populateChunk
(int x, int z) boolean
populateChunk
(int x, int z, boolean force) int
void
regenerateChunk
(int x, int z) void
registerChunkLoader
(ChunkLoader loader, int chunkX, int chunkZ) void
registerChunkLoader
(ChunkLoader loader, int chunkX, int chunkZ, boolean autoLoad) void
reinitAntiXray
(boolean global) void
void
removeAntiXrayFakeBlock
(Block originBlock, Collection<Block> fakeBlocks) void
removeAntiXrayOreBlock
(Block oreBlock, Block replaceWith) void
removeBlockEntity
(BlockEntity entity) void
removeEntity
(Entity entity) void
removeMetadata
(String metadataKey, Plugin owningPlugin) void
requestChunk
(int x, int z, Player player) final LevelProvider
Returns the level provider if it exists.boolean
save()
boolean
save
(boolean force) void
scanBlocks
(AxisAlignedBB bb, BiPredicate<BlockVector3, BlockState> condition) void
scheduleBlockEntityUpdate
(BlockEntity entity) void
scheduleUpdate
(Block pos, int delay) void
scheduleUpdate
(Block pos, int delay, boolean checkBlockWhenUpdate) void
scheduleUpdate
(Block block, Vector3 pos, int delay) void
scheduleUpdate
(Block block, Vector3 pos, int delay, int priority) void
scheduleUpdate
(Block block, Vector3 pos, int delay, int priority, boolean checkArea) void
scheduleUpdate
(Block block, Vector3 pos, int delay, int priority, boolean checkArea, boolean checkBlockWhenUpdate) void
sendBlockExtraData
(int x, int y, int z, int id, int data) void
sendBlockExtraData
(int x, int y, int z, int id, int data, Player[] players) void
sendBlockExtraData
(int x, int y, int z, int id, int data, Collection<Player> players) void
sendBlocks
(Player[] target, Vector3[] blocks) void
sendBlocks
(Player[] target, Vector3[] blocks, int flags) void
sendBlocks
(Player[] target, Vector3[] blocks, int flags, boolean optimizeRebuilds) void
sendBlocks
(Player[] target, Vector3[] blocks, int flags, int dataLayer) void
sendBlocks
(Player[] target, Vector3[] blocks, int flags, int dataLayer, boolean optimizeRebuilds) void
sendTime()
void
void
sendWeather
(Player player) void
sendWeather
(Player[] players) void
sendWeather
(Collection<Player> players) void
setAntiXrayEnabled
(boolean antiXrayEnabled) void
setAutoSave
(boolean autoSave) void
setBiomeId
(int x, int z, byte biomeId) void
setBiomeId
(int x, int y, int z, byte biomeId) boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
void
setBlockAt
(int x, int y, int z, int id, int data) Deprecated.boolean
setBlockAtLayer
(int x, int y, int z, int layer, int id, int data) Deprecated.void
setBlockDataAt
(int x, int y, int z, int data) Deprecated.void
setBlockDataAt
(int x, int y, int z, int layer, int data) Deprecated.void
setBlockExtraDataAt
(int x, int y, int z, int id, int data) void
setBlockFullIdAt
(int x, int y, int z, int fullId) Deprecated.void
setBlockFullIdAt
(int x, int y, int z, int layer, int fullId) Deprecated.void
setBlockIdAt
(int x, int y, int z, int id) void
setBlockIdAt
(int x, int y, int z, int layer, int id) void
setBlockLightAt
(int x, int y, int z, int level) void
setBlockSkyLightAt
(int x, int y, int z, int level) boolean
setBlockStateAt
(int x, int y, int z, int layer, BlockState state) static void
setCanRandomTick
(int blockId, boolean newValue) void
setChunk
(int chunkX, int chunkZ) void
setChunk
(int chunkX, int chunkZ, BaseFullChunk chunk) void
setChunk
(int chunkX, int chunkZ, BaseFullChunk chunk, boolean unload) void
setFakeOreDenominator
(int fakeOreDenominator) void
setHeightMap
(int x, int z, int value) void
setMetadata
(String metadataKey, MetadataValue newMetadataValue) void
setPreDeObfuscate
(boolean preDeObfuscate) boolean
setRaining
(boolean raining) void
setRainTime
(int rainTime) void
setSeed
(int seed) void
setSpawnLocation
(Vector3 pos) boolean
setThundering
(boolean thundering) void
setThunderTime
(int thunderTime) void
setTickRate
(int tickRate) void
setTime
(int time) boolean
boolean
void
void
stopTime()
streamCollidingEntities
(AxisAlignedBB bb, Entity entity) toString()
boolean
unload()
boolean
unload
(boolean force) boolean
unloadChunk
(int x, int z) boolean
unloadChunk
(int x, int z, boolean safe) boolean
unloadChunk
(int x, int z, boolean safe, boolean trySave) boolean
unloadChunkRequest
(int x, int z) boolean
unloadChunkRequest
(int x, int z, boolean safe) void
void
unloadChunks
(boolean force) void
unloadChunks
(int maxUnload, boolean force) void
unregisterChunkLoader
(ChunkLoader loader, int chunkX, int chunkZ) void
updateAllLight
(Vector3 pos) void
updateAround
(int x, int y, int z) void
updateAround
(Vector3 pos) void
updateAroundRedstone
(Vector3 pos, BlockFace face) Deprecated.void
void
updateBlockSkyLight
(int x, int y, int z) void
void
updateComparatorOutputLevelSelective
(Vector3 v, boolean observer) useBreakOn
(Vector3 vector) useBreakOn
(Vector3 vector, int layer, BlockFace face, Item item, Player player, boolean createParticles, boolean setBlockDestroy) useBreakOn
(Vector3 vector, Item item) useBreakOn
(Vector3 vector, Item item, Player player) useBreakOn
(Vector3 vector, Item item, Player player, boolean createParticles) useBreakOn
(Vector3 vector, BlockFace face, Item item, Player player, boolean createParticles) useBreakOn
(Vector3 vector, BlockFace face, Item item, Player player, boolean createParticles, boolean setBlockDestroy) useItemOn
(Vector3 vector, Item item, BlockFace face, float fx, float fy, float fz, Player player, boolean playSound) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface cn.nukkit.level.ChunkManager
getBlockStateAt, getChunk, setBlockAt, setBlockAtLayer, setBlockStateAt
-
Field Details
-
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
-
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
-
stopTime
public boolean stopTime -
skyLightSubtracted
public float skyLightSubtracted -
sleepTicks
public int sleepTicks -
timings
-
tickRateTime
public int tickRateTime -
tickRateCounter
public int tickRateCounter -
tickRateOptDelay
public int tickRateOptDelay当tps过低的时候,tps优化延迟会上升,计算密集型任务应当每隔此tick才运行一次 -
gameRules
-
-
Constructor Details
-
Level
-
-
Method Details
-
canRandomTick
-
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
-
localBlockHash
@PowerNukkitXOnly @Since("1.6.0.0-PNX") public static int localBlockHash(int x, int y, int z, int layer, Level level) -
getBlockXYZ
-
chunkBlockHash
-
getHashX
public static int getHashX(long hash) -
getHashZ
public static int getHashZ(long hash) -
getBlockXYZ
-
getChunkXZ
-
generateChunkLoaderId
-
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
-
setAntiXrayEnabled
-
getFakeOreDenominator
-
setFakeOreDenominator
-
isPreDeObfuscate
-
setPreDeObfuscate
-
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
-
isHighLightChunk
-
initLevel
-
initLevel
@PowerNukkitXDifference(since="1.19.20-r3") public void initLevel(@Nullable DimensionData givenDimensionData) -
getGenerator
-
getBlockMetadata
-
getServer
-
getProvider
-
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
-
addSound
-
addSound
public void addSound(Vector3 pos, Sound sound, float volume, float pitch, Collection<Player> players) -
addSound
-
addLevelEvent
-
addLevelEvent
-
addLevelEvent
-
addLevelEvent
-
addLevelEvent
-
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 playedtype
- ID of the sound fromLevelSoundEventPacket
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
-
addParticle
-
addParticle
-
addParticle
-
addParticleEffect
-
addParticleEffect
-
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
-
getAutoSave
public boolean getAutoSave() -
setAutoSave
public void setAutoSave(boolean autoSave) -
unload
public boolean unload() -
unload
public boolean unload(boolean force) -
getChunkPlayers
-
getChunkLoaders
-
addChunkPacket
-
registerChunkLoader
-
registerChunkLoader
-
unregisterChunkLoader
-
checkTime
public void checkTime() -
sendTime
-
sendTime
public void sendTime() -
getGameRules
-
releaseTickCachedBlocks
-
doTick
public void doTick(int currentTick) -
adjustPosToNearbyEntity
-
checkSleep
public void checkSleep() -
sendBlockExtraData
public void sendBlockExtraData(int x, int y, int z, int id, int data) -
sendBlockExtraData
-
sendBlockExtraData
-
sendBlocks
-
sendBlocks
-
sendBlocks
-
sendBlocks
-
sendBlocks
-
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
-
updateComparatorOutputLevelSelective
@PowerNukkitOnly @Since("1.4.0.0-PN") public void updateComparatorOutputLevelSelective(Vector3 v, boolean observer) -
updateAround
-
updateAround
public void updateAround(int x, int y, int z) -
scheduleUpdate
-
scheduleUpdate
@PowerNukkitXOnly @Since("1.6.0.0-PNX") public void scheduleUpdate(Block pos, int delay, boolean checkBlockWhenUpdate) -
scheduleUpdate
-
scheduleUpdate
-
scheduleUpdate
-
scheduleUpdate
@PowerNukkitXOnly @Since("1.6.0.0-PNX") public void scheduleUpdate(Block block, Vector3 pos, int delay, int priority, boolean checkArea, boolean checkBlockWhenUpdate) -
cancelSheduledUpdate
-
isUpdateScheduled
-
isBlockTickPending
-
getPendingBlockUpdates
-
getPendingBlockUpdates
-
scanBlocks
@PowerNukkitOnly @Since("1.4.0.0-PN") public List<Block> scanBlocks(@Nonnull AxisAlignedBB bb, @Nonnull BiPredicate<BlockVector3, BlockState> condition) -
getCollisionBlocks
-
getCollisionBlocks
-
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
-
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
-
getCollisionCubes
-
getCollisionCubes
public AxisAlignedBB[] getCollisionCubes(Entity entity, AxisAlignedBB bb, boolean entities, boolean solidEntities) -
fastCollisionCubes
-
fastCollisionCubes
-
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
-
calculateSkylightSubtracted
-
getRainStrength
-
getThunderStrength
-
getCelestialAngle
-
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
-
getBlockRuntimeId
-
getBlockAround
-
getTickCachedBlock
-
getTickCachedBlock
-
getTickCachedBlock
-
getTickCachedBlock
@PowerNukkitXOnly @Since("1.6.0.0-PNX") public Block getTickCachedBlock(Vector3 pos, int layer, boolean load) -
getTickCachedBlock
-
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
-
getBlock
-
getBlock
-
getBlock
-
getBlock
-
getBlock
-
getBlock
-
getBlock
-
updateAllLight
-
updateBlockSkyLight
public void updateBlockSkyLight(int x, int y, int z) -
getHighestAdjacentBlockSkyLight
Returns the highest block skylight level available in the positions adjacent to the specified block coordinates. -
updateBlockLight
-
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 interfaceChunkManager
-
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 interfaceChunkManager
-
setBlock
-
setBlock
-
setBlock
-
setBlock
-
setBlock
-
setBlock
@PowerNukkitOnly public boolean setBlock(Vector3 pos, int layer, Block block, boolean direct, boolean update) -
setBlock
-
setBlock
@PowerNukkitOnly public boolean setBlock(int x, int y, int z, int layer, Block block, boolean direct, boolean update) -
dropItem
-
dropItem
-
dropItem
-
dropItem
-
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
-
useBreakOn
-
useBreakOn
-
useBreakOn
-
useBreakOn
-
useBreakOn
-
useBreakOn
-
dropExpOrb
-
dropExpOrb
-
dropExpOrb
-
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
-
useItemOn
-
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
-
getEntity
-
getEntities
-
getCollidingEntities
-
getCollidingEntities
-
fastCollidingEntities
-
fastCollidingEntities
-
streamCollidingEntities
-
getNearbyEntities
-
getNearbyEntities
-
getNearbyEntities
-
fastNearbyEntities
-
fastNearbyEntities
-
fastNearbyEntities
-
getBlockEntities
-
getBlockEntityById
-
getPlayers
-
getLoaders
-
getBlockEntity
-
getBlockEntity
-
getBlockEntityIfLoaded
-
getChunkEntities
-
getChunkEntities
-
getChunkBlockEntities
-
getBlockStateAt
- Specified by:
getBlockStateAt
in interfaceChunkManager
-
getBlockIdAt
public int getBlockIdAt(int x, int y, int z) - Specified by:
getBlockIdAt
in interfaceChunkManager
-
getBlockIdAt
- Specified by:
getBlockIdAt
in interfaceChunkManager
-
setBlockIdAt
public void setBlockIdAt(int x, int y, int z, int id) - Specified by:
setBlockIdAt
in interfaceChunkManager
-
setBlockIdAt
- Specified by:
setBlockIdAt
in interfaceChunkManager
-
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 interfaceChunkManager
-
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 interfaceChunkManager
-
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 interfaceChunkManager
-
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 interfaceChunkManager
-
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 interfaceChunkManager
-
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 interfaceChunkManager
-
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 interfaceChunkManager
-
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
-
setBiomeId
-
getHeightMap
public int getHeightMap(int x, int z) -
setHeightMap
public void setHeightMap(int x, int z, int value) -
getChunks
-
getChunk
- Specified by:
getChunk
in interfaceChunkManager
-
getChunk
-
getChunkIfLoaded
-
generateChunkCallback
-
generateChunkCallback
-
setChunk
public void setChunk(int chunkX, int chunkZ) - Specified by:
setChunk
in interfaceChunkManager
-
setChunk
- Specified by:
setChunk
in interfaceChunkManager
-
setChunk
-
getHighestBlockAt
public int getHighestBlockAt(int x, int z) -
getMapColorAt
-
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
-
setSpawnLocation
-
getFuzzySpawnLocation
-
requestChunk
-
chunkRequestCallback
public void chunkRequestCallback(long timestamp, int x, int z, int subChunkCount, byte[] payload) -
removeEntity
-
addEntity
-
addBlockEntity
-
scheduleBlockEntityUpdate
-
removeBlockEntity
-
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
-
getSafeSpawn
-
getSafeSpawn
-
getSafeSpawn
-
standable
-
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
-
getFolderName
-
stopTime
public void stopTime() -
startTime
public void startTime() -
getSeed
public long getSeed()- Specified by:
getSeed
in interfaceChunkManager
-
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
-
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
- Specified by:
setMetadata
in interfaceMetadatable
- Throws:
Exception
-
getMetadata
- Specified by:
getMetadata
in interfaceMetadatable
- Throws:
Exception
-
hasMetadata
- Specified by:
hasMetadata
in interfaceMetadatable
- Throws:
Exception
-
removeMetadata
- Specified by:
removeMetadata
in interfaceMetadatable
- 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
-
sendWeather
-
sendWeather
-
getDimensionData
-
getDimension
public int getDimension() -
isOverWorld
-
isNether
-
isTheEnd
-
isYInRange
-
canBlockSeeSky
-
getMinHeight
- Returns:
- 最低高度
-
getMaxHeight
最大高度,请注意此y值不能放置方块- Returns:
- 最大高度
-
getStrongPower
-
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
-
getRedstonePower
-
isBlockPowered
-
isBlockIndirectlyGettingPowered
-
isAreaLoaded
-
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
-
toString
-