Class Block
- All Implemented Interfaces:
BlockID
,IBlockState
,IMutableBlockState
,AxisAlignedBB
,Metadatable
,Cloneable
- Direct Known Subclasses:
BlockInfoUpdate
,BlockMeta
,BlockSolid
,BlockTransparent
- Author:
- MagicDroidX (Nukkit Project)
-
Nested Class Summary
Nested classes/interfaces inherited from interface cn.nukkit.math.AxisAlignedBB
AxisAlignedBB.BBConsumer<T>
-
Field Summary
Modifier and TypeFieldDescriptionprotected BlockColor
static final ConcurrentHashMap<String,
Integer> static final int
Deprecated.static final int
Deprecated.static final int
Deprecated.static final double
static final double
static final Block[]
static Block[]
Deprecated.static double[]
Deprecated.static boolean[]
Deprecated.static final it.unimi.dsi.fastutil.ints.Int2ObjectMap<CustomBlock>
int
static int[]
Deprecated.static int[]
Deprecated.Deprecated.static final int
static boolean[]
Deprecated.static boolean[]
Deprecated.protected static final Map<Long,
BlockColor> Fields inherited from interface cn.nukkit.math.AxisAlignedBB
EMPTY_LIST
Fields inherited from interface cn.nukkit.block.BlockID
ACACIA_BUTTON, ACACIA_DOOR_BLOCK, ACACIA_HANGING_SIGN, ACACIA_PRESSURE_PLATE, ACACIA_STANDING_SIGN, ACACIA_TRAPDOOR, ACACIA_WALL_SIGN, ACACIA_WOOD_STAIRS, ACACIA_WOODEN_STAIRS, ACTIVATOR_RAIL, AIR, ALLOW, AMETHYST_BLOCK, AMETHYST_CLUSTER, ANCIENT_DERBRIS, ANDESITE_STAIRS, ANVIL, AZALEA, AZALEA_LEAVES, AZALEA_LEAVES_FLOWERED, BAMBOO, BAMBOO_BLOCK, BAMBOO_BUTTON, BAMBOO_DOOR, BAMBOO_DOUBLE_SLAB, BAMBOO_FENCE, BAMBOO_FENCE_GATE, BAMBOO_HANGING_SIGN, BAMBOO_MOSAIC, BAMBOO_MOSAIC_DOUBLE_SLAB, BAMBOO_MOSAIC_SLAB, BAMBOO_MOSAIC_STAIRS, BAMBOO_PLANKS, BAMBOO_PRESSURE_PLATE, BAMBOO_SAPLING, BAMBOO_SLAB, BAMBOO_STAIRS, BAMBOO_STANDING_SIGN, BAMBOO_TRAPDOOR, BAMBOO_WALL_SIGN, BARREL, BARRIER, BASALT, BEACON, BED_BLOCK, BEDROCK, BEE_NEST, BEEHIVE, BEETROOT_BLOCK, BELL, BIG_DRIPLEAF, BIRCH_BUTTON, BIRCH_DOOR_BLOCK, BIRCH_HANGING_SIGN, BIRCH_PRESSURE_PLATE, BIRCH_STAIRS, BIRCH_STANDING_SIGN, BIRCH_TRAPDOOR, BIRCH_WALL_SIGN, BIRCH_WOOD_STAIRS, BIRCH_WOODEN_STAIRS, BLACK_CANDLE, BLACK_CANDLE_CAKE, BLACK_GLAZED_TERRACOTTA, BLACKSTONE, BLACKSTONE_DOUBLE_SLAB, BLACKSTONE_SLAB, BLACKSTONE_STAIRS, BLACKSTONE_WALL, BLAST_FURNACE, BLOCK_KELP, BLOCK_NETHER_WART_BLOCK, BLUE_CANDLE, BLUE_CANDLE_CAKE, BLUE_GLAZED_TERRACOTTA, BLUE_ICE, BONE_BLOCK, BOOKSHELF, BORDER_BLOCK, BREWING_BLOCK, BREWING_STAND_BLOCK, BRICK_STAIRS, BRICKS, BRICKS_BLOCK, BROWN_CANDLE, BROWN_CANDLE_CAKE, BROWN_GLAZED_TERRACOTTA, BROWN_MUSHROOM, BROWN_MUSHROOM_BLOCK, BUBBLE_COLUMN, BUDDING_AMETHYST, BURNING_FURNACE, BUSH, CACTUS, CAKE_BLOCK, CALCITE, CALIBRATED_SCULK_SENSOR, CAMPFIRE_BLOCK, CANDLE, CANDLE_CAKE, CARPET, CARROT_BLOCK, CARTOGRAPHY_TABLE, CARVED_PUMPKIN, CAULDRON_BLOCK, CAVE_VINES, CAVE_VINES_BODY_WITH_BERRIES, CAVE_VINES_HEAD_WITH_BERRIES, CHAIN_BLOCK, CHAIN_COMMAND_BLOCK, CHERRY_BUTTON, CHERRY_DOOR, CHERRY_FENCE, CHERRY_FENCE_GATE, CHERRY_HANGING_SIGN, CHERRY_LEAVES, CHERRY_LOG, CHERRY_PLANKS, CHERRY_PRESSURE_PLATE, CHERRY_SAPLING, CHERRY_SLAB, CHERRY_STAIRS, CHERRY_STANDING_SIGN, CHERRY_TRAPDOOR, CHERRY_WALL_SIGN, CHERRY_WOOD, CHEST, CHISELED_BOOKSHELF, CHISELED_DEEPSLATE, CHISELED_NETHER_BRICKS, CHISELED_POLISHED_BLACKSTONE, CHORUS_FLOWER, CHORUS_PLANT, CLAY_BLOCK, COAL_BLOCK, COAL_ORE, COBBLE, COBBLE_STAIRS, COBBLE_WALL, COBBLED_DEEPSLATE, COBBLED_DEEPSLATE_DOUBLE_SLAB, COBBLED_DEEPSLATE_SLAB, COBBLED_DEEPSLATE_STAIRS, COBBLED_DEEPSLATE_WALL, COBBLESTONE, COBBLESTONE_STAIRS, COBBLESTONE_WALL, COBWEB, COCOA, COCOA_BLOCK, COMMAND_BLOCK, COMPOSTER, CONCRETE, CONCRETE_POWDER, CONCRETEPOWDER, CONDUIT, COPPER_BLOCK, COPPER_ORE, CORAL, CORAL_BLOCK, CORAL_FAN, CORAL_FAN_DEAD, CORAL_FAN_HANG, CORAL_FAN_HANG2, CORAL_FAN_HANG3, CRACKED_DEEPSLATE_BRICKS, CRACKED_DEEPSLATE_TILES, CRACKED_NETHER_BRICKS, CRACKED_POLISHED_BLACKSTONE_BRICKS, CRAFTING_TABLE, CRIMSON_BUTTON, CRIMSON_DOOR_BLOCK, CRIMSON_DOUBLE_SLAB, CRIMSON_FENCE, CRIMSON_FENCE_GATE, CRIMSON_FUNGUS, CRIMSON_HANGING_SIGN, CRIMSON_HYPHAE, CRIMSON_NYLIUM, CRIMSON_PLANKS, CRIMSON_PRESSURE_PLATE, CRIMSON_ROOTS, CRIMSON_SLAB, CRIMSON_STAIRS, CRIMSON_STANDING_SIGN, CRIMSON_STEM, CRIMSON_TRAPDOOR, CRIMSON_WALL_SIGN, CRYING_OBSIDIAN, CUT_COPPER, CUT_COPPER_SLAB, CUT_COPPER_STAIRS, CYAN_CANDLE, CYAN_CANDLE_CAKE, CYAN_GLAZED_TERRACOTTA, DANDELION, DARK_OAK_BUTTON, DARK_OAK_DOOR_BLOCK, DARK_OAK_HANGING_SIGN, DARK_OAK_PRESSURE_PLATE, DARK_OAK_STANDING_SIGN, DARK_OAK_TRAPDOOR, DARK_OAK_WALL_SIGN, DARK_OAK_WOOD_STAIRS, DARK_OAK_WOODEN_STAIRS, DARK_PRISMARINE_STAIRS, DARKOAK_STANDING_SIGN, DARKOAK_WALL_SIGN, DAYLIGHT_DETECTOR, DAYLIGHT_DETECTOR_INVERTED, DEAD_BUSH, DECORATED_POT, DEEPSLATE, DEEPSLATE_BRICK_DOUBLE_SLAB, DEEPSLATE_BRICK_SLAB, DEEPSLATE_BRICK_STAIRS, DEEPSLATE_BRICK_WALL, DEEPSLATE_BRICKS, DEEPSLATE_COAL_ORE, DEEPSLATE_COPPER_ORE, DEEPSLATE_DIAMOND_ORE, DEEPSLATE_EMERALD_ORE, DEEPSLATE_GOLD_ORE, DEEPSLATE_IRON_ORE, DEEPSLATE_LAPIS_ORE, DEEPSLATE_REDSTONE_ORE, DEEPSLATE_TILE_DOUBLE_SLAB, DEEPSLATE_TILE_SLAB, DEEPSLATE_TILE_STAIRS, DEEPSLATE_TILE_WALL, DEEPSLATE_TILES, DENY, DETECTOR_RAIL, DIAMOND_BLOCK, DIAMOND_ORE, DIORITE_STAIRS, DIRT, DIRT_WITH_ROOTS, DISPENSER, DOOR_BLOCK, DOUBLE_CHERRY_SLAB, DOUBLE_CUT_COPPER_SLAB, DOUBLE_MANGROVE_SLAB, DOUBLE_PLANT, DOUBLE_RED_SANDSTONE_SLAB, DOUBLE_SLAB, DOUBLE_SLABS, DOUBLE_STONE_BLOCK_SLAB, DOUBLE_STONE_BLOCK_SLAB2, DOUBLE_STONE_BLOCK_SLAB3, DOUBLE_STONE_BLOCK_SLAB4, DOUBLE_STONE_SLAB, DOUBLE_STONE_SLAB3, DOUBLE_STONE_SLAB4, DOUBLE_WOOD_SLAB, DOUBLE_WOOD_SLABS, DOUBLE_WOODEN_SLAB, DOUBLE_WOODEN_SLABS, DRAGON_EGG, DRIED_KELP_BLOCK, DRIPSTONE_BLOCK, DROPPER, EMERALD_BLOCK, EMERALD_ORE, ENCHANT_TABLE, ENCHANTING_TABLE, ENCHANTMENT_TABLE, END_BRICK_STAIRS, END_BRICKS, END_GATEWAY, END_PORTAL, END_PORTAL_FRAME, END_ROD, END_STONE, ENDER_CHEST, EXPOSED_COPPER, EXPOSED_CUT_COPPER, EXPOSED_CUT_COPPER_SLAB, EXPOSED_CUT_COPPER_STAIRS, EXPOSED_DOUBLE_CUT_COPPER_SLAB, FARMLAND, FENCE, FENCE_GATE, FENCE_GATE_ACACIA, FENCE_GATE_BIRCH, FENCE_GATE_DARK_OAK, FENCE_GATE_JUNGLE, FENCE_GATE_OAK, FENCE_GATE_SPRUCE, FIRE, FLETCHING_TABLE, FLOWER, FLOWER_POT_BLOCK, FLOWERING_AZALEA, FLOWING_LAVA, FLOWING_WATER, FROG_SPAWN, FURNACE, GILDED_BLACKSTONE, GLASS, GLASS_PANE, GLASS_PANEL, GLOW_FRAME, GLOW_LICHEN, GLOWING_OBSIDIAN, GLOWING_REDSTONE_ORE, GLOWSTONE, GLOWSTONE_BLOCK, GOLD_BLOCK, GOLD_ORE, GRANITE_STAIRS, GRASS, GRASS_PATH, GRAVEL, GRAY_CANDLE, GRAY_CANDLE_CAKE, GRAY_GLAZED_TERRACOTTA, GREEN_CANDLE, GREEN_CANDLE_CAKE, GREEN_GLAZED_TERRACOTTA, GRINDSTONE, HANGING_ROOTS, HARDENED_CLAY, HAY_BALE, HEAVY_WEIGHTED_PRESSURE_PLATE, HONEY_BLOCK, HONEYCOMB_BLOCK, HOPPER_BLOCK, ICE, ICE_FROSTED, INFESTED_DEEPSLATE, INFO_UPDATE, INFO_UPDATE2, INVISIBLE_BEDROCK, IRON_BAR, IRON_BARS, IRON_BLOCK, IRON_DOOR_BLOCK, IRON_ORE, IRON_TRAPDOOR, ITEM_FRAME_BLOCK, JACK_O_LANTERN, JIGSAW, JUKEBOX, JUNGLE_BUTTON, JUNGLE_DOOR_BLOCK, JUNGLE_HANGING_SIGN, JUNGLE_PRESSURE_PLATE, JUNGLE_STAIRS, JUNGLE_STANDING_SIGN, JUNGLE_TRAPDOOR, JUNGLE_WALL_SIGN, JUNGLE_WOOD_STAIRS, JUNGLE_WOODEN_STAIRS, LADDER, LANTERN, LAPIS_BLOCK, LAPIS_ORE, LARGE_AMETHYST_BUD, LAVA, LAVA_CAULDRON, LEAVE, LEAVE2, LEAVES, LEAVES2, LECTERN, LEVER, LIGHT_BLOCK, LIGHT_BLUE_CANDLE, LIGHT_BLUE_CANDLE_CAKE, LIGHT_BLUE_GLAZED_TERRACOTTA, LIGHT_GRAY_CANDLE, LIGHT_GRAY_CANDLE_CAKE, LIGHT_WEIGHTED_PRESSURE_PLATE, LIGHTNING_ROD, LILY_PAD, LIME_CANDLE, LIME_CANDLE_CAKE, LIME_GLAZED_TERRACOTTA, LIT_BLAST_FURNACE, LIT_DEEPSLATE_REDSTONE_ORE, LIT_FURNACE, LIT_PUMPKIN, LIT_REDSTONE_LAMP, LIT_REDSTONE_ORE, LIT_SMOKER, LODESTONE, LOG, LOG2, LOOM, MAGENTA_CANDLE, MAGENTA_CANDLE_CAKE, MAGENTA_GLAZED_TERRACOTTA, MAGMA, MANGROVE_BUTTON, MANGROVE_DOOR, MANGROVE_FENCE, MANGROVE_FENCE_GATE, MANGROVE_HANGING_SIGN, MANGROVE_LEAVES, MANGROVE_LOG, MANGROVE_PLANKS, MANGROVE_PRESSURE_PLATE, MANGROVE_PROPAGULE, MANGROVE_PROPAGULE_HANGING, MANGROVE_ROOTS, MANGROVE_SLAB, MANGROVE_STAIRS, MANGROVE_STANDING_SIGN, MANGROVE_TRAPDOOR, MANGROVE_WALL_SIGN, MANGROVE_WOOD, MEDIUM_AMETHYST_BUD, MELON_BLOCK, MELON_STEM, MOB_SPAWNER, MONSTER_EGG, MONSTER_SPAWNER, MOSS_BLOCK, MOSS_CARPET, MOSS_STONE, MOSSY_COBBLESTONE, MOSSY_COBBLESTONE_STAIRS, MOSSY_STONE, MOSSY_STONE_BRICK_STAIRS, MOVING_BLOCK, MUD, MUD_BRICK_DOUBLE_SLAB, MUD_BRICK_SLAB, MUD_BRICK_STAIRS, MUD_BRICK_WALL, MUD_BRICKS, MUDDY_MANGROVE_ROOTS, MYCELIUM, NETHER_BRICK_BLOCK, NETHER_BRICK_FENCE, NETHER_BRICKS, NETHER_BRICKS_STAIRS, NETHER_GOLD_ORE, NETHER_PORTAL, NETHER_REACTOR, NETHER_SPROUTS_BLOCK, NETHER_WART_BLOCK, NETHERITE_BLOCK, NETHERRACK, NETHERREACTOR, NORMAL_STONE_STAIRS, NOTEBLOCK, OAK_DOOR_BLOCK, OAK_HANGING_SIGN, OAK_STAIRS, OAK_WOOD_STAIRS, OAK_WOODEN_STAIRS, OBSERVER, OBSIDIAN, OCHRE_FROGLIGHT, ORANGE_CANDLE, ORANGE_CANDLE_CAKE, ORANGE_GLAZED_TERRACOTTA, OXIDIZED_COPPER, OXIDIZED_CUT_COPPER, OXIDIZED_CUT_COPPER_SLAB, OXIDIZED_CUT_COPPER_STAIRS, OXIDIZED_DOUBLE_CUT_COPPER_SLAB, PACKED_ICE, PACKED_MUD, PEARLESCENT_FROGLIGHT, PINK_CANDLE, PINK_CANDLE_CAKE, PINK_GLAZED_TERRACOTTA, PINK_PETALS, PISTON, PISTON_ARM_COLLISION, PISTON_EXTENSION, PISTON_HEAD_STICKY, PITCHER_CROP, PITCHER_PLANT, PLANK, PLANKS, PODZOL, POINTED_DRIPSTONE, POLISHED_ANDESITE_STAIRS, POLISHED_BASALT, POLISHED_BLACKSTONE, POLISHED_BLACKSTONE_BRICK_DOUBLE_SLAB, POLISHED_BLACKSTONE_BRICK_SLAB, POLISHED_BLACKSTONE_BRICK_STAIRS, POLISHED_BLACKSTONE_BRICK_WALL, POLISHED_BLACKSTONE_BRICKS, POLISHED_BLACKSTONE_BUTTON, POLISHED_BLACKSTONE_DOUBLE_SLAB, POLISHED_BLACKSTONE_PRESSURE_PLATE, POLISHED_BLACKSTONE_SLAB, POLISHED_BLACKSTONE_STAIRS, POLISHED_BLACKSTONE_WALL, POLISHED_DEEPSLATE, POLISHED_DEEPSLATE_DOUBLE_SLAB, POLISHED_DEEPSLATE_SLAB, POLISHED_DEEPSLATE_STAIRS, POLISHED_DEEPSLATE_WALL, POLISHED_DIORITE_STAIRS, POLISHED_GRANITE_STAIRS, POPPY, POTATO_BLOCK, POWDER_SNOW, POWERED_COMPARATOR, POWERED_RAIL, POWERED_REPEATER, PRISMARINE, PRISMARINE_BRICKS_STAIRS, PRISMARINE_STAIRS, PUMPKIN, PUMPKIN_STEM, PURPLE_CANDLE, PURPLE_CANDLE_CAKE, PURPLE_GLAZED_TERRACOTTA, PURPUR_BLOCK, PURPUR_STAIRS, QUARTZ_BLOCK, QUARTZ_BRICKS, QUARTZ_ORE, QUARTZ_STAIRS, RAIL, RAW_COPPER_BLOCK, RAW_GOLD_BLOCK, RAW_IRON_BLOCK, RED_CANDLE, RED_CANDLE_CAKE, RED_FLOWER, RED_GLAZED_TERRACOTTA, RED_MUSHROOM, RED_MUSHROOM_BLOCK, RED_NETHER_BRICK, RED_NETHER_BRICK_STAIRS, RED_SANDSTONE, RED_SANDSTONE_SLAB, RED_SANDSTONE_STAIRS, REDSTONE_BLOCK, REDSTONE_LAMP, REDSTONE_ORE, REDSTONE_TORCH, REDSTONE_WIRE, REEDS, REINFORCED_DEEPSLATE, REPEATING_COMMAND_BLOCK, RESPAWN_ANCHOR, ROSE, SAND, SANDSTONE, SANDSTONE_STAIRS, SAPLING, SAPLINGS, SCAFFOLDING, SCULK, SCULK_CATALYST, SCULK_SENSOR, SCULK_SHRIEKER, SCULK_VEIN, SEA_LANTERN, SEA_PICKLE, SEAGRASS, SHROOMLIGHT, SHULKER_BOX, SIGN_POST, SILVER_GLAZED_TERRACOTTA, SKULL_BLOCK, SLAB, SLABS, SLIME_BLOCK, SMALL_AMETHYST_BUD, SMALL_DRIPLEAF_BLOCK, SMITHING_TABLE, SMOKER, SMOOTH_BASALT, SMOOTH_QUARTZ_STAIRS, SMOOTH_RED_SANDSTONE_STAIRS, SMOOTH_SANDSTONE_STAIRS, SMOOTH_STONE, SNIFFER_EGG, SNOW, SNOW_BLOCK, SNOW_LAYER, SOUL_CAMPFIRE_BLOCK, SOUL_FIRE, SOUL_LANTERN, SOUL_SAND, SOUL_SOIL, SOUL_TORCH, SPONGE, SPORE_BLOSSOM, SPRUCE_BUTTON, SPRUCE_DOOR_BLOCK, SPRUCE_HANGING_SIGN, SPRUCE_PRESSURE_PLATE, SPRUCE_STAIRS, SPRUCE_STANDING_SIGN, SPRUCE_TRAPDOOR, SPRUCE_WALL_SIGN, SPRUCE_WOOD_STAIRS, SPRUCE_WOODEN_STAIRS, STAINED_GLASS, STAINED_GLASS_PANE, STAINED_HARDENED_CLAY, STAINED_TERRACOTTA, STANDING_BANNER, STICKY_PISTON, STICKY_PISTON_ARM_COLLISION, STILL_LAVA, STILL_WATER, STONE, STONE_BLOCK_SLAB, STONE_BLOCK_SLAB2, STONE_BLOCK_SLAB3, STONE_BLOCK_SLAB4, STONE_BRICK, STONE_BRICK_STAIRS, STONE_BRICKS, STONE_BUTTON, STONE_PRESSURE_PLATE, STONE_SLAB, STONE_SLAB3, STONE_SLAB4, STONE_STAIRS, STONE_WALL, STONEBRICK, STONECUTTER, STONECUTTER_BLOCK, STRIPPED_ACACIA_LOG, STRIPPED_BAMBOO_BLOCK, STRIPPED_BIRCH_LOG, STRIPPED_CHERRY_LOG, STRIPPED_CHERRY_WOOD, STRIPPED_CRIMSON_HYPHAE, STRIPPED_CRIMSON_STEM, STRIPPED_DARK_OAK_LOG, STRIPPED_JUNGLE_LOG, STRIPPED_MANGROVE_LOG, STRIPPED_MANGROVE_WOOD, STRIPPED_OAK_LOG, STRIPPED_SPRUCE_LOG, STRIPPED_WARPED_HYPHAE, STRIPPED_WARPED_STEM, STRUCTURE_BLOCK, STRUCTURE_VOID, SUGARCANE_BLOCK, SUSPICIOUS_GRAVEL, SUSPICIOUS_SAND, SWEET_BERRY_BUSH, TALL_GRASS, TARGET, TERRACOTTA, TINTED_GLASS, TNT, TORCH, TORCHFLOWER, TORCHFLOWER_CROP, TRAPDOOR, TRAPPED_CHEST, TRIP_WIRE, TRIPWIRE_HOOK, TRUNK, TRUNK2, TUFF, TURTLE_EGG, TWISTING_VINES, UNDYED_SHULKER_BOX, UNLIT_REDSTONE_TORCH, UNPOWERED_COMPARATOR, UNPOWERED_REPEATER, VERDANT_FROGLIGHT, VINE, VINES, WALL_BANNER, WALL_SIGN, WARPED_BUTTON, WARPED_DOOR_BLOCK, WARPED_DOUBLE_SLAB, WARPED_FENCE, WARPED_FENCE_GATE, WARPED_FUNGUS, WARPED_HANGING_SIGN, WARPED_HYPHAE, WARPED_NYLIUM, WARPED_PLANKS, WARPED_PRESSURE_PLATE, WARPED_ROOTS, WARPED_SLAB, WARPED_STAIRS, WARPED_STANDING_SIGN, WARPED_STEM, WARPED_TRAPDOOR, WARPED_WALL_SIGN, WARPED_WART_BLOCK, WATER, WATER_LILY, WATERLILY, WAXED_COPPER, WAXED_CUT_COPPER, WAXED_CUT_COPPER_SLAB, WAXED_CUT_COPPER_STAIRS, WAXED_DOUBLE_CUT_COPPER_SLAB, WAXED_EXPOSED_COPPER, WAXED_EXPOSED_CUT_COPPER, WAXED_EXPOSED_CUT_COPPER_SLAB, WAXED_EXPOSED_CUT_COPPER_STAIRS, WAXED_EXPOSED_DOUBLE_CUT_COPPER_SLAB, WAXED_OXIDIZED_COPPER, WAXED_OXIDIZED_CUT_COPPER, WAXED_OXIDIZED_CUT_COPPER_SLAB, WAXED_OXIDIZED_CUT_COPPER_STAIRS, WAXED_OXIDIZED_DOUBLE_CUT_COPPER_SLAB, WAXED_WEATHERED_COPPER, WAXED_WEATHERED_CUT_COPPER, WAXED_WEATHERED_CUT_COPPER_SLAB, WAXED_WEATHERED_CUT_COPPER_STAIRS, WAXED_WEATHERED_DOUBLE_CUT_COPPER_SLAB, WEATHERED_COPPER, WEATHERED_CUT_COPPER, WEATHERED_CUT_COPPER_SLAB, WEATHERED_CUT_COPPER_STAIRS, WEATHERED_DOUBLE_CUT_COPPER_SLAB, WEEPING_VINES, WHEAT_BLOCK, WHITE_CANDLE, WHITE_CANDLE_CAKE, WHITE_GLAZED_TERRACOTTA, WITHER_ROSE, WOOD, WOOD_BARK, WOOD_DOOR_BLOCK, WOOD_SLAB, WOOD_SLABS, WOOD_STAIRS, WOOD2, WOODEN_BUTTON, WOODEN_DOOR_BLOCK, WOODEN_PLANK, WOODEN_PLANKS, WOODEN_PRESSURE_PLATE, WOODEN_SLAB, WOODEN_SLABS, WOODEN_STAIRS, WOOL, WORKBENCH, YELLOW_CANDLE, YELLOW_CANDLE_CAKE, YELLOW_GLAZED_TERRACOTTA
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addVelocityToEntity
(Entity entity, Vector3 vector) void
afterRemoval
(Block newBlock, boolean update) final ItemBlock
boolean
double
calculateBreakTick
(Item item, Player player) 计算方块挖掘需要多少tick (计算算法来自https://minecraft.wiki/w/Breaking)double
calculateBreakTime
(Item item) double
calculateBreakTime
(Item item, Player player) 计算方块挖掘时间double
calculateBreakTimeNotInAir
(Item item, Player player) 忽略玩家在空中时,计算方块的挖掘时间calculateIntercept
(Vector3 pos1, Vector3 pos2) boolean
boolean
canBeBrokenWith
(Item item) boolean
boolean
boolean
boolean
boolean
boolean
boolean
canHarvest
(Item item) boolean
boolean
final boolean
boolean
boolean
final boolean
clone()
boolean
boolean
将方块克隆到指定位置boolean
boolean
collidesWithBB
(AxisAlignedBB bb, boolean collisionBB) int
long
static void
boolean
static boolean
diffusesSkyLight
(int blockId) down()
down
(int step) down
(int step, int layer) east()
east
(int step) east
(int step, int layer) static boolean
static boolean
boolean
equalsBlock
(Object obj) firstInLayers
(int startingLayer, Predicate<Block> condition) firstInLayers
(Predicate<Block> condition) forState
(IBlockState state) Replace all matching states of this block state with the same states of the given block state.static Block
get
(int id) static Block
get
(int id, int data) Deprecated.static Block
Deprecated.static Block
Deprecated.static Block
Deprecated.static Block
Deprecated.static Block
Deprecated.static Block
Deprecated.static Block
Deprecated.int
Deprecated.final Block
getBlock()
final int
Deprecated.boolean
getBooleanValue
(String propertyName) double
getBreakTime
(Item item) double
getBreakTime
(Item item, Player player) int
这个值越大,越有可能被旁边的火焰引燃int
这个值越大,这个方块本身越容易起火 返回-1,这个方块不能被点燃getColor()
int
final BlockState
static List<CustomBlockDefinition>
static HashMap<Integer,
CustomBlock> int
Deprecated.final Number
int
Item[]
控制方块被破坏时掉落的物品 常在Level.useBreakOn(Vector3, int, BlockFace, Item, Player, boolean, boolean)
方法被调用final int
double
服务端侧的摩擦系数,用于控制玩家丢弃物品、实体、船其在上方移动的速度。值越大,移动越快。int
Deprecated.PowerNukkit: The meta is limited to 32 bitsdouble
控制方块硬度static double
getHardness
(int blockId) abstract int
getId()
int
getIntValue
(String propertyName) int
int
int
Deprecated.int
控制方块吸收的光亮static int
getLightFilter
(int blockId) int
控制方块的发光等级static int
getLightLevel
(int blockId) double
getMaxX()
double
getMaxY()
double
getMaxZ()
getMetadata
(String metadataKey) double
getMinX()
double
getMinY()
double
getMinZ()
final MutableBlockState
abstract String
getName()
double
控制方块的通过阻力因素(0-1)。此值越小阻力越大getPersistenceValue
(String propertyName) The properties that fully describe all possible and valid states that this block can have.getPropertyValue
(String propertyName) double
控制方块爆炸抗性final int
getSideAtLayer
(int layer, BlockFace face) getSideAtLayer
(int layer, BlockFace face, int step) int
Deprecated.int
getStrongPower
(BlockFace side) getTickCachedSide
(BlockFace face) getTickCachedSide
(BlockFace face, int step) getTickCachedSideAtLayer
(int layer, BlockFace face) getTickCachedSideAtLayer
(int layer, BlockFace face, int step) int
控制挖掘方块的最低工具级别(木质、石质...)int
控制挖掘方块的工具类型int
获取走过这个方块所需要的额外代价,通常用于水、浆果丛等难以让实体经过的方块int
int
getWeakPower
(BlockFace face) boolean
boolean
int
hashCode()
boolean
hasMetadata
(String metadataKey) static void
init()
static void
final boolean
final boolean
isBlockChangeAllowed
(Player player) boolean
isBreakable
(Item item) boolean
isBreakable
(Vector3 vector, int layer, BlockFace face, Item item, Player player, boolean setBlockDestroy) boolean
boolean
boolean
Check if the block occupies the entire block space, like a stone and normal glass blocksboolean
Check if a block is getting powered threw a block or directly.static boolean
boolean
If the block, when in item form, is resistant to lava and fire and can float on lava like if it was on water.boolean
Check if the block is not transparent, is solid and can't provide redstone power.boolean
boolean
isSideFull
(BlockFace face) Check if the given face is fully occupied by the block bounding box.boolean
Check if the block is not transparent, is solid and is a full cube like a stone block.boolean
isSolid()
static boolean
isSolid
(int blockId) boolean
Check if blocks can be attached in the given side.boolean
boolean
控制方块是否透明(默认为false)static boolean
isTransparent
(int blockId) boolean
boolean
mustSilkTouch
(Vector3 vector, int layer, BlockFace face, Item item, Player player) north()
north
(int step) north
(int step, int layer) boolean
onActivate
(Item item) boolean
onActivate
(Item item, Player player) boolean
void
onEntityCollide
(Entity entity) void
onEntityFallOn
(Entity entity, float fallDistance) void
onNeighborChange
(BlockFace side) void
onPlayerRightClick
(Player player, Item item, BlockFace face, Vector3 clickPoint) boolean
onProjectileHit
(Entity projectile, Position position, Vector3 motion) int
onTouch
(Player player, PlayerInteractEvent.Action action) 当玩家使用与左键或者右键方块时会触发,常被用于处理例如物品展示框左键掉落物品这种逻辑
触发点在Player
的onBlockBreakStart中int
onUpdate
(int type) boolean
place
(Item item, Block block, Block target, BlockFace face, double fx, double fy, double fz, Player player) Place and initialize a this block correctly in the world.final void
protected AxisAlignedBB
protected AxisAlignedBB
static void
registerBlockImplementation
(int blockId, Class<? extends Block> blockClass, String persistenceName, boolean receivesRandomTick) Register a new block implementation overriding the existing one.static OK<?>
registerCustomBlock
(List<Class<? extends CustomBlock>> blockClassList) 注册自定义方块static OK<?>
registerCustomBlock
(Map<String, Class<? extends CustomBlock>> blockNamespaceClassMap) 注册自定义方块void
removeMetadata
(String metadataKey, Plugin owningPlugin) void
setBooleanValue
(String propertyName, boolean value) void
setDamage
(int meta) Deprecated.final void
Deprecated.void
setDataStorage
(Number storage) boolean
setDataStorage
(Number storage, boolean repair, Consumer<BlockStateRepair> callback) void
setDataStorageFromInt
(int storage) boolean
setDataStorageFromInt
(int storage, boolean repair, Consumer<BlockStateRepair> callback) void
setIntValue
(String propertyName, int value) void
setMetadata
(String metadataKey, MetadataValue newMetadataValue) void
setPropertyValue
(String propertyName, Serializable value) void
setState
(IBlockState state) Replace all matching states of this block state with the same states of the given block state.south()
south
(int step) south
(int step, int layer) boolean
int
tickRate()
toItem()
toString()
up()
up
(int step) up
(int step, int layer) boolean
west()
west
(int step) west
(int step, int layer) Methods inherited from class cn.nukkit.level.Position
abs, add, add, add, add, ceil, divide, floor, fromObject, fromObject, getChunk, getLevel, getLevelBlock, getLevelBlock, getLevelBlock, getLevelBlock, getLevelBlockAround, getLevelBlockAtLayer, getLevelBlockEntity, getLevelBlockState, getLevelBlockState, getLevelName, getLocation, getSidePos, getTickCachedLevelBlock, getTickCachedLevelBlockAtLayer, getTypedBlockEntity, getValidLevel, isValid, multiply, round, setComponents, setComponents, setLevel, setStrong, setWeak, subtract, subtract, subtract, subtract, subtract
Methods inherited from class cn.nukkit.positiontracking.NamedPosition
matchesNamedPosition
Methods inherited from class cn.nukkit.math.Vector3
asBlockVector3, asVector3f, cross, distance, distance, distanceManhattan, distanceSquared, distanceSquared, dot, equals, getAxis, getChunkSectionY, getChunkVector, getChunkX, getChunkZ, getFloorX, getFloorY, getFloorZ, getForward, getIntermediateWithXValue, getIntermediateWithYValue, getIntermediateWithZValue, getRight, getSideVec, getSouth, getUp, getWest, getX, getY, getZ, length, lengthSquared, maxPlainDistance, maxPlainDistance, maxPlainDistance, maxPlainDistance, maxPlainDistance, normalize, rawHashCode, setComponentsAdding, setComponentsAdding, setX, setY, setZ
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface cn.nukkit.math.AxisAlignedBB
addCoord, calculateXOffset, calculateYOffset, calculateZOffset, contract, expand, forEach, getAverageEdgeLength, getOffsetBoundingBox, getOffsetBoundingBox, grow, intersectsWith, isVectorInside, isVectorInside, isVectorInXY, isVectorInXZ, isVectorInYZ, offset, setBB, setBounds, setMaxX, setMaxY, setMaxZ, setMinX, setMinY, setMinZ, shrink
Methods inherited from interface cn.nukkit.blockstate.IBlockState
asItemBlock, getBigId, getBitSize, getBlock, getBlock, getBlock, getBlock, getBlock, getBlock, getBlock, getBlockRepairing, getBlockRepairing, getBlockRepairing, getBlockRepairing, getBlockRepairing, getBlockRepairing, getBlockRepairing, getBlockRepairing, getBooleanValue, getCheckedProperty, getCheckedPropertyValue, getIntValue, getLegacyStateId, getMinimalistStateId, getPersistenceName, getPersistenceValue, getProperty, getPropertyNames, getPropertyValue, getStateId, getUncheckedPropertyValue, getUncheckedPropertyValue
Methods inherited from interface cn.nukkit.blockstate.IMutableBlockState
setBooleanValue, setDataStorage, setDataStorageFromInt, setDataStorageFromItemBlockMeta, setIntValue, setPropertyValue, toggleBooleanProperty, toggleBooleanProperty
-
Field Details
-
EMPTY_ARRAY
-
MAX_BLOCK_ID
@DeprecationDetails(since="1.4.0.0-PN", reason="It is being replaced by an other solution that don\'t require a fixed size") @PowerNukkitOnly public static final int MAX_BLOCK_ID -
DATA_BITS
@Deprecated @DeprecationDetails(since="1.4.0.0-PN", reason="It\'s not a constant value, it may be changed on major updates and plugins will have to be recompiled in order to update this value in the binary files, it\'s also being replaced by the BlockState system") @PowerNukkitOnly public static final int DATA_BITSDeprecated. -
DATA_SIZE
@Deprecated @DeprecationDetails(since="1.4.0.0-PN", reason="It\'s not a constant value, it may be changed on major updates and plugins will have to be recompiled in order to update this value in the binary files, it\'s also being replaced by the BlockState system") @PowerNukkitOnly public static final int DATA_SIZEDeprecated. -
DATA_MASK
@Deprecated @DeprecationDetails(since="1.4.0.0-PN", reason="It\'s not a constant value, it may be changed on major updates and plugins will have to be recompiled in order to update this value in the binary files, it\'s also being replaced by the BlockState system") @PowerNukkitOnly public static final int DATA_MASKDeprecated. -
list
@Deprecated @DeprecationDetails(since="1.4.0.0-PN", reason="Not encapsulated, easy to break", replaceWith="Block.get(int).getClass(), to register new blocks use registerBlockImplementation()") public static Class<? extends Block>[] listDeprecated. -
fullList
@DeprecationDetails(reason="The meta is limited to 32 bits", since="1.3.0.0-PN", replaceWith="To register/override implementations use registerBlockImplementation(), to get the block with a given state use BlockState.of and than BlockState.getBlock()") @Deprecated public static Block[] fullListDeprecated. -
light
@Deprecated @DeprecationDetails(reason="Not encapsulated, easy to break", since="1.4.0.0-PN", replaceWith="Block.getLightLevel() or Block.getLightLevel(int)") public static int[] lightDeprecated. -
lightFilter
@Deprecated @DeprecationDetails(reason="Not encapsulated, easy to break", since="1.4.0.0-PN", replaceWith="Block.getLightFilter() or Block.getLightFilter(int)") public static int[] lightFilterDeprecated. -
solid
@Deprecated @DeprecationDetails(reason="Not encapsulated, easy to break", since="1.4.0.0-PN", replaceWith="Block.isSolid() or Block.isSolid(int)") public static boolean[] solidDeprecated. -
hardness
@Deprecated @DeprecationDetails(reason="Not encapsulated, easy to break", since="1.4.0.0-PN", replaceWith="Block.getHardness() or Block.getHardness(int)") public static double[] hardnessDeprecated. -
transparent
@Deprecated @DeprecationDetails(reason="Not encapsulated, easy to break", since="1.4.0.0-PN", replaceWith="Block.isTransparent() or Block.isTransparent(int)") public static boolean[] transparentDeprecated. -
ID_TO_CUSTOM_BLOCK
@PowerNukkitXOnly public static final it.unimi.dsi.fastutil.ints.Int2ObjectMap<CustomBlock> ID_TO_CUSTOM_BLOCK -
CUSTOM_BLOCK_ID_MAP
-
hasMeta
@Deprecated @DeprecationDetails(since="1.4.0.0-PN", reason="It\'s being replaced by the BlockState system") public static boolean[] hasMetaDeprecated.if a block has can have variants -
layer
-
DEFAULT_FRICTION_FACTOR
public static final double DEFAULT_FRICTION_FACTOR- See Also:
-
DEFAULT_AIR_FLUID_FRICTION
public static final double DEFAULT_AIR_FLUID_FRICTION- See Also:
-
VANILLA_BLOCK_COLOR_MAP
-
color
-
-
Constructor Details
-
Block
protected Block()
-
-
Method Details
-
isInitializing
-
init
public static void init() -
get
-
get
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", replaceWith="BlockState.getBlock()", since="1.4.0.0-PN") public static Block get(int id, Integer meta) Deprecated. -
get
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", replaceWith="BlockState.getBlock()", since="1.4.0.0-PN") public static Block get(int id, Integer meta, Position pos) Deprecated. -
get
@PowerNukkitOnly @Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", replaceWith="BlockState.getBlock()", since="1.4.0.0-PN") public static Block get(int id, Integer meta, Position pos, int layer) Deprecated. -
get
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", replaceWith="BlockState.getBlock()", since="1.4.0.0-PN") public static Block get(int id, int data) Deprecated. -
get
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.3.0.0-PN") public static Block get(int fullId, Level level, int x, int y, int z) Deprecated. -
get
@PowerNukkitOnly @Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.3.0.0-PN") public static Block get(int fullId, Level level, int x, int y, int z, int layer) Deprecated. -
get
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", replaceWith="BlockState.getBlock()", since="1.4.0.0-PN") @PowerNukkitOnly @Since("1.3.0.0-PN") public static Block get(int id, int meta, Level level, int x, int y, int z) Deprecated. -
get
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", replaceWith="BlockState.getBlock()", since="1.4.0.0-PN") @PowerNukkitOnly @Since("1.3.0.0-PN") public static Block get(int id, int meta, Level level, int x, int y, int z, int layer) Deprecated. -
isSolid
-
diffusesSkyLight
-
getHardness
-
getLightLevel
-
getLightFilter
-
isTransparent
-
registerBlockImplementation
@PowerNukkitOnly @Since("1.4.0.0-PN") public static void registerBlockImplementation(int blockId, @NotNull Class<? extends Block> blockClass, @NotNull String persistenceName, boolean receivesRandomTick) Register a new block implementation overriding the existing one.- Parameters:
blockId
- The block ID that will be registered. Can't be negative.blockClass
- The class that overridesBlock
and implements this block, it must have a constructor without params and optionally one that acceptsNumber
orint
persistenceName
- The block persistence name, must use the format namespace:block_namereceivesRandomTick
- If the block should receive random ticks from the level
-
registerCustomBlock
@PowerNukkitXOnly public static OK<?> registerCustomBlock(@NotNull List<Class<? extends CustomBlock>> blockClassList) 注册自定义方块- Parameters:
blockClassList
- 传入自定义方块class List
-
registerCustomBlock
@PowerNukkitXOnly public static OK<?> registerCustomBlock(@NotNull Map<String, Class<? extends CustomBlock>> blockNamespaceClassMap) 注册自定义方块- Parameters:
blockNamespaceClassMap
- 传入自定义方块classMap { key: NamespaceID, value: Class }
-
initCustomBlock
public static void initCustomBlock() -
deleteAllCustomBlock
-
getCustomBlockDefinitionList
@PowerNukkitXOnly @Since("1.19.31-r1") public static List<CustomBlockDefinition> getCustomBlockDefinitionList() -
getCustomBlockMap
-
getMutableState
-
place
public boolean place(@NotNull Item item, @NotNull Block block, @NotNull Block target, @NotNull BlockFace face, double fx, double fy, double fz, @Nullable Player player) Place and initialize a this block correctly in the world.The current instance must have level, x, y, z, and layer properties already set before calling this method.
- Parameters:
item
- The item being used to place the block. Should be used as an optional reference, may mismatch the block that is being placed depending on plugin implementations.block
- The current block that is in the world and is getting replaced by this instance. It has the same x, y, z, layer, and level as this block.target
- The block that was clicked to create the place action in this block position.face
- The face that was clicked in the target blockfx
- The detailed X coordinate of the clicked target block facefy
- The detailed Y coordinate of the clicked target block facefz
- The detailed Z coordinate of the clicked target block faceplayer
- The player that is placing the block. May be null.- Returns:
true
if the block was properly place. The implementation is responsible for reverting any partial change.
-
canHarvestWithHand
public boolean canHarvestWithHand() -
isBreakable
-
tickRate
public int tickRate() -
onBreak
-
onUpdate
public int onUpdate(int type) -
onTouch
@PowerNukkitOnly @Since("1.4.0.0-PN") public int onTouch(@Nullable Player player, PlayerInteractEvent.Action action) 当玩家使用与左键或者右键方块时会触发,常被用于处理例如物品展示框左键掉落物品这种逻辑
触发点在Player
的onBlockBreakStart中It will be triggered when the player uses the left or right click on the block, which is often used to deal with logic such as left button dropping items in the item frame
The trigger point is in the onBlockBreakStart ofPlayer
- Parameters:
player
- the playeraction
- the action- Returns:
- 状态值,返回值不为0代表这是一个touch操作而不是一个挖掘方块的操作
Status value, if the return value is not 0, it means that this is a touch operation rather than a mining block operation
-
onPlayerRightClick
-
onNeighborChange
-
onActivate
-
onActivate
-
afterRemoval
-
isSoulSpeedCompatible
-
getHardness
public double getHardness()控制方块硬度- Returns:
- 方块的硬度
-
getResistance
public double getResistance()控制方块爆炸抗性- Returns:
- 方块的爆炸抗性
-
getBurnChance
public int getBurnChance()这个值越大,这个方块本身越容易起火 返回-1,这个方块不能被点燃The higher this value, the more likely the block itself is to catch fire
- Returns:
- the burn chance
-
getBurnAbility
public int getBurnAbility()这个值越大,越有可能被旁边的火焰引燃The higher this value, the more likely it is to be ignited by the fire next to it
-
getToolType
public int getToolType()控制挖掘方块的工具类型- Returns:
- 挖掘方块的工具类型
-
getFrictionFactor
public double getFrictionFactor()服务端侧的摩擦系数,用于控制玩家丢弃物品、实体、船其在上方移动的速度。值越大,移动越快。The friction on the server side, which is used to control the speed that player drops item,entity walk and boat movement on the block.The larger the value, the faster the movement.
-
getPassableBlockFrictionFactor
控制方块的通过阻力因素(0-1)。此值越小阻力越大 对于不可穿过的方块,若未覆写,此值始终为1(无效) -
getWalkThroughExtraCost
获取走过这个方块所需要的额外代价,通常用于水、浆果丛等难以让实体经过的方块- Returns:
- 走过这个方块所需要的额外代价
-
getLightLevel
public int getLightLevel()控制方块的发光等级- Returns:
- 发光等级(0 - 15)
-
canBePlaced
public boolean canBePlaced() -
canBeReplaced
public boolean canBeReplaced() -
isTransparent
public boolean isTransparent()控制方块是否透明(默认为false)- Returns:
- 方块是否透明
-
isSolid
public boolean isSolid() -
isSolid
Check if blocks can be attached in the given side. -
diffusesSkyLight
-
canBeFlowedInto
public boolean canBeFlowedInto() -
getWaterloggingLevel
-
canWaterloggingFlowInto
-
canBeActivated
public boolean canBeActivated() -
hasEntityCollision
public boolean hasEntityCollision() -
canPassThrough
public boolean canPassThrough() -
canBePushed
public boolean canBePushed()- Returns:
- 方块是否可以被活塞推动
-
canBePulled
- Returns:
- 方块是否可以被活塞拉动
-
breaksWhenMoved
- Returns:
- 当被活塞移动时是否会被破坏
-
sticksToPiston
- Returns:
- 是否可以粘在粘性活塞上
-
canSticksBlock
- Returns:
- 被活塞移动的时候是否可以粘住其他方块。eg:粘液块,蜂蜜块
-
hasComparatorInputOverride
public boolean hasComparatorInputOverride() -
getComparatorInputOverride
public int getComparatorInputOverride() -
canHarvest
-
getToolTier
控制挖掘方块的最低工具级别(木质、石质...)- Returns:
- 挖掘方块的最低工具级别
-
canBeClimbed
public boolean canBeClimbed() -
getColor
-
getName
-
getId
public abstract int getId() -
getItemId
-
getFullId
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.3.0.0-PN") public int getFullId()Deprecated.PowerNukkit: The meta is limited to 32 bitsThe full id is a combination of the id and data.- Specified by:
getFullId
in interfaceIBlockState
- Returns:
- full id
-
getProperties
The properties that fully describe all possible and valid states that this block can have.- Specified by:
getProperties
in interfaceIBlockState
-
getCurrentState
- Specified by:
getCurrentState
in interfaceIBlockState
-
getRuntimeId
- Specified by:
getRuntimeId
in interfaceIBlockState
-
addVelocityToEntity
-
getDamage
@Deprecated @DeprecationDetails(reason="Limited to 32 bits", since="1.4.0.0-PN") public int getDamage()Deprecated. -
setDamage
@Deprecated @DeprecationDetails(reason="Limited to 32 bits", since="1.4.0.0-PN") public void setDamage(int meta) Deprecated. -
setDamage
@Deprecated @DeprecationDetails(reason="Limited to 32 bits", since="1.4.0.0-PN") public final void setDamage(Integer meta) Deprecated. -
position
-
getDrops
控制方块被破坏时掉落的物品 常在Level.useBreakOn(Vector3, int, BlockFace, Item, Player, boolean, boolean)
方法被调用- Returns:
- 掉落的物品数组
-
getBreakTime
-
getBreakTime
-
calculateBreakTime
-
calculateBreakTime
@PowerNukkitOnly @Since("1.4.0.0-PN") public double calculateBreakTime(@NotNull Item item, @Nullable Player player) 计算方块挖掘时间- Parameters:
item
- 挖掘该方块的物品player
- 挖掘该方块的玩家- Returns:
- 方块的挖掘时间
-
calculateBreakTimeNotInAir
@PowerNukkitOnly @Since("1.4.0.0-PN") public double calculateBreakTimeNotInAir(@NotNull Item item, @Nullable Player player) 忽略玩家在空中时,计算方块的挖掘时间- Parameters:
item
- 挖掘该方块的物品player
- 挖掘该方块的玩家- Returns:
- 方块的挖掘时间
-
calculateBreakTick
计算方块挖掘需要多少tick (计算算法来自https://minecraft.wiki/w/Breaking)- Parameters:
item
- 挖掘工具player
- 挖掘方块的玩家- Returns:
- 挖掘耗费的tick
-
canBeBrokenWith
-
getTickCachedSide
-
getTickCachedSide
-
getTickCachedSideAtLayer
@PowerNukkitXOnly @Since("1.6.0.0-PNX") public Block getTickCachedSideAtLayer(int layer, BlockFace face) -
getTickCachedSideAtLayer
@PowerNukkitXOnly @Since("1.6.0.0-PNX") public Block getTickCachedSideAtLayer(int layer, BlockFace face, int step) -
getSide
-
getSide
-
getSideAtLayer
-
getSideAtLayer
-
up
-
up
-
up
-
down
-
down
-
down
-
north
-
north
-
north
-
south
-
south
-
south
-
east
-
east
-
east
-
west
-
west
-
west
-
toString
-
collidesWithBB
-
collidesWithBB
-
onEntityCollide
-
onEntityFallOn
@PowerNukkitXOnly @Since("1.6.0.0-PNX") public void onEntityFallOn(Entity entity, float fallDistance) -
useDefaultFallDamage
-
getBoundingBox
-
getCollisionBoundingBox
-
recalculateBoundingBox
-
getMinX
public double getMinX()- Specified by:
getMinX
in interfaceAxisAlignedBB
-
getMinY
public double getMinY()- Specified by:
getMinY
in interfaceAxisAlignedBB
-
getMinZ
public double getMinZ()- Specified by:
getMinZ
in interfaceAxisAlignedBB
-
getMaxX
public double getMaxX()- Specified by:
getMaxX
in interfaceAxisAlignedBB
-
getMaxY
public double getMaxY()- Specified by:
getMaxY
in interfaceAxisAlignedBB
-
getMaxZ
public double getMaxZ()- Specified by:
getMaxZ
in interfaceAxisAlignedBB
-
recalculateCollisionBoundingBox
-
calculateIntercept
- Specified by:
calculateIntercept
in interfaceAxisAlignedBB
-
getSaveId
-
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
-
clone
- Specified by:
clone
in interfaceAxisAlignedBB
- Overrides:
clone
in classPosition
-
getWeakPower
-
getStrongPower
-
isPowerSource
public boolean isPowerSource() -
getLocationHash
-
getDropExp
public int getDropExp() -
isNormalBlock
public boolean isNormalBlock()Check if the block is not transparent, is solid and can't provide redstone power. -
isSimpleBlock
Check if the block is not transparent, is solid and is a full cube like a stone block. -
isSideFull
Check if the given face is fully occupied by the block bounding box.- Parameters:
face
- The face to be checked- Returns:
- If and only if the bounding box completely cover the face
-
isFullBlock
Check if the block occupies the entire block space, like a stone and normal glass blocks -
equals
-
equals
-
toItem
-
isLavaResistant
If the block, when in item form, is resistant to lava and fire and can float on lava like if it was on water.- Since:
- 1.4.0.0-PN
-
asItemBlock
- Specified by:
asItemBlock
in interfaceIBlockState
-
canSilkTouch
public boolean canSilkTouch() -
mustSilkTouch
-
mustDrop
-
firstInLayers
-
firstInLayers
@PowerNukkitOnly public Optional<Block> firstInLayers(int startingLayer, Predicate<Block> condition) -
setState
@PowerNukkitOnly @Since("1.4.0.0-PN") public void setState(@NotNull IBlockState state) throws InvalidBlockStateException Description copied from interface:IMutableBlockState
Replace all matching states of this block state with the same states of the given block state.States that doesn't exists in the other state are ignored.
Only properties that matches each other will be copied, for example, if this state have an age property going from 0 to 7 and the other have an age from 0 to 15, the age property won't change.
- Specified by:
setState
in interfaceIMutableBlockState
- Parameters:
state
- The states that will have the properties copied.- Throws:
InvalidBlockStateException
- If the given storage has invalid data properties
-
forState
@Since("1.5.1.0-PN") @PowerNukkitOnly @NotNull public Block forState(@NotNull IBlockState state) throws InvalidBlockStateException Description copied from interface:IMutableBlockState
Replace all matching states of this block state with the same states of the given block state. But giving opportunity to return a new instance of this mutable state if needed.States that doesn't exists in the other state are ignored.
Only properties that matches each other will be copied, for example, if this state have an age property going from 0 to 7 and the other have an age from 0 to 15, the age property won't change.
If the implementation recognizes that the given state does not match the current set of properties and needs an update, it may update and return a new state with a different block id and different set of properties that represent the expected visual state. The this change can be detected with an
==
operation.- Specified by:
forState
in interfaceIMutableBlockState
- Parameters:
state
- The states that will have the properties copied.- Throws:
InvalidBlockStateException
- If the given storage has invalid data properties
-
setDataStorage
@PowerNukkitOnly @Since("1.4.0.0-PN") public void setDataStorage(@Nonnegative @NotNull Number storage) - Specified by:
setDataStorage
in interfaceIMutableBlockState
-
setDataStorageFromInt
- Specified by:
setDataStorageFromInt
in interfaceIMutableBlockState
-
setDataStorage
@Since("1.4.0.0-PN") @PowerNukkitOnly public boolean setDataStorage(@Nonnegative @NotNull Number storage, boolean repair, Consumer<BlockStateRepair> callback) - Specified by:
setDataStorage
in interfaceIMutableBlockState
- Returns:
- if the storage was repaired
-
setDataStorageFromInt
@Since("1.4.0.0-PN") @PowerNukkitOnly public boolean setDataStorageFromInt(@Nonnegative int storage, boolean repair, Consumer<BlockStateRepair> callback) - Specified by:
setDataStorageFromInt
in interfaceIMutableBlockState
- Returns:
- if the storage was repaired
-
setPropertyValue
@PowerNukkitOnly @Since("1.4.0.0-PN") public void setPropertyValue(@NotNull String propertyName, @Nullable Serializable value) - Specified by:
setPropertyValue
in interfaceIMutableBlockState
-
setBooleanValue
@PowerNukkitOnly @Since("1.4.0.0-PN") public void setBooleanValue(@NotNull String propertyName, boolean value) - Specified by:
setBooleanValue
in interfaceIMutableBlockState
-
setIntValue
@PowerNukkitOnly @Since("1.4.0.0-PN") public void setIntValue(@NotNull String propertyName, int value) - Specified by:
setIntValue
in interfaceIMutableBlockState
-
getBlockId
@Nonnegative @PowerNukkitOnly @Since("1.4.0.0-PN") @Deprecated @DeprecationDetails(reason="Does the same as getId() but the other is compatible with NukkitX and this is not", since="1.4.0.0-PN") public final int getBlockId()Deprecated.- Specified by:
getBlockId
in interfaceIBlockState
-
getDataStorage
- Specified by:
getDataStorage
in interfaceIBlockState
-
getLegacyDamage
@Nonnegative @PowerNukkitOnly @Since("1.4.0.0-PN") @Deprecated @DeprecationDetails(reason="Can\'t store all data, exists for backward compatibility reasons", since="1.4.0.0-PN", replaceWith="getDataStorage()") public int getLegacyDamage()Deprecated.- Specified by:
getLegacyDamage
in interfaceIBlockState
-
getBigDamage
@Unsigned @PowerNukkitOnly @Since("1.4.0.0-PN") @Deprecated @DeprecationDetails(reason="Can\'t store all data, exists for backward compatibility reasons", since="1.4.0.0-PN", replaceWith="getDataStorage()") public int getBigDamage()Deprecated.- Specified by:
getBigDamage
in interfaceIBlockState
-
getSignedBigDamage
@Nonnegative @Since("1.4.0.0-PN") @PowerNukkitOnly @Deprecated @DeprecationDetails(reason="Can\'t store all data, exists for backward compatibility reasons", since="1.4.0.0-PN", replaceWith="getDataStorage()") public int getSignedBigDamage()Deprecated.- Specified by:
getSignedBigDamage
in interfaceIBlockState
-
getHugeDamage
- Specified by:
getHugeDamage
in interfaceIBlockState
-
getPropertyValue
@PowerNukkitOnly @Since("1.4.0.0-PN") @NotNull public Serializable getPropertyValue(@NotNull String propertyName) - Specified by:
getPropertyValue
in interfaceIBlockState
-
getIntValue
- Specified by:
getIntValue
in interfaceIBlockState
-
getBooleanValue
- Specified by:
getBooleanValue
in interfaceIBlockState
-
getPersistenceValue
@PowerNukkitOnly @Since("1.4.0.0-PN") @NotNull public String getPersistenceValue(@NotNull String propertyName) - Specified by:
getPersistenceValue
in interfaceIBlockState
-
getExactIntStorage
- Specified by:
getExactIntStorage
in interfaceIBlockState
-
isBreakable
-
isBlockChangeAllowed
-
isBlockChangeAllowed
@PowerNukkitOnly @Since("1.4.0.0-PN") public final boolean isBlockChangeAllowed(@Nullable Player player) -
getLightFilter
控制方块吸收的光亮- Returns:
- 方块吸收的光亮
-
canRandomTick
-
onProjectileHit
@PowerNukkitOnly @Since("1.4.0.0-PN") public boolean onProjectileHit(@NotNull Entity projectile, @NotNull Position position, @NotNull Vector3 motion) -
getBlock
- Specified by:
getBlock
in interfaceIBlockState
-
isDefaultState
- Specified by:
isDefaultState
in interfaceIBlockState
-
getItemMaxStackSize
-
isGettingPower
@PowerNukkitOnly @Since("1.4.0.0-PN") @PowerNukkitDifference(info="Used so often, why not create own method here?", since="1.4.0.0-PN") public boolean isGettingPower()Check if a block is getting powered threw a block or directly.- Returns:
- if the gets powered.
-
cloneTo
-
cloneTo
将方块克隆到指定位置 此方法会连带克隆方块实体 注意,此方法会先清除指定位置的方块为空气再进行克隆- Parameters:
pos
- 要克隆到的位置update
- 是否需要更新克隆的方块- Returns:
- 是否克隆成功
-
equalsBlock
-
computeBlockStateHash
-
hashCode
public int hashCode() -
computeUnsignedBlockStateHash
-
isFertilizable
-