From 1a19bc457f4bb8de1819826f9d36bae9a9aa1aeb Mon Sep 17 00:00:00 2001 From: matt <4009945+MattBDev@users.noreply.github.com> Date: Tue, 2 Apr 2019 15:03:59 -0400 Subject: [PATCH 01/11] Added Nullable to BlockTypes --- .../worldedit/world/block/BlockTypes.java | 1206 ++++++++--------- 1 file changed, 603 insertions(+), 603 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypes.java index 57ae659ec..455edecce 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypes.java @@ -65,605 +65,605 @@ public class BlockTypes{ Replaced at runtime by the block registry ----------------------------------------------------- */ - public static final BlockType __RESERVED__ = register("minecraft:__reserved__"); - public static final BlockType ACACIA_BUTTON = register("minecraft:acacia_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType ACACIA_DOOR = register("minecraft:acacia_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType ACACIA_FENCE = register("minecraft:acacia_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType ACACIA_FENCE_GATE = register("minecraft:acacia_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType ACACIA_LEAVES = register("minecraft:acacia_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); - public static final BlockType ACACIA_LOG = register("minecraft:acacia_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType ACACIA_PLANKS = register("minecraft:acacia_planks"); - public static final BlockType ACACIA_PRESSURE_PLATE = register("minecraft:acacia_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType ACACIA_SAPLING = register("minecraft:acacia_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); - public static final BlockType ACACIA_SLAB = register("minecraft:acacia_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType ACACIA_STAIRS = register("minecraft:acacia_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType ACACIA_TRAPDOOR = register("minecraft:acacia_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType ACACIA_WOOD = register("minecraft:acacia_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType ACTIVATOR_RAIL = register("minecraft:activator_rail", state -> state.with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("shape"), "north_south")); - public static final BlockType AIR = register("minecraft:air"); - public static final BlockType ALLIUM = register("minecraft:allium"); - public static final BlockType ANDESITE = register("minecraft:andesite"); - public static final BlockType ANVIL = register("minecraft:anvil", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType ATTACHED_MELON_STEM = register("minecraft:attached_melon_stem", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType ATTACHED_PUMPKIN_STEM = register("minecraft:attached_pumpkin_stem", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType AZURE_BLUET = register("minecraft:azure_bluet"); - public static final BlockType BARRIER = register("minecraft:barrier"); - public static final BlockType BEACON = register("minecraft:beacon"); - public static final BlockType BEDROCK = register("minecraft:bedrock"); - public static final BlockType BEETROOTS = register("minecraft:beetroots", state -> state.with(state.getBlockType().getProperty("age"), 0)); - public static final BlockType BIRCH_BUTTON = register("minecraft:birch_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType BIRCH_DOOR = register("minecraft:birch_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType BIRCH_FENCE = register("minecraft:birch_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType BIRCH_FENCE_GATE = register("minecraft:birch_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType BIRCH_LEAVES = register("minecraft:birch_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); - public static final BlockType BIRCH_LOG = register("minecraft:birch_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType BIRCH_PLANKS = register("minecraft:birch_planks"); - public static final BlockType BIRCH_PRESSURE_PLATE = register("minecraft:birch_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType BIRCH_SAPLING = register("minecraft:birch_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); - public static final BlockType BIRCH_SLAB = register("minecraft:birch_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType BIRCH_STAIRS = register("minecraft:birch_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType BIRCH_TRAPDOOR = register("minecraft:birch_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType BIRCH_WOOD = register("minecraft:birch_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType BLACK_BANNER = register("minecraft:black_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - public static final BlockType BLACK_BED = register("minecraft:black_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - public static final BlockType BLACK_CARPET = register("minecraft:black_carpet"); - public static final BlockType BLACK_CONCRETE = register("minecraft:black_concrete"); - public static final BlockType BLACK_CONCRETE_POWDER = register("minecraft:black_concrete_powder"); - public static final BlockType BLACK_GLAZED_TERRACOTTA = register("minecraft:black_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType BLACK_SHULKER_BOX = register("minecraft:black_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - public static final BlockType BLACK_STAINED_GLASS = register("minecraft:black_stained_glass"); - public static final BlockType BLACK_STAINED_GLASS_PANE = register("minecraft:black_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType BLACK_TERRACOTTA = register("minecraft:black_terracotta"); - public static final BlockType BLACK_WALL_BANNER = register("minecraft:black_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType BLACK_WOOL = register("minecraft:black_wool"); - public static final BlockType BLUE_BANNER = register("minecraft:blue_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - public static final BlockType BLUE_BED = register("minecraft:blue_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - public static final BlockType BLUE_CARPET = register("minecraft:blue_carpet"); - public static final BlockType BLUE_CONCRETE = register("minecraft:blue_concrete"); - public static final BlockType BLUE_CONCRETE_POWDER = register("minecraft:blue_concrete_powder"); - public static final BlockType BLUE_GLAZED_TERRACOTTA = register("minecraft:blue_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType BLUE_ICE = register("minecraft:blue_ice"); - public static final BlockType BLUE_ORCHID = register("minecraft:blue_orchid"); - public static final BlockType BLUE_SHULKER_BOX = register("minecraft:blue_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - public static final BlockType BLUE_STAINED_GLASS = register("minecraft:blue_stained_glass"); - public static final BlockType BLUE_STAINED_GLASS_PANE = register("minecraft:blue_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType BLUE_TERRACOTTA = register("minecraft:blue_terracotta"); - public static final BlockType BLUE_WALL_BANNER = register("minecraft:blue_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType BLUE_WOOL = register("minecraft:blue_wool"); - public static final BlockType BONE_BLOCK = register("minecraft:bone_block", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType BOOKSHELF = register("minecraft:bookshelf"); - public static final BlockType BRAIN_CORAL = register("minecraft:brain_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType BRAIN_CORAL_BLOCK = register("minecraft:brain_coral_block"); - public static final BlockType BRAIN_CORAL_FAN = register("minecraft:brain_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType BRAIN_CORAL_WALL_FAN = register("minecraft:brain_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType BREWING_STAND = register("minecraft:brewing_stand", state -> state.with(state.getBlockType().getProperty("has_bottle_0"), false).with(state.getBlockType().getProperty("has_bottle_1"), false).with(state.getBlockType().getProperty("has_bottle_2"), false)); - public static final BlockType BRICK_SLAB = register("minecraft:brick_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType BRICK_STAIRS = register("minecraft:brick_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType BRICKS = register("minecraft:bricks"); - public static final BlockType BROWN_BANNER = register("minecraft:brown_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - public static final BlockType BROWN_BED = register("minecraft:brown_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - public static final BlockType BROWN_CARPET = register("minecraft:brown_carpet"); - public static final BlockType BROWN_CONCRETE = register("minecraft:brown_concrete"); - public static final BlockType BROWN_CONCRETE_POWDER = register("minecraft:brown_concrete_powder"); - public static final BlockType BROWN_GLAZED_TERRACOTTA = register("minecraft:brown_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType BROWN_MUSHROOM = register("minecraft:brown_mushroom"); - public static final BlockType BROWN_MUSHROOM_BLOCK = register("minecraft:brown_mushroom_block", state -> state.with(state.getBlockType().getProperty("down"), true).with(state.getBlockType().getProperty("east"), true).with(state.getBlockType().getProperty("north"), true).with(state.getBlockType().getProperty("south"), true).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("west"), true)); - public static final BlockType BROWN_SHULKER_BOX = register("minecraft:brown_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - public static final BlockType BROWN_STAINED_GLASS = register("minecraft:brown_stained_glass"); - public static final BlockType BROWN_STAINED_GLASS_PANE = register("minecraft:brown_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType BROWN_TERRACOTTA = register("minecraft:brown_terracotta"); - public static final BlockType BROWN_WALL_BANNER = register("minecraft:brown_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType BROWN_WOOL = register("minecraft:brown_wool"); - public static final BlockType BUBBLE_COLUMN = register("minecraft:bubble_column", state -> state.with(state.getBlockType().getProperty("drag"), true)); - public static final BlockType BUBBLE_CORAL = register("minecraft:bubble_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType BUBBLE_CORAL_BLOCK = register("minecraft:bubble_coral_block"); - public static final BlockType BUBBLE_CORAL_FAN = register("minecraft:bubble_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType BUBBLE_CORAL_WALL_FAN = register("minecraft:bubble_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType CACTUS = register("minecraft:cactus", state -> state.with(state.getBlockType().getProperty("age"), 0)); - public static final BlockType CAKE = register("minecraft:cake", state -> state.with(state.getBlockType().getProperty("bites"), 0)); - public static final BlockType CARROTS = register("minecraft:carrots", state -> state.with(state.getBlockType().getProperty("age"), 0)); - public static final BlockType CARVED_PUMPKIN = register("minecraft:carved_pumpkin", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType CAULDRON = register("minecraft:cauldron", state -> state.with(state.getBlockType().getProperty("level"), 0)); - public static final BlockType CAVE_AIR = register("minecraft:cave_air"); - public static final BlockType CHAIN_COMMAND_BLOCK = register("minecraft:chain_command_block", state -> state.with(state.getBlockType().getProperty("conditional"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType CHEST = register("minecraft:chest", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("type"), "SINGLE").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType CHIPPED_ANVIL = register("minecraft:chipped_anvil", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType CHISELED_QUARTZ_BLOCK = register("minecraft:chiseled_quartz_block"); - public static final BlockType CHISELED_RED_SANDSTONE = register("minecraft:chiseled_red_sandstone"); - public static final BlockType CHISELED_SANDSTONE = register("minecraft:chiseled_sandstone"); - public static final BlockType CHISELED_STONE_BRICKS = register("minecraft:chiseled_stone_bricks"); - public static final BlockType CHORUS_FLOWER = register("minecraft:chorus_flower", state -> state.with(state.getBlockType().getProperty("age"), 0)); - public static final BlockType CHORUS_PLANT = register("minecraft:chorus_plant", state -> state.with(state.getBlockType().getProperty("down"), false).with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType CLAY = register("minecraft:clay"); - public static final BlockType COAL_BLOCK = register("minecraft:coal_block"); - public static final BlockType COAL_ORE = register("minecraft:coal_ore"); - public static final BlockType COARSE_DIRT = register("minecraft:coarse_dirt"); - public static final BlockType COBBLESTONE = register("minecraft:cobblestone"); - public static final BlockType COBBLESTONE_SLAB = register("minecraft:cobblestone_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType COBBLESTONE_STAIRS = register("minecraft:cobblestone_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType COBBLESTONE_WALL = register("minecraft:cobblestone_wall", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType COBWEB = register("minecraft:cobweb"); - public static final BlockType COCOA = register("minecraft:cocoa", state -> state.with(state.getBlockType().getProperty("age"), 0).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType COMMAND_BLOCK = register("minecraft:command_block", state -> state.with(state.getBlockType().getProperty("conditional"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType COMPARATOR = register("minecraft:comparator", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("mode"), "compare").with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType CONDUIT = register("minecraft:conduit", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType CRACKED_STONE_BRICKS = register("minecraft:cracked_stone_bricks"); - public static final BlockType CRAFTING_TABLE = register("minecraft:crafting_table"); - public static final BlockType CREEPER_HEAD = register("minecraft:creeper_head", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - public static final BlockType CREEPER_WALL_HEAD = register("minecraft:creeper_wall_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType CUT_RED_SANDSTONE = register("minecraft:cut_red_sandstone"); - public static final BlockType CUT_SANDSTONE = register("minecraft:cut_sandstone"); - public static final BlockType CYAN_BANNER = register("minecraft:cyan_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - public static final BlockType CYAN_BED = register("minecraft:cyan_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - public static final BlockType CYAN_CARPET = register("minecraft:cyan_carpet"); - public static final BlockType CYAN_CONCRETE = register("minecraft:cyan_concrete"); - public static final BlockType CYAN_CONCRETE_POWDER = register("minecraft:cyan_concrete_powder"); - public static final BlockType CYAN_GLAZED_TERRACOTTA = register("minecraft:cyan_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType CYAN_SHULKER_BOX = register("minecraft:cyan_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - public static final BlockType CYAN_STAINED_GLASS = register("minecraft:cyan_stained_glass"); - public static final BlockType CYAN_STAINED_GLASS_PANE = register("minecraft:cyan_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType CYAN_TERRACOTTA = register("minecraft:cyan_terracotta"); - public static final BlockType CYAN_WALL_BANNER = register("minecraft:cyan_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType CYAN_WOOL = register("minecraft:cyan_wool"); - public static final BlockType DAMAGED_ANVIL = register("minecraft:damaged_anvil", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType DANDELION = register("minecraft:dandelion"); - public static final BlockType DARK_OAK_BUTTON = register("minecraft:dark_oak_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType DARK_OAK_DOOR = register("minecraft:dark_oak_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType DARK_OAK_FENCE = register("minecraft:dark_oak_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType DARK_OAK_FENCE_GATE = register("minecraft:dark_oak_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType DARK_OAK_LEAVES = register("minecraft:dark_oak_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); - public static final BlockType DARK_OAK_LOG = register("minecraft:dark_oak_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType DARK_OAK_PLANKS = register("minecraft:dark_oak_planks"); - public static final BlockType DARK_OAK_PRESSURE_PLATE = register("minecraft:dark_oak_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType DARK_OAK_SAPLING = register("minecraft:dark_oak_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); - public static final BlockType DARK_OAK_SLAB = register("minecraft:dark_oak_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType DARK_OAK_STAIRS = register("minecraft:dark_oak_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType DARK_OAK_TRAPDOOR = register("minecraft:dark_oak_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType DARK_OAK_WOOD = register("minecraft:dark_oak_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType DARK_PRISMARINE = register("minecraft:dark_prismarine"); - public static final BlockType DARK_PRISMARINE_SLAB = register("minecraft:dark_prismarine_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType DARK_PRISMARINE_STAIRS = register("minecraft:dark_prismarine_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType DAYLIGHT_DETECTOR = register("minecraft:daylight_detector", state -> state.with(state.getBlockType().getProperty("inverted"), false).with(state.getBlockType().getProperty("power"), 0)); - public static final BlockType DEAD_BRAIN_CORAL = register("minecraft:dead_brain_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType DEAD_BRAIN_CORAL_BLOCK = register("minecraft:dead_brain_coral_block"); - public static final BlockType DEAD_BRAIN_CORAL_FAN = register("minecraft:dead_brain_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType DEAD_BRAIN_CORAL_WALL_FAN = register("minecraft:dead_brain_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType DEAD_BUBBLE_CORAL = register("minecraft:dead_bubble_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType DEAD_BUBBLE_CORAL_BLOCK = register("minecraft:dead_bubble_coral_block"); - public static final BlockType DEAD_BUBBLE_CORAL_FAN = register("minecraft:dead_bubble_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType DEAD_BUBBLE_CORAL_WALL_FAN = register("minecraft:dead_bubble_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType DEAD_BUSH = register("minecraft:dead_bush"); - public static final BlockType DEAD_FIRE_CORAL = register("minecraft:dead_fire_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType DEAD_FIRE_CORAL_BLOCK = register("minecraft:dead_fire_coral_block"); - public static final BlockType DEAD_FIRE_CORAL_FAN = register("minecraft:dead_fire_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType DEAD_FIRE_CORAL_WALL_FAN = register("minecraft:dead_fire_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType DEAD_HORN_CORAL = register("minecraft:dead_horn_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType DEAD_HORN_CORAL_BLOCK = register("minecraft:dead_horn_coral_block"); - public static final BlockType DEAD_HORN_CORAL_FAN = register("minecraft:dead_horn_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType DEAD_HORN_CORAL_WALL_FAN = register("minecraft:dead_horn_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType DEAD_TUBE_CORAL = register("minecraft:dead_tube_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType DEAD_TUBE_CORAL_BLOCK = register("minecraft:dead_tube_coral_block"); - public static final BlockType DEAD_TUBE_CORAL_FAN = register("minecraft:dead_tube_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType DEAD_TUBE_CORAL_WALL_FAN = register("minecraft:dead_tube_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType DETECTOR_RAIL = register("minecraft:detector_rail", state -> state.with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("shape"), "north_south")); - public static final BlockType DIAMOND_BLOCK = register("minecraft:diamond_block"); - public static final BlockType DIAMOND_ORE = register("minecraft:diamond_ore"); - public static final BlockType DIORITE = register("minecraft:diorite"); - public static final BlockType DIRT = register("minecraft:dirt"); - public static final BlockType DISPENSER = register("minecraft:dispenser", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("triggered"), false)); - public static final BlockType DRAGON_EGG = register("minecraft:dragon_egg"); - public static final BlockType DRAGON_HEAD = register("minecraft:dragon_head", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - public static final BlockType DRAGON_WALL_HEAD = register("minecraft:dragon_wall_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType DRIED_KELP_BLOCK = register("minecraft:dried_kelp_block"); - public static final BlockType DROPPER = register("minecraft:dropper", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("triggered"), false)); - public static final BlockType EMERALD_BLOCK = register("minecraft:emerald_block"); - public static final BlockType EMERALD_ORE = register("minecraft:emerald_ore"); - public static final BlockType ENCHANTING_TABLE = register("minecraft:enchanting_table"); - public static final BlockType END_GATEWAY = register("minecraft:end_gateway"); - public static final BlockType END_PORTAL = register("minecraft:end_portal"); - public static final BlockType END_PORTAL_FRAME = register("minecraft:end_portal_frame", state -> state.with(state.getBlockType().getProperty("eye"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType END_ROD = register("minecraft:end_rod", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - public static final BlockType END_STONE = register("minecraft:end_stone"); - public static final BlockType END_STONE_BRICKS = register("minecraft:end_stone_bricks"); - public static final BlockType ENDER_CHEST = register("minecraft:ender_chest", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType FARMLAND = register("minecraft:farmland", state -> state.with(state.getBlockType().getProperty("moisture"), 0)); - public static final BlockType FERN = register("minecraft:fern"); - public static final BlockType FIRE = register("minecraft:fire", state -> state.with(state.getBlockType().getProperty("age"), 0).with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType FIRE_CORAL = register("minecraft:fire_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType FIRE_CORAL_BLOCK = register("minecraft:fire_coral_block"); - public static final BlockType FIRE_CORAL_FAN = register("minecraft:fire_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType FIRE_CORAL_WALL_FAN = register("minecraft:fire_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType FLOWER_POT = register("minecraft:flower_pot"); - public static final BlockType FROSTED_ICE = register("minecraft:frosted_ice", state -> state.with(state.getBlockType().getProperty("age"), 0)); - public static final BlockType FURNACE = register("minecraft:furnace", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("lit"), false)); - public static final BlockType GLASS = register("minecraft:glass"); - public static final BlockType GLASS_PANE = register("minecraft:glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType GLOWSTONE = register("minecraft:glowstone"); - public static final BlockType GOLD_BLOCK = register("minecraft:gold_block"); - public static final BlockType GOLD_ORE = register("minecraft:gold_ore"); - public static final BlockType GRANITE = register("minecraft:granite"); - public static final BlockType GRASS = register("minecraft:grass"); - public static final BlockType GRASS_BLOCK = register("minecraft:grass_block", state -> state.with(state.getBlockType().getProperty("snowy"), false)); - public static final BlockType GRASS_PATH = register("minecraft:grass_path"); - public static final BlockType GRAVEL = register("minecraft:gravel"); - public static final BlockType GRAY_BANNER = register("minecraft:gray_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - public static final BlockType GRAY_BED = register("minecraft:gray_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - public static final BlockType GRAY_CARPET = register("minecraft:gray_carpet"); - public static final BlockType GRAY_CONCRETE = register("minecraft:gray_concrete"); - public static final BlockType GRAY_CONCRETE_POWDER = register("minecraft:gray_concrete_powder"); - public static final BlockType GRAY_GLAZED_TERRACOTTA = register("minecraft:gray_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType GRAY_SHULKER_BOX = register("minecraft:gray_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - public static final BlockType GRAY_STAINED_GLASS = register("minecraft:gray_stained_glass"); - public static final BlockType GRAY_STAINED_GLASS_PANE = register("minecraft:gray_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType GRAY_TERRACOTTA = register("minecraft:gray_terracotta"); - public static final BlockType GRAY_WALL_BANNER = register("minecraft:gray_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType GRAY_WOOL = register("minecraft:gray_wool"); - public static final BlockType GREEN_BANNER = register("minecraft:green_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - public static final BlockType GREEN_BED = register("minecraft:green_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - public static final BlockType GREEN_CARPET = register("minecraft:green_carpet"); - public static final BlockType GREEN_CONCRETE = register("minecraft:green_concrete"); - public static final BlockType GREEN_CONCRETE_POWDER = register("minecraft:green_concrete_powder"); - public static final BlockType GREEN_GLAZED_TERRACOTTA = register("minecraft:green_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType GREEN_SHULKER_BOX = register("minecraft:green_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - public static final BlockType GREEN_STAINED_GLASS = register("minecraft:green_stained_glass"); - public static final BlockType GREEN_STAINED_GLASS_PANE = register("minecraft:green_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType GREEN_TERRACOTTA = register("minecraft:green_terracotta"); - public static final BlockType GREEN_WALL_BANNER = register("minecraft:green_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType GREEN_WOOL = register("minecraft:green_wool"); - public static final BlockType HAY_BLOCK = register("minecraft:hay_block", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType HEAVY_WEIGHTED_PRESSURE_PLATE = register("minecraft:heavy_weighted_pressure_plate", state -> state.with(state.getBlockType().getProperty("power"), 0)); - public static final BlockType HOPPER = register("minecraft:hopper", state -> state.with(state.getBlockType().getProperty("enabled"), true).with(state.getBlockType().getProperty("facing"), Direction.DOWN)); - public static final BlockType HORN_CORAL = register("minecraft:horn_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType HORN_CORAL_BLOCK = register("minecraft:horn_coral_block"); - public static final BlockType HORN_CORAL_FAN = register("minecraft:horn_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType HORN_CORAL_WALL_FAN = register("minecraft:horn_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType ICE = register("minecraft:ice"); - public static final BlockType INFESTED_CHISELED_STONE_BRICKS = register("minecraft:infested_chiseled_stone_bricks"); - public static final BlockType INFESTED_COBBLESTONE = register("minecraft:infested_cobblestone"); - public static final BlockType INFESTED_CRACKED_STONE_BRICKS = register("minecraft:infested_cracked_stone_bricks"); - public static final BlockType INFESTED_MOSSY_STONE_BRICKS = register("minecraft:infested_mossy_stone_bricks"); - public static final BlockType INFESTED_STONE = register("minecraft:infested_stone"); - public static final BlockType INFESTED_STONE_BRICKS = register("minecraft:infested_stone_bricks"); - public static final BlockType IRON_BARS = register("minecraft:iron_bars", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType IRON_BLOCK = register("minecraft:iron_block"); - public static final BlockType IRON_DOOR = register("minecraft:iron_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType IRON_ORE = register("minecraft:iron_ore"); - public static final BlockType IRON_TRAPDOOR = register("minecraft:iron_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType JACK_O_LANTERN = register("minecraft:jack_o_lantern", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType JUKEBOX = register("minecraft:jukebox", state -> state.with(state.getBlockType().getProperty("has_record"), false)); - public static final BlockType JUNGLE_BUTTON = register("minecraft:jungle_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType JUNGLE_DOOR = register("minecraft:jungle_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType JUNGLE_FENCE = register("minecraft:jungle_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType JUNGLE_FENCE_GATE = register("minecraft:jungle_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType JUNGLE_LEAVES = register("minecraft:jungle_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); - public static final BlockType JUNGLE_LOG = register("minecraft:jungle_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType JUNGLE_PLANKS = register("minecraft:jungle_planks"); - public static final BlockType JUNGLE_PRESSURE_PLATE = register("minecraft:jungle_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType JUNGLE_SAPLING = register("minecraft:jungle_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); - public static final BlockType JUNGLE_SLAB = register("minecraft:jungle_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType JUNGLE_STAIRS = register("minecraft:jungle_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType JUNGLE_TRAPDOOR = register("minecraft:jungle_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType JUNGLE_WOOD = register("minecraft:jungle_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType KELP = register("minecraft:kelp", state -> state.with(state.getBlockType().getProperty("age"), 0)); - public static final BlockType KELP_PLANT = register("minecraft:kelp_plant"); - public static final BlockType LADDER = register("minecraft:ladder", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType LAPIS_BLOCK = register("minecraft:lapis_block"); - public static final BlockType LAPIS_ORE = register("minecraft:lapis_ore"); - public static final BlockType LARGE_FERN = register("minecraft:large_fern", state -> state.with(state.getBlockType().getProperty("half"), "lower")); - public static final BlockType LAVA = register("minecraft:lava", state -> state.with(state.getBlockType().getProperty("level"), 0)); - public static final BlockType LEVER = register("minecraft:lever", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType LIGHT_BLUE_BANNER = register("minecraft:light_blue_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - public static final BlockType LIGHT_BLUE_BED = register("minecraft:light_blue_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - public static final BlockType LIGHT_BLUE_CARPET = register("minecraft:light_blue_carpet"); - public static final BlockType LIGHT_BLUE_CONCRETE = register("minecraft:light_blue_concrete"); - public static final BlockType LIGHT_BLUE_CONCRETE_POWDER = register("minecraft:light_blue_concrete_powder"); - public static final BlockType LIGHT_BLUE_GLAZED_TERRACOTTA = register("minecraft:light_blue_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType LIGHT_BLUE_SHULKER_BOX = register("minecraft:light_blue_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - public static final BlockType LIGHT_BLUE_STAINED_GLASS = register("minecraft:light_blue_stained_glass"); - public static final BlockType LIGHT_BLUE_STAINED_GLASS_PANE = register("minecraft:light_blue_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType LIGHT_BLUE_TERRACOTTA = register("minecraft:light_blue_terracotta"); - public static final BlockType LIGHT_BLUE_WALL_BANNER = register("minecraft:light_blue_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType LIGHT_BLUE_WOOL = register("minecraft:light_blue_wool"); - public static final BlockType LIGHT_GRAY_BANNER = register("minecraft:light_gray_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - public static final BlockType LIGHT_GRAY_BED = register("minecraft:light_gray_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - public static final BlockType LIGHT_GRAY_CARPET = register("minecraft:light_gray_carpet"); - public static final BlockType LIGHT_GRAY_CONCRETE = register("minecraft:light_gray_concrete"); - public static final BlockType LIGHT_GRAY_CONCRETE_POWDER = register("minecraft:light_gray_concrete_powder"); - public static final BlockType LIGHT_GRAY_GLAZED_TERRACOTTA = register("minecraft:light_gray_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType LIGHT_GRAY_SHULKER_BOX = register("minecraft:light_gray_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - public static final BlockType LIGHT_GRAY_STAINED_GLASS = register("minecraft:light_gray_stained_glass"); - public static final BlockType LIGHT_GRAY_STAINED_GLASS_PANE = register("minecraft:light_gray_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType LIGHT_GRAY_TERRACOTTA = register("minecraft:light_gray_terracotta"); - public static final BlockType LIGHT_GRAY_WALL_BANNER = register("minecraft:light_gray_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType LIGHT_GRAY_WOOL = register("minecraft:light_gray_wool"); - public static final BlockType LIGHT_WEIGHTED_PRESSURE_PLATE = register("minecraft:light_weighted_pressure_plate", state -> state.with(state.getBlockType().getProperty("power"), 0)); - public static final BlockType LILAC = register("minecraft:lilac", state -> state.with(state.getBlockType().getProperty("half"), "lower")); - public static final BlockType LILY_PAD = register("minecraft:lily_pad"); - public static final BlockType LIME_BANNER = register("minecraft:lime_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - public static final BlockType LIME_BED = register("minecraft:lime_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - public static final BlockType LIME_CARPET = register("minecraft:lime_carpet"); - public static final BlockType LIME_CONCRETE = register("minecraft:lime_concrete"); - public static final BlockType LIME_CONCRETE_POWDER = register("minecraft:lime_concrete_powder"); - public static final BlockType LIME_GLAZED_TERRACOTTA = register("minecraft:lime_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType LIME_SHULKER_BOX = register("minecraft:lime_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - public static final BlockType LIME_STAINED_GLASS = register("minecraft:lime_stained_glass"); - public static final BlockType LIME_STAINED_GLASS_PANE = register("minecraft:lime_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType LIME_TERRACOTTA = register("minecraft:lime_terracotta"); - public static final BlockType LIME_WALL_BANNER = register("minecraft:lime_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType LIME_WOOL = register("minecraft:lime_wool"); - public static final BlockType MAGENTA_BANNER = register("minecraft:magenta_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - public static final BlockType MAGENTA_BED = register("minecraft:magenta_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - public static final BlockType MAGENTA_CARPET = register("minecraft:magenta_carpet"); - public static final BlockType MAGENTA_CONCRETE = register("minecraft:magenta_concrete"); - public static final BlockType MAGENTA_CONCRETE_POWDER = register("minecraft:magenta_concrete_powder"); - public static final BlockType MAGENTA_GLAZED_TERRACOTTA = register("minecraft:magenta_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType MAGENTA_SHULKER_BOX = register("minecraft:magenta_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - public static final BlockType MAGENTA_STAINED_GLASS = register("minecraft:magenta_stained_glass"); - public static final BlockType MAGENTA_STAINED_GLASS_PANE = register("minecraft:magenta_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType MAGENTA_TERRACOTTA = register("minecraft:magenta_terracotta"); - public static final BlockType MAGENTA_WALL_BANNER = register("minecraft:magenta_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType MAGENTA_WOOL = register("minecraft:magenta_wool"); - public static final BlockType MAGMA_BLOCK = register("minecraft:magma_block"); - public static final BlockType MELON = register("minecraft:melon"); - public static final BlockType MELON_STEM = register("minecraft:melon_stem", state -> state.with(state.getBlockType().getProperty("age"), 0)); - public static final BlockType MOSSY_COBBLESTONE = register("minecraft:mossy_cobblestone"); - public static final BlockType MOSSY_COBBLESTONE_WALL = register("minecraft:mossy_cobblestone_wall", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType MOSSY_STONE_BRICKS = register("minecraft:mossy_stone_bricks"); - public static final BlockType MOVING_PISTON = register("minecraft:moving_piston", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("type"), "normal")); - public static final BlockType MUSHROOM_STEM = register("minecraft:mushroom_stem", state -> state.with(state.getBlockType().getProperty("down"), true).with(state.getBlockType().getProperty("east"), true).with(state.getBlockType().getProperty("north"), true).with(state.getBlockType().getProperty("south"), true).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("west"), true)); - public static final BlockType MYCELIUM = register("minecraft:mycelium", state -> state.with(state.getBlockType().getProperty("snowy"), false)); - public static final BlockType NETHER_BRICK_FENCE = register("minecraft:nether_brick_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType NETHER_BRICK_SLAB = register("minecraft:nether_brick_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType NETHER_BRICK_STAIRS = register("minecraft:nether_brick_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType NETHER_BRICKS = register("minecraft:nether_bricks"); - public static final BlockType NETHER_PORTAL = register("minecraft:nether_portal", state -> state.with(state.getBlockType().getProperty("axis"), "x")); - public static final BlockType NETHER_QUARTZ_ORE = register("minecraft:nether_quartz_ore"); - public static final BlockType NETHER_WART = register("minecraft:nether_wart", state -> state.with(state.getBlockType().getProperty("age"), 0)); - public static final BlockType NETHER_WART_BLOCK = register("minecraft:nether_wart_block"); - public static final BlockType NETHERRACK = register("minecraft:netherrack"); - public static final BlockType NOTE_BLOCK = register("minecraft:note_block", state -> state.with(state.getBlockType().getProperty("instrument"), "HARP").with(state.getBlockType().getProperty("note"), 0).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType OAK_BUTTON = register("minecraft:oak_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType OAK_DOOR = register("minecraft:oak_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType OAK_FENCE = register("minecraft:oak_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType OAK_FENCE_GATE = register("minecraft:oak_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType OAK_LEAVES = register("minecraft:oak_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); - public static final BlockType OAK_LOG = register("minecraft:oak_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType OAK_PLANKS = register("minecraft:oak_planks"); - public static final BlockType OAK_PRESSURE_PLATE = register("minecraft:oak_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType OAK_SAPLING = register("minecraft:oak_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); - public static final BlockType OAK_SLAB = register("minecraft:oak_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType OAK_STAIRS = register("minecraft:oak_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType OAK_TRAPDOOR = register("minecraft:oak_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType OAK_WOOD = register("minecraft:oak_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType OBSERVER = register("minecraft:observer", state -> state.with(state.getBlockType().getProperty("facing"), Direction.SOUTH).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType OBSIDIAN = register("minecraft:obsidian"); - public static final BlockType ORANGE_BANNER = register("minecraft:orange_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - public static final BlockType ORANGE_BED = register("minecraft:orange_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - public static final BlockType ORANGE_CARPET = register("minecraft:orange_carpet"); - public static final BlockType ORANGE_CONCRETE = register("minecraft:orange_concrete"); - public static final BlockType ORANGE_CONCRETE_POWDER = register("minecraft:orange_concrete_powder"); - public static final BlockType ORANGE_GLAZED_TERRACOTTA = register("minecraft:orange_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType ORANGE_SHULKER_BOX = register("minecraft:orange_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - public static final BlockType ORANGE_STAINED_GLASS = register("minecraft:orange_stained_glass"); - public static final BlockType ORANGE_STAINED_GLASS_PANE = register("minecraft:orange_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType ORANGE_TERRACOTTA = register("minecraft:orange_terracotta"); - public static final BlockType ORANGE_TULIP = register("minecraft:orange_tulip"); - public static final BlockType ORANGE_WALL_BANNER = register("minecraft:orange_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType ORANGE_WOOL = register("minecraft:orange_wool"); - public static final BlockType OXEYE_DAISY = register("minecraft:oxeye_daisy"); - public static final BlockType PACKED_ICE = register("minecraft:packed_ice"); - public static final BlockType PEONY = register("minecraft:peony", state -> state.with(state.getBlockType().getProperty("half"), "lower")); - public static final BlockType PETRIFIED_OAK_SLAB = register("minecraft:petrified_oak_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType PINK_BANNER = register("minecraft:pink_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - public static final BlockType PINK_BED = register("minecraft:pink_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - public static final BlockType PINK_CARPET = register("minecraft:pink_carpet"); - public static final BlockType PINK_CONCRETE = register("minecraft:pink_concrete"); - public static final BlockType PINK_CONCRETE_POWDER = register("minecraft:pink_concrete_powder"); - public static final BlockType PINK_GLAZED_TERRACOTTA = register("minecraft:pink_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType PINK_SHULKER_BOX = register("minecraft:pink_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - public static final BlockType PINK_STAINED_GLASS = register("minecraft:pink_stained_glass"); - public static final BlockType PINK_STAINED_GLASS_PANE = register("minecraft:pink_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType PINK_TERRACOTTA = register("minecraft:pink_terracotta"); - public static final BlockType PINK_TULIP = register("minecraft:pink_tulip"); - public static final BlockType PINK_WALL_BANNER = register("minecraft:pink_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType PINK_WOOL = register("minecraft:pink_wool"); - public static final BlockType PISTON = register("minecraft:piston", state -> state.with(state.getBlockType().getProperty("extended"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType PISTON_HEAD = register("minecraft:piston_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("short"), false).with(state.getBlockType().getProperty("type"), "normal")); - public static final BlockType PLAYER_HEAD = register("minecraft:player_head", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - public static final BlockType PLAYER_WALL_HEAD = register("minecraft:player_wall_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType PODZOL = register("minecraft:podzol", state -> state.with(state.getBlockType().getProperty("snowy"), false)); - public static final BlockType POLISHED_ANDESITE = register("minecraft:polished_andesite"); - public static final BlockType POLISHED_DIORITE = register("minecraft:polished_diorite"); - public static final BlockType POLISHED_GRANITE = register("minecraft:polished_granite"); - public static final BlockType POPPY = register("minecraft:poppy"); - public static final BlockType POTATOES = register("minecraft:potatoes", state -> state.with(state.getBlockType().getProperty("age"), 0)); - public static final BlockType POTTED_ACACIA_SAPLING = register("minecraft:potted_acacia_sapling"); - public static final BlockType POTTED_ALLIUM = register("minecraft:potted_allium"); - public static final BlockType POTTED_AZURE_BLUET = register("minecraft:potted_azure_bluet"); - public static final BlockType POTTED_BIRCH_SAPLING = register("minecraft:potted_birch_sapling"); - public static final BlockType POTTED_BLUE_ORCHID = register("minecraft:potted_blue_orchid"); - public static final BlockType POTTED_BROWN_MUSHROOM = register("minecraft:potted_brown_mushroom"); - public static final BlockType POTTED_CACTUS = register("minecraft:potted_cactus"); - public static final BlockType POTTED_DANDELION = register("minecraft:potted_dandelion"); - public static final BlockType POTTED_DARK_OAK_SAPLING = register("minecraft:potted_dark_oak_sapling"); - public static final BlockType POTTED_DEAD_BUSH = register("minecraft:potted_dead_bush"); - public static final BlockType POTTED_FERN = register("minecraft:potted_fern"); - public static final BlockType POTTED_JUNGLE_SAPLING = register("minecraft:potted_jungle_sapling"); - public static final BlockType POTTED_OAK_SAPLING = register("minecraft:potted_oak_sapling"); - public static final BlockType POTTED_ORANGE_TULIP = register("minecraft:potted_orange_tulip"); - public static final BlockType POTTED_OXEYE_DAISY = register("minecraft:potted_oxeye_daisy"); - public static final BlockType POTTED_PINK_TULIP = register("minecraft:potted_pink_tulip"); - public static final BlockType POTTED_POPPY = register("minecraft:potted_poppy"); - public static final BlockType POTTED_RED_MUSHROOM = register("minecraft:potted_red_mushroom"); - public static final BlockType POTTED_RED_TULIP = register("minecraft:potted_red_tulip"); - public static final BlockType POTTED_SPRUCE_SAPLING = register("minecraft:potted_spruce_sapling"); - public static final BlockType POTTED_WHITE_TULIP = register("minecraft:potted_white_tulip"); - public static final BlockType POWERED_RAIL = register("minecraft:powered_rail", state -> state.with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("shape"), "north_south")); - public static final BlockType PRISMARINE = register("minecraft:prismarine"); - public static final BlockType PRISMARINE_BRICK_SLAB = register("minecraft:prismarine_brick_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType PRISMARINE_BRICK_STAIRS = register("minecraft:prismarine_brick_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType PRISMARINE_BRICKS = register("minecraft:prismarine_bricks"); - public static final BlockType PRISMARINE_SLAB = register("minecraft:prismarine_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType PRISMARINE_STAIRS = register("minecraft:prismarine_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType PUMPKIN = register("minecraft:pumpkin"); - public static final BlockType PUMPKIN_STEM = register("minecraft:pumpkin_stem", state -> state.with(state.getBlockType().getProperty("age"), 0)); - public static final BlockType PURPLE_BANNER = register("minecraft:purple_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - public static final BlockType PURPLE_BED = register("minecraft:purple_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - public static final BlockType PURPLE_CARPET = register("minecraft:purple_carpet"); - public static final BlockType PURPLE_CONCRETE = register("minecraft:purple_concrete"); - public static final BlockType PURPLE_CONCRETE_POWDER = register("minecraft:purple_concrete_powder"); - public static final BlockType PURPLE_GLAZED_TERRACOTTA = register("minecraft:purple_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType PURPLE_SHULKER_BOX = register("minecraft:purple_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - public static final BlockType PURPLE_STAINED_GLASS = register("minecraft:purple_stained_glass"); - public static final BlockType PURPLE_STAINED_GLASS_PANE = register("minecraft:purple_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType PURPLE_TERRACOTTA = register("minecraft:purple_terracotta"); - public static final BlockType PURPLE_WALL_BANNER = register("minecraft:purple_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType PURPLE_WOOL = register("minecraft:purple_wool"); - public static final BlockType PURPUR_BLOCK = register("minecraft:purpur_block"); - public static final BlockType PURPUR_PILLAR = register("minecraft:purpur_pillar", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType PURPUR_SLAB = register("minecraft:purpur_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType PURPUR_STAIRS = register("minecraft:purpur_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType QUARTZ_BLOCK = register("minecraft:quartz_block"); - public static final BlockType QUARTZ_PILLAR = register("minecraft:quartz_pillar", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType QUARTZ_SLAB = register("minecraft:quartz_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType QUARTZ_STAIRS = register("minecraft:quartz_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType RAIL = register("minecraft:rail", state -> state.with(state.getBlockType().getProperty("shape"), "north_south")); - public static final BlockType RED_BANNER = register("minecraft:red_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - public static final BlockType RED_BED = register("minecraft:red_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - public static final BlockType RED_CARPET = register("minecraft:red_carpet"); - public static final BlockType RED_CONCRETE = register("minecraft:red_concrete"); - public static final BlockType RED_CONCRETE_POWDER = register("minecraft:red_concrete_powder"); - public static final BlockType RED_GLAZED_TERRACOTTA = register("minecraft:red_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType RED_MUSHROOM = register("minecraft:red_mushroom"); - public static final BlockType RED_MUSHROOM_BLOCK = register("minecraft:red_mushroom_block", state -> state.with(state.getBlockType().getProperty("down"), true).with(state.getBlockType().getProperty("east"), true).with(state.getBlockType().getProperty("north"), true).with(state.getBlockType().getProperty("south"), true).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("west"), true)); - public static final BlockType RED_NETHER_BRICKS = register("minecraft:red_nether_bricks"); - public static final BlockType RED_SAND = register("minecraft:red_sand"); - public static final BlockType RED_SANDSTONE = register("minecraft:red_sandstone"); - public static final BlockType RED_SANDSTONE_SLAB = register("minecraft:red_sandstone_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType RED_SANDSTONE_STAIRS = register("minecraft:red_sandstone_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType RED_SHULKER_BOX = register("minecraft:red_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - public static final BlockType RED_STAINED_GLASS = register("minecraft:red_stained_glass"); - public static final BlockType RED_STAINED_GLASS_PANE = register("minecraft:red_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType RED_TERRACOTTA = register("minecraft:red_terracotta"); - public static final BlockType RED_TULIP = register("minecraft:red_tulip"); - public static final BlockType RED_WALL_BANNER = register("minecraft:red_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType RED_WOOL = register("minecraft:red_wool"); - public static final BlockType REDSTONE_BLOCK = register("minecraft:redstone_block"); - public static final BlockType REDSTONE_LAMP = register("minecraft:redstone_lamp", state -> state.with(state.getBlockType().getProperty("lit"), false)); - public static final BlockType REDSTONE_ORE = register("minecraft:redstone_ore", state -> state.with(state.getBlockType().getProperty("lit"), false)); - public static final BlockType REDSTONE_TORCH = register("minecraft:redstone_torch", state -> state.with(state.getBlockType().getProperty("lit"), true)); - public static final BlockType REDSTONE_WALL_TORCH = register("minecraft:redstone_wall_torch", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("lit"), true)); - public static final BlockType REDSTONE_WIRE = register("minecraft:redstone_wire", state -> state.with(state.getBlockType().getProperty("east"), "none").with(state.getBlockType().getProperty("north"), "none").with(state.getBlockType().getProperty("power"), 0).with(state.getBlockType().getProperty("south"), "none").with(state.getBlockType().getProperty("west"), "none")); - public static final BlockType REPEATER = register("minecraft:repeater", state -> state.with(state.getBlockType().getProperty("delay"), 1).with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("locked"), false).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType REPEATING_COMMAND_BLOCK = register("minecraft:repeating_command_block", state -> state.with(state.getBlockType().getProperty("conditional"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType ROSE_BUSH = register("minecraft:rose_bush", state -> state.with(state.getBlockType().getProperty("half"), "lower")); - public static final BlockType SAND = register("minecraft:sand"); - public static final BlockType SANDSTONE = register("minecraft:sandstone"); - public static final BlockType SANDSTONE_SLAB = register("minecraft:sandstone_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType SANDSTONE_STAIRS = register("minecraft:sandstone_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType SEA_LANTERN = register("minecraft:sea_lantern"); - public static final BlockType SEA_PICKLE = register("minecraft:sea_pickle", state -> state.with(state.getBlockType().getProperty("pickles"), 1).with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType SEAGRASS = register("minecraft:seagrass"); - public static final BlockType SHULKER_BOX = register("minecraft:shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - public static final BlockType SIGN = register("minecraft:sign", state -> state.with(state.getBlockType().getProperty("rotation"), 0).with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType SKELETON_SKULL = register("minecraft:skeleton_skull", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - public static final BlockType SKELETON_WALL_SKULL = register("minecraft:skeleton_wall_skull", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType SLIME_BLOCK = register("minecraft:slime_block"); - public static final BlockType SMOOTH_QUARTZ = register("minecraft:smooth_quartz"); - public static final BlockType SMOOTH_RED_SANDSTONE = register("minecraft:smooth_red_sandstone"); - public static final BlockType SMOOTH_SANDSTONE = register("minecraft:smooth_sandstone"); - public static final BlockType SMOOTH_STONE = register("minecraft:smooth_stone"); - public static final BlockType SNOW = register("minecraft:snow", state -> state.with(state.getBlockType().getProperty("layers"), 1)); - public static final BlockType SNOW_BLOCK = register("minecraft:snow_block"); - public static final BlockType SOUL_SAND = register("minecraft:soul_sand"); - public static final BlockType SPAWNER = register("minecraft:spawner"); - public static final BlockType SPONGE = register("minecraft:sponge"); - public static final BlockType SPRUCE_BUTTON = register("minecraft:spruce_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType SPRUCE_DOOR = register("minecraft:spruce_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType SPRUCE_FENCE = register("minecraft:spruce_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType SPRUCE_FENCE_GATE = register("minecraft:spruce_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType SPRUCE_LEAVES = register("minecraft:spruce_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); - public static final BlockType SPRUCE_LOG = register("minecraft:spruce_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType SPRUCE_PLANKS = register("minecraft:spruce_planks"); - public static final BlockType SPRUCE_PRESSURE_PLATE = register("minecraft:spruce_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType SPRUCE_SAPLING = register("minecraft:spruce_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); - public static final BlockType SPRUCE_SLAB = register("minecraft:spruce_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType SPRUCE_STAIRS = register("minecraft:spruce_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType SPRUCE_TRAPDOOR = register("minecraft:spruce_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType SPRUCE_WOOD = register("minecraft:spruce_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType STICKY_PISTON = register("minecraft:sticky_piston", state -> state.with(state.getBlockType().getProperty("extended"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType STONE = register("minecraft:stone"); - public static final BlockType STONE_BRICK_SLAB = register("minecraft:stone_brick_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType STONE_BRICK_STAIRS = register("minecraft:stone_brick_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType STONE_BRICKS = register("minecraft:stone_bricks"); - public static final BlockType STONE_BUTTON = register("minecraft:stone_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType STONE_PRESSURE_PLATE = register("minecraft:stone_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType STONE_SLAB = register("minecraft:stone_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType STRIPPED_ACACIA_LOG = register("minecraft:stripped_acacia_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType STRIPPED_ACACIA_WOOD = register("minecraft:stripped_acacia_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType STRIPPED_BIRCH_LOG = register("minecraft:stripped_birch_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType STRIPPED_BIRCH_WOOD = register("minecraft:stripped_birch_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType STRIPPED_DARK_OAK_LOG = register("minecraft:stripped_dark_oak_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType STRIPPED_DARK_OAK_WOOD = register("minecraft:stripped_dark_oak_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType STRIPPED_JUNGLE_LOG = register("minecraft:stripped_jungle_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType STRIPPED_JUNGLE_WOOD = register("minecraft:stripped_jungle_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType STRIPPED_OAK_LOG = register("minecraft:stripped_oak_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType STRIPPED_OAK_WOOD = register("minecraft:stripped_oak_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType STRIPPED_SPRUCE_LOG = register("minecraft:stripped_spruce_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType STRIPPED_SPRUCE_WOOD = register("minecraft:stripped_spruce_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - public static final BlockType STRUCTURE_BLOCK = register("minecraft:structure_block", state -> state.with(state.getBlockType().getProperty("mode"), "SAVE")); - public static final BlockType STRUCTURE_VOID = register("minecraft:structure_void"); - public static final BlockType SUGAR_CANE = register("minecraft:sugar_cane", state -> state.with(state.getBlockType().getProperty("age"), 0)); - public static final BlockType SUNFLOWER = register("minecraft:sunflower", state -> state.with(state.getBlockType().getProperty("half"), "lower")); - public static final BlockType TALL_GRASS = register("minecraft:tall_grass", state -> state.with(state.getBlockType().getProperty("half"), "lower")); - public static final BlockType TALL_SEAGRASS = register("minecraft:tall_seagrass", state -> state.with(state.getBlockType().getProperty("half"), "lower")); - public static final BlockType TERRACOTTA = register("minecraft:terracotta"); - public static final BlockType TNT = register("minecraft:tnt", state -> state.with(state.getBlockType().getProperty("unstable"), false)); - public static final BlockType TORCH = register("minecraft:torch"); - public static final BlockType TRAPPED_CHEST = register("minecraft:trapped_chest", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("type"), "SINGLE").with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType TRIPWIRE = register("minecraft:tripwire", state -> state.with(state.getBlockType().getProperty("attached"), false).with(state.getBlockType().getProperty("disarmed"), false).with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType TRIPWIRE_HOOK = register("minecraft:tripwire_hook", state -> state.with(state.getBlockType().getProperty("attached"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); - public static final BlockType TUBE_CORAL = register("minecraft:tube_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType TUBE_CORAL_BLOCK = register("minecraft:tube_coral_block"); - public static final BlockType TUBE_CORAL_FAN = register("minecraft:tube_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType TUBE_CORAL_WALL_FAN = register("minecraft:tube_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); - public static final BlockType TURTLE_EGG = register("minecraft:turtle_egg", state -> state.with(state.getBlockType().getProperty("eggs"), 1).with(state.getBlockType().getProperty("hatch"), 0)); - public static final BlockType VINE = register("minecraft:vine", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType VOID_AIR = register("minecraft:void_air"); - public static final BlockType WALL_SIGN = register("minecraft:wall_sign", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), false)); - public static final BlockType WALL_TORCH = register("minecraft:wall_torch", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType WATER = register("minecraft:water", state -> state.with(state.getBlockType().getProperty("level"), 0)); - public static final BlockType WET_SPONGE = register("minecraft:wet_sponge"); - public static final BlockType WHEAT = register("minecraft:wheat", state -> state.with(state.getBlockType().getProperty("age"), 0)); - public static final BlockType WHITE_BANNER = register("minecraft:white_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - public static final BlockType WHITE_BED = register("minecraft:white_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - public static final BlockType WHITE_CARPET = register("minecraft:white_carpet"); - public static final BlockType WHITE_CONCRETE = register("minecraft:white_concrete"); - public static final BlockType WHITE_CONCRETE_POWDER = register("minecraft:white_concrete_powder"); - public static final BlockType WHITE_GLAZED_TERRACOTTA = register("minecraft:white_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType WHITE_SHULKER_BOX = register("minecraft:white_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - public static final BlockType WHITE_STAINED_GLASS = register("minecraft:white_stained_glass"); - public static final BlockType WHITE_STAINED_GLASS_PANE = register("minecraft:white_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType WHITE_TERRACOTTA = register("minecraft:white_terracotta"); - public static final BlockType WHITE_TULIP = register("minecraft:white_tulip"); - public static final BlockType WHITE_WALL_BANNER = register("minecraft:white_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType WHITE_WOOL = register("minecraft:white_wool"); - public static final BlockType WITHER_SKELETON_SKULL = register("minecraft:wither_skeleton_skull", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - public static final BlockType WITHER_SKELETON_WALL_SKULL = register("minecraft:wither_skeleton_wall_skull", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType YELLOW_BANNER = register("minecraft:yellow_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - public static final BlockType YELLOW_BED = register("minecraft:yellow_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - public static final BlockType YELLOW_CARPET = register("minecraft:yellow_carpet"); - public static final BlockType YELLOW_CONCRETE = register("minecraft:yellow_concrete"); - public static final BlockType YELLOW_CONCRETE_POWDER = register("minecraft:yellow_concrete_powder"); - public static final BlockType YELLOW_GLAZED_TERRACOTTA = register("minecraft:yellow_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType YELLOW_SHULKER_BOX = register("minecraft:yellow_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - public static final BlockType YELLOW_STAINED_GLASS = register("minecraft:yellow_stained_glass"); - public static final BlockType YELLOW_STAINED_GLASS_PANE = register("minecraft:yellow_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - public static final BlockType YELLOW_TERRACOTTA = register("minecraft:yellow_terracotta"); - public static final BlockType YELLOW_WALL_BANNER = register("minecraft:yellow_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - public static final BlockType YELLOW_WOOL = register("minecraft:yellow_wool"); - public static final BlockType ZOMBIE_HEAD = register("minecraft:zombie_head", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - public static final BlockType ZOMBIE_WALL_HEAD = register("minecraft:zombie_wall_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType __RESERVED__ = register("minecraft:__reserved__"); + @Nullable static final BlockType ACACIA_BUTTON = register("minecraft:acacia_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType ACACIA_DOOR = register("minecraft:acacia_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType ACACIA_FENCE = register("minecraft:acacia_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType ACACIA_FENCE_GATE = register("minecraft:acacia_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType ACACIA_LEAVES = register("minecraft:acacia_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); + @Nullable static final BlockType ACACIA_LOG = register("minecraft:acacia_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType ACACIA_PLANKS = register("minecraft:acacia_planks"); + @Nullable static final BlockType ACACIA_PRESSURE_PLATE = register("minecraft:acacia_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType ACACIA_SAPLING = register("minecraft:acacia_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); + @Nullable static final BlockType ACACIA_SLAB = register("minecraft:acacia_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType ACACIA_STAIRS = register("minecraft:acacia_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType ACACIA_TRAPDOOR = register("minecraft:acacia_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType ACACIA_WOOD = register("minecraft:acacia_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType ACTIVATOR_RAIL = register("minecraft:activator_rail", state -> state.with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("shape"), "north_south")); + @Nullable static final BlockType AIR = register("minecraft:air"); + @Nullable static final BlockType ALLIUM = register("minecraft:allium"); + @Nullable static final BlockType ANDESITE = register("minecraft:andesite"); + @Nullable static final BlockType ANVIL = register("minecraft:anvil", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType ATTACHED_MELON_STEM = register("minecraft:attached_melon_stem", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType ATTACHED_PUMPKIN_STEM = register("minecraft:attached_pumpkin_stem", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType AZURE_BLUET = register("minecraft:azure_bluet"); + @Nullable static final BlockType BARRIER = register("minecraft:barrier"); + @Nullable static final BlockType BEACON = register("minecraft:beacon"); + @Nullable static final BlockType BEDROCK = register("minecraft:bedrock"); + @Nullable static final BlockType BEETROOTS = register("minecraft:beetroots", state -> state.with(state.getBlockType().getProperty("age"), 0)); + @Nullable static final BlockType BIRCH_BUTTON = register("minecraft:birch_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType BIRCH_DOOR = register("minecraft:birch_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType BIRCH_FENCE = register("minecraft:birch_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType BIRCH_FENCE_GATE = register("minecraft:birch_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType BIRCH_LEAVES = register("minecraft:birch_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); + @Nullable static final BlockType BIRCH_LOG = register("minecraft:birch_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType BIRCH_PLANKS = register("minecraft:birch_planks"); + @Nullable static final BlockType BIRCH_PRESSURE_PLATE = register("minecraft:birch_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType BIRCH_SAPLING = register("minecraft:birch_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); + @Nullable static final BlockType BIRCH_SLAB = register("minecraft:birch_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType BIRCH_STAIRS = register("minecraft:birch_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType BIRCH_TRAPDOOR = register("minecraft:birch_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType BIRCH_WOOD = register("minecraft:birch_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType BLACK_BANNER = register("minecraft:black_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable static final BlockType BLACK_BED = register("minecraft:black_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable static final BlockType BLACK_CARPET = register("minecraft:black_carpet"); + @Nullable static final BlockType BLACK_CONCRETE = register("minecraft:black_concrete"); + @Nullable static final BlockType BLACK_CONCRETE_POWDER = register("minecraft:black_concrete_powder"); + @Nullable static final BlockType BLACK_GLAZED_TERRACOTTA = register("minecraft:black_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType BLACK_SHULKER_BOX = register("minecraft:black_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable static final BlockType BLACK_STAINED_GLASS = register("minecraft:black_stained_glass"); + @Nullable static final BlockType BLACK_STAINED_GLASS_PANE = register("minecraft:black_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType BLACK_TERRACOTTA = register("minecraft:black_terracotta"); + @Nullable static final BlockType BLACK_WALL_BANNER = register("minecraft:black_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType BLACK_WOOL = register("minecraft:black_wool"); + @Nullable static final BlockType BLUE_BANNER = register("minecraft:blue_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable static final BlockType BLUE_BED = register("minecraft:blue_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable static final BlockType BLUE_CARPET = register("minecraft:blue_carpet"); + @Nullable static final BlockType BLUE_CONCRETE = register("minecraft:blue_concrete"); + @Nullable static final BlockType BLUE_CONCRETE_POWDER = register("minecraft:blue_concrete_powder"); + @Nullable static final BlockType BLUE_GLAZED_TERRACOTTA = register("minecraft:blue_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType BLUE_ICE = register("minecraft:blue_ice"); + @Nullable static final BlockType BLUE_ORCHID = register("minecraft:blue_orchid"); + @Nullable static final BlockType BLUE_SHULKER_BOX = register("minecraft:blue_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable static final BlockType BLUE_STAINED_GLASS = register("minecraft:blue_stained_glass"); + @Nullable static final BlockType BLUE_STAINED_GLASS_PANE = register("minecraft:blue_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType BLUE_TERRACOTTA = register("minecraft:blue_terracotta"); + @Nullable static final BlockType BLUE_WALL_BANNER = register("minecraft:blue_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType BLUE_WOOL = register("minecraft:blue_wool"); + @Nullable static final BlockType BONE_BLOCK = register("minecraft:bone_block", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType BOOKSHELF = register("minecraft:bookshelf"); + @Nullable static final BlockType BRAIN_CORAL = register("minecraft:brain_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType BRAIN_CORAL_BLOCK = register("minecraft:brain_coral_block"); + @Nullable static final BlockType BRAIN_CORAL_FAN = register("minecraft:brain_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType BRAIN_CORAL_WALL_FAN = register("minecraft:brain_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType BREWING_STAND = register("minecraft:brewing_stand", state -> state.with(state.getBlockType().getProperty("has_bottle_0"), false).with(state.getBlockType().getProperty("has_bottle_1"), false).with(state.getBlockType().getProperty("has_bottle_2"), false)); + @Nullable static final BlockType BRICK_SLAB = register("minecraft:brick_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType BRICK_STAIRS = register("minecraft:brick_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType BRICKS = register("minecraft:bricks"); + @Nullable static final BlockType BROWN_BANNER = register("minecraft:brown_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable static final BlockType BROWN_BED = register("minecraft:brown_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable static final BlockType BROWN_CARPET = register("minecraft:brown_carpet"); + @Nullable static final BlockType BROWN_CONCRETE = register("minecraft:brown_concrete"); + @Nullable static final BlockType BROWN_CONCRETE_POWDER = register("minecraft:brown_concrete_powder"); + @Nullable static final BlockType BROWN_GLAZED_TERRACOTTA = register("minecraft:brown_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType BROWN_MUSHROOM = register("minecraft:brown_mushroom"); + @Nullable static final BlockType BROWN_MUSHROOM_BLOCK = register("minecraft:brown_mushroom_block", state -> state.with(state.getBlockType().getProperty("down"), true).with(state.getBlockType().getProperty("east"), true).with(state.getBlockType().getProperty("north"), true).with(state.getBlockType().getProperty("south"), true).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("west"), true)); + @Nullable static final BlockType BROWN_SHULKER_BOX = register("minecraft:brown_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable static final BlockType BROWN_STAINED_GLASS = register("minecraft:brown_stained_glass"); + @Nullable static final BlockType BROWN_STAINED_GLASS_PANE = register("minecraft:brown_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType BROWN_TERRACOTTA = register("minecraft:brown_terracotta"); + @Nullable static final BlockType BROWN_WALL_BANNER = register("minecraft:brown_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType BROWN_WOOL = register("minecraft:brown_wool"); + @Nullable static final BlockType BUBBLE_COLUMN = register("minecraft:bubble_column", state -> state.with(state.getBlockType().getProperty("drag"), true)); + @Nullable static final BlockType BUBBLE_CORAL = register("minecraft:bubble_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType BUBBLE_CORAL_BLOCK = register("minecraft:bubble_coral_block"); + @Nullable static final BlockType BUBBLE_CORAL_FAN = register("minecraft:bubble_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType BUBBLE_CORAL_WALL_FAN = register("minecraft:bubble_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType CACTUS = register("minecraft:cactus", state -> state.with(state.getBlockType().getProperty("age"), 0)); + @Nullable static final BlockType CAKE = register("minecraft:cake", state -> state.with(state.getBlockType().getProperty("bites"), 0)); + @Nullable static final BlockType CARROTS = register("minecraft:carrots", state -> state.with(state.getBlockType().getProperty("age"), 0)); + @Nullable static final BlockType CARVED_PUMPKIN = register("minecraft:carved_pumpkin", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType CAULDRON = register("minecraft:cauldron", state -> state.with(state.getBlockType().getProperty("level"), 0)); + @Nullable static final BlockType CAVE_AIR = register("minecraft:cave_air"); + @Nullable static final BlockType CHAIN_COMMAND_BLOCK = register("minecraft:chain_command_block", state -> state.with(state.getBlockType().getProperty("conditional"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType CHEST = register("minecraft:chest", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("type"), "SINGLE").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType CHIPPED_ANVIL = register("minecraft:chipped_anvil", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType CHISELED_QUARTZ_BLOCK = register("minecraft:chiseled_quartz_block"); + @Nullable static final BlockType CHISELED_RED_SANDSTONE = register("minecraft:chiseled_red_sandstone"); + @Nullable static final BlockType CHISELED_SANDSTONE = register("minecraft:chiseled_sandstone"); + @Nullable static final BlockType CHISELED_STONE_BRICKS = register("minecraft:chiseled_stone_bricks"); + @Nullable static final BlockType CHORUS_FLOWER = register("minecraft:chorus_flower", state -> state.with(state.getBlockType().getProperty("age"), 0)); + @Nullable static final BlockType CHORUS_PLANT = register("minecraft:chorus_plant", state -> state.with(state.getBlockType().getProperty("down"), false).with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType CLAY = register("minecraft:clay"); + @Nullable static final BlockType COAL_BLOCK = register("minecraft:coal_block"); + @Nullable static final BlockType COAL_ORE = register("minecraft:coal_ore"); + @Nullable static final BlockType COARSE_DIRT = register("minecraft:coarse_dirt"); + @Nullable static final BlockType COBBLESTONE = register("minecraft:cobblestone"); + @Nullable static final BlockType COBBLESTONE_SLAB = register("minecraft:cobblestone_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType COBBLESTONE_STAIRS = register("minecraft:cobblestone_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType COBBLESTONE_WALL = register("minecraft:cobblestone_wall", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType COBWEB = register("minecraft:cobweb"); + @Nullable static final BlockType COCOA = register("minecraft:cocoa", state -> state.with(state.getBlockType().getProperty("age"), 0).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType COMMAND_BLOCK = register("minecraft:command_block", state -> state.with(state.getBlockType().getProperty("conditional"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType COMPARATOR = register("minecraft:comparator", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("mode"), "compare").with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType CONDUIT = register("minecraft:conduit", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType CRACKED_STONE_BRICKS = register("minecraft:cracked_stone_bricks"); + @Nullable static final BlockType CRAFTING_TABLE = register("minecraft:crafting_table"); + @Nullable static final BlockType CREEPER_HEAD = register("minecraft:creeper_head", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable static final BlockType CREEPER_WALL_HEAD = register("minecraft:creeper_wall_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType CUT_RED_SANDSTONE = register("minecraft:cut_red_sandstone"); + @Nullable static final BlockType CUT_SANDSTONE = register("minecraft:cut_sandstone"); + @Nullable static final BlockType CYAN_BANNER = register("minecraft:cyan_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable static final BlockType CYAN_BED = register("minecraft:cyan_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable static final BlockType CYAN_CARPET = register("minecraft:cyan_carpet"); + @Nullable static final BlockType CYAN_CONCRETE = register("minecraft:cyan_concrete"); + @Nullable static final BlockType CYAN_CONCRETE_POWDER = register("minecraft:cyan_concrete_powder"); + @Nullable static final BlockType CYAN_GLAZED_TERRACOTTA = register("minecraft:cyan_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType CYAN_SHULKER_BOX = register("minecraft:cyan_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable static final BlockType CYAN_STAINED_GLASS = register("minecraft:cyan_stained_glass"); + @Nullable static final BlockType CYAN_STAINED_GLASS_PANE = register("minecraft:cyan_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType CYAN_TERRACOTTA = register("minecraft:cyan_terracotta"); + @Nullable static final BlockType CYAN_WALL_BANNER = register("minecraft:cyan_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType CYAN_WOOL = register("minecraft:cyan_wool"); + @Nullable static final BlockType DAMAGED_ANVIL = register("minecraft:damaged_anvil", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType DANDELION = register("minecraft:dandelion"); + @Nullable static final BlockType DARK_OAK_BUTTON = register("minecraft:dark_oak_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType DARK_OAK_DOOR = register("minecraft:dark_oak_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType DARK_OAK_FENCE = register("minecraft:dark_oak_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType DARK_OAK_FENCE_GATE = register("minecraft:dark_oak_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType DARK_OAK_LEAVES = register("minecraft:dark_oak_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); + @Nullable static final BlockType DARK_OAK_LOG = register("minecraft:dark_oak_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType DARK_OAK_PLANKS = register("minecraft:dark_oak_planks"); + @Nullable static final BlockType DARK_OAK_PRESSURE_PLATE = register("minecraft:dark_oak_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType DARK_OAK_SAPLING = register("minecraft:dark_oak_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); + @Nullable static final BlockType DARK_OAK_SLAB = register("minecraft:dark_oak_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType DARK_OAK_STAIRS = register("minecraft:dark_oak_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType DARK_OAK_TRAPDOOR = register("minecraft:dark_oak_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType DARK_OAK_WOOD = register("minecraft:dark_oak_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType DARK_PRISMARINE = register("minecraft:dark_prismarine"); + @Nullable static final BlockType DARK_PRISMARINE_SLAB = register("minecraft:dark_prismarine_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType DARK_PRISMARINE_STAIRS = register("minecraft:dark_prismarine_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType DAYLIGHT_DETECTOR = register("minecraft:daylight_detector", state -> state.with(state.getBlockType().getProperty("inverted"), false).with(state.getBlockType().getProperty("power"), 0)); + @Nullable static final BlockType DEAD_BRAIN_CORAL = register("minecraft:dead_brain_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType DEAD_BRAIN_CORAL_BLOCK = register("minecraft:dead_brain_coral_block"); + @Nullable static final BlockType DEAD_BRAIN_CORAL_FAN = register("minecraft:dead_brain_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType DEAD_BRAIN_CORAL_WALL_FAN = register("minecraft:dead_brain_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType DEAD_BUBBLE_CORAL = register("minecraft:dead_bubble_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType DEAD_BUBBLE_CORAL_BLOCK = register("minecraft:dead_bubble_coral_block"); + @Nullable static final BlockType DEAD_BUBBLE_CORAL_FAN = register("minecraft:dead_bubble_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType DEAD_BUBBLE_CORAL_WALL_FAN = register("minecraft:dead_bubble_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType DEAD_BUSH = register("minecraft:dead_bush"); + @Nullable static final BlockType DEAD_FIRE_CORAL = register("minecraft:dead_fire_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType DEAD_FIRE_CORAL_BLOCK = register("minecraft:dead_fire_coral_block"); + @Nullable static final BlockType DEAD_FIRE_CORAL_FAN = register("minecraft:dead_fire_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType DEAD_FIRE_CORAL_WALL_FAN = register("minecraft:dead_fire_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType DEAD_HORN_CORAL = register("minecraft:dead_horn_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType DEAD_HORN_CORAL_BLOCK = register("minecraft:dead_horn_coral_block"); + @Nullable static final BlockType DEAD_HORN_CORAL_FAN = register("minecraft:dead_horn_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType DEAD_HORN_CORAL_WALL_FAN = register("minecraft:dead_horn_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType DEAD_TUBE_CORAL = register("minecraft:dead_tube_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType DEAD_TUBE_CORAL_BLOCK = register("minecraft:dead_tube_coral_block"); + @Nullable static final BlockType DEAD_TUBE_CORAL_FAN = register("minecraft:dead_tube_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType DEAD_TUBE_CORAL_WALL_FAN = register("minecraft:dead_tube_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType DETECTOR_RAIL = register("minecraft:detector_rail", state -> state.with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("shape"), "north_south")); + @Nullable static final BlockType DIAMOND_BLOCK = register("minecraft:diamond_block"); + @Nullable static final BlockType DIAMOND_ORE = register("minecraft:diamond_ore"); + @Nullable static final BlockType DIORITE = register("minecraft:diorite"); + @Nullable static final BlockType DIRT = register("minecraft:dirt"); + @Nullable static final BlockType DISPENSER = register("minecraft:dispenser", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("triggered"), false)); + @Nullable static final BlockType DRAGON_EGG = register("minecraft:dragon_egg"); + @Nullable static final BlockType DRAGON_HEAD = register("minecraft:dragon_head", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable static final BlockType DRAGON_WALL_HEAD = register("minecraft:dragon_wall_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType DRIED_KELP_BLOCK = register("minecraft:dried_kelp_block"); + @Nullable static final BlockType DROPPER = register("minecraft:dropper", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("triggered"), false)); + @Nullable static final BlockType EMERALD_BLOCK = register("minecraft:emerald_block"); + @Nullable static final BlockType EMERALD_ORE = register("minecraft:emerald_ore"); + @Nullable static final BlockType ENCHANTING_TABLE = register("minecraft:enchanting_table"); + @Nullable static final BlockType END_GATEWAY = register("minecraft:end_gateway"); + @Nullable static final BlockType END_PORTAL = register("minecraft:end_portal"); + @Nullable static final BlockType END_PORTAL_FRAME = register("minecraft:end_portal_frame", state -> state.with(state.getBlockType().getProperty("eye"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType END_ROD = register("minecraft:end_rod", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable static final BlockType END_STONE = register("minecraft:end_stone"); + @Nullable static final BlockType END_STONE_BRICKS = register("minecraft:end_stone_bricks"); + @Nullable static final BlockType ENDER_CHEST = register("minecraft:ender_chest", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType FARMLAND = register("minecraft:farmland", state -> state.with(state.getBlockType().getProperty("moisture"), 0)); + @Nullable static final BlockType FERN = register("minecraft:fern"); + @Nullable static final BlockType FIRE = register("minecraft:fire", state -> state.with(state.getBlockType().getProperty("age"), 0).with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType FIRE_CORAL = register("minecraft:fire_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType FIRE_CORAL_BLOCK = register("minecraft:fire_coral_block"); + @Nullable static final BlockType FIRE_CORAL_FAN = register("minecraft:fire_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType FIRE_CORAL_WALL_FAN = register("minecraft:fire_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType FLOWER_POT = register("minecraft:flower_pot"); + @Nullable static final BlockType FROSTED_ICE = register("minecraft:frosted_ice", state -> state.with(state.getBlockType().getProperty("age"), 0)); + @Nullable static final BlockType FURNACE = register("minecraft:furnace", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("lit"), false)); + @Nullable static final BlockType GLASS = register("minecraft:glass"); + @Nullable static final BlockType GLASS_PANE = register("minecraft:glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType GLOWSTONE = register("minecraft:glowstone"); + @Nullable static final BlockType GOLD_BLOCK = register("minecraft:gold_block"); + @Nullable static final BlockType GOLD_ORE = register("minecraft:gold_ore"); + @Nullable static final BlockType GRANITE = register("minecraft:granite"); + @Nullable static final BlockType GRASS = register("minecraft:grass"); + @Nullable static final BlockType GRASS_BLOCK = register("minecraft:grass_block", state -> state.with(state.getBlockType().getProperty("snowy"), false)); + @Nullable static final BlockType GRASS_PATH = register("minecraft:grass_path"); + @Nullable static final BlockType GRAVEL = register("minecraft:gravel"); + @Nullable static final BlockType GRAY_BANNER = register("minecraft:gray_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable static final BlockType GRAY_BED = register("minecraft:gray_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable static final BlockType GRAY_CARPET = register("minecraft:gray_carpet"); + @Nullable static final BlockType GRAY_CONCRETE = register("minecraft:gray_concrete"); + @Nullable static final BlockType GRAY_CONCRETE_POWDER = register("minecraft:gray_concrete_powder"); + @Nullable static final BlockType GRAY_GLAZED_TERRACOTTA = register("minecraft:gray_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType GRAY_SHULKER_BOX = register("minecraft:gray_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable static final BlockType GRAY_STAINED_GLASS = register("minecraft:gray_stained_glass"); + @Nullable static final BlockType GRAY_STAINED_GLASS_PANE = register("minecraft:gray_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType GRAY_TERRACOTTA = register("minecraft:gray_terracotta"); + @Nullable static final BlockType GRAY_WALL_BANNER = register("minecraft:gray_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType GRAY_WOOL = register("minecraft:gray_wool"); + @Nullable static final BlockType GREEN_BANNER = register("minecraft:green_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable static final BlockType GREEN_BED = register("minecraft:green_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable static final BlockType GREEN_CARPET = register("minecraft:green_carpet"); + @Nullable static final BlockType GREEN_CONCRETE = register("minecraft:green_concrete"); + @Nullable static final BlockType GREEN_CONCRETE_POWDER = register("minecraft:green_concrete_powder"); + @Nullable static final BlockType GREEN_GLAZED_TERRACOTTA = register("minecraft:green_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType GREEN_SHULKER_BOX = register("minecraft:green_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable static final BlockType GREEN_STAINED_GLASS = register("minecraft:green_stained_glass"); + @Nullable static final BlockType GREEN_STAINED_GLASS_PANE = register("minecraft:green_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType GREEN_TERRACOTTA = register("minecraft:green_terracotta"); + @Nullable static final BlockType GREEN_WALL_BANNER = register("minecraft:green_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType GREEN_WOOL = register("minecraft:green_wool"); + @Nullable static final BlockType HAY_BLOCK = register("minecraft:hay_block", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType HEAVY_WEIGHTED_PRESSURE_PLATE = register("minecraft:heavy_weighted_pressure_plate", state -> state.with(state.getBlockType().getProperty("power"), 0)); + @Nullable static final BlockType HOPPER = register("minecraft:hopper", state -> state.with(state.getBlockType().getProperty("enabled"), true).with(state.getBlockType().getProperty("facing"), Direction.DOWN)); + @Nullable static final BlockType HORN_CORAL = register("minecraft:horn_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType HORN_CORAL_BLOCK = register("minecraft:horn_coral_block"); + @Nullable static final BlockType HORN_CORAL_FAN = register("minecraft:horn_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType HORN_CORAL_WALL_FAN = register("minecraft:horn_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType ICE = register("minecraft:ice"); + @Nullable static final BlockType INFESTED_CHISELED_STONE_BRICKS = register("minecraft:infested_chiseled_stone_bricks"); + @Nullable static final BlockType INFESTED_COBBLESTONE = register("minecraft:infested_cobblestone"); + @Nullable static final BlockType INFESTED_CRACKED_STONE_BRICKS = register("minecraft:infested_cracked_stone_bricks"); + @Nullable static final BlockType INFESTED_MOSSY_STONE_BRICKS = register("minecraft:infested_mossy_stone_bricks"); + @Nullable static final BlockType INFESTED_STONE = register("minecraft:infested_stone"); + @Nullable static final BlockType INFESTED_STONE_BRICKS = register("minecraft:infested_stone_bricks"); + @Nullable static final BlockType IRON_BARS = register("minecraft:iron_bars", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType IRON_BLOCK = register("minecraft:iron_block"); + @Nullable static final BlockType IRON_DOOR = register("minecraft:iron_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType IRON_ORE = register("minecraft:iron_ore"); + @Nullable static final BlockType IRON_TRAPDOOR = register("minecraft:iron_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType JACK_O_LANTERN = register("minecraft:jack_o_lantern", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType JUKEBOX = register("minecraft:jukebox", state -> state.with(state.getBlockType().getProperty("has_record"), false)); + @Nullable static final BlockType JUNGLE_BUTTON = register("minecraft:jungle_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType JUNGLE_DOOR = register("minecraft:jungle_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType JUNGLE_FENCE = register("minecraft:jungle_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType JUNGLE_FENCE_GATE = register("minecraft:jungle_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType JUNGLE_LEAVES = register("minecraft:jungle_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); + @Nullable static final BlockType JUNGLE_LOG = register("minecraft:jungle_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType JUNGLE_PLANKS = register("minecraft:jungle_planks"); + @Nullable static final BlockType JUNGLE_PRESSURE_PLATE = register("minecraft:jungle_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType JUNGLE_SAPLING = register("minecraft:jungle_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); + @Nullable static final BlockType JUNGLE_SLAB = register("minecraft:jungle_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType JUNGLE_STAIRS = register("minecraft:jungle_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType JUNGLE_TRAPDOOR = register("minecraft:jungle_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType JUNGLE_WOOD = register("minecraft:jungle_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType KELP = register("minecraft:kelp", state -> state.with(state.getBlockType().getProperty("age"), 0)); + @Nullable static final BlockType KELP_PLANT = register("minecraft:kelp_plant"); + @Nullable static final BlockType LADDER = register("minecraft:ladder", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType LAPIS_BLOCK = register("minecraft:lapis_block"); + @Nullable static final BlockType LAPIS_ORE = register("minecraft:lapis_ore"); + @Nullable static final BlockType LARGE_FERN = register("minecraft:large_fern", state -> state.with(state.getBlockType().getProperty("half"), "lower")); + @Nullable static final BlockType LAVA = register("minecraft:lava", state -> state.with(state.getBlockType().getProperty("level"), 0)); + @Nullable static final BlockType LEVER = register("minecraft:lever", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType LIGHT_BLUE_BANNER = register("minecraft:light_blue_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable static final BlockType LIGHT_BLUE_BED = register("minecraft:light_blue_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable static final BlockType LIGHT_BLUE_CARPET = register("minecraft:light_blue_carpet"); + @Nullable static final BlockType LIGHT_BLUE_CONCRETE = register("minecraft:light_blue_concrete"); + @Nullable static final BlockType LIGHT_BLUE_CONCRETE_POWDER = register("minecraft:light_blue_concrete_powder"); + @Nullable static final BlockType LIGHT_BLUE_GLAZED_TERRACOTTA = register("minecraft:light_blue_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType LIGHT_BLUE_SHULKER_BOX = register("minecraft:light_blue_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable static final BlockType LIGHT_BLUE_STAINED_GLASS = register("minecraft:light_blue_stained_glass"); + @Nullable static final BlockType LIGHT_BLUE_STAINED_GLASS_PANE = register("minecraft:light_blue_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType LIGHT_BLUE_TERRACOTTA = register("minecraft:light_blue_terracotta"); + @Nullable static final BlockType LIGHT_BLUE_WALL_BANNER = register("minecraft:light_blue_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType LIGHT_BLUE_WOOL = register("minecraft:light_blue_wool"); + @Nullable static final BlockType LIGHT_GRAY_BANNER = register("minecraft:light_gray_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable static final BlockType LIGHT_GRAY_BED = register("minecraft:light_gray_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable static final BlockType LIGHT_GRAY_CARPET = register("minecraft:light_gray_carpet"); + @Nullable static final BlockType LIGHT_GRAY_CONCRETE = register("minecraft:light_gray_concrete"); + @Nullable static final BlockType LIGHT_GRAY_CONCRETE_POWDER = register("minecraft:light_gray_concrete_powder"); + @Nullable static final BlockType LIGHT_GRAY_GLAZED_TERRACOTTA = register("minecraft:light_gray_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType LIGHT_GRAY_SHULKER_BOX = register("minecraft:light_gray_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable static final BlockType LIGHT_GRAY_STAINED_GLASS = register("minecraft:light_gray_stained_glass"); + @Nullable static final BlockType LIGHT_GRAY_STAINED_GLASS_PANE = register("minecraft:light_gray_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType LIGHT_GRAY_TERRACOTTA = register("minecraft:light_gray_terracotta"); + @Nullable static final BlockType LIGHT_GRAY_WALL_BANNER = register("minecraft:light_gray_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType LIGHT_GRAY_WOOL = register("minecraft:light_gray_wool"); + @Nullable static final BlockType LIGHT_WEIGHTED_PRESSURE_PLATE = register("minecraft:light_weighted_pressure_plate", state -> state.with(state.getBlockType().getProperty("power"), 0)); + @Nullable static final BlockType LILAC = register("minecraft:lilac", state -> state.with(state.getBlockType().getProperty("half"), "lower")); + @Nullable static final BlockType LILY_PAD = register("minecraft:lily_pad"); + @Nullable static final BlockType LIME_BANNER = register("minecraft:lime_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable static final BlockType LIME_BED = register("minecraft:lime_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable static final BlockType LIME_CARPET = register("minecraft:lime_carpet"); + @Nullable static final BlockType LIME_CONCRETE = register("minecraft:lime_concrete"); + @Nullable static final BlockType LIME_CONCRETE_POWDER = register("minecraft:lime_concrete_powder"); + @Nullable static final BlockType LIME_GLAZED_TERRACOTTA = register("minecraft:lime_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType LIME_SHULKER_BOX = register("minecraft:lime_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable static final BlockType LIME_STAINED_GLASS = register("minecraft:lime_stained_glass"); + @Nullable static final BlockType LIME_STAINED_GLASS_PANE = register("minecraft:lime_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType LIME_TERRACOTTA = register("minecraft:lime_terracotta"); + @Nullable static final BlockType LIME_WALL_BANNER = register("minecraft:lime_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType LIME_WOOL = register("minecraft:lime_wool"); + @Nullable static final BlockType MAGENTA_BANNER = register("minecraft:magenta_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable static final BlockType MAGENTA_BED = register("minecraft:magenta_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable static final BlockType MAGENTA_CARPET = register("minecraft:magenta_carpet"); + @Nullable static final BlockType MAGENTA_CONCRETE = register("minecraft:magenta_concrete"); + @Nullable static final BlockType MAGENTA_CONCRETE_POWDER = register("minecraft:magenta_concrete_powder"); + @Nullable static final BlockType MAGENTA_GLAZED_TERRACOTTA = register("minecraft:magenta_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType MAGENTA_SHULKER_BOX = register("minecraft:magenta_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable static final BlockType MAGENTA_STAINED_GLASS = register("minecraft:magenta_stained_glass"); + @Nullable static final BlockType MAGENTA_STAINED_GLASS_PANE = register("minecraft:magenta_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType MAGENTA_TERRACOTTA = register("minecraft:magenta_terracotta"); + @Nullable static final BlockType MAGENTA_WALL_BANNER = register("minecraft:magenta_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType MAGENTA_WOOL = register("minecraft:magenta_wool"); + @Nullable static final BlockType MAGMA_BLOCK = register("minecraft:magma_block"); + @Nullable static final BlockType MELON = register("minecraft:melon"); + @Nullable static final BlockType MELON_STEM = register("minecraft:melon_stem", state -> state.with(state.getBlockType().getProperty("age"), 0)); + @Nullable static final BlockType MOSSY_COBBLESTONE = register("minecraft:mossy_cobblestone"); + @Nullable static final BlockType MOSSY_COBBLESTONE_WALL = register("minecraft:mossy_cobblestone_wall", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType MOSSY_STONE_BRICKS = register("minecraft:mossy_stone_bricks"); + @Nullable static final BlockType MOVING_PISTON = register("minecraft:moving_piston", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("type"), "normal")); + @Nullable static final BlockType MUSHROOM_STEM = register("minecraft:mushroom_stem", state -> state.with(state.getBlockType().getProperty("down"), true).with(state.getBlockType().getProperty("east"), true).with(state.getBlockType().getProperty("north"), true).with(state.getBlockType().getProperty("south"), true).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("west"), true)); + @Nullable static final BlockType MYCELIUM = register("minecraft:mycelium", state -> state.with(state.getBlockType().getProperty("snowy"), false)); + @Nullable static final BlockType NETHER_BRICK_FENCE = register("minecraft:nether_brick_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType NETHER_BRICK_SLAB = register("minecraft:nether_brick_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType NETHER_BRICK_STAIRS = register("minecraft:nether_brick_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType NETHER_BRICKS = register("minecraft:nether_bricks"); + @Nullable static final BlockType NETHER_PORTAL = register("minecraft:nether_portal", state -> state.with(state.getBlockType().getProperty("axis"), "x")); + @Nullable static final BlockType NETHER_QUARTZ_ORE = register("minecraft:nether_quartz_ore"); + @Nullable static final BlockType NETHER_WART = register("minecraft:nether_wart", state -> state.with(state.getBlockType().getProperty("age"), 0)); + @Nullable static final BlockType NETHER_WART_BLOCK = register("minecraft:nether_wart_block"); + @Nullable static final BlockType NETHERRACK = register("minecraft:netherrack"); + @Nullable static final BlockType NOTE_BLOCK = register("minecraft:note_block", state -> state.with(state.getBlockType().getProperty("instrument"), "HARP").with(state.getBlockType().getProperty("note"), 0).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType OAK_BUTTON = register("minecraft:oak_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType OAK_DOOR = register("minecraft:oak_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType OAK_FENCE = register("minecraft:oak_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType OAK_FENCE_GATE = register("minecraft:oak_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType OAK_LEAVES = register("minecraft:oak_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); + @Nullable static final BlockType OAK_LOG = register("minecraft:oak_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType OAK_PLANKS = register("minecraft:oak_planks"); + @Nullable static final BlockType OAK_PRESSURE_PLATE = register("minecraft:oak_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType OAK_SAPLING = register("minecraft:oak_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); + @Nullable static final BlockType OAK_SLAB = register("minecraft:oak_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType OAK_STAIRS = register("minecraft:oak_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType OAK_TRAPDOOR = register("minecraft:oak_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType OAK_WOOD = register("minecraft:oak_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType OBSERVER = register("minecraft:observer", state -> state.with(state.getBlockType().getProperty("facing"), Direction.SOUTH).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType OBSIDIAN = register("minecraft:obsidian"); + @Nullable static final BlockType ORANGE_BANNER = register("minecraft:orange_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable static final BlockType ORANGE_BED = register("minecraft:orange_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable static final BlockType ORANGE_CARPET = register("minecraft:orange_carpet"); + @Nullable static final BlockType ORANGE_CONCRETE = register("minecraft:orange_concrete"); + @Nullable static final BlockType ORANGE_CONCRETE_POWDER = register("minecraft:orange_concrete_powder"); + @Nullable static final BlockType ORANGE_GLAZED_TERRACOTTA = register("minecraft:orange_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType ORANGE_SHULKER_BOX = register("minecraft:orange_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable static final BlockType ORANGE_STAINED_GLASS = register("minecraft:orange_stained_glass"); + @Nullable static final BlockType ORANGE_STAINED_GLASS_PANE = register("minecraft:orange_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType ORANGE_TERRACOTTA = register("minecraft:orange_terracotta"); + @Nullable static final BlockType ORANGE_TULIP = register("minecraft:orange_tulip"); + @Nullable static final BlockType ORANGE_WALL_BANNER = register("minecraft:orange_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType ORANGE_WOOL = register("minecraft:orange_wool"); + @Nullable static final BlockType OXEYE_DAISY = register("minecraft:oxeye_daisy"); + @Nullable static final BlockType PACKED_ICE = register("minecraft:packed_ice"); + @Nullable static final BlockType PEONY = register("minecraft:peony", state -> state.with(state.getBlockType().getProperty("half"), "lower")); + @Nullable static final BlockType PETRIFIED_OAK_SLAB = register("minecraft:petrified_oak_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType PINK_BANNER = register("minecraft:pink_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable static final BlockType PINK_BED = register("minecraft:pink_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable static final BlockType PINK_CARPET = register("minecraft:pink_carpet"); + @Nullable static final BlockType PINK_CONCRETE = register("minecraft:pink_concrete"); + @Nullable static final BlockType PINK_CONCRETE_POWDER = register("minecraft:pink_concrete_powder"); + @Nullable static final BlockType PINK_GLAZED_TERRACOTTA = register("minecraft:pink_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType PINK_SHULKER_BOX = register("minecraft:pink_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable static final BlockType PINK_STAINED_GLASS = register("minecraft:pink_stained_glass"); + @Nullable static final BlockType PINK_STAINED_GLASS_PANE = register("minecraft:pink_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType PINK_TERRACOTTA = register("minecraft:pink_terracotta"); + @Nullable static final BlockType PINK_TULIP = register("minecraft:pink_tulip"); + @Nullable static final BlockType PINK_WALL_BANNER = register("minecraft:pink_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType PINK_WOOL = register("minecraft:pink_wool"); + @Nullable static final BlockType PISTON = register("minecraft:piston", state -> state.with(state.getBlockType().getProperty("extended"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType PISTON_HEAD = register("minecraft:piston_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("short"), false).with(state.getBlockType().getProperty("type"), "normal")); + @Nullable static final BlockType PLAYER_HEAD = register("minecraft:player_head", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable static final BlockType PLAYER_WALL_HEAD = register("minecraft:player_wall_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType PODZOL = register("minecraft:podzol", state -> state.with(state.getBlockType().getProperty("snowy"), false)); + @Nullable static final BlockType POLISHED_ANDESITE = register("minecraft:polished_andesite"); + @Nullable static final BlockType POLISHED_DIORITE = register("minecraft:polished_diorite"); + @Nullable static final BlockType POLISHED_GRANITE = register("minecraft:polished_granite"); + @Nullable static final BlockType POPPY = register("minecraft:poppy"); + @Nullable static final BlockType POTATOES = register("minecraft:potatoes", state -> state.with(state.getBlockType().getProperty("age"), 0)); + @Nullable static final BlockType POTTED_ACACIA_SAPLING = register("minecraft:potted_acacia_sapling"); + @Nullable static final BlockType POTTED_ALLIUM = register("minecraft:potted_allium"); + @Nullable static final BlockType POTTED_AZURE_BLUET = register("minecraft:potted_azure_bluet"); + @Nullable static final BlockType POTTED_BIRCH_SAPLING = register("minecraft:potted_birch_sapling"); + @Nullable static final BlockType POTTED_BLUE_ORCHID = register("minecraft:potted_blue_orchid"); + @Nullable static final BlockType POTTED_BROWN_MUSHROOM = register("minecraft:potted_brown_mushroom"); + @Nullable static final BlockType POTTED_CACTUS = register("minecraft:potted_cactus"); + @Nullable static final BlockType POTTED_DANDELION = register("minecraft:potted_dandelion"); + @Nullable static final BlockType POTTED_DARK_OAK_SAPLING = register("minecraft:potted_dark_oak_sapling"); + @Nullable static final BlockType POTTED_DEAD_BUSH = register("minecraft:potted_dead_bush"); + @Nullable static final BlockType POTTED_FERN = register("minecraft:potted_fern"); + @Nullable static final BlockType POTTED_JUNGLE_SAPLING = register("minecraft:potted_jungle_sapling"); + @Nullable static final BlockType POTTED_OAK_SAPLING = register("minecraft:potted_oak_sapling"); + @Nullable static final BlockType POTTED_ORANGE_TULIP = register("minecraft:potted_orange_tulip"); + @Nullable static final BlockType POTTED_OXEYE_DAISY = register("minecraft:potted_oxeye_daisy"); + @Nullable static final BlockType POTTED_PINK_TULIP = register("minecraft:potted_pink_tulip"); + @Nullable static final BlockType POTTED_POPPY = register("minecraft:potted_poppy"); + @Nullable static final BlockType POTTED_RED_MUSHROOM = register("minecraft:potted_red_mushroom"); + @Nullable static final BlockType POTTED_RED_TULIP = register("minecraft:potted_red_tulip"); + @Nullable static final BlockType POTTED_SPRUCE_SAPLING = register("minecraft:potted_spruce_sapling"); + @Nullable static final BlockType POTTED_WHITE_TULIP = register("minecraft:potted_white_tulip"); + @Nullable static final BlockType POWERED_RAIL = register("minecraft:powered_rail", state -> state.with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("shape"), "north_south")); + @Nullable static final BlockType PRISMARINE = register("minecraft:prismarine"); + @Nullable static final BlockType PRISMARINE_BRICK_SLAB = register("minecraft:prismarine_brick_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType PRISMARINE_BRICK_STAIRS = register("minecraft:prismarine_brick_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType PRISMARINE_BRICKS = register("minecraft:prismarine_bricks"); + @Nullable static final BlockType PRISMARINE_SLAB = register("minecraft:prismarine_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType PRISMARINE_STAIRS = register("minecraft:prismarine_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType PUMPKIN = register("minecraft:pumpkin"); + @Nullable static final BlockType PUMPKIN_STEM = register("minecraft:pumpkin_stem", state -> state.with(state.getBlockType().getProperty("age"), 0)); + @Nullable static final BlockType PURPLE_BANNER = register("minecraft:purple_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable static final BlockType PURPLE_BED = register("minecraft:purple_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable static final BlockType PURPLE_CARPET = register("minecraft:purple_carpet"); + @Nullable static final BlockType PURPLE_CONCRETE = register("minecraft:purple_concrete"); + @Nullable static final BlockType PURPLE_CONCRETE_POWDER = register("minecraft:purple_concrete_powder"); + @Nullable static final BlockType PURPLE_GLAZED_TERRACOTTA = register("minecraft:purple_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType PURPLE_SHULKER_BOX = register("minecraft:purple_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable static final BlockType PURPLE_STAINED_GLASS = register("minecraft:purple_stained_glass"); + @Nullable static final BlockType PURPLE_STAINED_GLASS_PANE = register("minecraft:purple_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType PURPLE_TERRACOTTA = register("minecraft:purple_terracotta"); + @Nullable static final BlockType PURPLE_WALL_BANNER = register("minecraft:purple_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType PURPLE_WOOL = register("minecraft:purple_wool"); + @Nullable static final BlockType PURPUR_BLOCK = register("minecraft:purpur_block"); + @Nullable static final BlockType PURPUR_PILLAR = register("minecraft:purpur_pillar", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType PURPUR_SLAB = register("minecraft:purpur_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType PURPUR_STAIRS = register("minecraft:purpur_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType QUARTZ_BLOCK = register("minecraft:quartz_block"); + @Nullable static final BlockType QUARTZ_PILLAR = register("minecraft:quartz_pillar", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType QUARTZ_SLAB = register("minecraft:quartz_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType QUARTZ_STAIRS = register("minecraft:quartz_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType RAIL = register("minecraft:rail", state -> state.with(state.getBlockType().getProperty("shape"), "north_south")); + @Nullable static final BlockType RED_BANNER = register("minecraft:red_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable static final BlockType RED_BED = register("minecraft:red_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable static final BlockType RED_CARPET = register("minecraft:red_carpet"); + @Nullable static final BlockType RED_CONCRETE = register("minecraft:red_concrete"); + @Nullable static final BlockType RED_CONCRETE_POWDER = register("minecraft:red_concrete_powder"); + @Nullable static final BlockType RED_GLAZED_TERRACOTTA = register("minecraft:red_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType RED_MUSHROOM = register("minecraft:red_mushroom"); + @Nullable static final BlockType RED_MUSHROOM_BLOCK = register("minecraft:red_mushroom_block", state -> state.with(state.getBlockType().getProperty("down"), true).with(state.getBlockType().getProperty("east"), true).with(state.getBlockType().getProperty("north"), true).with(state.getBlockType().getProperty("south"), true).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("west"), true)); + @Nullable static final BlockType RED_NETHER_BRICKS = register("minecraft:red_nether_bricks"); + @Nullable static final BlockType RED_SAND = register("minecraft:red_sand"); + @Nullable static final BlockType RED_SANDSTONE = register("minecraft:red_sandstone"); + @Nullable static final BlockType RED_SANDSTONE_SLAB = register("minecraft:red_sandstone_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType RED_SANDSTONE_STAIRS = register("minecraft:red_sandstone_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType RED_SHULKER_BOX = register("minecraft:red_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable static final BlockType RED_STAINED_GLASS = register("minecraft:red_stained_glass"); + @Nullable static final BlockType RED_STAINED_GLASS_PANE = register("minecraft:red_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType RED_TERRACOTTA = register("minecraft:red_terracotta"); + @Nullable static final BlockType RED_TULIP = register("minecraft:red_tulip"); + @Nullable static final BlockType RED_WALL_BANNER = register("minecraft:red_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType RED_WOOL = register("minecraft:red_wool"); + @Nullable static final BlockType REDSTONE_BLOCK = register("minecraft:redstone_block"); + @Nullable static final BlockType REDSTONE_LAMP = register("minecraft:redstone_lamp", state -> state.with(state.getBlockType().getProperty("lit"), false)); + @Nullable static final BlockType REDSTONE_ORE = register("minecraft:redstone_ore", state -> state.with(state.getBlockType().getProperty("lit"), false)); + @Nullable static final BlockType REDSTONE_TORCH = register("minecraft:redstone_torch", state -> state.with(state.getBlockType().getProperty("lit"), true)); + @Nullable static final BlockType REDSTONE_WALL_TORCH = register("minecraft:redstone_wall_torch", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("lit"), true)); + @Nullable static final BlockType REDSTONE_WIRE = register("minecraft:redstone_wire", state -> state.with(state.getBlockType().getProperty("east"), "none").with(state.getBlockType().getProperty("north"), "none").with(state.getBlockType().getProperty("power"), 0).with(state.getBlockType().getProperty("south"), "none").with(state.getBlockType().getProperty("west"), "none")); + @Nullable static final BlockType REPEATER = register("minecraft:repeater", state -> state.with(state.getBlockType().getProperty("delay"), 1).with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("locked"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType REPEATING_COMMAND_BLOCK = register("minecraft:repeating_command_block", state -> state.with(state.getBlockType().getProperty("conditional"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType ROSE_BUSH = register("minecraft:rose_bush", state -> state.with(state.getBlockType().getProperty("half"), "lower")); + @Nullable static final BlockType SAND = register("minecraft:sand"); + @Nullable static final BlockType SANDSTONE = register("minecraft:sandstone"); + @Nullable static final BlockType SANDSTONE_SLAB = register("minecraft:sandstone_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType SANDSTONE_STAIRS = register("minecraft:sandstone_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType SEA_LANTERN = register("minecraft:sea_lantern"); + @Nullable static final BlockType SEA_PICKLE = register("minecraft:sea_pickle", state -> state.with(state.getBlockType().getProperty("pickles"), 1).with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType SEAGRASS = register("minecraft:seagrass"); + @Nullable static final BlockType SHULKER_BOX = register("minecraft:shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable static final BlockType SIGN = register("minecraft:sign", state -> state.with(state.getBlockType().getProperty("rotation"), 0).with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType SKELETON_SKULL = register("minecraft:skeleton_skull", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable static final BlockType SKELETON_WALL_SKULL = register("minecraft:skeleton_wall_skull", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType SLIME_BLOCK = register("minecraft:slime_block"); + @Nullable static final BlockType SMOOTH_QUARTZ = register("minecraft:smooth_quartz"); + @Nullable static final BlockType SMOOTH_RED_SANDSTONE = register("minecraft:smooth_red_sandstone"); + @Nullable static final BlockType SMOOTH_SANDSTONE = register("minecraft:smooth_sandstone"); + @Nullable static final BlockType SMOOTH_STONE = register("minecraft:smooth_stone"); + @Nullable static final BlockType SNOW = register("minecraft:snow", state -> state.with(state.getBlockType().getProperty("layers"), 1)); + @Nullable static final BlockType SNOW_BLOCK = register("minecraft:snow_block"); + @Nullable static final BlockType SOUL_SAND = register("minecraft:soul_sand"); + @Nullable static final BlockType SPAWNER = register("minecraft:spawner"); + @Nullable static final BlockType SPONGE = register("minecraft:sponge"); + @Nullable static final BlockType SPRUCE_BUTTON = register("minecraft:spruce_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType SPRUCE_DOOR = register("minecraft:spruce_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType SPRUCE_FENCE = register("minecraft:spruce_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType SPRUCE_FENCE_GATE = register("minecraft:spruce_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType SPRUCE_LEAVES = register("minecraft:spruce_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); + @Nullable static final BlockType SPRUCE_LOG = register("minecraft:spruce_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType SPRUCE_PLANKS = register("minecraft:spruce_planks"); + @Nullable static final BlockType SPRUCE_PRESSURE_PLATE = register("minecraft:spruce_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType SPRUCE_SAPLING = register("minecraft:spruce_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); + @Nullable static final BlockType SPRUCE_SLAB = register("minecraft:spruce_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType SPRUCE_STAIRS = register("minecraft:spruce_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType SPRUCE_TRAPDOOR = register("minecraft:spruce_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType SPRUCE_WOOD = register("minecraft:spruce_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType STICKY_PISTON = register("minecraft:sticky_piston", state -> state.with(state.getBlockType().getProperty("extended"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType STONE = register("minecraft:stone"); + @Nullable static final BlockType STONE_BRICK_SLAB = register("minecraft:stone_brick_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType STONE_BRICK_STAIRS = register("minecraft:stone_brick_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType STONE_BRICKS = register("minecraft:stone_bricks"); + @Nullable static final BlockType STONE_BUTTON = register("minecraft:stone_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType STONE_PRESSURE_PLATE = register("minecraft:stone_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType STONE_SLAB = register("minecraft:stone_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType STRIPPED_ACACIA_LOG = register("minecraft:stripped_acacia_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType STRIPPED_ACACIA_WOOD = register("minecraft:stripped_acacia_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType STRIPPED_BIRCH_LOG = register("minecraft:stripped_birch_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType STRIPPED_BIRCH_WOOD = register("minecraft:stripped_birch_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType STRIPPED_DARK_OAK_LOG = register("minecraft:stripped_dark_oak_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType STRIPPED_DARK_OAK_WOOD = register("minecraft:stripped_dark_oak_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType STRIPPED_JUNGLE_LOG = register("minecraft:stripped_jungle_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType STRIPPED_JUNGLE_WOOD = register("minecraft:stripped_jungle_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType STRIPPED_OAK_LOG = register("minecraft:stripped_oak_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType STRIPPED_OAK_WOOD = register("minecraft:stripped_oak_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType STRIPPED_SPRUCE_LOG = register("minecraft:stripped_spruce_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType STRIPPED_SPRUCE_WOOD = register("minecraft:stripped_spruce_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable static final BlockType STRUCTURE_BLOCK = register("minecraft:structure_block", state -> state.with(state.getBlockType().getProperty("mode"), "SAVE")); + @Nullable static final BlockType STRUCTURE_VOID = register("minecraft:structure_void"); + @Nullable static final BlockType SUGAR_CANE = register("minecraft:sugar_cane", state -> state.with(state.getBlockType().getProperty("age"), 0)); + @Nullable static final BlockType SUNFLOWER = register("minecraft:sunflower", state -> state.with(state.getBlockType().getProperty("half"), "lower")); + @Nullable static final BlockType TALL_GRASS = register("minecraft:tall_grass", state -> state.with(state.getBlockType().getProperty("half"), "lower")); + @Nullable static final BlockType TALL_SEAGRASS = register("minecraft:tall_seagrass", state -> state.with(state.getBlockType().getProperty("half"), "lower")); + @Nullable static final BlockType TERRACOTTA = register("minecraft:terracotta"); + @Nullable static final BlockType TNT = register("minecraft:tnt", state -> state.with(state.getBlockType().getProperty("unstable"), false)); + @Nullable static final BlockType TORCH = register("minecraft:torch"); + @Nullable static final BlockType TRAPPED_CHEST = register("minecraft:trapped_chest", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("type"), "SINGLE").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType TRIPWIRE = register("minecraft:tripwire", state -> state.with(state.getBlockType().getProperty("attached"), false).with(state.getBlockType().getProperty("disarmed"), false).with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType TRIPWIRE_HOOK = register("minecraft:tripwire_hook", state -> state.with(state.getBlockType().getProperty("attached"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + @Nullable static final BlockType TUBE_CORAL = register("minecraft:tube_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType TUBE_CORAL_BLOCK = register("minecraft:tube_coral_block"); + @Nullable static final BlockType TUBE_CORAL_FAN = register("minecraft:tube_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType TUBE_CORAL_WALL_FAN = register("minecraft:tube_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable static final BlockType TURTLE_EGG = register("minecraft:turtle_egg", state -> state.with(state.getBlockType().getProperty("eggs"), 1).with(state.getBlockType().getProperty("hatch"), 0)); + @Nullable static final BlockType VINE = register("minecraft:vine", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType VOID_AIR = register("minecraft:void_air"); + @Nullable static final BlockType WALL_SIGN = register("minecraft:wall_sign", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable static final BlockType WALL_TORCH = register("minecraft:wall_torch", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType WATER = register("minecraft:water", state -> state.with(state.getBlockType().getProperty("level"), 0)); + @Nullable static final BlockType WET_SPONGE = register("minecraft:wet_sponge"); + @Nullable static final BlockType WHEAT = register("minecraft:wheat", state -> state.with(state.getBlockType().getProperty("age"), 0)); + @Nullable static final BlockType WHITE_BANNER = register("minecraft:white_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable static final BlockType WHITE_BED = register("minecraft:white_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable static final BlockType WHITE_CARPET = register("minecraft:white_carpet"); + @Nullable static final BlockType WHITE_CONCRETE = register("minecraft:white_concrete"); + @Nullable static final BlockType WHITE_CONCRETE_POWDER = register("minecraft:white_concrete_powder"); + @Nullable static final BlockType WHITE_GLAZED_TERRACOTTA = register("minecraft:white_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType WHITE_SHULKER_BOX = register("minecraft:white_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable static final BlockType WHITE_STAINED_GLASS = register("minecraft:white_stained_glass"); + @Nullable static final BlockType WHITE_STAINED_GLASS_PANE = register("minecraft:white_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType WHITE_TERRACOTTA = register("minecraft:white_terracotta"); + @Nullable static final BlockType WHITE_TULIP = register("minecraft:white_tulip"); + @Nullable static final BlockType WHITE_WALL_BANNER = register("minecraft:white_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType WHITE_WOOL = register("minecraft:white_wool"); + @Nullable static final BlockType WITHER_SKELETON_SKULL = register("minecraft:wither_skeleton_skull", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable static final BlockType WITHER_SKELETON_WALL_SKULL = register("minecraft:wither_skeleton_wall_skull", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType YELLOW_BANNER = register("minecraft:yellow_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable static final BlockType YELLOW_BED = register("minecraft:yellow_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable static final BlockType YELLOW_CARPET = register("minecraft:yellow_carpet"); + @Nullable static final BlockType YELLOW_CONCRETE = register("minecraft:yellow_concrete"); + @Nullable static final BlockType YELLOW_CONCRETE_POWDER = register("minecraft:yellow_concrete_powder"); + @Nullable static final BlockType YELLOW_GLAZED_TERRACOTTA = register("minecraft:yellow_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType YELLOW_SHULKER_BOX = register("minecraft:yellow_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable static final BlockType YELLOW_STAINED_GLASS = register("minecraft:yellow_stained_glass"); + @Nullable static final BlockType YELLOW_STAINED_GLASS_PANE = register("minecraft:yellow_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable static final BlockType YELLOW_TERRACOTTA = register("minecraft:yellow_terracotta"); + @Nullable static final BlockType YELLOW_WALL_BANNER = register("minecraft:yellow_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable static final BlockType YELLOW_WOOL = register("minecraft:yellow_wool"); + @Nullable static final BlockType ZOMBIE_HEAD = register("minecraft:zombie_head", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable static final BlockType ZOMBIE_WALL_HEAD = register("minecraft:zombie_wall_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); private static BlockType register(String id) { @@ -698,8 +698,8 @@ public class BlockTypes{ init(blockType, blockType.getId(), internalId, stateList); if(BlockType.REGISTRY.get(blockType.getId()) == null) BlockType.REGISTRY.register(blockType.getId(), blockType); $NAMESPACES.add(blockType.getNamespace()); - values = sortedRegistry.toArray(new BlockType[sortedRegistry.size()]); - states = stateList.toArray(new BlockState[stateList.size()]); + values = sortedRegistry.toArray(new BlockType[0]); + states = stateList.toArray(new BlockState[0]); return blockType; } @@ -835,8 +835,8 @@ public class BlockTypes{ try { BlockStateHolder block = LegacyMapper.getInstance().getBlockFromLegacy(input); if (block != null) return block.getBlockType(); - } catch (NumberFormatException e) { - } catch (IndexOutOfBoundsException e) {} + } catch (NumberFormatException | IndexOutOfBoundsException e) { + } throw new SuggestInputParseException("Does not match a valid block type: " + inputLower, inputLower, () -> Stream.of(BlockTypes.values) .filter(b -> b.getId().contains(inputLower)) From 6ccd0eb58e9cbdac7cfa96d429b0a3460728296f Mon Sep 17 00:00:00 2001 From: matt <4009945+MattBDev@users.noreply.github.com> Date: Tue, 2 Apr 2019 15:22:54 -0400 Subject: [PATCH 02/11] Fixed deleted code due to IDE glitch --- .../worldedit/world/block/BlockTypes.java | 1201 ++++++++--------- 1 file changed, 600 insertions(+), 601 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypes.java index 455edecce..f7a56174d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypes.java @@ -58,612 +58,611 @@ import java.util.stream.Stream; /** * Stores a list of common Block String IDs. */ -@SuppressWarnings("deprecation") -public class BlockTypes{ +public final class BlockTypes{ /* ----------------------------------------------------- Replaced at runtime by the block registry ----------------------------------------------------- */ - @Nullable static final BlockType __RESERVED__ = register("minecraft:__reserved__"); - @Nullable static final BlockType ACACIA_BUTTON = register("minecraft:acacia_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType ACACIA_DOOR = register("minecraft:acacia_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType ACACIA_FENCE = register("minecraft:acacia_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType ACACIA_FENCE_GATE = register("minecraft:acacia_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType ACACIA_LEAVES = register("minecraft:acacia_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); - @Nullable static final BlockType ACACIA_LOG = register("minecraft:acacia_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType ACACIA_PLANKS = register("minecraft:acacia_planks"); - @Nullable static final BlockType ACACIA_PRESSURE_PLATE = register("minecraft:acacia_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType ACACIA_SAPLING = register("minecraft:acacia_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); - @Nullable static final BlockType ACACIA_SLAB = register("minecraft:acacia_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType ACACIA_STAIRS = register("minecraft:acacia_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType ACACIA_TRAPDOOR = register("minecraft:acacia_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType ACACIA_WOOD = register("minecraft:acacia_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType ACTIVATOR_RAIL = register("minecraft:activator_rail", state -> state.with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("shape"), "north_south")); - @Nullable static final BlockType AIR = register("minecraft:air"); - @Nullable static final BlockType ALLIUM = register("minecraft:allium"); - @Nullable static final BlockType ANDESITE = register("minecraft:andesite"); - @Nullable static final BlockType ANVIL = register("minecraft:anvil", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType ATTACHED_MELON_STEM = register("minecraft:attached_melon_stem", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType ATTACHED_PUMPKIN_STEM = register("minecraft:attached_pumpkin_stem", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType AZURE_BLUET = register("minecraft:azure_bluet"); - @Nullable static final BlockType BARRIER = register("minecraft:barrier"); - @Nullable static final BlockType BEACON = register("minecraft:beacon"); - @Nullable static final BlockType BEDROCK = register("minecraft:bedrock"); - @Nullable static final BlockType BEETROOTS = register("minecraft:beetroots", state -> state.with(state.getBlockType().getProperty("age"), 0)); - @Nullable static final BlockType BIRCH_BUTTON = register("minecraft:birch_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType BIRCH_DOOR = register("minecraft:birch_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType BIRCH_FENCE = register("minecraft:birch_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType BIRCH_FENCE_GATE = register("minecraft:birch_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType BIRCH_LEAVES = register("minecraft:birch_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); - @Nullable static final BlockType BIRCH_LOG = register("minecraft:birch_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType BIRCH_PLANKS = register("minecraft:birch_planks"); - @Nullable static final BlockType BIRCH_PRESSURE_PLATE = register("minecraft:birch_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType BIRCH_SAPLING = register("minecraft:birch_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); - @Nullable static final BlockType BIRCH_SLAB = register("minecraft:birch_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType BIRCH_STAIRS = register("minecraft:birch_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType BIRCH_TRAPDOOR = register("minecraft:birch_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType BIRCH_WOOD = register("minecraft:birch_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType BLACK_BANNER = register("minecraft:black_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - @Nullable static final BlockType BLACK_BED = register("minecraft:black_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - @Nullable static final BlockType BLACK_CARPET = register("minecraft:black_carpet"); - @Nullable static final BlockType BLACK_CONCRETE = register("minecraft:black_concrete"); - @Nullable static final BlockType BLACK_CONCRETE_POWDER = register("minecraft:black_concrete_powder"); - @Nullable static final BlockType BLACK_GLAZED_TERRACOTTA = register("minecraft:black_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType BLACK_SHULKER_BOX = register("minecraft:black_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - @Nullable static final BlockType BLACK_STAINED_GLASS = register("minecraft:black_stained_glass"); - @Nullable static final BlockType BLACK_STAINED_GLASS_PANE = register("minecraft:black_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType BLACK_TERRACOTTA = register("minecraft:black_terracotta"); - @Nullable static final BlockType BLACK_WALL_BANNER = register("minecraft:black_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType BLACK_WOOL = register("minecraft:black_wool"); - @Nullable static final BlockType BLUE_BANNER = register("minecraft:blue_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - @Nullable static final BlockType BLUE_BED = register("minecraft:blue_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - @Nullable static final BlockType BLUE_CARPET = register("minecraft:blue_carpet"); - @Nullable static final BlockType BLUE_CONCRETE = register("minecraft:blue_concrete"); - @Nullable static final BlockType BLUE_CONCRETE_POWDER = register("minecraft:blue_concrete_powder"); - @Nullable static final BlockType BLUE_GLAZED_TERRACOTTA = register("minecraft:blue_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType BLUE_ICE = register("minecraft:blue_ice"); - @Nullable static final BlockType BLUE_ORCHID = register("minecraft:blue_orchid"); - @Nullable static final BlockType BLUE_SHULKER_BOX = register("minecraft:blue_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - @Nullable static final BlockType BLUE_STAINED_GLASS = register("minecraft:blue_stained_glass"); - @Nullable static final BlockType BLUE_STAINED_GLASS_PANE = register("minecraft:blue_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType BLUE_TERRACOTTA = register("minecraft:blue_terracotta"); - @Nullable static final BlockType BLUE_WALL_BANNER = register("minecraft:blue_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType BLUE_WOOL = register("minecraft:blue_wool"); - @Nullable static final BlockType BONE_BLOCK = register("minecraft:bone_block", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType BOOKSHELF = register("minecraft:bookshelf"); - @Nullable static final BlockType BRAIN_CORAL = register("minecraft:brain_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType BRAIN_CORAL_BLOCK = register("minecraft:brain_coral_block"); - @Nullable static final BlockType BRAIN_CORAL_FAN = register("minecraft:brain_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType BRAIN_CORAL_WALL_FAN = register("minecraft:brain_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType BREWING_STAND = register("minecraft:brewing_stand", state -> state.with(state.getBlockType().getProperty("has_bottle_0"), false).with(state.getBlockType().getProperty("has_bottle_1"), false).with(state.getBlockType().getProperty("has_bottle_2"), false)); - @Nullable static final BlockType BRICK_SLAB = register("minecraft:brick_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType BRICK_STAIRS = register("minecraft:brick_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType BRICKS = register("minecraft:bricks"); - @Nullable static final BlockType BROWN_BANNER = register("minecraft:brown_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - @Nullable static final BlockType BROWN_BED = register("minecraft:brown_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - @Nullable static final BlockType BROWN_CARPET = register("minecraft:brown_carpet"); - @Nullable static final BlockType BROWN_CONCRETE = register("minecraft:brown_concrete"); - @Nullable static final BlockType BROWN_CONCRETE_POWDER = register("minecraft:brown_concrete_powder"); - @Nullable static final BlockType BROWN_GLAZED_TERRACOTTA = register("minecraft:brown_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType BROWN_MUSHROOM = register("minecraft:brown_mushroom"); - @Nullable static final BlockType BROWN_MUSHROOM_BLOCK = register("minecraft:brown_mushroom_block", state -> state.with(state.getBlockType().getProperty("down"), true).with(state.getBlockType().getProperty("east"), true).with(state.getBlockType().getProperty("north"), true).with(state.getBlockType().getProperty("south"), true).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("west"), true)); - @Nullable static final BlockType BROWN_SHULKER_BOX = register("minecraft:brown_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - @Nullable static final BlockType BROWN_STAINED_GLASS = register("minecraft:brown_stained_glass"); - @Nullable static final BlockType BROWN_STAINED_GLASS_PANE = register("minecraft:brown_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType BROWN_TERRACOTTA = register("minecraft:brown_terracotta"); - @Nullable static final BlockType BROWN_WALL_BANNER = register("minecraft:brown_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType BROWN_WOOL = register("minecraft:brown_wool"); - @Nullable static final BlockType BUBBLE_COLUMN = register("minecraft:bubble_column", state -> state.with(state.getBlockType().getProperty("drag"), true)); - @Nullable static final BlockType BUBBLE_CORAL = register("minecraft:bubble_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType BUBBLE_CORAL_BLOCK = register("minecraft:bubble_coral_block"); - @Nullable static final BlockType BUBBLE_CORAL_FAN = register("minecraft:bubble_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType BUBBLE_CORAL_WALL_FAN = register("minecraft:bubble_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType CACTUS = register("minecraft:cactus", state -> state.with(state.getBlockType().getProperty("age"), 0)); - @Nullable static final BlockType CAKE = register("minecraft:cake", state -> state.with(state.getBlockType().getProperty("bites"), 0)); - @Nullable static final BlockType CARROTS = register("minecraft:carrots", state -> state.with(state.getBlockType().getProperty("age"), 0)); - @Nullable static final BlockType CARVED_PUMPKIN = register("minecraft:carved_pumpkin", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType CAULDRON = register("minecraft:cauldron", state -> state.with(state.getBlockType().getProperty("level"), 0)); - @Nullable static final BlockType CAVE_AIR = register("minecraft:cave_air"); - @Nullable static final BlockType CHAIN_COMMAND_BLOCK = register("minecraft:chain_command_block", state -> state.with(state.getBlockType().getProperty("conditional"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType CHEST = register("minecraft:chest", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("type"), "SINGLE").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType CHIPPED_ANVIL = register("minecraft:chipped_anvil", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType CHISELED_QUARTZ_BLOCK = register("minecraft:chiseled_quartz_block"); - @Nullable static final BlockType CHISELED_RED_SANDSTONE = register("minecraft:chiseled_red_sandstone"); - @Nullable static final BlockType CHISELED_SANDSTONE = register("minecraft:chiseled_sandstone"); - @Nullable static final BlockType CHISELED_STONE_BRICKS = register("minecraft:chiseled_stone_bricks"); - @Nullable static final BlockType CHORUS_FLOWER = register("minecraft:chorus_flower", state -> state.with(state.getBlockType().getProperty("age"), 0)); - @Nullable static final BlockType CHORUS_PLANT = register("minecraft:chorus_plant", state -> state.with(state.getBlockType().getProperty("down"), false).with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType CLAY = register("minecraft:clay"); - @Nullable static final BlockType COAL_BLOCK = register("minecraft:coal_block"); - @Nullable static final BlockType COAL_ORE = register("minecraft:coal_ore"); - @Nullable static final BlockType COARSE_DIRT = register("minecraft:coarse_dirt"); - @Nullable static final BlockType COBBLESTONE = register("minecraft:cobblestone"); - @Nullable static final BlockType COBBLESTONE_SLAB = register("minecraft:cobblestone_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType COBBLESTONE_STAIRS = register("minecraft:cobblestone_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType COBBLESTONE_WALL = register("minecraft:cobblestone_wall", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType COBWEB = register("minecraft:cobweb"); - @Nullable static final BlockType COCOA = register("minecraft:cocoa", state -> state.with(state.getBlockType().getProperty("age"), 0).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType COMMAND_BLOCK = register("minecraft:command_block", state -> state.with(state.getBlockType().getProperty("conditional"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType COMPARATOR = register("minecraft:comparator", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("mode"), "compare").with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType CONDUIT = register("minecraft:conduit", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType CRACKED_STONE_BRICKS = register("minecraft:cracked_stone_bricks"); - @Nullable static final BlockType CRAFTING_TABLE = register("minecraft:crafting_table"); - @Nullable static final BlockType CREEPER_HEAD = register("minecraft:creeper_head", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - @Nullable static final BlockType CREEPER_WALL_HEAD = register("minecraft:creeper_wall_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType CUT_RED_SANDSTONE = register("minecraft:cut_red_sandstone"); - @Nullable static final BlockType CUT_SANDSTONE = register("minecraft:cut_sandstone"); - @Nullable static final BlockType CYAN_BANNER = register("minecraft:cyan_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - @Nullable static final BlockType CYAN_BED = register("minecraft:cyan_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - @Nullable static final BlockType CYAN_CARPET = register("minecraft:cyan_carpet"); - @Nullable static final BlockType CYAN_CONCRETE = register("minecraft:cyan_concrete"); - @Nullable static final BlockType CYAN_CONCRETE_POWDER = register("minecraft:cyan_concrete_powder"); - @Nullable static final BlockType CYAN_GLAZED_TERRACOTTA = register("minecraft:cyan_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType CYAN_SHULKER_BOX = register("minecraft:cyan_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - @Nullable static final BlockType CYAN_STAINED_GLASS = register("minecraft:cyan_stained_glass"); - @Nullable static final BlockType CYAN_STAINED_GLASS_PANE = register("minecraft:cyan_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType CYAN_TERRACOTTA = register("minecraft:cyan_terracotta"); - @Nullable static final BlockType CYAN_WALL_BANNER = register("minecraft:cyan_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType CYAN_WOOL = register("minecraft:cyan_wool"); - @Nullable static final BlockType DAMAGED_ANVIL = register("minecraft:damaged_anvil", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType DANDELION = register("minecraft:dandelion"); - @Nullable static final BlockType DARK_OAK_BUTTON = register("minecraft:dark_oak_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType DARK_OAK_DOOR = register("minecraft:dark_oak_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType DARK_OAK_FENCE = register("minecraft:dark_oak_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType DARK_OAK_FENCE_GATE = register("minecraft:dark_oak_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType DARK_OAK_LEAVES = register("minecraft:dark_oak_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); - @Nullable static final BlockType DARK_OAK_LOG = register("minecraft:dark_oak_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType DARK_OAK_PLANKS = register("minecraft:dark_oak_planks"); - @Nullable static final BlockType DARK_OAK_PRESSURE_PLATE = register("minecraft:dark_oak_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType DARK_OAK_SAPLING = register("minecraft:dark_oak_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); - @Nullable static final BlockType DARK_OAK_SLAB = register("minecraft:dark_oak_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType DARK_OAK_STAIRS = register("minecraft:dark_oak_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType DARK_OAK_TRAPDOOR = register("minecraft:dark_oak_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType DARK_OAK_WOOD = register("minecraft:dark_oak_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType DARK_PRISMARINE = register("minecraft:dark_prismarine"); - @Nullable static final BlockType DARK_PRISMARINE_SLAB = register("minecraft:dark_prismarine_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType DARK_PRISMARINE_STAIRS = register("minecraft:dark_prismarine_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType DAYLIGHT_DETECTOR = register("minecraft:daylight_detector", state -> state.with(state.getBlockType().getProperty("inverted"), false).with(state.getBlockType().getProperty("power"), 0)); - @Nullable static final BlockType DEAD_BRAIN_CORAL = register("minecraft:dead_brain_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType DEAD_BRAIN_CORAL_BLOCK = register("minecraft:dead_brain_coral_block"); - @Nullable static final BlockType DEAD_BRAIN_CORAL_FAN = register("minecraft:dead_brain_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType DEAD_BRAIN_CORAL_WALL_FAN = register("minecraft:dead_brain_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType DEAD_BUBBLE_CORAL = register("minecraft:dead_bubble_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType DEAD_BUBBLE_CORAL_BLOCK = register("minecraft:dead_bubble_coral_block"); - @Nullable static final BlockType DEAD_BUBBLE_CORAL_FAN = register("minecraft:dead_bubble_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType DEAD_BUBBLE_CORAL_WALL_FAN = register("minecraft:dead_bubble_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType DEAD_BUSH = register("minecraft:dead_bush"); - @Nullable static final BlockType DEAD_FIRE_CORAL = register("minecraft:dead_fire_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType DEAD_FIRE_CORAL_BLOCK = register("minecraft:dead_fire_coral_block"); - @Nullable static final BlockType DEAD_FIRE_CORAL_FAN = register("minecraft:dead_fire_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType DEAD_FIRE_CORAL_WALL_FAN = register("minecraft:dead_fire_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType DEAD_HORN_CORAL = register("minecraft:dead_horn_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType DEAD_HORN_CORAL_BLOCK = register("minecraft:dead_horn_coral_block"); - @Nullable static final BlockType DEAD_HORN_CORAL_FAN = register("minecraft:dead_horn_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType DEAD_HORN_CORAL_WALL_FAN = register("minecraft:dead_horn_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType DEAD_TUBE_CORAL = register("minecraft:dead_tube_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType DEAD_TUBE_CORAL_BLOCK = register("minecraft:dead_tube_coral_block"); - @Nullable static final BlockType DEAD_TUBE_CORAL_FAN = register("minecraft:dead_tube_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType DEAD_TUBE_CORAL_WALL_FAN = register("minecraft:dead_tube_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType DETECTOR_RAIL = register("minecraft:detector_rail", state -> state.with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("shape"), "north_south")); - @Nullable static final BlockType DIAMOND_BLOCK = register("minecraft:diamond_block"); - @Nullable static final BlockType DIAMOND_ORE = register("minecraft:diamond_ore"); - @Nullable static final BlockType DIORITE = register("minecraft:diorite"); - @Nullable static final BlockType DIRT = register("minecraft:dirt"); - @Nullable static final BlockType DISPENSER = register("minecraft:dispenser", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("triggered"), false)); - @Nullable static final BlockType DRAGON_EGG = register("minecraft:dragon_egg"); - @Nullable static final BlockType DRAGON_HEAD = register("minecraft:dragon_head", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - @Nullable static final BlockType DRAGON_WALL_HEAD = register("minecraft:dragon_wall_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType DRIED_KELP_BLOCK = register("minecraft:dried_kelp_block"); - @Nullable static final BlockType DROPPER = register("minecraft:dropper", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("triggered"), false)); - @Nullable static final BlockType EMERALD_BLOCK = register("minecraft:emerald_block"); - @Nullable static final BlockType EMERALD_ORE = register("minecraft:emerald_ore"); - @Nullable static final BlockType ENCHANTING_TABLE = register("minecraft:enchanting_table"); - @Nullable static final BlockType END_GATEWAY = register("minecraft:end_gateway"); - @Nullable static final BlockType END_PORTAL = register("minecraft:end_portal"); - @Nullable static final BlockType END_PORTAL_FRAME = register("minecraft:end_portal_frame", state -> state.with(state.getBlockType().getProperty("eye"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType END_ROD = register("minecraft:end_rod", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - @Nullable static final BlockType END_STONE = register("minecraft:end_stone"); - @Nullable static final BlockType END_STONE_BRICKS = register("minecraft:end_stone_bricks"); - @Nullable static final BlockType ENDER_CHEST = register("minecraft:ender_chest", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType FARMLAND = register("minecraft:farmland", state -> state.with(state.getBlockType().getProperty("moisture"), 0)); - @Nullable static final BlockType FERN = register("minecraft:fern"); - @Nullable static final BlockType FIRE = register("minecraft:fire", state -> state.with(state.getBlockType().getProperty("age"), 0).with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType FIRE_CORAL = register("minecraft:fire_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType FIRE_CORAL_BLOCK = register("minecraft:fire_coral_block"); - @Nullable static final BlockType FIRE_CORAL_FAN = register("minecraft:fire_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType FIRE_CORAL_WALL_FAN = register("minecraft:fire_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType FLOWER_POT = register("minecraft:flower_pot"); - @Nullable static final BlockType FROSTED_ICE = register("minecraft:frosted_ice", state -> state.with(state.getBlockType().getProperty("age"), 0)); - @Nullable static final BlockType FURNACE = register("minecraft:furnace", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("lit"), false)); - @Nullable static final BlockType GLASS = register("minecraft:glass"); - @Nullable static final BlockType GLASS_PANE = register("minecraft:glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType GLOWSTONE = register("minecraft:glowstone"); - @Nullable static final BlockType GOLD_BLOCK = register("minecraft:gold_block"); - @Nullable static final BlockType GOLD_ORE = register("minecraft:gold_ore"); - @Nullable static final BlockType GRANITE = register("minecraft:granite"); - @Nullable static final BlockType GRASS = register("minecraft:grass"); - @Nullable static final BlockType GRASS_BLOCK = register("minecraft:grass_block", state -> state.with(state.getBlockType().getProperty("snowy"), false)); - @Nullable static final BlockType GRASS_PATH = register("minecraft:grass_path"); - @Nullable static final BlockType GRAVEL = register("minecraft:gravel"); - @Nullable static final BlockType GRAY_BANNER = register("minecraft:gray_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - @Nullable static final BlockType GRAY_BED = register("minecraft:gray_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - @Nullable static final BlockType GRAY_CARPET = register("minecraft:gray_carpet"); - @Nullable static final BlockType GRAY_CONCRETE = register("minecraft:gray_concrete"); - @Nullable static final BlockType GRAY_CONCRETE_POWDER = register("minecraft:gray_concrete_powder"); - @Nullable static final BlockType GRAY_GLAZED_TERRACOTTA = register("minecraft:gray_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType GRAY_SHULKER_BOX = register("minecraft:gray_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - @Nullable static final BlockType GRAY_STAINED_GLASS = register("minecraft:gray_stained_glass"); - @Nullable static final BlockType GRAY_STAINED_GLASS_PANE = register("minecraft:gray_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType GRAY_TERRACOTTA = register("minecraft:gray_terracotta"); - @Nullable static final BlockType GRAY_WALL_BANNER = register("minecraft:gray_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType GRAY_WOOL = register("minecraft:gray_wool"); - @Nullable static final BlockType GREEN_BANNER = register("minecraft:green_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - @Nullable static final BlockType GREEN_BED = register("minecraft:green_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - @Nullable static final BlockType GREEN_CARPET = register("minecraft:green_carpet"); - @Nullable static final BlockType GREEN_CONCRETE = register("minecraft:green_concrete"); - @Nullable static final BlockType GREEN_CONCRETE_POWDER = register("minecraft:green_concrete_powder"); - @Nullable static final BlockType GREEN_GLAZED_TERRACOTTA = register("minecraft:green_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType GREEN_SHULKER_BOX = register("minecraft:green_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - @Nullable static final BlockType GREEN_STAINED_GLASS = register("minecraft:green_stained_glass"); - @Nullable static final BlockType GREEN_STAINED_GLASS_PANE = register("minecraft:green_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType GREEN_TERRACOTTA = register("minecraft:green_terracotta"); - @Nullable static final BlockType GREEN_WALL_BANNER = register("minecraft:green_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType GREEN_WOOL = register("minecraft:green_wool"); - @Nullable static final BlockType HAY_BLOCK = register("minecraft:hay_block", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType HEAVY_WEIGHTED_PRESSURE_PLATE = register("minecraft:heavy_weighted_pressure_plate", state -> state.with(state.getBlockType().getProperty("power"), 0)); - @Nullable static final BlockType HOPPER = register("minecraft:hopper", state -> state.with(state.getBlockType().getProperty("enabled"), true).with(state.getBlockType().getProperty("facing"), Direction.DOWN)); - @Nullable static final BlockType HORN_CORAL = register("minecraft:horn_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType HORN_CORAL_BLOCK = register("minecraft:horn_coral_block"); - @Nullable static final BlockType HORN_CORAL_FAN = register("minecraft:horn_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType HORN_CORAL_WALL_FAN = register("minecraft:horn_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType ICE = register("minecraft:ice"); - @Nullable static final BlockType INFESTED_CHISELED_STONE_BRICKS = register("minecraft:infested_chiseled_stone_bricks"); - @Nullable static final BlockType INFESTED_COBBLESTONE = register("minecraft:infested_cobblestone"); - @Nullable static final BlockType INFESTED_CRACKED_STONE_BRICKS = register("minecraft:infested_cracked_stone_bricks"); - @Nullable static final BlockType INFESTED_MOSSY_STONE_BRICKS = register("minecraft:infested_mossy_stone_bricks"); - @Nullable static final BlockType INFESTED_STONE = register("minecraft:infested_stone"); - @Nullable static final BlockType INFESTED_STONE_BRICKS = register("minecraft:infested_stone_bricks"); - @Nullable static final BlockType IRON_BARS = register("minecraft:iron_bars", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType IRON_BLOCK = register("minecraft:iron_block"); - @Nullable static final BlockType IRON_DOOR = register("minecraft:iron_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType IRON_ORE = register("minecraft:iron_ore"); - @Nullable static final BlockType IRON_TRAPDOOR = register("minecraft:iron_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType JACK_O_LANTERN = register("minecraft:jack_o_lantern", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType JUKEBOX = register("minecraft:jukebox", state -> state.with(state.getBlockType().getProperty("has_record"), false)); - @Nullable static final BlockType JUNGLE_BUTTON = register("minecraft:jungle_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType JUNGLE_DOOR = register("minecraft:jungle_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType JUNGLE_FENCE = register("minecraft:jungle_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType JUNGLE_FENCE_GATE = register("minecraft:jungle_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType JUNGLE_LEAVES = register("minecraft:jungle_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); - @Nullable static final BlockType JUNGLE_LOG = register("minecraft:jungle_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType JUNGLE_PLANKS = register("minecraft:jungle_planks"); - @Nullable static final BlockType JUNGLE_PRESSURE_PLATE = register("minecraft:jungle_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType JUNGLE_SAPLING = register("minecraft:jungle_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); - @Nullable static final BlockType JUNGLE_SLAB = register("minecraft:jungle_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType JUNGLE_STAIRS = register("minecraft:jungle_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType JUNGLE_TRAPDOOR = register("minecraft:jungle_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType JUNGLE_WOOD = register("minecraft:jungle_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType KELP = register("minecraft:kelp", state -> state.with(state.getBlockType().getProperty("age"), 0)); - @Nullable static final BlockType KELP_PLANT = register("minecraft:kelp_plant"); - @Nullable static final BlockType LADDER = register("minecraft:ladder", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType LAPIS_BLOCK = register("minecraft:lapis_block"); - @Nullable static final BlockType LAPIS_ORE = register("minecraft:lapis_ore"); - @Nullable static final BlockType LARGE_FERN = register("minecraft:large_fern", state -> state.with(state.getBlockType().getProperty("half"), "lower")); - @Nullable static final BlockType LAVA = register("minecraft:lava", state -> state.with(state.getBlockType().getProperty("level"), 0)); - @Nullable static final BlockType LEVER = register("minecraft:lever", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType LIGHT_BLUE_BANNER = register("minecraft:light_blue_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - @Nullable static final BlockType LIGHT_BLUE_BED = register("minecraft:light_blue_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - @Nullable static final BlockType LIGHT_BLUE_CARPET = register("minecraft:light_blue_carpet"); - @Nullable static final BlockType LIGHT_BLUE_CONCRETE = register("minecraft:light_blue_concrete"); - @Nullable static final BlockType LIGHT_BLUE_CONCRETE_POWDER = register("minecraft:light_blue_concrete_powder"); - @Nullable static final BlockType LIGHT_BLUE_GLAZED_TERRACOTTA = register("minecraft:light_blue_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType LIGHT_BLUE_SHULKER_BOX = register("minecraft:light_blue_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - @Nullable static final BlockType LIGHT_BLUE_STAINED_GLASS = register("minecraft:light_blue_stained_glass"); - @Nullable static final BlockType LIGHT_BLUE_STAINED_GLASS_PANE = register("minecraft:light_blue_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType LIGHT_BLUE_TERRACOTTA = register("minecraft:light_blue_terracotta"); - @Nullable static final BlockType LIGHT_BLUE_WALL_BANNER = register("minecraft:light_blue_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType LIGHT_BLUE_WOOL = register("minecraft:light_blue_wool"); - @Nullable static final BlockType LIGHT_GRAY_BANNER = register("minecraft:light_gray_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - @Nullable static final BlockType LIGHT_GRAY_BED = register("minecraft:light_gray_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - @Nullable static final BlockType LIGHT_GRAY_CARPET = register("minecraft:light_gray_carpet"); - @Nullable static final BlockType LIGHT_GRAY_CONCRETE = register("minecraft:light_gray_concrete"); - @Nullable static final BlockType LIGHT_GRAY_CONCRETE_POWDER = register("minecraft:light_gray_concrete_powder"); - @Nullable static final BlockType LIGHT_GRAY_GLAZED_TERRACOTTA = register("minecraft:light_gray_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType LIGHT_GRAY_SHULKER_BOX = register("minecraft:light_gray_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - @Nullable static final BlockType LIGHT_GRAY_STAINED_GLASS = register("minecraft:light_gray_stained_glass"); - @Nullable static final BlockType LIGHT_GRAY_STAINED_GLASS_PANE = register("minecraft:light_gray_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType LIGHT_GRAY_TERRACOTTA = register("minecraft:light_gray_terracotta"); - @Nullable static final BlockType LIGHT_GRAY_WALL_BANNER = register("minecraft:light_gray_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType LIGHT_GRAY_WOOL = register("minecraft:light_gray_wool"); - @Nullable static final BlockType LIGHT_WEIGHTED_PRESSURE_PLATE = register("minecraft:light_weighted_pressure_plate", state -> state.with(state.getBlockType().getProperty("power"), 0)); - @Nullable static final BlockType LILAC = register("minecraft:lilac", state -> state.with(state.getBlockType().getProperty("half"), "lower")); - @Nullable static final BlockType LILY_PAD = register("minecraft:lily_pad"); - @Nullable static final BlockType LIME_BANNER = register("minecraft:lime_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - @Nullable static final BlockType LIME_BED = register("minecraft:lime_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - @Nullable static final BlockType LIME_CARPET = register("minecraft:lime_carpet"); - @Nullable static final BlockType LIME_CONCRETE = register("minecraft:lime_concrete"); - @Nullable static final BlockType LIME_CONCRETE_POWDER = register("minecraft:lime_concrete_powder"); - @Nullable static final BlockType LIME_GLAZED_TERRACOTTA = register("minecraft:lime_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType LIME_SHULKER_BOX = register("minecraft:lime_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - @Nullable static final BlockType LIME_STAINED_GLASS = register("minecraft:lime_stained_glass"); - @Nullable static final BlockType LIME_STAINED_GLASS_PANE = register("minecraft:lime_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType LIME_TERRACOTTA = register("minecraft:lime_terracotta"); - @Nullable static final BlockType LIME_WALL_BANNER = register("minecraft:lime_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType LIME_WOOL = register("minecraft:lime_wool"); - @Nullable static final BlockType MAGENTA_BANNER = register("minecraft:magenta_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - @Nullable static final BlockType MAGENTA_BED = register("minecraft:magenta_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - @Nullable static final BlockType MAGENTA_CARPET = register("minecraft:magenta_carpet"); - @Nullable static final BlockType MAGENTA_CONCRETE = register("minecraft:magenta_concrete"); - @Nullable static final BlockType MAGENTA_CONCRETE_POWDER = register("minecraft:magenta_concrete_powder"); - @Nullable static final BlockType MAGENTA_GLAZED_TERRACOTTA = register("minecraft:magenta_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType MAGENTA_SHULKER_BOX = register("minecraft:magenta_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - @Nullable static final BlockType MAGENTA_STAINED_GLASS = register("minecraft:magenta_stained_glass"); - @Nullable static final BlockType MAGENTA_STAINED_GLASS_PANE = register("minecraft:magenta_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType MAGENTA_TERRACOTTA = register("minecraft:magenta_terracotta"); - @Nullable static final BlockType MAGENTA_WALL_BANNER = register("minecraft:magenta_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType MAGENTA_WOOL = register("minecraft:magenta_wool"); - @Nullable static final BlockType MAGMA_BLOCK = register("minecraft:magma_block"); - @Nullable static final BlockType MELON = register("minecraft:melon"); - @Nullable static final BlockType MELON_STEM = register("minecraft:melon_stem", state -> state.with(state.getBlockType().getProperty("age"), 0)); - @Nullable static final BlockType MOSSY_COBBLESTONE = register("minecraft:mossy_cobblestone"); - @Nullable static final BlockType MOSSY_COBBLESTONE_WALL = register("minecraft:mossy_cobblestone_wall", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType MOSSY_STONE_BRICKS = register("minecraft:mossy_stone_bricks"); - @Nullable static final BlockType MOVING_PISTON = register("minecraft:moving_piston", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("type"), "normal")); - @Nullable static final BlockType MUSHROOM_STEM = register("minecraft:mushroom_stem", state -> state.with(state.getBlockType().getProperty("down"), true).with(state.getBlockType().getProperty("east"), true).with(state.getBlockType().getProperty("north"), true).with(state.getBlockType().getProperty("south"), true).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("west"), true)); - @Nullable static final BlockType MYCELIUM = register("minecraft:mycelium", state -> state.with(state.getBlockType().getProperty("snowy"), false)); - @Nullable static final BlockType NETHER_BRICK_FENCE = register("minecraft:nether_brick_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType NETHER_BRICK_SLAB = register("minecraft:nether_brick_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType NETHER_BRICK_STAIRS = register("minecraft:nether_brick_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType NETHER_BRICKS = register("minecraft:nether_bricks"); - @Nullable static final BlockType NETHER_PORTAL = register("minecraft:nether_portal", state -> state.with(state.getBlockType().getProperty("axis"), "x")); - @Nullable static final BlockType NETHER_QUARTZ_ORE = register("minecraft:nether_quartz_ore"); - @Nullable static final BlockType NETHER_WART = register("minecraft:nether_wart", state -> state.with(state.getBlockType().getProperty("age"), 0)); - @Nullable static final BlockType NETHER_WART_BLOCK = register("minecraft:nether_wart_block"); - @Nullable static final BlockType NETHERRACK = register("minecraft:netherrack"); - @Nullable static final BlockType NOTE_BLOCK = register("minecraft:note_block", state -> state.with(state.getBlockType().getProperty("instrument"), "HARP").with(state.getBlockType().getProperty("note"), 0).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType OAK_BUTTON = register("minecraft:oak_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType OAK_DOOR = register("minecraft:oak_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType OAK_FENCE = register("minecraft:oak_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType OAK_FENCE_GATE = register("minecraft:oak_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType OAK_LEAVES = register("minecraft:oak_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); - @Nullable static final BlockType OAK_LOG = register("minecraft:oak_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType OAK_PLANKS = register("minecraft:oak_planks"); - @Nullable static final BlockType OAK_PRESSURE_PLATE = register("minecraft:oak_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType OAK_SAPLING = register("minecraft:oak_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); - @Nullable static final BlockType OAK_SLAB = register("minecraft:oak_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType OAK_STAIRS = register("minecraft:oak_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType OAK_TRAPDOOR = register("minecraft:oak_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType OAK_WOOD = register("minecraft:oak_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType OBSERVER = register("minecraft:observer", state -> state.with(state.getBlockType().getProperty("facing"), Direction.SOUTH).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType OBSIDIAN = register("minecraft:obsidian"); - @Nullable static final BlockType ORANGE_BANNER = register("minecraft:orange_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - @Nullable static final BlockType ORANGE_BED = register("minecraft:orange_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - @Nullable static final BlockType ORANGE_CARPET = register("minecraft:orange_carpet"); - @Nullable static final BlockType ORANGE_CONCRETE = register("minecraft:orange_concrete"); - @Nullable static final BlockType ORANGE_CONCRETE_POWDER = register("minecraft:orange_concrete_powder"); - @Nullable static final BlockType ORANGE_GLAZED_TERRACOTTA = register("minecraft:orange_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType ORANGE_SHULKER_BOX = register("minecraft:orange_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - @Nullable static final BlockType ORANGE_STAINED_GLASS = register("minecraft:orange_stained_glass"); - @Nullable static final BlockType ORANGE_STAINED_GLASS_PANE = register("minecraft:orange_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType ORANGE_TERRACOTTA = register("minecraft:orange_terracotta"); - @Nullable static final BlockType ORANGE_TULIP = register("minecraft:orange_tulip"); - @Nullable static final BlockType ORANGE_WALL_BANNER = register("minecraft:orange_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType ORANGE_WOOL = register("minecraft:orange_wool"); - @Nullable static final BlockType OXEYE_DAISY = register("minecraft:oxeye_daisy"); - @Nullable static final BlockType PACKED_ICE = register("minecraft:packed_ice"); - @Nullable static final BlockType PEONY = register("minecraft:peony", state -> state.with(state.getBlockType().getProperty("half"), "lower")); - @Nullable static final BlockType PETRIFIED_OAK_SLAB = register("minecraft:petrified_oak_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType PINK_BANNER = register("minecraft:pink_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - @Nullable static final BlockType PINK_BED = register("minecraft:pink_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - @Nullable static final BlockType PINK_CARPET = register("minecraft:pink_carpet"); - @Nullable static final BlockType PINK_CONCRETE = register("minecraft:pink_concrete"); - @Nullable static final BlockType PINK_CONCRETE_POWDER = register("minecraft:pink_concrete_powder"); - @Nullable static final BlockType PINK_GLAZED_TERRACOTTA = register("minecraft:pink_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType PINK_SHULKER_BOX = register("minecraft:pink_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - @Nullable static final BlockType PINK_STAINED_GLASS = register("minecraft:pink_stained_glass"); - @Nullable static final BlockType PINK_STAINED_GLASS_PANE = register("minecraft:pink_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType PINK_TERRACOTTA = register("minecraft:pink_terracotta"); - @Nullable static final BlockType PINK_TULIP = register("minecraft:pink_tulip"); - @Nullable static final BlockType PINK_WALL_BANNER = register("minecraft:pink_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType PINK_WOOL = register("minecraft:pink_wool"); - @Nullable static final BlockType PISTON = register("minecraft:piston", state -> state.with(state.getBlockType().getProperty("extended"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType PISTON_HEAD = register("minecraft:piston_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("short"), false).with(state.getBlockType().getProperty("type"), "normal")); - @Nullable static final BlockType PLAYER_HEAD = register("minecraft:player_head", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - @Nullable static final BlockType PLAYER_WALL_HEAD = register("minecraft:player_wall_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType PODZOL = register("minecraft:podzol", state -> state.with(state.getBlockType().getProperty("snowy"), false)); - @Nullable static final BlockType POLISHED_ANDESITE = register("minecraft:polished_andesite"); - @Nullable static final BlockType POLISHED_DIORITE = register("minecraft:polished_diorite"); - @Nullable static final BlockType POLISHED_GRANITE = register("minecraft:polished_granite"); - @Nullable static final BlockType POPPY = register("minecraft:poppy"); - @Nullable static final BlockType POTATOES = register("minecraft:potatoes", state -> state.with(state.getBlockType().getProperty("age"), 0)); - @Nullable static final BlockType POTTED_ACACIA_SAPLING = register("minecraft:potted_acacia_sapling"); - @Nullable static final BlockType POTTED_ALLIUM = register("minecraft:potted_allium"); - @Nullable static final BlockType POTTED_AZURE_BLUET = register("minecraft:potted_azure_bluet"); - @Nullable static final BlockType POTTED_BIRCH_SAPLING = register("minecraft:potted_birch_sapling"); - @Nullable static final BlockType POTTED_BLUE_ORCHID = register("minecraft:potted_blue_orchid"); - @Nullable static final BlockType POTTED_BROWN_MUSHROOM = register("minecraft:potted_brown_mushroom"); - @Nullable static final BlockType POTTED_CACTUS = register("minecraft:potted_cactus"); - @Nullable static final BlockType POTTED_DANDELION = register("minecraft:potted_dandelion"); - @Nullable static final BlockType POTTED_DARK_OAK_SAPLING = register("minecraft:potted_dark_oak_sapling"); - @Nullable static final BlockType POTTED_DEAD_BUSH = register("minecraft:potted_dead_bush"); - @Nullable static final BlockType POTTED_FERN = register("minecraft:potted_fern"); - @Nullable static final BlockType POTTED_JUNGLE_SAPLING = register("minecraft:potted_jungle_sapling"); - @Nullable static final BlockType POTTED_OAK_SAPLING = register("minecraft:potted_oak_sapling"); - @Nullable static final BlockType POTTED_ORANGE_TULIP = register("minecraft:potted_orange_tulip"); - @Nullable static final BlockType POTTED_OXEYE_DAISY = register("minecraft:potted_oxeye_daisy"); - @Nullable static final BlockType POTTED_PINK_TULIP = register("minecraft:potted_pink_tulip"); - @Nullable static final BlockType POTTED_POPPY = register("minecraft:potted_poppy"); - @Nullable static final BlockType POTTED_RED_MUSHROOM = register("minecraft:potted_red_mushroom"); - @Nullable static final BlockType POTTED_RED_TULIP = register("minecraft:potted_red_tulip"); - @Nullable static final BlockType POTTED_SPRUCE_SAPLING = register("minecraft:potted_spruce_sapling"); - @Nullable static final BlockType POTTED_WHITE_TULIP = register("minecraft:potted_white_tulip"); - @Nullable static final BlockType POWERED_RAIL = register("minecraft:powered_rail", state -> state.with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("shape"), "north_south")); - @Nullable static final BlockType PRISMARINE = register("minecraft:prismarine"); - @Nullable static final BlockType PRISMARINE_BRICK_SLAB = register("minecraft:prismarine_brick_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType PRISMARINE_BRICK_STAIRS = register("minecraft:prismarine_brick_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType PRISMARINE_BRICKS = register("minecraft:prismarine_bricks"); - @Nullable static final BlockType PRISMARINE_SLAB = register("minecraft:prismarine_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType PRISMARINE_STAIRS = register("minecraft:prismarine_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType PUMPKIN = register("minecraft:pumpkin"); - @Nullable static final BlockType PUMPKIN_STEM = register("minecraft:pumpkin_stem", state -> state.with(state.getBlockType().getProperty("age"), 0)); - @Nullable static final BlockType PURPLE_BANNER = register("minecraft:purple_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - @Nullable static final BlockType PURPLE_BED = register("minecraft:purple_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - @Nullable static final BlockType PURPLE_CARPET = register("minecraft:purple_carpet"); - @Nullable static final BlockType PURPLE_CONCRETE = register("minecraft:purple_concrete"); - @Nullable static final BlockType PURPLE_CONCRETE_POWDER = register("minecraft:purple_concrete_powder"); - @Nullable static final BlockType PURPLE_GLAZED_TERRACOTTA = register("minecraft:purple_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType PURPLE_SHULKER_BOX = register("minecraft:purple_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - @Nullable static final BlockType PURPLE_STAINED_GLASS = register("minecraft:purple_stained_glass"); - @Nullable static final BlockType PURPLE_STAINED_GLASS_PANE = register("minecraft:purple_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType PURPLE_TERRACOTTA = register("minecraft:purple_terracotta"); - @Nullable static final BlockType PURPLE_WALL_BANNER = register("minecraft:purple_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType PURPLE_WOOL = register("minecraft:purple_wool"); - @Nullable static final BlockType PURPUR_BLOCK = register("minecraft:purpur_block"); - @Nullable static final BlockType PURPUR_PILLAR = register("minecraft:purpur_pillar", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType PURPUR_SLAB = register("minecraft:purpur_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType PURPUR_STAIRS = register("minecraft:purpur_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType QUARTZ_BLOCK = register("minecraft:quartz_block"); - @Nullable static final BlockType QUARTZ_PILLAR = register("minecraft:quartz_pillar", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType QUARTZ_SLAB = register("minecraft:quartz_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType QUARTZ_STAIRS = register("minecraft:quartz_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType RAIL = register("minecraft:rail", state -> state.with(state.getBlockType().getProperty("shape"), "north_south")); - @Nullable static final BlockType RED_BANNER = register("minecraft:red_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - @Nullable static final BlockType RED_BED = register("minecraft:red_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - @Nullable static final BlockType RED_CARPET = register("minecraft:red_carpet"); - @Nullable static final BlockType RED_CONCRETE = register("minecraft:red_concrete"); - @Nullable static final BlockType RED_CONCRETE_POWDER = register("minecraft:red_concrete_powder"); - @Nullable static final BlockType RED_GLAZED_TERRACOTTA = register("minecraft:red_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType RED_MUSHROOM = register("minecraft:red_mushroom"); - @Nullable static final BlockType RED_MUSHROOM_BLOCK = register("minecraft:red_mushroom_block", state -> state.with(state.getBlockType().getProperty("down"), true).with(state.getBlockType().getProperty("east"), true).with(state.getBlockType().getProperty("north"), true).with(state.getBlockType().getProperty("south"), true).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("west"), true)); - @Nullable static final BlockType RED_NETHER_BRICKS = register("minecraft:red_nether_bricks"); - @Nullable static final BlockType RED_SAND = register("minecraft:red_sand"); - @Nullable static final BlockType RED_SANDSTONE = register("minecraft:red_sandstone"); - @Nullable static final BlockType RED_SANDSTONE_SLAB = register("minecraft:red_sandstone_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType RED_SANDSTONE_STAIRS = register("minecraft:red_sandstone_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType RED_SHULKER_BOX = register("minecraft:red_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - @Nullable static final BlockType RED_STAINED_GLASS = register("minecraft:red_stained_glass"); - @Nullable static final BlockType RED_STAINED_GLASS_PANE = register("minecraft:red_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType RED_TERRACOTTA = register("minecraft:red_terracotta"); - @Nullable static final BlockType RED_TULIP = register("minecraft:red_tulip"); - @Nullable static final BlockType RED_WALL_BANNER = register("minecraft:red_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType RED_WOOL = register("minecraft:red_wool"); - @Nullable static final BlockType REDSTONE_BLOCK = register("minecraft:redstone_block"); - @Nullable static final BlockType REDSTONE_LAMP = register("minecraft:redstone_lamp", state -> state.with(state.getBlockType().getProperty("lit"), false)); - @Nullable static final BlockType REDSTONE_ORE = register("minecraft:redstone_ore", state -> state.with(state.getBlockType().getProperty("lit"), false)); - @Nullable static final BlockType REDSTONE_TORCH = register("minecraft:redstone_torch", state -> state.with(state.getBlockType().getProperty("lit"), true)); - @Nullable static final BlockType REDSTONE_WALL_TORCH = register("minecraft:redstone_wall_torch", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("lit"), true)); - @Nullable static final BlockType REDSTONE_WIRE = register("minecraft:redstone_wire", state -> state.with(state.getBlockType().getProperty("east"), "none").with(state.getBlockType().getProperty("north"), "none").with(state.getBlockType().getProperty("power"), 0).with(state.getBlockType().getProperty("south"), "none").with(state.getBlockType().getProperty("west"), "none")); - @Nullable static final BlockType REPEATER = register("minecraft:repeater", state -> state.with(state.getBlockType().getProperty("delay"), 1).with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("locked"), false).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType REPEATING_COMMAND_BLOCK = register("minecraft:repeating_command_block", state -> state.with(state.getBlockType().getProperty("conditional"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType ROSE_BUSH = register("minecraft:rose_bush", state -> state.with(state.getBlockType().getProperty("half"), "lower")); - @Nullable static final BlockType SAND = register("minecraft:sand"); - @Nullable static final BlockType SANDSTONE = register("minecraft:sandstone"); - @Nullable static final BlockType SANDSTONE_SLAB = register("minecraft:sandstone_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType SANDSTONE_STAIRS = register("minecraft:sandstone_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType SEA_LANTERN = register("minecraft:sea_lantern"); - @Nullable static final BlockType SEA_PICKLE = register("minecraft:sea_pickle", state -> state.with(state.getBlockType().getProperty("pickles"), 1).with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType SEAGRASS = register("minecraft:seagrass"); - @Nullable static final BlockType SHULKER_BOX = register("minecraft:shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - @Nullable static final BlockType SIGN = register("minecraft:sign", state -> state.with(state.getBlockType().getProperty("rotation"), 0).with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType SKELETON_SKULL = register("minecraft:skeleton_skull", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - @Nullable static final BlockType SKELETON_WALL_SKULL = register("minecraft:skeleton_wall_skull", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType SLIME_BLOCK = register("minecraft:slime_block"); - @Nullable static final BlockType SMOOTH_QUARTZ = register("minecraft:smooth_quartz"); - @Nullable static final BlockType SMOOTH_RED_SANDSTONE = register("minecraft:smooth_red_sandstone"); - @Nullable static final BlockType SMOOTH_SANDSTONE = register("minecraft:smooth_sandstone"); - @Nullable static final BlockType SMOOTH_STONE = register("minecraft:smooth_stone"); - @Nullable static final BlockType SNOW = register("minecraft:snow", state -> state.with(state.getBlockType().getProperty("layers"), 1)); - @Nullable static final BlockType SNOW_BLOCK = register("minecraft:snow_block"); - @Nullable static final BlockType SOUL_SAND = register("minecraft:soul_sand"); - @Nullable static final BlockType SPAWNER = register("minecraft:spawner"); - @Nullable static final BlockType SPONGE = register("minecraft:sponge"); - @Nullable static final BlockType SPRUCE_BUTTON = register("minecraft:spruce_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType SPRUCE_DOOR = register("minecraft:spruce_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType SPRUCE_FENCE = register("minecraft:spruce_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType SPRUCE_FENCE_GATE = register("minecraft:spruce_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType SPRUCE_LEAVES = register("minecraft:spruce_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); - @Nullable static final BlockType SPRUCE_LOG = register("minecraft:spruce_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType SPRUCE_PLANKS = register("minecraft:spruce_planks"); - @Nullable static final BlockType SPRUCE_PRESSURE_PLATE = register("minecraft:spruce_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType SPRUCE_SAPLING = register("minecraft:spruce_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); - @Nullable static final BlockType SPRUCE_SLAB = register("minecraft:spruce_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType SPRUCE_STAIRS = register("minecraft:spruce_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType SPRUCE_TRAPDOOR = register("minecraft:spruce_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType SPRUCE_WOOD = register("minecraft:spruce_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType STICKY_PISTON = register("minecraft:sticky_piston", state -> state.with(state.getBlockType().getProperty("extended"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType STONE = register("minecraft:stone"); - @Nullable static final BlockType STONE_BRICK_SLAB = register("minecraft:stone_brick_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType STONE_BRICK_STAIRS = register("minecraft:stone_brick_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType STONE_BRICKS = register("minecraft:stone_bricks"); - @Nullable static final BlockType STONE_BUTTON = register("minecraft:stone_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType STONE_PRESSURE_PLATE = register("minecraft:stone_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType STONE_SLAB = register("minecraft:stone_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType STRIPPED_ACACIA_LOG = register("minecraft:stripped_acacia_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType STRIPPED_ACACIA_WOOD = register("minecraft:stripped_acacia_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType STRIPPED_BIRCH_LOG = register("minecraft:stripped_birch_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType STRIPPED_BIRCH_WOOD = register("minecraft:stripped_birch_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType STRIPPED_DARK_OAK_LOG = register("minecraft:stripped_dark_oak_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType STRIPPED_DARK_OAK_WOOD = register("minecraft:stripped_dark_oak_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType STRIPPED_JUNGLE_LOG = register("minecraft:stripped_jungle_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType STRIPPED_JUNGLE_WOOD = register("minecraft:stripped_jungle_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType STRIPPED_OAK_LOG = register("minecraft:stripped_oak_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType STRIPPED_OAK_WOOD = register("minecraft:stripped_oak_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType STRIPPED_SPRUCE_LOG = register("minecraft:stripped_spruce_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType STRIPPED_SPRUCE_WOOD = register("minecraft:stripped_spruce_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); - @Nullable static final BlockType STRUCTURE_BLOCK = register("minecraft:structure_block", state -> state.with(state.getBlockType().getProperty("mode"), "SAVE")); - @Nullable static final BlockType STRUCTURE_VOID = register("minecraft:structure_void"); - @Nullable static final BlockType SUGAR_CANE = register("minecraft:sugar_cane", state -> state.with(state.getBlockType().getProperty("age"), 0)); - @Nullable static final BlockType SUNFLOWER = register("minecraft:sunflower", state -> state.with(state.getBlockType().getProperty("half"), "lower")); - @Nullable static final BlockType TALL_GRASS = register("minecraft:tall_grass", state -> state.with(state.getBlockType().getProperty("half"), "lower")); - @Nullable static final BlockType TALL_SEAGRASS = register("minecraft:tall_seagrass", state -> state.with(state.getBlockType().getProperty("half"), "lower")); - @Nullable static final BlockType TERRACOTTA = register("minecraft:terracotta"); - @Nullable static final BlockType TNT = register("minecraft:tnt", state -> state.with(state.getBlockType().getProperty("unstable"), false)); - @Nullable static final BlockType TORCH = register("minecraft:torch"); - @Nullable static final BlockType TRAPPED_CHEST = register("minecraft:trapped_chest", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("type"), "SINGLE").with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType TRIPWIRE = register("minecraft:tripwire", state -> state.with(state.getBlockType().getProperty("attached"), false).with(state.getBlockType().getProperty("disarmed"), false).with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType TRIPWIRE_HOOK = register("minecraft:tripwire_hook", state -> state.with(state.getBlockType().getProperty("attached"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); - @Nullable static final BlockType TUBE_CORAL = register("minecraft:tube_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType TUBE_CORAL_BLOCK = register("minecraft:tube_coral_block"); - @Nullable static final BlockType TUBE_CORAL_FAN = register("minecraft:tube_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType TUBE_CORAL_WALL_FAN = register("minecraft:tube_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); - @Nullable static final BlockType TURTLE_EGG = register("minecraft:turtle_egg", state -> state.with(state.getBlockType().getProperty("eggs"), 1).with(state.getBlockType().getProperty("hatch"), 0)); - @Nullable static final BlockType VINE = register("minecraft:vine", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType VOID_AIR = register("minecraft:void_air"); - @Nullable static final BlockType WALL_SIGN = register("minecraft:wall_sign", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), false)); - @Nullable static final BlockType WALL_TORCH = register("minecraft:wall_torch", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType WATER = register("minecraft:water", state -> state.with(state.getBlockType().getProperty("level"), 0)); - @Nullable static final BlockType WET_SPONGE = register("minecraft:wet_sponge"); - @Nullable static final BlockType WHEAT = register("minecraft:wheat", state -> state.with(state.getBlockType().getProperty("age"), 0)); - @Nullable static final BlockType WHITE_BANNER = register("minecraft:white_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - @Nullable static final BlockType WHITE_BED = register("minecraft:white_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - @Nullable static final BlockType WHITE_CARPET = register("minecraft:white_carpet"); - @Nullable static final BlockType WHITE_CONCRETE = register("minecraft:white_concrete"); - @Nullable static final BlockType WHITE_CONCRETE_POWDER = register("minecraft:white_concrete_powder"); - @Nullable static final BlockType WHITE_GLAZED_TERRACOTTA = register("minecraft:white_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType WHITE_SHULKER_BOX = register("minecraft:white_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - @Nullable static final BlockType WHITE_STAINED_GLASS = register("minecraft:white_stained_glass"); - @Nullable static final BlockType WHITE_STAINED_GLASS_PANE = register("minecraft:white_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType WHITE_TERRACOTTA = register("minecraft:white_terracotta"); - @Nullable static final BlockType WHITE_TULIP = register("minecraft:white_tulip"); - @Nullable static final BlockType WHITE_WALL_BANNER = register("minecraft:white_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType WHITE_WOOL = register("minecraft:white_wool"); - @Nullable static final BlockType WITHER_SKELETON_SKULL = register("minecraft:wither_skeleton_skull", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - @Nullable static final BlockType WITHER_SKELETON_WALL_SKULL = register("minecraft:wither_skeleton_wall_skull", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType YELLOW_BANNER = register("minecraft:yellow_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - @Nullable static final BlockType YELLOW_BED = register("minecraft:yellow_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); - @Nullable static final BlockType YELLOW_CARPET = register("minecraft:yellow_carpet"); - @Nullable static final BlockType YELLOW_CONCRETE = register("minecraft:yellow_concrete"); - @Nullable static final BlockType YELLOW_CONCRETE_POWDER = register("minecraft:yellow_concrete_powder"); - @Nullable static final BlockType YELLOW_GLAZED_TERRACOTTA = register("minecraft:yellow_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType YELLOW_SHULKER_BOX = register("minecraft:yellow_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); - @Nullable static final BlockType YELLOW_STAINED_GLASS = register("minecraft:yellow_stained_glass"); - @Nullable static final BlockType YELLOW_STAINED_GLASS_PANE = register("minecraft:yellow_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); - @Nullable static final BlockType YELLOW_TERRACOTTA = register("minecraft:yellow_terracotta"); - @Nullable static final BlockType YELLOW_WALL_BANNER = register("minecraft:yellow_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); - @Nullable static final BlockType YELLOW_WOOL = register("minecraft:yellow_wool"); - @Nullable static final BlockType ZOMBIE_HEAD = register("minecraft:zombie_head", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); - @Nullable static final BlockType ZOMBIE_WALL_HEAD = register("minecraft:zombie_wall_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType __RESERVED__ = register("minecraft:__reserved__"); + @Nullable public static final BlockType ACACIA_BUTTON = register("minecraft:acacia_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType ACACIA_DOOR = register("minecraft:acacia_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType ACACIA_FENCE = register("minecraft:acacia_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType ACACIA_FENCE_GATE = register("minecraft:acacia_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType ACACIA_LEAVES = register("minecraft:acacia_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); + @Nullable public static final BlockType ACACIA_LOG = register("minecraft:acacia_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType ACACIA_PLANKS = register("minecraft:acacia_planks"); + @Nullable public static final BlockType ACACIA_PRESSURE_PLATE = register("minecraft:acacia_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType ACACIA_SAPLING = register("minecraft:acacia_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); + @Nullable public static final BlockType ACACIA_SLAB = register("minecraft:acacia_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType ACACIA_STAIRS = register("minecraft:acacia_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType ACACIA_TRAPDOOR = register("minecraft:acacia_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType ACACIA_WOOD = register("minecraft:acacia_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType ACTIVATOR_RAIL = register("minecraft:activator_rail", state -> state.with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("shape"), "north_south")); + @Nullable public static final BlockType AIR = register("minecraft:air"); + @Nullable public static final BlockType ALLIUM = register("minecraft:allium"); + @Nullable public static final BlockType ANDESITE = register("minecraft:andesite"); + @Nullable public static final BlockType ANVIL = register("minecraft:anvil", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType ATTACHED_MELON_STEM = register("minecraft:attached_melon_stem", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType ATTACHED_PUMPKIN_STEM = register("minecraft:attached_pumpkin_stem", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType AZURE_BLUET = register("minecraft:azure_bluet"); + @Nullable public static final BlockType BARRIER = register("minecraft:barrier"); + @Nullable public static final BlockType BEACON = register("minecraft:beacon"); + @Nullable public static final BlockType BEDROCK = register("minecraft:bedrock"); + @Nullable public static final BlockType BEETROOTS = register("minecraft:beetroots", state -> state.with(state.getBlockType().getProperty("age"), 0)); + @Nullable public static final BlockType BIRCH_BUTTON = register("minecraft:birch_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType BIRCH_DOOR = register("minecraft:birch_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType BIRCH_FENCE = register("minecraft:birch_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType BIRCH_FENCE_GATE = register("minecraft:birch_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType BIRCH_LEAVES = register("minecraft:birch_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); + @Nullable public static final BlockType BIRCH_LOG = register("minecraft:birch_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType BIRCH_PLANKS = register("minecraft:birch_planks"); + @Nullable public static final BlockType BIRCH_PRESSURE_PLATE = register("minecraft:birch_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType BIRCH_SAPLING = register("minecraft:birch_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); + @Nullable public static final BlockType BIRCH_SLAB = register("minecraft:birch_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType BIRCH_STAIRS = register("minecraft:birch_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType BIRCH_TRAPDOOR = register("minecraft:birch_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType BIRCH_WOOD = register("minecraft:birch_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType BLACK_BANNER = register("minecraft:black_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable public static final BlockType BLACK_BED = register("minecraft:black_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable public static final BlockType BLACK_CARPET = register("minecraft:black_carpet"); + @Nullable public static final BlockType BLACK_CONCRETE = register("minecraft:black_concrete"); + @Nullable public static final BlockType BLACK_CONCRETE_POWDER = register("minecraft:black_concrete_powder"); + @Nullable public static final BlockType BLACK_GLAZED_TERRACOTTA = register("minecraft:black_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType BLACK_SHULKER_BOX = register("minecraft:black_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable public static final BlockType BLACK_STAINED_GLASS = register("minecraft:black_stained_glass"); + @Nullable public static final BlockType BLACK_STAINED_GLASS_PANE = register("minecraft:black_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType BLACK_TERRACOTTA = register("minecraft:black_terracotta"); + @Nullable public static final BlockType BLACK_WALL_BANNER = register("minecraft:black_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType BLACK_WOOL = register("minecraft:black_wool"); + @Nullable public static final BlockType BLUE_BANNER = register("minecraft:blue_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable public static final BlockType BLUE_BED = register("minecraft:blue_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable public static final BlockType BLUE_CARPET = register("minecraft:blue_carpet"); + @Nullable public static final BlockType BLUE_CONCRETE = register("minecraft:blue_concrete"); + @Nullable public static final BlockType BLUE_CONCRETE_POWDER = register("minecraft:blue_concrete_powder"); + @Nullable public static final BlockType BLUE_GLAZED_TERRACOTTA = register("minecraft:blue_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType BLUE_ICE = register("minecraft:blue_ice"); + @Nullable public static final BlockType BLUE_ORCHID = register("minecraft:blue_orchid"); + @Nullable public static final BlockType BLUE_SHULKER_BOX = register("minecraft:blue_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable public static final BlockType BLUE_STAINED_GLASS = register("minecraft:blue_stained_glass"); + @Nullable public static final BlockType BLUE_STAINED_GLASS_PANE = register("minecraft:blue_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType BLUE_TERRACOTTA = register("minecraft:blue_terracotta"); + @Nullable public static final BlockType BLUE_WALL_BANNER = register("minecraft:blue_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType BLUE_WOOL = register("minecraft:blue_wool"); + @Nullable public static final BlockType BONE_BLOCK = register("minecraft:bone_block", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType BOOKSHELF = register("minecraft:bookshelf"); + @Nullable public static final BlockType BRAIN_CORAL = register("minecraft:brain_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType BRAIN_CORAL_BLOCK = register("minecraft:brain_coral_block"); + @Nullable public static final BlockType BRAIN_CORAL_FAN = register("minecraft:brain_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType BRAIN_CORAL_WALL_FAN = register("minecraft:brain_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType BREWING_STAND = register("minecraft:brewing_stand", state -> state.with(state.getBlockType().getProperty("has_bottle_0"), false).with(state.getBlockType().getProperty("has_bottle_1"), false).with(state.getBlockType().getProperty("has_bottle_2"), false)); + @Nullable public static final BlockType BRICK_SLAB = register("minecraft:brick_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType BRICK_STAIRS = register("minecraft:brick_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType BRICKS = register("minecraft:bricks"); + @Nullable public static final BlockType BROWN_BANNER = register("minecraft:brown_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable public static final BlockType BROWN_BED = register("minecraft:brown_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable public static final BlockType BROWN_CARPET = register("minecraft:brown_carpet"); + @Nullable public static final BlockType BROWN_CONCRETE = register("minecraft:brown_concrete"); + @Nullable public static final BlockType BROWN_CONCRETE_POWDER = register("minecraft:brown_concrete_powder"); + @Nullable public static final BlockType BROWN_GLAZED_TERRACOTTA = register("minecraft:brown_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType BROWN_MUSHROOM = register("minecraft:brown_mushroom"); + @Nullable public static final BlockType BROWN_MUSHROOM_BLOCK = register("minecraft:brown_mushroom_block", state -> state.with(state.getBlockType().getProperty("down"), true).with(state.getBlockType().getProperty("east"), true).with(state.getBlockType().getProperty("north"), true).with(state.getBlockType().getProperty("south"), true).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("west"), true)); + @Nullable public static final BlockType BROWN_SHULKER_BOX = register("minecraft:brown_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable public static final BlockType BROWN_STAINED_GLASS = register("minecraft:brown_stained_glass"); + @Nullable public static final BlockType BROWN_STAINED_GLASS_PANE = register("minecraft:brown_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType BROWN_TERRACOTTA = register("minecraft:brown_terracotta"); + @Nullable public static final BlockType BROWN_WALL_BANNER = register("minecraft:brown_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType BROWN_WOOL = register("minecraft:brown_wool"); + @Nullable public static final BlockType BUBBLE_COLUMN = register("minecraft:bubble_column", state -> state.with(state.getBlockType().getProperty("drag"), true)); + @Nullable public static final BlockType BUBBLE_CORAL = register("minecraft:bubble_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType BUBBLE_CORAL_BLOCK = register("minecraft:bubble_coral_block"); + @Nullable public static final BlockType BUBBLE_CORAL_FAN = register("minecraft:bubble_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType BUBBLE_CORAL_WALL_FAN = register("minecraft:bubble_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType CACTUS = register("minecraft:cactus", state -> state.with(state.getBlockType().getProperty("age"), 0)); + @Nullable public static final BlockType CAKE = register("minecraft:cake", state -> state.with(state.getBlockType().getProperty("bites"), 0)); + @Nullable public static final BlockType CARROTS = register("minecraft:carrots", state -> state.with(state.getBlockType().getProperty("age"), 0)); + @Nullable public static final BlockType CARVED_PUMPKIN = register("minecraft:carved_pumpkin", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType CAULDRON = register("minecraft:cauldron", state -> state.with(state.getBlockType().getProperty("level"), 0)); + @Nullable public static final BlockType CAVE_AIR = register("minecraft:cave_air"); + @Nullable public static final BlockType CHAIN_COMMAND_BLOCK = register("minecraft:chain_command_block", state -> state.with(state.getBlockType().getProperty("conditional"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType CHEST = register("minecraft:chest", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("type"), "SINGLE").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType CHIPPED_ANVIL = register("minecraft:chipped_anvil", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType CHISELED_QUARTZ_BLOCK = register("minecraft:chiseled_quartz_block"); + @Nullable public static final BlockType CHISELED_RED_SANDSTONE = register("minecraft:chiseled_red_sandstone"); + @Nullable public static final BlockType CHISELED_SANDSTONE = register("minecraft:chiseled_sandstone"); + @Nullable public static final BlockType CHISELED_STONE_BRICKS = register("minecraft:chiseled_stone_bricks"); + @Nullable public static final BlockType CHORUS_FLOWER = register("minecraft:chorus_flower", state -> state.with(state.getBlockType().getProperty("age"), 0)); + @Nullable public static final BlockType CHORUS_PLANT = register("minecraft:chorus_plant", state -> state.with(state.getBlockType().getProperty("down"), false).with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType CLAY = register("minecraft:clay"); + @Nullable public static final BlockType COAL_BLOCK = register("minecraft:coal_block"); + @Nullable public static final BlockType COAL_ORE = register("minecraft:coal_ore"); + @Nullable public static final BlockType COARSE_DIRT = register("minecraft:coarse_dirt"); + @Nullable public static final BlockType COBBLESTONE = register("minecraft:cobblestone"); + @Nullable public static final BlockType COBBLESTONE_SLAB = register("minecraft:cobblestone_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType COBBLESTONE_STAIRS = register("minecraft:cobblestone_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType COBBLESTONE_WALL = register("minecraft:cobblestone_wall", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType COBWEB = register("minecraft:cobweb"); + @Nullable public static final BlockType COCOA = register("minecraft:cocoa", state -> state.with(state.getBlockType().getProperty("age"), 0).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType COMMAND_BLOCK = register("minecraft:command_block", state -> state.with(state.getBlockType().getProperty("conditional"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType COMPARATOR = register("minecraft:comparator", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("mode"), "compare").with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType CONDUIT = register("minecraft:conduit", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType CRACKED_STONE_BRICKS = register("minecraft:cracked_stone_bricks"); + @Nullable public static final BlockType CRAFTING_TABLE = register("minecraft:crafting_table"); + @Nullable public static final BlockType CREEPER_HEAD = register("minecraft:creeper_head", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable public static final BlockType CREEPER_WALL_HEAD = register("minecraft:creeper_wall_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType CUT_RED_SANDSTONE = register("minecraft:cut_red_sandstone"); + @Nullable public static final BlockType CUT_SANDSTONE = register("minecraft:cut_sandstone"); + @Nullable public static final BlockType CYAN_BANNER = register("minecraft:cyan_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable public static final BlockType CYAN_BED = register("minecraft:cyan_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable public static final BlockType CYAN_CARPET = register("minecraft:cyan_carpet"); + @Nullable public static final BlockType CYAN_CONCRETE = register("minecraft:cyan_concrete"); + @Nullable public static final BlockType CYAN_CONCRETE_POWDER = register("minecraft:cyan_concrete_powder"); + @Nullable public static final BlockType CYAN_GLAZED_TERRACOTTA = register("minecraft:cyan_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType CYAN_SHULKER_BOX = register("minecraft:cyan_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable public static final BlockType CYAN_STAINED_GLASS = register("minecraft:cyan_stained_glass"); + @Nullable public static final BlockType CYAN_STAINED_GLASS_PANE = register("minecraft:cyan_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType CYAN_TERRACOTTA = register("minecraft:cyan_terracotta"); + @Nullable public static final BlockType CYAN_WALL_BANNER = register("minecraft:cyan_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType CYAN_WOOL = register("minecraft:cyan_wool"); + @Nullable public static final BlockType DAMAGED_ANVIL = register("minecraft:damaged_anvil", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType DANDELION = register("minecraft:dandelion"); + @Nullable public static final BlockType DARK_OAK_BUTTON = register("minecraft:dark_oak_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType DARK_OAK_DOOR = register("minecraft:dark_oak_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType DARK_OAK_FENCE = register("minecraft:dark_oak_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType DARK_OAK_FENCE_GATE = register("minecraft:dark_oak_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType DARK_OAK_LEAVES = register("minecraft:dark_oak_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); + @Nullable public static final BlockType DARK_OAK_LOG = register("minecraft:dark_oak_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType DARK_OAK_PLANKS = register("minecraft:dark_oak_planks"); + @Nullable public static final BlockType DARK_OAK_PRESSURE_PLATE = register("minecraft:dark_oak_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType DARK_OAK_SAPLING = register("minecraft:dark_oak_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); + @Nullable public static final BlockType DARK_OAK_SLAB = register("minecraft:dark_oak_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType DARK_OAK_STAIRS = register("minecraft:dark_oak_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType DARK_OAK_TRAPDOOR = register("minecraft:dark_oak_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType DARK_OAK_WOOD = register("minecraft:dark_oak_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType DARK_PRISMARINE = register("minecraft:dark_prismarine"); + @Nullable public static final BlockType DARK_PRISMARINE_SLAB = register("minecraft:dark_prismarine_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType DARK_PRISMARINE_STAIRS = register("minecraft:dark_prismarine_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType DAYLIGHT_DETECTOR = register("minecraft:daylight_detector", state -> state.with(state.getBlockType().getProperty("inverted"), false).with(state.getBlockType().getProperty("power"), 0)); + @Nullable public static final BlockType DEAD_BRAIN_CORAL = register("minecraft:dead_brain_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType DEAD_BRAIN_CORAL_BLOCK = register("minecraft:dead_brain_coral_block"); + @Nullable public static final BlockType DEAD_BRAIN_CORAL_FAN = register("minecraft:dead_brain_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType DEAD_BRAIN_CORAL_WALL_FAN = register("minecraft:dead_brain_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType DEAD_BUBBLE_CORAL = register("minecraft:dead_bubble_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType DEAD_BUBBLE_CORAL_BLOCK = register("minecraft:dead_bubble_coral_block"); + @Nullable public static final BlockType DEAD_BUBBLE_CORAL_FAN = register("minecraft:dead_bubble_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType DEAD_BUBBLE_CORAL_WALL_FAN = register("minecraft:dead_bubble_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType DEAD_BUSH = register("minecraft:dead_bush"); + @Nullable public static final BlockType DEAD_FIRE_CORAL = register("minecraft:dead_fire_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType DEAD_FIRE_CORAL_BLOCK = register("minecraft:dead_fire_coral_block"); + @Nullable public static final BlockType DEAD_FIRE_CORAL_FAN = register("minecraft:dead_fire_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType DEAD_FIRE_CORAL_WALL_FAN = register("minecraft:dead_fire_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType DEAD_HORN_CORAL = register("minecraft:dead_horn_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType DEAD_HORN_CORAL_BLOCK = register("minecraft:dead_horn_coral_block"); + @Nullable public static final BlockType DEAD_HORN_CORAL_FAN = register("minecraft:dead_horn_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType DEAD_HORN_CORAL_WALL_FAN = register("minecraft:dead_horn_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType DEAD_TUBE_CORAL = register("minecraft:dead_tube_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType DEAD_TUBE_CORAL_BLOCK = register("minecraft:dead_tube_coral_block"); + @Nullable public static final BlockType DEAD_TUBE_CORAL_FAN = register("minecraft:dead_tube_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType DEAD_TUBE_CORAL_WALL_FAN = register("minecraft:dead_tube_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType DETECTOR_RAIL = register("minecraft:detector_rail", state -> state.with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("shape"), "north_south")); + @Nullable public static final BlockType DIAMOND_BLOCK = register("minecraft:diamond_block"); + @Nullable public static final BlockType DIAMOND_ORE = register("minecraft:diamond_ore"); + @Nullable public static final BlockType DIORITE = register("minecraft:diorite"); + @Nullable public static final BlockType DIRT = register("minecraft:dirt"); + @Nullable public static final BlockType DISPENSER = register("minecraft:dispenser", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("triggered"), false)); + @Nullable public static final BlockType DRAGON_EGG = register("minecraft:dragon_egg"); + @Nullable public static final BlockType DRAGON_HEAD = register("minecraft:dragon_head", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable public static final BlockType DRAGON_WALL_HEAD = register("minecraft:dragon_wall_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType DRIED_KELP_BLOCK = register("minecraft:dried_kelp_block"); + @Nullable public static final BlockType DROPPER = register("minecraft:dropper", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("triggered"), false)); + @Nullable public static final BlockType EMERALD_BLOCK = register("minecraft:emerald_block"); + @Nullable public static final BlockType EMERALD_ORE = register("minecraft:emerald_ore"); + @Nullable public static final BlockType ENCHANTING_TABLE = register("minecraft:enchanting_table"); + @Nullable public static final BlockType END_GATEWAY = register("minecraft:end_gateway"); + @Nullable public static final BlockType END_PORTAL = register("minecraft:end_portal"); + @Nullable public static final BlockType END_PORTAL_FRAME = register("minecraft:end_portal_frame", state -> state.with(state.getBlockType().getProperty("eye"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType END_ROD = register("minecraft:end_rod", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable public static final BlockType END_STONE = register("minecraft:end_stone"); + @Nullable public static final BlockType END_STONE_BRICKS = register("minecraft:end_stone_bricks"); + @Nullable public static final BlockType ENDER_CHEST = register("minecraft:ender_chest", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType FARMLAND = register("minecraft:farmland", state -> state.with(state.getBlockType().getProperty("moisture"), 0)); + @Nullable public static final BlockType FERN = register("minecraft:fern"); + @Nullable public static final BlockType FIRE = register("minecraft:fire", state -> state.with(state.getBlockType().getProperty("age"), 0).with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType FIRE_CORAL = register("minecraft:fire_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType FIRE_CORAL_BLOCK = register("minecraft:fire_coral_block"); + @Nullable public static final BlockType FIRE_CORAL_FAN = register("minecraft:fire_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType FIRE_CORAL_WALL_FAN = register("minecraft:fire_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType FLOWER_POT = register("minecraft:flower_pot"); + @Nullable public static final BlockType FROSTED_ICE = register("minecraft:frosted_ice", state -> state.with(state.getBlockType().getProperty("age"), 0)); + @Nullable public static final BlockType FURNACE = register("minecraft:furnace", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("lit"), false)); + @Nullable public static final BlockType GLASS = register("minecraft:glass"); + @Nullable public static final BlockType GLASS_PANE = register("minecraft:glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType GLOWSTONE = register("minecraft:glowstone"); + @Nullable public static final BlockType GOLD_BLOCK = register("minecraft:gold_block"); + @Nullable public static final BlockType GOLD_ORE = register("minecraft:gold_ore"); + @Nullable public static final BlockType GRANITE = register("minecraft:granite"); + @Nullable public static final BlockType GRASS = register("minecraft:grass"); + @Nullable public static final BlockType GRASS_BLOCK = register("minecraft:grass_block", state -> state.with(state.getBlockType().getProperty("snowy"), false)); + @Nullable public static final BlockType GRASS_PATH = register("minecraft:grass_path"); + @Nullable public static final BlockType GRAVEL = register("minecraft:gravel"); + @Nullable public static final BlockType GRAY_BANNER = register("minecraft:gray_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable public static final BlockType GRAY_BED = register("minecraft:gray_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable public static final BlockType GRAY_CARPET = register("minecraft:gray_carpet"); + @Nullable public static final BlockType GRAY_CONCRETE = register("minecraft:gray_concrete"); + @Nullable public static final BlockType GRAY_CONCRETE_POWDER = register("minecraft:gray_concrete_powder"); + @Nullable public static final BlockType GRAY_GLAZED_TERRACOTTA = register("minecraft:gray_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType GRAY_SHULKER_BOX = register("minecraft:gray_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable public static final BlockType GRAY_STAINED_GLASS = register("minecraft:gray_stained_glass"); + @Nullable public static final BlockType GRAY_STAINED_GLASS_PANE = register("minecraft:gray_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType GRAY_TERRACOTTA = register("minecraft:gray_terracotta"); + @Nullable public static final BlockType GRAY_WALL_BANNER = register("minecraft:gray_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType GRAY_WOOL = register("minecraft:gray_wool"); + @Nullable public static final BlockType GREEN_BANNER = register("minecraft:green_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable public static final BlockType GREEN_BED = register("minecraft:green_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable public static final BlockType GREEN_CARPET = register("minecraft:green_carpet"); + @Nullable public static final BlockType GREEN_CONCRETE = register("minecraft:green_concrete"); + @Nullable public static final BlockType GREEN_CONCRETE_POWDER = register("minecraft:green_concrete_powder"); + @Nullable public static final BlockType GREEN_GLAZED_TERRACOTTA = register("minecraft:green_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType GREEN_SHULKER_BOX = register("minecraft:green_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable public static final BlockType GREEN_STAINED_GLASS = register("minecraft:green_stained_glass"); + @Nullable public static final BlockType GREEN_STAINED_GLASS_PANE = register("minecraft:green_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType GREEN_TERRACOTTA = register("minecraft:green_terracotta"); + @Nullable public static final BlockType GREEN_WALL_BANNER = register("minecraft:green_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType GREEN_WOOL = register("minecraft:green_wool"); + @Nullable public static final BlockType HAY_BLOCK = register("minecraft:hay_block", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType HEAVY_WEIGHTED_PRESSURE_PLATE = register("minecraft:heavy_weighted_pressure_plate", state -> state.with(state.getBlockType().getProperty("power"), 0)); + @Nullable public static final BlockType HOPPER = register("minecraft:hopper", state -> state.with(state.getBlockType().getProperty("enabled"), true).with(state.getBlockType().getProperty("facing"), Direction.DOWN)); + @Nullable public static final BlockType HORN_CORAL = register("minecraft:horn_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType HORN_CORAL_BLOCK = register("minecraft:horn_coral_block"); + @Nullable public static final BlockType HORN_CORAL_FAN = register("minecraft:horn_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType HORN_CORAL_WALL_FAN = register("minecraft:horn_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType ICE = register("minecraft:ice"); + @Nullable public static final BlockType INFESTED_CHISELED_STONE_BRICKS = register("minecraft:infested_chiseled_stone_bricks"); + @Nullable public static final BlockType INFESTED_COBBLESTONE = register("minecraft:infested_cobblestone"); + @Nullable public static final BlockType INFESTED_CRACKED_STONE_BRICKS = register("minecraft:infested_cracked_stone_bricks"); + @Nullable public static final BlockType INFESTED_MOSSY_STONE_BRICKS = register("minecraft:infested_mossy_stone_bricks"); + @Nullable public static final BlockType INFESTED_STONE = register("minecraft:infested_stone"); + @Nullable public static final BlockType INFESTED_STONE_BRICKS = register("minecraft:infested_stone_bricks"); + @Nullable public static final BlockType IRON_BARS = register("minecraft:iron_bars", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType IRON_BLOCK = register("minecraft:iron_block"); + @Nullable public static final BlockType IRON_DOOR = register("minecraft:iron_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType IRON_ORE = register("minecraft:iron_ore"); + @Nullable public static final BlockType IRON_TRAPDOOR = register("minecraft:iron_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType JACK_O_LANTERN = register("minecraft:jack_o_lantern", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType JUKEBOX = register("minecraft:jukebox", state -> state.with(state.getBlockType().getProperty("has_record"), false)); + @Nullable public static final BlockType JUNGLE_BUTTON = register("minecraft:jungle_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType JUNGLE_DOOR = register("minecraft:jungle_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType JUNGLE_FENCE = register("minecraft:jungle_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType JUNGLE_FENCE_GATE = register("minecraft:jungle_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType JUNGLE_LEAVES = register("minecraft:jungle_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); + @Nullable public static final BlockType JUNGLE_LOG = register("minecraft:jungle_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType JUNGLE_PLANKS = register("minecraft:jungle_planks"); + @Nullable public static final BlockType JUNGLE_PRESSURE_PLATE = register("minecraft:jungle_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType JUNGLE_SAPLING = register("minecraft:jungle_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); + @Nullable public static final BlockType JUNGLE_SLAB = register("minecraft:jungle_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType JUNGLE_STAIRS = register("minecraft:jungle_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType JUNGLE_TRAPDOOR = register("minecraft:jungle_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType JUNGLE_WOOD = register("minecraft:jungle_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType KELP = register("minecraft:kelp", state -> state.with(state.getBlockType().getProperty("age"), 0)); + @Nullable public static final BlockType KELP_PLANT = register("minecraft:kelp_plant"); + @Nullable public static final BlockType LADDER = register("minecraft:ladder", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType LAPIS_BLOCK = register("minecraft:lapis_block"); + @Nullable public static final BlockType LAPIS_ORE = register("minecraft:lapis_ore"); + @Nullable public static final BlockType LARGE_FERN = register("minecraft:large_fern", state -> state.with(state.getBlockType().getProperty("half"), "lower")); + @Nullable public static final BlockType LAVA = register("minecraft:lava", state -> state.with(state.getBlockType().getProperty("level"), 0)); + @Nullable public static final BlockType LEVER = register("minecraft:lever", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType LIGHT_BLUE_BANNER = register("minecraft:light_blue_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable public static final BlockType LIGHT_BLUE_BED = register("minecraft:light_blue_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable public static final BlockType LIGHT_BLUE_CARPET = register("minecraft:light_blue_carpet"); + @Nullable public static final BlockType LIGHT_BLUE_CONCRETE = register("minecraft:light_blue_concrete"); + @Nullable public static final BlockType LIGHT_BLUE_CONCRETE_POWDER = register("minecraft:light_blue_concrete_powder"); + @Nullable public static final BlockType LIGHT_BLUE_GLAZED_TERRACOTTA = register("minecraft:light_blue_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType LIGHT_BLUE_SHULKER_BOX = register("minecraft:light_blue_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable public static final BlockType LIGHT_BLUE_STAINED_GLASS = register("minecraft:light_blue_stained_glass"); + @Nullable public static final BlockType LIGHT_BLUE_STAINED_GLASS_PANE = register("minecraft:light_blue_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType LIGHT_BLUE_TERRACOTTA = register("minecraft:light_blue_terracotta"); + @Nullable public static final BlockType LIGHT_BLUE_WALL_BANNER = register("minecraft:light_blue_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType LIGHT_BLUE_WOOL = register("minecraft:light_blue_wool"); + @Nullable public static final BlockType LIGHT_GRAY_BANNER = register("minecraft:light_gray_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable public static final BlockType LIGHT_GRAY_BED = register("minecraft:light_gray_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable public static final BlockType LIGHT_GRAY_CARPET = register("minecraft:light_gray_carpet"); + @Nullable public static final BlockType LIGHT_GRAY_CONCRETE = register("minecraft:light_gray_concrete"); + @Nullable public static final BlockType LIGHT_GRAY_CONCRETE_POWDER = register("minecraft:light_gray_concrete_powder"); + @Nullable public static final BlockType LIGHT_GRAY_GLAZED_TERRACOTTA = register("minecraft:light_gray_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType LIGHT_GRAY_SHULKER_BOX = register("minecraft:light_gray_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable public static final BlockType LIGHT_GRAY_STAINED_GLASS = register("minecraft:light_gray_stained_glass"); + @Nullable public static final BlockType LIGHT_GRAY_STAINED_GLASS_PANE = register("minecraft:light_gray_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType LIGHT_GRAY_TERRACOTTA = register("minecraft:light_gray_terracotta"); + @Nullable public static final BlockType LIGHT_GRAY_WALL_BANNER = register("minecraft:light_gray_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType LIGHT_GRAY_WOOL = register("minecraft:light_gray_wool"); + @Nullable public static final BlockType LIGHT_WEIGHTED_PRESSURE_PLATE = register("minecraft:light_weighted_pressure_plate", state -> state.with(state.getBlockType().getProperty("power"), 0)); + @Nullable public static final BlockType LILAC = register("minecraft:lilac", state -> state.with(state.getBlockType().getProperty("half"), "lower")); + @Nullable public static final BlockType LILY_PAD = register("minecraft:lily_pad"); + @Nullable public static final BlockType LIME_BANNER = register("minecraft:lime_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable public static final BlockType LIME_BED = register("minecraft:lime_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable public static final BlockType LIME_CARPET = register("minecraft:lime_carpet"); + @Nullable public static final BlockType LIME_CONCRETE = register("minecraft:lime_concrete"); + @Nullable public static final BlockType LIME_CONCRETE_POWDER = register("minecraft:lime_concrete_powder"); + @Nullable public static final BlockType LIME_GLAZED_TERRACOTTA = register("minecraft:lime_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType LIME_SHULKER_BOX = register("minecraft:lime_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable public static final BlockType LIME_STAINED_GLASS = register("minecraft:lime_stained_glass"); + @Nullable public static final BlockType LIME_STAINED_GLASS_PANE = register("minecraft:lime_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType LIME_TERRACOTTA = register("minecraft:lime_terracotta"); + @Nullable public static final BlockType LIME_WALL_BANNER = register("minecraft:lime_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType LIME_WOOL = register("minecraft:lime_wool"); + @Nullable public static final BlockType MAGENTA_BANNER = register("minecraft:magenta_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable public static final BlockType MAGENTA_BED = register("minecraft:magenta_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable public static final BlockType MAGENTA_CARPET = register("minecraft:magenta_carpet"); + @Nullable public static final BlockType MAGENTA_CONCRETE = register("minecraft:magenta_concrete"); + @Nullable public static final BlockType MAGENTA_CONCRETE_POWDER = register("minecraft:magenta_concrete_powder"); + @Nullable public static final BlockType MAGENTA_GLAZED_TERRACOTTA = register("minecraft:magenta_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType MAGENTA_SHULKER_BOX = register("minecraft:magenta_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable public static final BlockType MAGENTA_STAINED_GLASS = register("minecraft:magenta_stained_glass"); + @Nullable public static final BlockType MAGENTA_STAINED_GLASS_PANE = register("minecraft:magenta_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType MAGENTA_TERRACOTTA = register("minecraft:magenta_terracotta"); + @Nullable public static final BlockType MAGENTA_WALL_BANNER = register("minecraft:magenta_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType MAGENTA_WOOL = register("minecraft:magenta_wool"); + @Nullable public static final BlockType MAGMA_BLOCK = register("minecraft:magma_block"); + @Nullable public static final BlockType MELON = register("minecraft:melon"); + @Nullable public static final BlockType MELON_STEM = register("minecraft:melon_stem", state -> state.with(state.getBlockType().getProperty("age"), 0)); + @Nullable public static final BlockType MOSSY_COBBLESTONE = register("minecraft:mossy_cobblestone"); + @Nullable public static final BlockType MOSSY_COBBLESTONE_WALL = register("minecraft:mossy_cobblestone_wall", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType MOSSY_STONE_BRICKS = register("minecraft:mossy_stone_bricks"); + @Nullable public static final BlockType MOVING_PISTON = register("minecraft:moving_piston", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("type"), "normal")); + @Nullable public static final BlockType MUSHROOM_STEM = register("minecraft:mushroom_stem", state -> state.with(state.getBlockType().getProperty("down"), true).with(state.getBlockType().getProperty("east"), true).with(state.getBlockType().getProperty("north"), true).with(state.getBlockType().getProperty("south"), true).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("west"), true)); + @Nullable public static final BlockType MYCELIUM = register("minecraft:mycelium", state -> state.with(state.getBlockType().getProperty("snowy"), false)); + @Nullable public static final BlockType NETHER_BRICK_FENCE = register("minecraft:nether_brick_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType NETHER_BRICK_SLAB = register("minecraft:nether_brick_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType NETHER_BRICK_STAIRS = register("minecraft:nether_brick_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType NETHER_BRICKS = register("minecraft:nether_bricks"); + @Nullable public static final BlockType NETHER_PORTAL = register("minecraft:nether_portal", state -> state.with(state.getBlockType().getProperty("axis"), "x")); + @Nullable public static final BlockType NETHER_QUARTZ_ORE = register("minecraft:nether_quartz_ore"); + @Nullable public static final BlockType NETHER_WART = register("minecraft:nether_wart", state -> state.with(state.getBlockType().getProperty("age"), 0)); + @Nullable public static final BlockType NETHER_WART_BLOCK = register("minecraft:nether_wart_block"); + @Nullable public static final BlockType NETHERRACK = register("minecraft:netherrack"); + @Nullable public static final BlockType NOTE_BLOCK = register("minecraft:note_block", state -> state.with(state.getBlockType().getProperty("instrument"), "HARP").with(state.getBlockType().getProperty("note"), 0).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType OAK_BUTTON = register("minecraft:oak_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType OAK_DOOR = register("minecraft:oak_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType OAK_FENCE = register("minecraft:oak_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType OAK_FENCE_GATE = register("minecraft:oak_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType OAK_LEAVES = register("minecraft:oak_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); + @Nullable public static final BlockType OAK_LOG = register("minecraft:oak_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType OAK_PLANKS = register("minecraft:oak_planks"); + @Nullable public static final BlockType OAK_PRESSURE_PLATE = register("minecraft:oak_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType OAK_SAPLING = register("minecraft:oak_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); + @Nullable public static final BlockType OAK_SLAB = register("minecraft:oak_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType OAK_STAIRS = register("minecraft:oak_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType OAK_TRAPDOOR = register("minecraft:oak_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType OAK_WOOD = register("minecraft:oak_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType OBSERVER = register("minecraft:observer", state -> state.with(state.getBlockType().getProperty("facing"), Direction.SOUTH).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType OBSIDIAN = register("minecraft:obsidian"); + @Nullable public static final BlockType ORANGE_BANNER = register("minecraft:orange_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable public static final BlockType ORANGE_BED = register("minecraft:orange_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable public static final BlockType ORANGE_CARPET = register("minecraft:orange_carpet"); + @Nullable public static final BlockType ORANGE_CONCRETE = register("minecraft:orange_concrete"); + @Nullable public static final BlockType ORANGE_CONCRETE_POWDER = register("minecraft:orange_concrete_powder"); + @Nullable public static final BlockType ORANGE_GLAZED_TERRACOTTA = register("minecraft:orange_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType ORANGE_SHULKER_BOX = register("minecraft:orange_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable public static final BlockType ORANGE_STAINED_GLASS = register("minecraft:orange_stained_glass"); + @Nullable public static final BlockType ORANGE_STAINED_GLASS_PANE = register("minecraft:orange_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType ORANGE_TERRACOTTA = register("minecraft:orange_terracotta"); + @Nullable public static final BlockType ORANGE_TULIP = register("minecraft:orange_tulip"); + @Nullable public static final BlockType ORANGE_WALL_BANNER = register("minecraft:orange_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType ORANGE_WOOL = register("minecraft:orange_wool"); + @Nullable public static final BlockType OXEYE_DAISY = register("minecraft:oxeye_daisy"); + @Nullable public static final BlockType PACKED_ICE = register("minecraft:packed_ice"); + @Nullable public static final BlockType PEONY = register("minecraft:peony", state -> state.with(state.getBlockType().getProperty("half"), "lower")); + @Nullable public static final BlockType PETRIFIED_OAK_SLAB = register("minecraft:petrified_oak_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType PINK_BANNER = register("minecraft:pink_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable public static final BlockType PINK_BED = register("minecraft:pink_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable public static final BlockType PINK_CARPET = register("minecraft:pink_carpet"); + @Nullable public static final BlockType PINK_CONCRETE = register("minecraft:pink_concrete"); + @Nullable public static final BlockType PINK_CONCRETE_POWDER = register("minecraft:pink_concrete_powder"); + @Nullable public static final BlockType PINK_GLAZED_TERRACOTTA = register("minecraft:pink_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType PINK_SHULKER_BOX = register("minecraft:pink_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable public static final BlockType PINK_STAINED_GLASS = register("minecraft:pink_stained_glass"); + @Nullable public static final BlockType PINK_STAINED_GLASS_PANE = register("minecraft:pink_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType PINK_TERRACOTTA = register("minecraft:pink_terracotta"); + @Nullable public static final BlockType PINK_TULIP = register("minecraft:pink_tulip"); + @Nullable public static final BlockType PINK_WALL_BANNER = register("minecraft:pink_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType PINK_WOOL = register("minecraft:pink_wool"); + @Nullable public static final BlockType PISTON = register("minecraft:piston", state -> state.with(state.getBlockType().getProperty("extended"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType PISTON_HEAD = register("minecraft:piston_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("short"), false).with(state.getBlockType().getProperty("type"), "normal")); + @Nullable public static final BlockType PLAYER_HEAD = register("minecraft:player_head", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable public static final BlockType PLAYER_WALL_HEAD = register("minecraft:player_wall_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType PODZOL = register("minecraft:podzol", state -> state.with(state.getBlockType().getProperty("snowy"), false)); + @Nullable public static final BlockType POLISHED_ANDESITE = register("minecraft:polished_andesite"); + @Nullable public static final BlockType POLISHED_DIORITE = register("minecraft:polished_diorite"); + @Nullable public static final BlockType POLISHED_GRANITE = register("minecraft:polished_granite"); + @Nullable public static final BlockType POPPY = register("minecraft:poppy"); + @Nullable public static final BlockType POTATOES = register("minecraft:potatoes", state -> state.with(state.getBlockType().getProperty("age"), 0)); + @Nullable public static final BlockType POTTED_ACACIA_SAPLING = register("minecraft:potted_acacia_sapling"); + @Nullable public static final BlockType POTTED_ALLIUM = register("minecraft:potted_allium"); + @Nullable public static final BlockType POTTED_AZURE_BLUET = register("minecraft:potted_azure_bluet"); + @Nullable public static final BlockType POTTED_BIRCH_SAPLING = register("minecraft:potted_birch_sapling"); + @Nullable public static final BlockType POTTED_BLUE_ORCHID = register("minecraft:potted_blue_orchid"); + @Nullable public static final BlockType POTTED_BROWN_MUSHROOM = register("minecraft:potted_brown_mushroom"); + @Nullable public static final BlockType POTTED_CACTUS = register("minecraft:potted_cactus"); + @Nullable public static final BlockType POTTED_DANDELION = register("minecraft:potted_dandelion"); + @Nullable public static final BlockType POTTED_DARK_OAK_SAPLING = register("minecraft:potted_dark_oak_sapling"); + @Nullable public static final BlockType POTTED_DEAD_BUSH = register("minecraft:potted_dead_bush"); + @Nullable public static final BlockType POTTED_FERN = register("minecraft:potted_fern"); + @Nullable public static final BlockType POTTED_JUNGLE_SAPLING = register("minecraft:potted_jungle_sapling"); + @Nullable public static final BlockType POTTED_OAK_SAPLING = register("minecraft:potted_oak_sapling"); + @Nullable public static final BlockType POTTED_ORANGE_TULIP = register("minecraft:potted_orange_tulip"); + @Nullable public static final BlockType POTTED_OXEYE_DAISY = register("minecraft:potted_oxeye_daisy"); + @Nullable public static final BlockType POTTED_PINK_TULIP = register("minecraft:potted_pink_tulip"); + @Nullable public static final BlockType POTTED_POPPY = register("minecraft:potted_poppy"); + @Nullable public static final BlockType POTTED_RED_MUSHROOM = register("minecraft:potted_red_mushroom"); + @Nullable public static final BlockType POTTED_RED_TULIP = register("minecraft:potted_red_tulip"); + @Nullable public static final BlockType POTTED_SPRUCE_SAPLING = register("minecraft:potted_spruce_sapling"); + @Nullable public static final BlockType POTTED_WHITE_TULIP = register("minecraft:potted_white_tulip"); + @Nullable public static final BlockType POWERED_RAIL = register("minecraft:powered_rail", state -> state.with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("shape"), "north_south")); + @Nullable public static final BlockType PRISMARINE = register("minecraft:prismarine"); + @Nullable public static final BlockType PRISMARINE_BRICK_SLAB = register("minecraft:prismarine_brick_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType PRISMARINE_BRICK_STAIRS = register("minecraft:prismarine_brick_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType PRISMARINE_BRICKS = register("minecraft:prismarine_bricks"); + @Nullable public static final BlockType PRISMARINE_SLAB = register("minecraft:prismarine_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType PRISMARINE_STAIRS = register("minecraft:prismarine_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType PUMPKIN = register("minecraft:pumpkin"); + @Nullable public static final BlockType PUMPKIN_STEM = register("minecraft:pumpkin_stem", state -> state.with(state.getBlockType().getProperty("age"), 0)); + @Nullable public static final BlockType PURPLE_BANNER = register("minecraft:purple_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable public static final BlockType PURPLE_BED = register("minecraft:purple_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable public static final BlockType PURPLE_CARPET = register("minecraft:purple_carpet"); + @Nullable public static final BlockType PURPLE_CONCRETE = register("minecraft:purple_concrete"); + @Nullable public static final BlockType PURPLE_CONCRETE_POWDER = register("minecraft:purple_concrete_powder"); + @Nullable public static final BlockType PURPLE_GLAZED_TERRACOTTA = register("minecraft:purple_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType PURPLE_SHULKER_BOX = register("minecraft:purple_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable public static final BlockType PURPLE_STAINED_GLASS = register("minecraft:purple_stained_glass"); + @Nullable public static final BlockType PURPLE_STAINED_GLASS_PANE = register("minecraft:purple_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType PURPLE_TERRACOTTA = register("minecraft:purple_terracotta"); + @Nullable public static final BlockType PURPLE_WALL_BANNER = register("minecraft:purple_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType PURPLE_WOOL = register("minecraft:purple_wool"); + @Nullable public static final BlockType PURPUR_BLOCK = register("minecraft:purpur_block"); + @Nullable public static final BlockType PURPUR_PILLAR = register("minecraft:purpur_pillar", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType PURPUR_SLAB = register("minecraft:purpur_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType PURPUR_STAIRS = register("minecraft:purpur_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType QUARTZ_BLOCK = register("minecraft:quartz_block"); + @Nullable public static final BlockType QUARTZ_PILLAR = register("minecraft:quartz_pillar", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType QUARTZ_SLAB = register("minecraft:quartz_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType QUARTZ_STAIRS = register("minecraft:quartz_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType RAIL = register("minecraft:rail", state -> state.with(state.getBlockType().getProperty("shape"), "north_south")); + @Nullable public static final BlockType RED_BANNER = register("minecraft:red_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable public static final BlockType RED_BED = register("minecraft:red_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable public static final BlockType RED_CARPET = register("minecraft:red_carpet"); + @Nullable public static final BlockType RED_CONCRETE = register("minecraft:red_concrete"); + @Nullable public static final BlockType RED_CONCRETE_POWDER = register("minecraft:red_concrete_powder"); + @Nullable public static final BlockType RED_GLAZED_TERRACOTTA = register("minecraft:red_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType RED_MUSHROOM = register("minecraft:red_mushroom"); + @Nullable public static final BlockType RED_MUSHROOM_BLOCK = register("minecraft:red_mushroom_block", state -> state.with(state.getBlockType().getProperty("down"), true).with(state.getBlockType().getProperty("east"), true).with(state.getBlockType().getProperty("north"), true).with(state.getBlockType().getProperty("south"), true).with(state.getBlockType().getProperty("up"), true).with(state.getBlockType().getProperty("west"), true)); + @Nullable public static final BlockType RED_NETHER_BRICKS = register("minecraft:red_nether_bricks"); + @Nullable public static final BlockType RED_SAND = register("minecraft:red_sand"); + @Nullable public static final BlockType RED_SANDSTONE = register("minecraft:red_sandstone"); + @Nullable public static final BlockType RED_SANDSTONE_SLAB = register("minecraft:red_sandstone_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType RED_SANDSTONE_STAIRS = register("minecraft:red_sandstone_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType RED_SHULKER_BOX = register("minecraft:red_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable public static final BlockType RED_STAINED_GLASS = register("minecraft:red_stained_glass"); + @Nullable public static final BlockType RED_STAINED_GLASS_PANE = register("minecraft:red_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType RED_TERRACOTTA = register("minecraft:red_terracotta"); + @Nullable public static final BlockType RED_TULIP = register("minecraft:red_tulip"); + @Nullable public static final BlockType RED_WALL_BANNER = register("minecraft:red_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType RED_WOOL = register("minecraft:red_wool"); + @Nullable public static final BlockType REDSTONE_BLOCK = register("minecraft:redstone_block"); + @Nullable public static final BlockType REDSTONE_LAMP = register("minecraft:redstone_lamp", state -> state.with(state.getBlockType().getProperty("lit"), false)); + @Nullable public static final BlockType REDSTONE_ORE = register("minecraft:redstone_ore", state -> state.with(state.getBlockType().getProperty("lit"), false)); + @Nullable public static final BlockType REDSTONE_TORCH = register("minecraft:redstone_torch", state -> state.with(state.getBlockType().getProperty("lit"), true)); + @Nullable public static final BlockType REDSTONE_WALL_TORCH = register("minecraft:redstone_wall_torch", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("lit"), true)); + @Nullable public static final BlockType REDSTONE_WIRE = register("minecraft:redstone_wire", state -> state.with(state.getBlockType().getProperty("east"), "none").with(state.getBlockType().getProperty("north"), "none").with(state.getBlockType().getProperty("power"), 0).with(state.getBlockType().getProperty("south"), "none").with(state.getBlockType().getProperty("west"), "none")); + @Nullable public static final BlockType REPEATER = register("minecraft:repeater", state -> state.with(state.getBlockType().getProperty("delay"), 1).with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("locked"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType REPEATING_COMMAND_BLOCK = register("minecraft:repeating_command_block", state -> state.with(state.getBlockType().getProperty("conditional"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType ROSE_BUSH = register("minecraft:rose_bush", state -> state.with(state.getBlockType().getProperty("half"), "lower")); + @Nullable public static final BlockType SAND = register("minecraft:sand"); + @Nullable public static final BlockType SANDSTONE = register("minecraft:sandstone"); + @Nullable public static final BlockType SANDSTONE_SLAB = register("minecraft:sandstone_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType SANDSTONE_STAIRS = register("minecraft:sandstone_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType SEA_LANTERN = register("minecraft:sea_lantern"); + @Nullable public static final BlockType SEA_PICKLE = register("minecraft:sea_pickle", state -> state.with(state.getBlockType().getProperty("pickles"), 1).with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType SEAGRASS = register("minecraft:seagrass"); + @Nullable public static final BlockType SHULKER_BOX = register("minecraft:shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable public static final BlockType SIGN = register("minecraft:sign", state -> state.with(state.getBlockType().getProperty("rotation"), 0).with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType SKELETON_SKULL = register("minecraft:skeleton_skull", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable public static final BlockType SKELETON_WALL_SKULL = register("minecraft:skeleton_wall_skull", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType SLIME_BLOCK = register("minecraft:slime_block"); + @Nullable public static final BlockType SMOOTH_QUARTZ = register("minecraft:smooth_quartz"); + @Nullable public static final BlockType SMOOTH_RED_SANDSTONE = register("minecraft:smooth_red_sandstone"); + @Nullable public static final BlockType SMOOTH_SANDSTONE = register("minecraft:smooth_sandstone"); + @Nullable public static final BlockType SMOOTH_STONE = register("minecraft:smooth_stone"); + @Nullable public static final BlockType SNOW = register("minecraft:snow", state -> state.with(state.getBlockType().getProperty("layers"), 1)); + @Nullable public static final BlockType SNOW_BLOCK = register("minecraft:snow_block"); + @Nullable public static final BlockType SOUL_SAND = register("minecraft:soul_sand"); + @Nullable public static final BlockType SPAWNER = register("minecraft:spawner"); + @Nullable public static final BlockType SPONGE = register("minecraft:sponge"); + @Nullable public static final BlockType SPRUCE_BUTTON = register("minecraft:spruce_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType SPRUCE_DOOR = register("minecraft:spruce_door", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "lower").with(state.getBlockType().getProperty("hinge"), "left").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType SPRUCE_FENCE = register("minecraft:spruce_fence", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType SPRUCE_FENCE_GATE = register("minecraft:spruce_fence_gate", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("in_wall"), false).with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType SPRUCE_LEAVES = register("minecraft:spruce_leaves", state -> state.with(state.getBlockType().getProperty("distance"), 7).with(state.getBlockType().getProperty("persistent"), false)); + @Nullable public static final BlockType SPRUCE_LOG = register("minecraft:spruce_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType SPRUCE_PLANKS = register("minecraft:spruce_planks"); + @Nullable public static final BlockType SPRUCE_PRESSURE_PLATE = register("minecraft:spruce_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType SPRUCE_SAPLING = register("minecraft:spruce_sapling", state -> state.with(state.getBlockType().getProperty("stage"), 0)); + @Nullable public static final BlockType SPRUCE_SLAB = register("minecraft:spruce_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType SPRUCE_STAIRS = register("minecraft:spruce_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType SPRUCE_TRAPDOOR = register("minecraft:spruce_trapdoor", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("open"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType SPRUCE_WOOD = register("minecraft:spruce_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType STICKY_PISTON = register("minecraft:sticky_piston", state -> state.with(state.getBlockType().getProperty("extended"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType STONE = register("minecraft:stone"); + @Nullable public static final BlockType STONE_BRICK_SLAB = register("minecraft:stone_brick_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType STONE_BRICK_STAIRS = register("minecraft:stone_brick_stairs", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("half"), "bottom").with(state.getBlockType().getProperty("shape"), "straight").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType STONE_BRICKS = register("minecraft:stone_bricks"); + @Nullable public static final BlockType STONE_BUTTON = register("minecraft:stone_button", state -> state.with(state.getBlockType().getProperty("face"), "WALL").with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType STONE_PRESSURE_PLATE = register("minecraft:stone_pressure_plate", state -> state.with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType STONE_SLAB = register("minecraft:stone_slab", state -> state.with(state.getBlockType().getProperty("type"), "bottom").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType STRIPPED_ACACIA_LOG = register("minecraft:stripped_acacia_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType STRIPPED_ACACIA_WOOD = register("minecraft:stripped_acacia_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType STRIPPED_BIRCH_LOG = register("minecraft:stripped_birch_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType STRIPPED_BIRCH_WOOD = register("minecraft:stripped_birch_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType STRIPPED_DARK_OAK_LOG = register("minecraft:stripped_dark_oak_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType STRIPPED_DARK_OAK_WOOD = register("minecraft:stripped_dark_oak_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType STRIPPED_JUNGLE_LOG = register("minecraft:stripped_jungle_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType STRIPPED_JUNGLE_WOOD = register("minecraft:stripped_jungle_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType STRIPPED_OAK_LOG = register("minecraft:stripped_oak_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType STRIPPED_OAK_WOOD = register("minecraft:stripped_oak_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType STRIPPED_SPRUCE_LOG = register("minecraft:stripped_spruce_log", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType STRIPPED_SPRUCE_WOOD = register("minecraft:stripped_spruce_wood", state -> state.with(state.getBlockType().getProperty("axis"), "y")); + @Nullable public static final BlockType STRUCTURE_BLOCK = register("minecraft:structure_block", state -> state.with(state.getBlockType().getProperty("mode"), "SAVE")); + @Nullable public static final BlockType STRUCTURE_VOID = register("minecraft:structure_void"); + @Nullable public static final BlockType SUGAR_CANE = register("minecraft:sugar_cane", state -> state.with(state.getBlockType().getProperty("age"), 0)); + @Nullable public static final BlockType SUNFLOWER = register("minecraft:sunflower", state -> state.with(state.getBlockType().getProperty("half"), "lower")); + @Nullable public static final BlockType TALL_GRASS = register("minecraft:tall_grass", state -> state.with(state.getBlockType().getProperty("half"), "lower")); + @Nullable public static final BlockType TALL_SEAGRASS = register("minecraft:tall_seagrass", state -> state.with(state.getBlockType().getProperty("half"), "lower")); + @Nullable public static final BlockType TERRACOTTA = register("minecraft:terracotta"); + @Nullable public static final BlockType TNT = register("minecraft:tnt", state -> state.with(state.getBlockType().getProperty("unstable"), false)); + @Nullable public static final BlockType TORCH = register("minecraft:torch"); + @Nullable public static final BlockType TRAPPED_CHEST = register("minecraft:trapped_chest", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("type"), "SINGLE").with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType TRIPWIRE = register("minecraft:tripwire", state -> state.with(state.getBlockType().getProperty("attached"), false).with(state.getBlockType().getProperty("disarmed"), false).with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("powered"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType TRIPWIRE_HOOK = register("minecraft:tripwire_hook", state -> state.with(state.getBlockType().getProperty("attached"), false).with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("powered"), false)); + @Nullable public static final BlockType TUBE_CORAL = register("minecraft:tube_coral", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType TUBE_CORAL_BLOCK = register("minecraft:tube_coral_block"); + @Nullable public static final BlockType TUBE_CORAL_FAN = register("minecraft:tube_coral_fan", state -> state.with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType TUBE_CORAL_WALL_FAN = register("minecraft:tube_coral_wall_fan", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), true)); + @Nullable public static final BlockType TURTLE_EGG = register("minecraft:turtle_egg", state -> state.with(state.getBlockType().getProperty("eggs"), 1).with(state.getBlockType().getProperty("hatch"), 0)); + @Nullable public static final BlockType VINE = register("minecraft:vine", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("up"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType VOID_AIR = register("minecraft:void_air"); + @Nullable public static final BlockType WALL_SIGN = register("minecraft:wall_sign", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("waterlogged"), false)); + @Nullable public static final BlockType WALL_TORCH = register("minecraft:wall_torch", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType WATER = register("minecraft:water", state -> state.with(state.getBlockType().getProperty("level"), 0)); + @Nullable public static final BlockType WET_SPONGE = register("minecraft:wet_sponge"); + @Nullable public static final BlockType WHEAT = register("minecraft:wheat", state -> state.with(state.getBlockType().getProperty("age"), 0)); + @Nullable public static final BlockType WHITE_BANNER = register("minecraft:white_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable public static final BlockType WHITE_BED = register("minecraft:white_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable public static final BlockType WHITE_CARPET = register("minecraft:white_carpet"); + @Nullable public static final BlockType WHITE_CONCRETE = register("minecraft:white_concrete"); + @Nullable public static final BlockType WHITE_CONCRETE_POWDER = register("minecraft:white_concrete_powder"); + @Nullable public static final BlockType WHITE_GLAZED_TERRACOTTA = register("minecraft:white_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType WHITE_SHULKER_BOX = register("minecraft:white_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable public static final BlockType WHITE_STAINED_GLASS = register("minecraft:white_stained_glass"); + @Nullable public static final BlockType WHITE_STAINED_GLASS_PANE = register("minecraft:white_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType WHITE_TERRACOTTA = register("minecraft:white_terracotta"); + @Nullable public static final BlockType WHITE_TULIP = register("minecraft:white_tulip"); + @Nullable public static final BlockType WHITE_WALL_BANNER = register("minecraft:white_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType WHITE_WOOL = register("minecraft:white_wool"); + @Nullable public static final BlockType WITHER_SKELETON_SKULL = register("minecraft:wither_skeleton_skull", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable public static final BlockType WITHER_SKELETON_WALL_SKULL = register("minecraft:wither_skeleton_wall_skull", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType YELLOW_BANNER = register("minecraft:yellow_banner", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable public static final BlockType YELLOW_BED = register("minecraft:yellow_bed", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH).with(state.getBlockType().getProperty("occupied"), false).with(state.getBlockType().getProperty("part"), "foot")); + @Nullable public static final BlockType YELLOW_CARPET = register("minecraft:yellow_carpet"); + @Nullable public static final BlockType YELLOW_CONCRETE = register("minecraft:yellow_concrete"); + @Nullable public static final BlockType YELLOW_CONCRETE_POWDER = register("minecraft:yellow_concrete_powder"); + @Nullable public static final BlockType YELLOW_GLAZED_TERRACOTTA = register("minecraft:yellow_glazed_terracotta", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType YELLOW_SHULKER_BOX = register("minecraft:yellow_shulker_box", state -> state.with(state.getBlockType().getProperty("facing"), Direction.UP)); + @Nullable public static final BlockType YELLOW_STAINED_GLASS = register("minecraft:yellow_stained_glass"); + @Nullable public static final BlockType YELLOW_STAINED_GLASS_PANE = register("minecraft:yellow_stained_glass_pane", state -> state.with(state.getBlockType().getProperty("east"), false).with(state.getBlockType().getProperty("north"), false).with(state.getBlockType().getProperty("south"), false).with(state.getBlockType().getProperty("waterlogged"), false).with(state.getBlockType().getProperty("west"), false)); + @Nullable public static final BlockType YELLOW_TERRACOTTA = register("minecraft:yellow_terracotta"); + @Nullable public static final BlockType YELLOW_WALL_BANNER = register("minecraft:yellow_wall_banner", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); + @Nullable public static final BlockType YELLOW_WOOL = register("minecraft:yellow_wool"); + @Nullable public static final BlockType ZOMBIE_HEAD = register("minecraft:zombie_head", state -> state.with(state.getBlockType().getProperty("rotation"), 0)); + @Nullable public static final BlockType ZOMBIE_WALL_HEAD = register("minecraft:zombie_wall_head", state -> state.with(state.getBlockType().getProperty("facing"), Direction.NORTH)); private static BlockType register(String id) { From 4af43eb84c4e1ca529afd28b24d5306336ecde91 Mon Sep 17 00:00:00 2001 From: matt <4009945+MattBDev@users.noreply.github.com> Date: Tue, 2 Apr 2019 15:43:40 -0400 Subject: [PATCH 03/11] WeatherTypes now matches upstream --- .../worldedit/world/weather/WeatherTypes.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/weather/WeatherTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/weather/WeatherTypes.java index 1aa1c9f12..7d8cfc4b3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/weather/WeatherTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/weather/WeatherTypes.java @@ -23,20 +23,20 @@ import javax.annotation.Nullable; public class WeatherTypes { - public static final WeatherType CLEAR = register("clear"); - public static final WeatherType RAIN = register("rain"); - public static final WeatherType THUNDER_STORM = register("thunder_storm"); + static { + // This isn't really a proper registry - so inject these before they're obtained. + WeatherType.REGISTRY.register("clear", new WeatherType("clear")); + WeatherType.REGISTRY.register("rain", new WeatherType("rain")); + WeatherType.REGISTRY.register("thunder_storm", new WeatherType("thunder_storm")); + } + + @Nullable public static final WeatherType CLEAR = get("clear"); + @Nullable public static final WeatherType RAIN = get("rain"); + @Nullable public static final WeatherType THUNDER_STORM = get("thunder_storm"); private WeatherTypes() { } - private static WeatherType register(final String id) { - return register(new WeatherType(id)); - } - - public static WeatherType register(final WeatherType weatherType) { - return WeatherType.REGISTRY.register(weatherType.getId(), weatherType); - } public static @Nullable WeatherType get(final String id) { return WeatherType.REGISTRY.get(id); From 7ad364917f0cd1712c9d59c470ce33b08c894b9e Mon Sep 17 00:00:00 2001 From: wizjany Date: Thu, 14 Feb 2019 18:07:07 -0500 Subject: [PATCH 04/11] Ignore synthetic classes when loading BukkitImplAdapter. (cherry picked from commit 319f2efe43946efd5affd4535ca2cb98604ac9af) --- .../com/sk89q/worldedit/bukkit/adapter/BukkitImplLoader.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplLoader.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplLoader.java index 9d65cf46b..db82a2abb 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplLoader.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplLoader.java @@ -93,7 +93,7 @@ public class BukkitImplLoader { try { Enumeration entries = jar.entries(); while (entries.hasMoreElements()) { - JarEntry jarEntry = (JarEntry) entries.nextElement(); + JarEntry jarEntry = entries.nextElement(); String className = jarEntry.getName().replaceAll("[/\\\\]+", "."); @@ -157,6 +157,7 @@ public class BukkitImplLoader { for (String className : adapterCandidates) { try { Class cls = Class.forName(className); + if (cls.isSynthetic()) continue; if (BukkitImplAdapter.class.isAssignableFrom(cls)) { return (BukkitImplAdapter) cls.newInstance(); } else { From 47e66913e3988bc264f9e34af393b21c004e1355 Mon Sep 17 00:00:00 2001 From: matt <4009945+MattBDev@users.noreply.github.com> Date: Tue, 2 Apr 2019 16:26:51 -0400 Subject: [PATCH 05/11] Selective upstream merge --- .../bukkit/util/CommandRegistration.java | 6 +---- .../java/com/sk89q/wepif/VaultResolver.java | 3 +++ .../bukkit/BukkitBlockCategoryRegistry.java | 2 +- .../sk89q/worldedit/bukkit/BukkitPlayer.java | 2 +- .../com/sk89q/worldedit/blocks/Blocks.java | 27 +++++++++++++++++++ .../worldedit/command/RegionCommands.java | 24 ++++++++--------- .../world/block/BlockCategories.java | 4 +-- 7 files changed, 47 insertions(+), 21 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/bukkit/util/CommandRegistration.java b/worldedit-bukkit/src/main/java/com/sk89q/bukkit/util/CommandRegistration.java index 0e47b5f9a..e7df6832c 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/bukkit/util/CommandRegistration.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/bukkit/util/CommandRegistration.java @@ -35,11 +35,7 @@ import java.util.Set; public class CommandRegistration { static { - try { - Bukkit.getServer().getHelpMap().registerHelpTopicFactory(DynamicPluginCommand.class, new DynamicPluginCommandHelpTopic.Factory()); - } catch (Throwable e) { - e.printStackTrace(); - } + Bukkit.getServer().getHelpMap().registerHelpTopicFactory(DynamicPluginCommand.class, new DynamicPluginCommandHelpTopic.Factory()); } protected final Plugin plugin; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/wepif/VaultResolver.java b/worldedit-bukkit/src/main/java/com/sk89q/wepif/VaultResolver.java index a97017ceb..a918d601a 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/wepif/VaultResolver.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/wepif/VaultResolver.java @@ -35,6 +35,9 @@ public class VaultResolver implements PermissionsResolver { return null; } RegisteredServiceProvider rsp = server.getServicesManager().getRegistration(Permission.class); + if (rsp == null) { + return null; + } perms = rsp.getProvider(); if (perms == null) { return null; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockCategoryRegistry.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockCategoryRegistry.java index 24cbe0f6b..cecec0691 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockCategoryRegistry.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockCategoryRegistry.java @@ -49,4 +49,4 @@ public class BukkitBlockCategoryRegistry implements BlockCategoryRegistry { public Set getAll(Category category) { return getCategorisedByName(category.getId()); } -} \ No newline at end of file +} diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java index b3674e986..b9aa53a25 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java @@ -290,7 +290,7 @@ public class BukkitPlayer extends AbstractPlayerActor { } @Override - public > void sendFakeBlock(BlockVector3 pos, B block) { + public void sendFakeBlock(BlockVector3 pos, BlockStateHolder block) { Location loc = new Location(player.getWorld(), pos.getX(), pos.getY(), pos.getZ()); if (block == null) { player.sendBlockChange(loc, player.getWorld().getBlockAt(loc).getBlockData()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/Blocks.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/Blocks.java index 83ebddc85..db59ddce6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/Blocks.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/Blocks.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.blocks; +import com.google.common.collect.Maps; +import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.world.block.BlockCategories; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockType; @@ -26,6 +28,7 @@ import com.sk89q.worldedit.world.block.BlockTypes; import java.util.Collection; import java.util.HashSet; +import java.util.Map; import java.util.Set; /** @@ -190,4 +193,28 @@ public final class Blocks { return false; } + /** + * Parses a string->string map to find the matching Property and values for the given BlockType. + * + * @param states the desired states and values + * @param type the block type to get properties and values for + * @return a property->value map + */ + public static Map, Object> resolveProperties(Map states, BlockType type) { + Map> existing = type.getPropertyMap(); + Map, Object> newMap = Maps.newHashMap(); + states.forEach((key, value) -> { + @SuppressWarnings("unchecked") + Property prop = (Property) existing.get(key); + if (prop == null) return; + Object val = null; + try { + val = prop.getValueFor(value); + } catch (IllegalArgumentException ignored) { + } + if (val == null) return; + newMap.put(prop, val); + }); + return newMap; + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java index 64d3f250c..ea648056d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java @@ -227,7 +227,7 @@ public class RegionCommands extends MethodCommands { @Command( aliases = {"/line"}, - usage = " [thickness]", + usage = " [thickness]", desc = "Draws a line segment between cuboid selection corners", help = "Draws a line segment between cuboid selection corners.\n" + @@ -261,7 +261,7 @@ public class RegionCommands extends MethodCommands { @Command( aliases = {"/curve", "/spline"}, - usage = " [thickness]", + usage = " [thickness]", desc = "Draws a spline through selected points", help = "Draws a spline through selected points.\n" + @@ -297,8 +297,8 @@ public class RegionCommands extends MethodCommands { } @Command( - aliases = {"/replace", "/re", "/rep", "/r"}, - usage = "[from-mask] ", + aliases = { "/replace", "/re", "/rep" }, + usage = "[from-block] ", desc = "Replace all blocks in the selection with another", flags = "f", min = 1, @@ -343,7 +343,7 @@ public class RegionCommands extends MethodCommands { @Command( aliases = {"/overlay"}, - usage = "", + usage = "", desc = "Set a block on top of blocks in the region", min = 1, max = 1 @@ -393,7 +393,7 @@ public class RegionCommands extends MethodCommands { @Command( aliases = {"/center", "/middle"}, - usage = "", + usage = "", desc = "Set the center block(s)", min = 1, max = 1 @@ -423,7 +423,7 @@ public class RegionCommands extends MethodCommands { @Command( aliases = {"/walls"}, - usage = "", + usage = "", desc = "Build the four sides of the selection", min = 1, max = 1 @@ -439,7 +439,7 @@ public class RegionCommands extends MethodCommands { @Command( aliases = {"/faces", "/outline"}, - usage = "", + usage = "", desc = "Build the walls, ceiling, and floor of a selection", min = 1, max = 1 @@ -527,7 +527,7 @@ public class RegionCommands extends MethodCommands { desc = "Move the contents of the selection", help = "Moves the contents of the selection.\n" + - " -s flag shifts the selection to the target location.\n" + + "The -s flag shifts the selection to the target location.\n" + " -b also copies biomes\n" + " -e ignores entities\n" + " -a ignores air\n" + @@ -621,7 +621,7 @@ public class RegionCommands extends MethodCommands { if (moveSelection) { try { final BlockVector3 size = region.getMaximumPoint().subtract(region.getMinimumPoint()).add(1, 1, 1); - BlockVector3 shiftVector = BlockVector3.at(direction.getX() * size.getX() * count, direction.getY() * size.getY() * count, direction.getZ() * size.getZ() * count); + final BlockVector3 shiftVector = BlockVector3.at(direction.getX() * size.getX() * count, direction.getY() * size.getY() * count, direction.getZ() * size.getZ() * count); region.shift(shiftVector); session.getRegionSelector(player.getWorld()).learnChanges(); @@ -735,7 +735,7 @@ public class RegionCommands extends MethodCommands { @Command( aliases = {"/hollow"}, - usage = "[[ ]]", + usage = "[[ ]]", desc = "Hollows out the object contained in this selection", help = "Hollows out the object contained in this selection.\n" + @@ -803,4 +803,4 @@ public class RegionCommands extends MethodCommands { } -} \ No newline at end of file +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategories.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategories.java index d60c96985..b9e08aab8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategories.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategories.java @@ -32,8 +32,8 @@ public final class BlockCategories { public static final BlockCategory BIRCH_LOGS = register("minecraft:birch_logs"); public static final BlockCategory BUTTONS = register("minecraft:buttons"); public static final BlockCategory CARPETS = register("minecraft:carpets"); - public static final BlockCategory CORAL = register("minecraft:coral"); - public static final BlockCategory CORAL_PLANTS = register("minecraft:coral_plants"); + public static final BlockCategory CORALS = register("minecraft:corals"); + public static final BlockCategory CORAL_BLOCKS = register("minecraft:coral_blocks"); public static final BlockCategory DARK_OAK_LOGS = register("minecraft:dark_oak_logs"); public static final BlockCategory DOORS = register("minecraft:doors"); public static final BlockCategory ENDERMAN_HOLDABLE = register("minecraft:enderman_holdable"); From 29692f3fbe59d39e3790b8786c3bd9e9bc33d95f Mon Sep 17 00:00:00 2001 From: matt <4009945+MattBDev@users.noreply.github.com> Date: Tue, 2 Apr 2019 18:21:02 -0400 Subject: [PATCH 06/11] Migrate to SLF4J --- worldedit-bukkit/build.gradle | 3 + .../adapter/v1_13_1/Spigot_v1_13_R2.java | 9 +- .../wepif/FlatFilePermissionsResolver.java | 10 +- .../sk89q/wepif/NijiPermissionsResolver.java | 15 +- .../wepif/PermissionsResolverManager.java | 14 +- .../java/com/sk89q/wepif/VaultResolver.java | 3 - .../worldedit/bukkit/BukkitBlockRegistry.java | 15 +- .../bukkit/BukkitCommandInspector.java | 14 +- .../worldedit/bukkit/BukkitConfiguration.java | 3 +- .../bukkit/BukkitItemCategoryRegistry.java | 2 +- .../bukkit/BukkitServerInterface.java | 2 +- .../sk89q/worldedit/bukkit/BukkitWorld.java | 18 +- .../worldedit/bukkit/WorldEditPlugin.java | 94 +- .../bukkit/adapter/BukkitImplLoader.java | 17 +- worldedit-core/build.gradle | 176 +-- .../com/sk89q/worldedit/blocks/SignBlock.java | 1 + .../ConfigurationSerialization.java | 52 +- .../util/commands/CommandsManager.java | 1170 ++++++++--------- .../util/commands/SimpleInjector.java | 9 +- .../java/com/sk89q/worldedit/EditSession.java | 15 +- .../com/sk89q/worldedit/LocalSession.java | 5 +- .../java/com/sk89q/worldedit/WorldEdit.java | 12 +- .../worldedit/command/ChunkCommands.java | 2 + .../worldedit/command/NavigationCommands.java | 19 +- .../worldedit/command/SchematicCommands.java | 15 +- .../worldedit/command/SnapshotCommands.java | 19 +- .../command/SnapshotUtilCommands.java | 11 +- .../command/composition/SelectionCommand.java | 7 +- .../command/tool/BlockDataCyler.java | 15 +- .../worldedit/command/tool/BlockReplacer.java | 10 +- .../worldedit/command/tool/TreePlanter.java | 20 +- .../command/tool/brush/CylinderBrush.java | 4 +- .../tool/brush/HollowCylinderBrush.java | 2 +- .../command/tool/brush/HollowSphereBrush.java | 2 +- .../command/tool/brush/SphereBrush.java | 2 +- .../extension/platform/CommandManager.java | 32 +- .../extension/platform/PlatformManager.java | 24 +- .../extent/clipboard/io/ClipboardFormats.java | 4 +- .../clipboard/io/MCEditSchematicReader.java | 13 +- .../extent/clipboard/io/SchematicReader.java | 7 +- .../clipboard/io/SpongeSchematicReader.java | 7 +- .../command/CommandLoggingHandler.java | 2 + .../ReparametrisingInterpolation.java | 11 +- .../worldedit/session/SessionManager.java | 23 +- .../session/storage/JsonFileSessionStore.java | 16 +- .../util/PropertiesConfiguration.java | 567 ++++---- .../worldedit/util/YAMLConfiguration.java | 5 +- .../worldedit/util/eventbus/EventBus.java | 13 +- .../com/sk89q/worldedit/util/io/Closer.java | 12 +- .../util/logging/WorldEditPrefixHandler.java | 3 +- .../util/paste/ActorCallbackPaste.java | 8 +- .../util/report/ShallowObjectReport.java | 9 +- .../worldedit/world/chunk/AnvilChunk.java | 2 +- .../sk89q/worldedit/world/chunk/OldChunk.java | 2 +- .../world/registry/BundledBlockData.java | 13 +- .../world/registry/BundledItemData.java | 11 +- .../world/registry/LegacyMapper.java | 25 +- .../worldedit/world/snapshot/Snapshot.java | 5 +- .../worldedit/world/registry/legacy.json | 5 +- .../util/commands/CommandContextTest.java | 28 +- worldedit-forge/build.gradle | 1 + .../sponge/adapter/SpongeImplLoader.java | 16 +- 62 files changed, 1346 insertions(+), 1305 deletions(-) diff --git a/worldedit-bukkit/build.gradle b/worldedit-bukkit/build.gradle index acefe8c9b..1e315e6b1 100644 --- a/worldedit-bukkit/build.gradle +++ b/worldedit-bukkit/build.gradle @@ -4,6 +4,8 @@ apply plugin: 'maven' repositories { maven { url "https://hub.spigotmc.org/nexus/content/groups/public" } + maven { url "https://repo.codemc.org/repository/maven-public" } + maven { url 'https://papermc.io/repo/repository/maven-public/' } } dependencies { @@ -12,6 +14,7 @@ dependencies { compile 'com.sk89q:dummypermscompat:1.10' compile 'com.destroystokyo.paper:paper-api:1.13.2-R0.1-SNAPSHOT' compile 'org.spigotmc:spigot:1.13.2-R0.1-SNAPSHOT' + compile 'org.slf4j:slf4j-jdk14:1.7.26' testCompile 'org.mockito:mockito-core:1.9.0-rc1' compile 'com.massivecraft:factions:2.8.0' compile 'com.drtshock:factions:1.6.9.5' diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/v1_13_1/Spigot_v1_13_R2.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/v1_13_1/Spigot_v1_13_R2.java index 628956cdf..8c5c639d2 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/v1_13_1/Spigot_v1_13_R2.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/v1_13_1/Spigot_v1_13_R2.java @@ -49,20 +49,21 @@ import org.bukkit.craftbukkit.v1_13_R2.block.data.CraftBlockData; import org.bukkit.craftbukkit.v1_13_R2.entity.CraftEntity; import org.bukkit.entity.Player; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.annotation.Nullable; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.*; import java.util.logging.Level; -import java.util.logging.Logger; import java.util.stream.Collectors; import static com.google.common.base.Preconditions.checkNotNull; public final class Spigot_v1_13_R2 extends CachedBukkitAdapter implements BukkitImplAdapter{ - private final Logger logger = Logger.getLogger(getClass().getCanonicalName()); + private final Logger logger = LoggerFactory.getLogger(getClass()); private final Field nbtListTagListField; private final Method nbtCreateTagMethod; @@ -348,7 +349,7 @@ public final class Spigot_v1_13_R2 extends CachedBukkitAdapter implements Bukkit return Collections.emptyMap(); } if (block == null) { - logger.warning("Failed to find properties for " + blockType.getId()); + logger.warn("Failed to find properties for " + blockType.getId()); return Collections.emptyMap(); } Map> properties = Maps.newLinkedHashMap(); @@ -414,7 +415,7 @@ public final class Spigot_v1_13_R2 extends CachedBukkitAdapter implements Bukkit try { return toNativeList((NBTTagList) foreign); } catch (Throwable e) { - logger.log(Level.WARNING, "Failed to convert NBTTagList", e); + logger.warn("Failed to convert NBTTagList", e); return new ListTag(ByteTag.class, new ArrayList()); } } else if (foreign instanceof NBTTagLong) { diff --git a/worldedit-bukkit/src/main/java/com/sk89q/wepif/FlatFilePermissionsResolver.java b/worldedit-bukkit/src/main/java/com/sk89q/wepif/FlatFilePermissionsResolver.java index 3f2324596..9b5229cf3 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/wepif/FlatFilePermissionsResolver.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/wepif/FlatFilePermissionsResolver.java @@ -22,6 +22,8 @@ package com.sk89q.wepif; import com.sk89q.util.yaml.YAMLProcessor; import org.bukkit.OfflinePlayer; import org.bukkit.Server; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.BufferedReader; import java.io.File; @@ -32,12 +34,10 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; public class FlatFilePermissionsResolver implements PermissionsResolver { - private static final Logger log = Logger.getLogger(FlatFilePermissionsResolver.class.getCanonicalName()); + private static final Logger log = LoggerFactory.getLogger(FlatFilePermissionsResolver.class); private Map> userPermissionsCache; private Set defaultPermissionsCache; @@ -98,7 +98,7 @@ public class FlatFilePermissionsResolver implements PermissionsResolver { } } } catch (IOException e) { - log.log(Level.WARNING, "Failed to load permissions", e); + log.warn("Failed to load permissions", e); } finally { try { if (buff != null) { @@ -164,7 +164,7 @@ public class FlatFilePermissionsResolver implements PermissionsResolver { } } } catch (IOException e) { - log.log(Level.WARNING, "Failed to load permissions", e); + log.warn("Failed to load permissions", e); } finally { try { if (buff != null) { diff --git a/worldedit-bukkit/src/main/java/com/sk89q/wepif/NijiPermissionsResolver.java b/worldedit-bukkit/src/main/java/com/sk89q/wepif/NijiPermissionsResolver.java index fe23bfa46..ef12e2ff4 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/wepif/NijiPermissionsResolver.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/wepif/NijiPermissionsResolver.java @@ -28,13 +28,12 @@ import org.bukkit.command.PluginCommand; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.PluginManager; - -import java.util.logging.Level; -import java.util.logging.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class NijiPermissionsResolver implements PermissionsResolver { - private static final Logger log = Logger.getLogger(NijiPermissionsResolver.class.getCanonicalName()); + private static final Logger log = LoggerFactory.getLogger(NijiPermissionsResolver.class); private Server server; private Permissions api; @@ -84,7 +83,7 @@ public class NijiPermissionsResolver implements PermissionsResolver { return api.Security.permission(player, permission); } } catch (Throwable t) { - log.log(Level.WARNING, "Failed to check permissions", t); + log.warn("Failed to check permissions", t); return false; } } @@ -98,7 +97,7 @@ public class NijiPermissionsResolver implements PermissionsResolver { return api.getHandler().has(server.getPlayerExact(name), permission); } } catch (Throwable t) { - log.log(Level.WARNING, "Failed to check permissions", t); + log.warn("Failed to check permissions", t); return false; } } @@ -115,7 +114,7 @@ public class NijiPermissionsResolver implements PermissionsResolver { return api.Security.inGroup(name, group); } } catch (Throwable t) { - log.log(Level.WARNING, "Failed to check groups", t); + log.warn("Failed to check groups", t); return false; } } @@ -139,7 +138,7 @@ public class NijiPermissionsResolver implements PermissionsResolver { return groups; } } catch (Throwable t) { - log.log(Level.WARNING, "Failed to get groups", t); + log.warn("Failed to get groups", t); return new String[0]; } } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsResolverManager.java b/worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsResolverManager.java index 4775d86c4..6514912a8 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsResolverManager.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsResolverManager.java @@ -27,6 +27,8 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.server.PluginDisableEvent; import org.bukkit.event.server.PluginEnableEvent; import org.bukkit.plugin.Plugin; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.File; import java.io.IOException; @@ -35,8 +37,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; public class PermissionsResolverManager implements PermissionsResolver { @@ -85,7 +85,7 @@ public class PermissionsResolverManager implements PermissionsResolver { private Server server; private PermissionsResolver permissionResolver; private YAMLProcessor config; - private Logger logger = Logger.getLogger(getClass().getCanonicalName()); + private Logger logger = LoggerFactory.getLogger(getClass()); private List> enabledResolvers = new ArrayList<>(); @SuppressWarnings("unchecked") @@ -119,7 +119,7 @@ public class PermissionsResolverManager implements PermissionsResolver { break; } } catch (Throwable e) { - logger.log(Level.WARNING, "Error in factory method for " + resolverClass.getSimpleName(), e); + logger.warn("Error in factory method for " + resolverClass.getSimpleName(), e); continue; } } @@ -195,14 +195,14 @@ public class PermissionsResolverManager implements PermissionsResolver { try { file.createNewFile(); } catch (IOException e) { - logger.log(Level.WARNING, "Failed to create new configuration file", e); + logger.warn("Failed to create new configuration file", e); } } config = new YAMLProcessor(file, false, YAMLFormat.EXTENDED); try { config.load(); } catch (IOException e) { - logger.log(Level.WARNING, "Error loading WEPIF configuration", e); + logger.warn("Error loading WEPIF configuration", e); } List keys = config.getKeys(null); config.setHeader(CONFIG_HEADER); @@ -232,7 +232,7 @@ public class PermissionsResolverManager implements PermissionsResolver { } catch (ClassNotFoundException e) {} if (next == null || !PermissionsResolver.class.isAssignableFrom(next)) { - logger.warning("WEPIF: Invalid or unknown class found in enabled resolvers: " + logger.warn("WEPIF: Invalid or unknown class found in enabled resolvers: " + nextName + ". Moving to disabled resolvers list."); i.remove(); disabledResolvers.add(nextName); diff --git a/worldedit-bukkit/src/main/java/com/sk89q/wepif/VaultResolver.java b/worldedit-bukkit/src/main/java/com/sk89q/wepif/VaultResolver.java index a918d601a..a97017ceb 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/wepif/VaultResolver.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/wepif/VaultResolver.java @@ -35,9 +35,6 @@ public class VaultResolver implements PermissionsResolver { return null; } RegisteredServiceProvider rsp = server.getServicesManager().getRegistration(Permission.class); - if (rsp == null) { - return null; - } perms = rsp.getProvider(); if (perms == null) { return null; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java index 0264ba49e..fcf2fd25d 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java @@ -54,18 +54,18 @@ public class BukkitBlockRegistry extends BundledBlockRegistry { BlockMaterial result = adapter.getMaterial(blockType); if (result != null) return result; } - Material type = BukkitAdapter.adapt(blockType); - if (type == null) { + Material mat = BukkitAdapter.adapt(blockType); + if (mat == null) { if (blockType == BlockTypes.__RESERVED__) return new PassthroughBlockMaterial(super.getMaterial(BlockTypes.AIR)); return new PassthroughBlockMaterial(null); } if (materialMap == null) { materialMap = new BukkitBlockMaterial[Material.values().length]; } - BukkitBlockMaterial result = materialMap[type.ordinal()]; + BukkitBlockMaterial result = materialMap[mat.ordinal()]; if (result == null) { - result = new BukkitBlockMaterial(BukkitBlockRegistry.super.getMaterial(blockType), type); - materialMap[type.ordinal()] = result; + result = new BukkitBlockMaterial(BukkitBlockRegistry.super.getMaterial(blockType), mat); + materialMap[mat.ordinal()] = result; } return result; } @@ -84,9 +84,8 @@ public class BukkitBlockRegistry extends BundledBlockRegistry { @Nullable @Override public Map> getProperties(BlockType blockType) { - BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter(); - if (adapter != null) { - return adapter.getProperties(blockType); + if (WorldEditPlugin.getInstance().getBukkitImplAdapter() != null) { + return WorldEditPlugin.getInstance().getBukkitImplAdapter().getProperties(blockType); } return super.getProperties(blockType); } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandInspector.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandInspector.java index b392c50ac..fa3f2917f 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandInspector.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandInspector.java @@ -19,8 +19,6 @@ package com.sk89q.worldedit.bukkit; -import static com.google.common.base.Preconditions.checkNotNull; - import com.sk89q.bukkit.util.CommandInspector; import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.worldedit.extension.platform.Actor; @@ -29,12 +27,14 @@ import com.sk89q.worldedit.util.command.Description; import com.sk89q.worldedit.util.command.Dispatcher; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; -import java.util.logging.Logger; +import static com.google.common.base.Preconditions.checkNotNull; class BukkitCommandInspector implements CommandInspector { - private static final Logger logger = Logger.getLogger(BukkitCommandInspector.class.getCanonicalName()); + private static final Logger logger = LoggerFactory.getLogger(BukkitCommandInspector.class); private final WorldEditPlugin plugin; private final Dispatcher dispatcher; @@ -51,7 +51,7 @@ class BukkitCommandInspector implements CommandInspector { if (mapping != null) { return mapping.getDescription().getDescription(); } else { - logger.warning("BukkitCommandInspector doesn't know how about the command '" + command + "'"); + logger.warn("BukkitCommandInspector doesn't know how about the command '" + command + "'"); return "Help text not available"; } } @@ -63,7 +63,7 @@ class BukkitCommandInspector implements CommandInspector { Description description = mapping.getDescription(); return "Usage: " + description.getUsage() + (description.getHelp() != null ? "\n" + description.getHelp() : ""); } else { - logger.warning("BukkitCommandInspector doesn't know how about the command '" + command + "'"); + logger.warn("BukkitCommandInspector doesn't know how about the command '" + command + "'"); return "Help text not available"; } } @@ -76,7 +76,7 @@ class BukkitCommandInspector implements CommandInspector { locals.put(Actor.class, plugin.wrapCommandSender(sender)); return mapping.getCallable().testPermission(locals); } else { - logger.warning("BukkitCommandInspector doesn't know how about the command '" + command + "'"); + logger.warn("BukkitCommandInspector doesn't know how about the command '" + command + "'"); return false; } } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitConfiguration.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitConfiguration.java index 494a464ea..96c755083 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitConfiguration.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitConfiguration.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.bukkit; import com.sk89q.util.yaml.YAMLProcessor; import com.sk89q.worldedit.util.YAMLConfiguration; import com.sk89q.worldedit.util.report.Unreported; +import org.slf4j.LoggerFactory; import java.io.File; @@ -34,7 +35,7 @@ public class BukkitConfiguration extends YAMLConfiguration { @Unreported private final WorldEditPlugin plugin; public BukkitConfiguration(YAMLProcessor config, WorldEditPlugin plugin) { - super(config, plugin.getLogger()); + super(config, LoggerFactory.getLogger(plugin.getLogger().getName())); this.plugin = plugin; } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitItemCategoryRegistry.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitItemCategoryRegistry.java index b5291b4e1..c75c56eb2 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitItemCategoryRegistry.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitItemCategoryRegistry.java @@ -49,4 +49,4 @@ public class BukkitItemCategoryRegistry implements ItemCategoryRegistry { public Set getAll(Category category) { return getCategorisedByName(category.getId()); } -} \ No newline at end of file +} diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java index bf460997e..2d312c19f 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java @@ -149,7 +149,7 @@ public class BukkitServerInterface implements MultiUserPlatform { @Override public String getPlatformName() { - return "bukkit"; + return "Bukkit"; } @Override diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index a199b6069..820d4a396 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -48,6 +48,7 @@ import org.bukkit.block.Chest; import org.bukkit.entity.Entity; import org.bukkit.inventory.DoubleChestInventory; import org.bukkit.inventory.Inventory; +import org.slf4j.Logger; import javax.annotation.Nullable; import java.lang.ref.WeakReference; @@ -56,8 +57,7 @@ import java.util.EnumMap; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; + import static com.google.common.base.Preconditions.checkNotNull; public class BukkitWorld extends AbstractWorld { @@ -118,9 +118,9 @@ public class BukkitWorld extends AbstractWorld { return null; } } catch (Exception e) { - logger.warning("Corrupt entity found when creating: " + entity.getType().getId()); + logger.warn("Corrupt entity found when creating: " + entity.getType().getId()); if (entity.getNbtData() != null) { - logger.warning(entity.getNbtData().toString()); + logger.warn(entity.getNbtData().toString()); } e.printStackTrace(); return null; @@ -183,7 +183,7 @@ public class BukkitWorld extends AbstractWorld { try { getWorld().regenerateChunk(chunk.getBlockX(), chunk.getBlockZ()); } catch (Throwable t) { - logger.log(Level.WARNING, "Chunk generation via Bukkit raised an error", t); + logger.warn("Chunk generation via Bukkit raised an error", t); } // Then restore @@ -280,7 +280,7 @@ public class BukkitWorld extends AbstractWorld { treeTypeMapping.put(TreeGenerator.TreeType.RANDOM_MUSHROOM, TreeType.BROWN_MUSHROOM); for (TreeGenerator.TreeType type : TreeGenerator.TreeType.values()) { if (treeTypeMapping.get(type) == null) { - WorldEdit.logger.severe("No TreeType mapping for TreeGenerator.TreeType." + type); + WorldEdit.logger.error("No TreeType mapping for TreeGenerator.TreeType." + type); } } } @@ -425,9 +425,9 @@ public class BukkitWorld extends AbstractWorld { try { return adapter.setBlock(BukkitAdapter.adapt(getWorld(), position), block, notifyAndLight); } catch (Exception e) { - if (block instanceof BaseBlock && ((BaseBlock)block).getNbtData() != null) { - logger.warning("Tried to set a corrupt tile entity at " + position.toString()); - logger.warning(((BaseBlock)block).getNbtData().toString()); + if (block instanceof BaseBlock && ((BaseBlock) block).getNbtData() != null) { + logger.warn("Tried to set a corrupt tile entity at " + position.toString()); + logger.warn(((BaseBlock) block).getNbtData().toString()); } e.printStackTrace(); Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ()); diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java index 78f8c8091..23e64aec2 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java @@ -33,24 +33,46 @@ import com.sk89q.worldedit.bukkit.adapter.AdapterLoadException; import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter; import com.sk89q.worldedit.bukkit.adapter.BukkitImplLoader; import com.sk89q.worldedit.event.platform.CommandEvent; +import com.sk89q.worldedit.event.platform.CommandSuggestionEvent; import com.sk89q.worldedit.event.platform.PlatformReadyEvent; +import com.sk89q.worldedit.extension.input.InputParseException; +import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Capability; -import com.sk89q.worldedit.extension.platform.NoCapablePlatformException; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extent.inventory.BlockBag; +import com.sk89q.worldedit.registry.state.Property; +import com.sk89q.worldedit.world.biome.BiomeType; +import com.sk89q.worldedit.world.block.BlockCategory; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.block.FuzzyBlockState; +import com.sk89q.worldedit.world.entity.EntityType; +import com.sk89q.worldedit.world.item.ItemCategory; +import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.registry.LegacyMapper; +import org.bstats.bukkit.Metrics; import org.bukkit.Bukkit; import org.bukkit.Material; +import org.bukkit.Tag; +import org.bukkit.block.Biome; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; +import org.bukkit.command.TabCompleter; import org.bukkit.entity.Player; -import org.bukkit.plugin.*; +import org.bukkit.plugin.Plugin; +import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPluginLoader; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.annotation.Nullable; -import java.io.*; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; @@ -59,7 +81,6 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.jar.JarFile; import java.util.logging.Level; -import java.util.logging.Logger; import java.util.zip.ZipEntry; import static com.google.common.base.Preconditions.checkNotNull; @@ -67,10 +88,9 @@ import static com.google.common.base.Preconditions.checkNotNull; /** * Plugin for Bukkit. */ -public class WorldEditPlugin extends JavaPlugin //implements TabCompleter -{ +public class WorldEditPlugin extends JavaPlugin { //implements TabCompleter - private static final Logger log = Logger.getLogger("FastAsyncWorldEdit"); + private static final Logger log = LoggerFactory.getLogger(WorldEditPlugin.class); public static final String CUI_PLUGIN_CHANNEL = "worldedit:cui"; private static WorldEditPlugin INSTANCE; @@ -220,18 +240,18 @@ public class WorldEditPlugin extends JavaPlugin //implements TabCompleter } } } - { - Logger logger = getLogger(); - if (logger != null) { - try { - Field nameField = Logger.class.getDeclaredField("name"); - nameField.setAccessible(true); - nameField.set(logger, "FastAsyncWorldEdit"); - } catch (Throwable ignore) { - ignore.printStackTrace(); - } - } - } +// { +// Logger logger = getLogger(); +// if (logger != null) { +// try { +// Field nameField = Logger.class.getDeclaredField("name"); +// nameField.setAccessible(true); +// nameField.set(logger, "FastAsyncWorldEdit"); +// } catch (Throwable ignore) { +// ignore.printStackTrace(); +// } +// } +// } { File pluginsFolder = MainUtil.getJarFile().getParentFile(); for (File file : pluginsFolder.listFiles()) { @@ -245,7 +265,7 @@ public class WorldEditPlugin extends JavaPlugin //implements TabCompleter e.printStackTrace(); } } - log.log(Level.INFO, "Please restart the server if you have any plugins which depend on FAWE."); + getLogger().info("Please restart the server if you have any plugins which depend on FAWE."); } } @@ -253,7 +273,7 @@ public class WorldEditPlugin extends JavaPlugin //implements TabCompleter try { run.run(); } catch (Throwable e) { - log.log(Level.SEVERE, message); + getLogger().severe(message); e.printStackTrace(); } } @@ -264,7 +284,7 @@ public class WorldEditPlugin extends JavaPlugin //implements TabCompleter config = new BukkitConfiguration(new YAMLProcessor(new File(getDataFolder(), "config-legacy.yml"), true), this); config.load(); } catch (Throwable e) { - log.log(Level.SEVERE, "Failed to load config.yml"); + getLogger().severe("Failed to load config.yml"); e.printStackTrace(); } // Create schematics folder @@ -280,37 +300,33 @@ public class WorldEditPlugin extends JavaPlugin //implements TabCompleter BukkitImplLoader adapterLoader = new BukkitImplLoader(); try { adapterLoader.addClass(Spigot_v1_13_R2.class); - } catch (Throwable ignore) { - ignore.printStackTrace(); + } catch (Throwable throwable) { + throwable.printStackTrace(); } try { adapterLoader.addFromPath(getClass().getClassLoader()); } catch (IOException e) { - log.log(Level.WARNING, "Failed to search path for Bukkit adapters"); + log.warn("Failed to search path for Bukkit adapters"); } try { adapterLoader.addFromJar(getFile()); } catch (IOException e) { - log.log(Level.WARNING, "Failed to search " + getFile() + " for Bukkit adapters", e); + log.warn("Failed to search " + getFile() + " for Bukkit adapters", e); } try { bukkitAdapter = adapterLoader.loadAdapter(); - log.log(Level.INFO, "Using " + bukkitAdapter.getClass().getCanonicalName() + " as the Bukkit adapter"); + log.info("Using " + bukkitAdapter.getClass().getCanonicalName() + " as the Bukkit adapter"); } catch (AdapterLoadException e) { - try { - Platform platform = worldEdit.getPlatformManager().queryCapability(Capability.WORLD_EDITING); - if (platform instanceof BukkitServerInterface) { - log.log(Level.WARNING, e.getMessage()); - return; - } else { - log.log(Level.INFO, "WorldEdit could not find a Bukkit adapter for this MC version, " + - "but it seems that you have another implementation of WorldEdit installed (" + platform.getPlatformName() + ") " + - "that handles the world editing."); - } - } catch (NoCapablePlatformException ignore) {} - log.log(Level.INFO, "WorldEdit could not find a Bukkit adapter for this MC version"); + Platform platform = worldEdit.getPlatformManager().queryCapability(Capability.WORLD_EDITING); + if (platform instanceof BukkitServerInterface) { + log.warn(e.getMessage()); + } else { + log.info("WorldEdit could not find a Bukkit adapter for this MC version, " + + "but it seems that you have another implementation of WorldEdit installed (" + platform.getPlatformName() + ") " + + "that handles the world editing."); + } } } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplLoader.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplLoader.java index db82a2abb..db87058d3 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplLoader.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplLoader.java @@ -20,6 +20,8 @@ package com.sk89q.worldedit.bukkit.adapter; import com.sk89q.worldedit.util.io.Closer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.File; import java.io.IOException; @@ -29,15 +31,13 @@ import java.util.Enumeration; import java.util.List; import java.util.jar.JarEntry; import java.util.jar.JarFile; -import java.util.logging.Level; -import java.util.logging.Logger; /** * Loads Bukkit implementation adapters. */ public class BukkitImplLoader { - private static final Logger log = Logger.getLogger(BukkitImplLoader.class.getCanonicalName()); + private static final Logger log = LoggerFactory.getLogger(BukkitImplLoader.class); private final List adapterCandidates = new ArrayList<>(); private String customCandidate; @@ -73,7 +73,7 @@ public class BukkitImplLoader { if (className != null) { customCandidate = className; adapterCandidates.add(className); - log.log(Level.INFO, "-Dworldedit.bukkit.adapter used to add " + className + " to the list of available Bukkit adapters"); + log.info("-Dworldedit.bukkit.adapter used to add " + className + " to the list of available Bukkit adapters"); } } @@ -161,19 +161,18 @@ public class BukkitImplLoader { if (BukkitImplAdapter.class.isAssignableFrom(cls)) { return (BukkitImplAdapter) cls.newInstance(); } else { - log.log(Level.WARNING, "Failed to load the Bukkit adapter class '" + className + + log.warn("Failed to load the Bukkit adapter class '" + className + "' because it does not implement " + BukkitImplAdapter.class.getCanonicalName()); } } catch (ClassNotFoundException e) { - log.log(Level.WARNING, "Failed to load the Bukkit adapter class '" + className + + log.warn("Failed to load the Bukkit adapter class '" + className + "' that is not supposed to be missing", e); } catch (IllegalAccessException e) { - log.log(Level.WARNING, "Failed to load the Bukkit adapter class '" + className + + log.warn("Failed to load the Bukkit adapter class '" + className + "' that is not supposed to be raising this error", e); } catch (Throwable e) { - e.printStackTrace(); if (className.equals(customCandidate)) { - log.log(Level.WARNING, "Failed to load the Bukkit adapter class '" + className + "'", e); + log.warn("Failed to load the Bukkit adapter class '" + className + "'", e); } } } diff --git a/worldedit-core/build.gradle b/worldedit-core/build.gradle index 89a595b92..eb0f957c3 100644 --- a/worldedit-core/build.gradle +++ b/worldedit-core/build.gradle @@ -1,87 +1,89 @@ -apply plugin: 'eclipse' -apply plugin: 'idea' -repositories { - maven {url "http://ci.athion.net/job/PlotSquared-Breaking/ws/mvn/"} -} -dependencies { - compile 'de.schlichtherle:truezip:6.8.3' - compile 'rhino:js:1.7R2' - compile 'com.google.guava:guava:21.0' - compile 'com.sk89q:jchronic:0.2.4a' - compile 'com.google.code.findbugs:jsr305:1.3.9' - compile 'com.thoughtworks.paranamer:paranamer:2.6' - compile 'com.google.code.gson:gson:2.8.0' - compile 'com.sk89q.lib:jlibnoise:1.0.0' - compile 'com.googlecode.json-simple:json-simple:1.1.1' - testCompile 'org.mockito:mockito-core:1.9.0-rc1' - - // Fawe depends - compile 'org.yaml:snakeyaml:1.19' - compile 'net.fabiozumbi12:redprotect:1.9.6' - compile ("com.github.intellectualsites.plotsquared:PlotSquared-API:latest") { - transitive = false - } - compile 'com.github.luben:zstd-jni:1.1.1' - compile 'co.aikar:fastutil-lite:1.0' -} - -sourceSets { - main { - java { - srcDir 'src/main/java' - srcDir 'src/legacy/java' - } - resources { - srcDir 'src/main/resources' - } - } -} - -processResources { - from('src/main/resources') { - include 'fawe.properties' - expand( - internalVersion: "${project.parent.version}", - name: project.parent.name, - ) - } -} - -jar.archiveName="fawe-api-${project.parent.version}.jar" -jar.destinationDir = file '../mvn/com/boydti/fawe-api/' + project.parent.version -task createPom << { - pom { - project { - groupId 'com.boydti' - artifactId 'fawe-api' - version project.parent.version - } - } - .getEffectivePom() - .setDependencies(new ArrayList<>()) - .writeTo("../mvn/com/boydti/fawe-api/${project.parent.version}/fawe-api-${project.parent.version}.pom") - pom { - project { - groupId 'com.boydti' - artifactId 'fawe-api' - version 'latest' - } - } - .getEffectivePom() - .setDependencies(new ArrayList<>()) - .writeTo("../mvn/com/boydti/fawe-api/latest/fawe-api-latest.pom") -} -task copyFiles { - doLast { - copy { - from "../mvn/com/boydti/fawe-api/${project.parent.version}/" - into '../mvn/com/boydti/fawe-api/latest/' - include('*.jar') - rename ("fawe-api-${project.parent.version}.jar", 'fawe-api-latest.jar') - } - } -} - -build.dependsOn(shadowJar) -build.finalizedBy(copyFiles) -copyFiles.dependsOn(createPom) +apply plugin: 'eclipse' +apply plugin: 'idea' +repositories { + maven {url "http://ci.athion.net/job/PlotSquared-Breaking/ws/mvn/"} +} +dependencies { + compile 'de.schlichtherle:truezip:6.8.3' + compile 'rhino:js:1.7R2' + compile 'com.google.guava:guava:21.0' + compile 'com.sk89q:jchronic:0.2.4a' + compile 'com.google.code.findbugs:jsr305:1.3.9' + compile 'com.thoughtworks.paranamer:paranamer:2.6' + compile 'com.google.code.gson:gson:2.8.0' + compile 'com.sk89q.lib:jlibnoise:1.0.0' + compile 'com.googlecode.json-simple:json-simple:1.1.1' + compile 'org.slf4j:slf4j-api:1.7.26' + //compile 'net.sf.trove4j:trove4j:3.0.3' + testCompile 'org.mockito:mockito-core:1.9.0-rc1' + + // Fawe depends + compile 'org.yaml:snakeyaml:1.19' + compile 'net.fabiozumbi12:redprotect:1.9.6' + compile ("com.github.intellectualsites.plotsquared:PlotSquared-API:latest") { + transitive = false + } + compile 'com.github.luben:zstd-jni:1.1.1' + compile 'co.aikar:fastutil-lite:1.0' +} + +sourceSets { + main { + java { + srcDir 'src/main/java' + srcDir 'src/legacy/java' + } + resources { + srcDir 'src/main/resources' + } + } +} + +processResources { + from('src/main/resources') { + include 'fawe.properties' + expand( + internalVersion: "${project.parent.version}", + name: project.parent.name, + ) + } +} + +jar.archiveName="fawe-api-${project.parent.version}.jar" +jar.destinationDir = file '../mvn/com/boydti/fawe-api/' + project.parent.version +task createPom << { + pom { + project { + groupId 'com.boydti' + artifactId 'fawe-api' + version project.parent.version + } + } + .getEffectivePom() + .setDependencies(new ArrayList<>()) + .writeTo("../mvn/com/boydti/fawe-api/${project.parent.version}/fawe-api-${project.parent.version}.pom") + pom { + project { + groupId 'com.boydti' + artifactId 'fawe-api' + version 'latest' + } + } + .getEffectivePom() + .setDependencies(new ArrayList<>()) + .writeTo("../mvn/com/boydti/fawe-api/latest/fawe-api-latest.pom") +} +task copyFiles { + doLast { + copy { + from "../mvn/com/boydti/fawe-api/${project.parent.version}/" + into '../mvn/com/boydti/fawe-api/latest/' + include('*.jar') + rename ("fawe-api-${project.parent.version}.jar", 'fawe-api-latest.jar') + } + } +} + +build.dependsOn(shadowJar) +build.finalizedBy(copyFiles) +copyFiles.dependsOn(createPom) diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java index 60dabd6c7..4cc0e5bcb 100644 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java +++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java @@ -25,6 +25,7 @@ import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.util.gson.GsonUtil; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; + import java.util.HashMap; import java.util.Map; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/configuration/serialization/ConfigurationSerialization.java b/worldedit-core/src/main/java/com/boydti/fawe/configuration/serialization/ConfigurationSerialization.java index 445702c6f..f3249bbbf 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/configuration/serialization/ConfigurationSerialization.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/configuration/serialization/ConfigurationSerialization.java @@ -1,16 +1,16 @@ package com.boydti.fawe.configuration.serialization; +import com.boydti.fawe.configuration.Configuration; +import org.slf4j.LoggerFactory; + import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.HashMap; import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - /** - * Utility class for storing and retrieving classes for {@link com.boydti.fawe.configuration.Configuration}. + * Utility class for storing and retrieving classes for {@link Configuration}. */ public class ConfigurationSerialization { @@ -27,7 +27,7 @@ public class ConfigurationSerialization { * Attempts to deserialize the given arguments into a new instance of the * given class. *

- *

The class must implement {@link com.boydti.fawe.configuration.serialization.ConfigurationSerializable}, including + *

The class must implement {@link ConfigurationSerializable}, including * the extra methods as specified in the javadoc of * ConfigurationSerializable.

*

@@ -39,7 +39,7 @@ public class ConfigurationSerialization { * @return New instance of the specified class */ public static ConfigurationSerializable deserializeObject(Map args, Class clazz) { - return new com.boydti.fawe.configuration.serialization.ConfigurationSerialization(clazz).deserialize(args); + return new ConfigurationSerialization(clazz).deserialize(args); } /** @@ -47,7 +47,7 @@ public class ConfigurationSerialization { *

* given class. *

- * The class must implement {@link com.boydti.fawe.configuration.serialization.ConfigurationSerializable}, including + * The class must implement {@link ConfigurationSerializable}, including * the extra methods as specified in the javadoc of * ConfigurationSerializable.

*

@@ -80,17 +80,17 @@ public class ConfigurationSerialization { throw new IllegalArgumentException("Args doesn't contain type key ('" + SERIALIZED_TYPE_KEY + "')"); } - return new com.boydti.fawe.configuration.serialization.ConfigurationSerialization(clazz).deserialize(args); + return new ConfigurationSerialization(clazz).deserialize(args); } /** - * Registers the given {@link com.boydti.fawe.configuration.serialization.ConfigurationSerializable} class by its + * Registers the given {@link ConfigurationSerializable} class by its * alias. * * @param clazz Class to register */ public static void registerClass(Class clazz) { - com.boydti.fawe.configuration.serialization.DelegateDeserialization delegate = clazz.getAnnotation(com.boydti.fawe.configuration.serialization.DelegateDeserialization.class); + DelegateDeserialization delegate = clazz.getAnnotation(DelegateDeserialization.class); if (delegate == null) { registerClass(clazz, getAlias(clazz)); @@ -99,19 +99,18 @@ public class ConfigurationSerialization { } /** - * Registers the given alias to the specified {@link - * com.boydti.fawe.configuration.serialization.ConfigurationSerializable} class. + * Registers the given alias to the specified {@link ConfigurationSerializable} class. * * @param clazz Class to register * @param alias Alias to register as - * @see com.boydti.fawe.configuration.serialization.SerializableAs + * @see SerializableAs */ public static void registerClass(Class clazz, String alias) { aliases.put(alias, clazz); } /** - * Unregisters the specified alias to a {@link com.boydti.fawe.configuration.serialization.ConfigurationSerializable} + * Unregisters the specified alias to a {@link ConfigurationSerializable} * * @param alias Alias to unregister */ @@ -120,8 +119,7 @@ public class ConfigurationSerialization { } /** - * Unregisters any aliases for the specified {@link - * com.boydti.fawe.configuration.serialization.ConfigurationSerializable} class. + * Unregisters any aliases for the specified {@link ConfigurationSerializable} class. * * @param clazz Class to unregister */ @@ -131,7 +129,7 @@ public class ConfigurationSerialization { } /** - * Attempts to get a registered {@link com.boydti.fawe.configuration.serialization.ConfigurationSerializable} class by + * Attempts to get a registered {@link ConfigurationSerializable} class by * its alias. * * @param alias Alias of the serializable @@ -142,14 +140,14 @@ public class ConfigurationSerialization { } /** - * Gets the correct alias for the given {@link com.boydti.fawe.configuration.serialization.ConfigurationSerializable} + * Gets the correct alias for the given {@link ConfigurationSerializable} * class. * * @param clazz Class to get alias for * @return Alias to use for the class */ public static String getAlias(Class clazz) { - com.boydti.fawe.configuration.serialization.DelegateDeserialization delegate = clazz.getAnnotation(DelegateDeserialization.class); + DelegateDeserialization delegate = clazz.getAnnotation(DelegateDeserialization.class); if (delegate != null) { if ((delegate.value() == null) || (delegate.value() == clazz)) { @@ -180,9 +178,7 @@ public class ConfigurationSerialization { } return method; - } catch (NoSuchMethodException ex) { - return null; - } catch (SecurityException ex) { + } catch (NoSuchMethodException | SecurityException ex) { return null; } } @@ -190,9 +186,7 @@ public class ConfigurationSerialization { protected Constructor getConstructor() { try { return this.clazz.getConstructor(Map.class); - } catch (NoSuchMethodException ex) { - return null; - } catch (SecurityException ex) { + } catch (NoSuchMethodException | SecurityException ex) { return null; } } @@ -202,14 +196,13 @@ public class ConfigurationSerialization { ConfigurationSerializable result = (ConfigurationSerializable) method.invoke(null, args); if (result == null) { - Logger.getLogger(com.boydti.fawe.configuration.serialization.ConfigurationSerialization.class.getName()).log(Level.SEVERE, + LoggerFactory.getLogger(ConfigurationSerialization.class).error( "Could not call method '" + method.toString() + "' of " + this.clazz + " for deserialization: method returned null"); } else { return result; } } catch (Throwable ex) { - Logger.getLogger(com.boydti.fawe.configuration.serialization.ConfigurationSerialization.class.getName()) - .log(Level.SEVERE, "Could not call method '" + method.toString() + "' of " + this.clazz + LoggerFactory.getLogger(ConfigurationSerialization.class).error("Could not call method '" + method.toString() + "' of " + this.clazz + " for deserialization", ex instanceof InvocationTargetException ? ex.getCause() : ex); } @@ -221,8 +214,7 @@ public class ConfigurationSerialization { try { return ctor.newInstance(args); } catch (Throwable ex) { - Logger.getLogger(com.boydti.fawe.configuration.serialization.ConfigurationSerialization.class.getName()) - .log(Level.SEVERE, "Could not call constructor '" + ctor.toString() + "' of " + this.clazz + LoggerFactory.getLogger(ConfigurationSerialization.class).error("Could not call constructor '" + ctor.toString() + "' of " + this.clazz + " for deserialization", ex instanceof InvocationTargetException ? ex.getCause() : ex); } diff --git a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandsManager.java b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandsManager.java index a8f49678b..f8af6a8c2 100644 --- a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandsManager.java +++ b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandsManager.java @@ -1,585 +1,585 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.minecraft.util.commands; - -import com.sk89q.util.StringUtil; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * Manager for handling commands. This allows you to easily process commands, - * including nested commands, by correctly annotating methods of a class. - * - *

To use this, it is merely a matter of registering classes containing - * the commands (as methods with the proper annotations) with the - * manager. When you want to process a command, use one of the - * {@code execute} methods. If something is wrong, such as incorrect - * usage, insufficient permissions, or a missing command altogether, an - * exception will be raised for upstream handling.

- * - *

Methods of a class to be registered can be static, but if an injector - * is registered with the class, the instances of the command classes - * will be created automatically and methods will be called non-statically.

- * - *

To mark a method as a command, use {@link Command}. For nested commands, - * see {@link NestedCommand}. To handle permissions, use - * {@link CommandPermissions}.

- * - *

This uses Java reflection extensively, but to reduce the overhead of - * reflection, command lookups are completely cached on registration. This - * allows for fast command handling. Method invocation still has to be done - * with reflection, but this is quite fast in that of itself.

- * - * @param command sender class - */ -@SuppressWarnings("ProtectedField") -public abstract class CommandsManager { - - protected static final Logger logger = - Logger.getLogger(CommandsManager.class.getCanonicalName()); - - /** - * Mapping of commands (including aliases) with a description. Root - * commands are stored under a key of null, whereas child commands are - * cached under their respective {@link Method}. The child map has - * the key of the command name (one for each alias) with the - * method. - */ - protected Map> commands = new HashMap<>(); - - /** - * Used to store the instances associated with a method. - */ - protected Map instances = new HashMap<>(); - - /** - * Mapping of commands (not including aliases) with a description. This - * is only for top level commands. - */ - protected Map descs = new HashMap<>(); - - /** - * Stores the injector used to getInstance. - */ - protected Injector injector; - - /** - * Mapping of commands (not including aliases) with a description. This - * is only for top level commands. - */ - protected Map helpMessages = new HashMap<>(); - - /** - * Register an class that contains commands (denoted by {@link Command}. - * If no dependency injector is specified, then the methods of the - * class will be registered to be called statically. Otherwise, new - * instances will be created of the command classes and methods will - * not be called statically. - * - * @param cls the class to register - */ - public void register(Class cls) { - registerMethods(cls, null); - } - - /** - * Register an class that contains commands (denoted by {@link Command}. - * If no dependency injector is specified, then the methods of the - * class will be registered to be called statically. Otherwise, new - * instances will be created of the command classes and methods will - * not be called statically. A List of {@link Command} annotations from - * registered commands is returned. - * - * @param cls the class to register - * @return A List of {@link Command} annotations from registered commands, - * for use in eg. a dynamic command registration system. - */ - public List registerAndReturn(Class cls) { - return registerMethods(cls, null); - } - - /** - * Register the methods of a class. This will automatically construct - * instances as necessary. - * - * @param cls the class to register - * @param parent the parent method - * @return Commands Registered - */ - public List registerMethods(Class cls, Method parent) { - try { - if (getInjector() == null) { - return registerMethods(cls, parent, null); - } else { - Object obj = getInjector().getInstance(cls); - return registerMethods(cls, parent, obj); - } - } catch (InvocationTargetException | InstantiationException | IllegalAccessException e) { - logger.log(Level.SEVERE, "Failed to register commands", e); - } - return null; - } - - /** - * Register the methods of a class. - * - * @param cls the class to register - * @param parent the parent method - * @param obj the object whose methods will become commands if they are annotated - * @return a list of commands - */ - private List registerMethods(Class cls, Method parent, Object obj) { - Map map; - List registered = new ArrayList<>(); - - // Make a new hash map to cache the commands for this class - // as looking up methods via reflection is fairly slow - if (commands.containsKey(parent)) { - map = commands.get(parent); - } else { - map = new HashMap<>(); - commands.put(parent, map); - } - - for (Method method : cls.getMethods()) { - if (!method.isAnnotationPresent(Command.class)) { - continue; - } - - boolean isStatic = Modifier.isStatic(method.getModifiers()); - - Command cmd = method.getAnnotation(Command.class); - - // Cache the aliases too - for (String alias : cmd.aliases()) { - map.put(alias, method); - } - - // We want to be able invoke with an instance - if (!isStatic) { - // Can't register this command if we don't have an instance - if (obj == null) { - continue; - } - - instances.put(method, obj); - } - - // Build a list of commands and their usage details, at least for - // root level commands - if (parent == null) { - final String commandName = cmd.aliases()[0]; - final String desc = cmd.desc(); - - final String usage = cmd.usage(); - if (usage.isEmpty()) { - descs.put(commandName, desc); - } else { - descs.put(commandName, usage + " - " + desc); - } - - String help = cmd.help(); - if (help.isEmpty()) { - help = desc; - } - - final CharSequence arguments = getArguments(cmd); - for (String alias : cmd.aliases()) { - final String helpMessage = "/" + alias + " " + arguments + "\n\n" + help; - final String key = alias.replaceAll("/", ""); - String previous = helpMessages.put(key, helpMessage); - - if (previous != null && !previous.replaceAll("^/[^ ]+ ", "").equals(helpMessage.replaceAll("^/[^ ]+ ", ""))) { - helpMessages.put(key, previous + "\n\n" + helpMessage); - } - } - - } - - // Add the command to the registered command list for return - registered.add(cmd); - - // Look for nested commands -- if there are any, those have - // to be cached too so that they can be quickly looked - // up when processing commands - if (method.isAnnotationPresent(NestedCommand.class)) { - NestedCommand nestedCmd = method.getAnnotation(NestedCommand.class); - - for (Class nestedCls : nestedCmd.value()) { - registerMethods(nestedCls, method); - } - } - } - - if (cls.getSuperclass() != null) { - registerMethods(cls.getSuperclass(), parent, obj); - } - - return registered; - } - - /** - * Checks to see whether there is a command named such at the root level. - * This will check aliases as well. - * - * @param command the command - * @return true if the command exists - */ - public boolean hasCommand(String command) { - return commands.get(null).containsKey(command.toLowerCase()); - } - - /** - * Get a list of command descriptions. This is only for root commands. - * - * @return a map of commands - */ - public Map getCommands() { - return descs; - } - - /** - * Get the mapping of methods under a parent command. - * - * @return the mapping - */ - public Map> getMethods() { - return commands; - } - - /** - * Get a map from command name to help message. This is only for root commands. - * - * @return a map of help messages for each command - */ - public Map getHelpMessages() { - return helpMessages; - } - - /** - * Get the usage string for a command. - * - * @param args the arguments - * @param level the depth of the command - * @param cmd the command annotation - * @return the usage string - */ - protected String getUsage(String[] args, int level, Command cmd) { - final StringBuilder command = new StringBuilder(); - - command.append('/'); - - for (int i = 0; i <= level; ++i) { - command.append(args[i]); - command.append(' '); - } - command.append(getArguments(cmd)); - - final String help = cmd.help(); - if (!help.isEmpty()) { - command.append("\n\n"); - command.append(help); - } - - return command.toString(); - } - - protected CharSequence getArguments(Command cmd) { - final String flags = cmd.flags(); - - final StringBuilder command2 = new StringBuilder(); - if (!flags.isEmpty()) { - String flagString = flags.replaceAll(".:", ""); - if (!flagString.isEmpty()) { - command2.append("[-"); - for (int i = 0; i < flagString.length(); ++i) { - command2.append(flagString.charAt(i)); - } - command2.append("] "); - } - } - - command2.append(cmd.usage()); - - return command2; - } - - /** - * Get the usage string for a nested command. - * - * @param args the arguments - * @param level the depth of the command - * @param method the parent method - * @param player the player - * @return the usage string - * @throws CommandException on some error - */ - protected String getNestedUsage(String[] args, int level, Method method, T player) throws CommandException { - StringBuilder command = new StringBuilder(); - - command.append("/"); - - for (int i = 0; i <= level; ++i) { - command.append(args[i]).append(" "); - } - - Map map = commands.get(method); - boolean found = false; - - command.append("<"); - - Set allowedCommands = new HashSet<>(); - - for (Map.Entry entry : map.entrySet()) { - Method childMethod = entry.getValue(); - found = true; - - if (hasPermission(childMethod, player)) { - Command childCmd = childMethod.getAnnotation(Command.class); - - allowedCommands.add(childCmd.aliases()[0]); - } - } - - if (!allowedCommands.isEmpty()) { - command.append(StringUtil.joinString(allowedCommands, "|", 0)); - } else { - if (!found) { - command.append("?"); - } else { - //command.append("action"); - throw new CommandPermissionsException(); - } - } - - command.append(">"); - - return command.toString(); - } - - /** - * Attempt to execute a command. This version takes a separate command - * name (for the root command) and then a list of following arguments. - * - * @param cmd command to run - * @param args arguments - * @param player command source - * @param methodArgs method arguments - * @throws CommandException thrown when the command throws an error - */ - public void execute(String cmd, String[] args, T player, Object... methodArgs) throws CommandException { - - String[] newArgs = new String[args.length + 1]; - System.arraycopy(args, 0, newArgs, 1, args.length); - newArgs[0] = cmd; - Object[] newMethodArgs = new Object[methodArgs.length + 1]; - System.arraycopy(methodArgs, 0, newMethodArgs, 1, methodArgs.length); - - executeMethod(null, newArgs, player, newMethodArgs, 0); - } - - /** - * Attempt to execute a command. - * - * @param args the arguments - * @param player the player - * @param methodArgs the arguments for the method - * @throws CommandException thrown on command error - */ - public void execute(String[] args, T player, Object... methodArgs) throws CommandException { - Object[] newMethodArgs = new Object[methodArgs.length + 1]; - System.arraycopy(methodArgs, 0, newMethodArgs, 1, methodArgs.length); - executeMethod(null, args, player, newMethodArgs, 0); - } - - /** - * Attempt to execute a command. - * - * @param parent the parent method - * @param args an array of arguments - * @param player the player - * @param methodArgs the array of method arguments - * @param level the depth of the command - * @throws CommandException thrown on a command error - */ - public void executeMethod(Method parent, String[] args, T player, Object[] methodArgs, int level) throws CommandException { - String cmdName = args[level]; - - Map map = commands.get(parent); - Method method = map.get(cmdName.toLowerCase()); - - if (method == null) { - if (parent == null) { // Root - throw new UnhandledCommandException(); - } else { - throw new MissingNestedCommandException("Unknown command: " + cmdName, - getNestedUsage(args, level - 1, parent, player)); - } - } - - checkPermission(player, method); - - int argsCount = args.length - 1 - level; - - // checks if we need to execute the body of the nested command method (false) - // or display the help what commands are available (true) - // this is all for an args count of 0 if it is > 0 and a NestedCommand Annotation is present - // it will always handle the methods that NestedCommand points to - // e.g.: - // - /cmd - @NestedCommand(executeBody = true) will go into the else loop and execute code in that method - // - /cmd - @NestedCommand(executeBody = true) will always go to the nested command class - // - /cmd - @NestedCommand(executeBody = false) will always go to the nested command class not matter the args - boolean executeNested = method.isAnnotationPresent(NestedCommand.class) - && (argsCount > 0 || !method.getAnnotation(NestedCommand.class).executeBody()); - - if (executeNested) { - if (argsCount == 0) { - throw new MissingNestedCommandException("Sub-command required.", - getNestedUsage(args, level, method, player)); - } else { - executeMethod(method, args, player, methodArgs, level + 1); - } - } else if (method.isAnnotationPresent(CommandAlias.class)) { - CommandAlias aCmd = method.getAnnotation(CommandAlias.class); - executeMethod(parent, aCmd.value(), player, methodArgs, level); - } else { - Command cmd = method.getAnnotation(Command.class); - - String[] newArgs = new String[args.length - level]; - System.arraycopy(args, level, newArgs, 0, args.length - level); - - final Set valueFlags = new HashSet<>(); - - char[] flags = cmd.flags().toCharArray(); - Set newFlags = new HashSet<>(); - for (int i = 0; i < flags.length; ++i) { - if (flags.length > i + 1 && flags[i + 1] == ':') { - valueFlags.add(flags[i]); - ++i; - } - newFlags.add(flags[i]); - } - - CommandContext context = new CommandContext(newArgs, valueFlags); - - if (context.argsLength() < cmd.min()) { - throw new CommandUsageException("Too few arguments.", getUsage(args, level, cmd)); - } - - if (cmd.max() != -1 && context.argsLength() > cmd.max()) { - throw new CommandUsageException("Too many arguments.", getUsage(args, level, cmd)); - } - - if (!cmd.anyFlags()) { - for (char flag : context.getFlags()) { - if (!newFlags.contains(flag)) { - throw new CommandUsageException("Unknown flag: " + flag, getUsage(args, level, cmd)); - } - } - } - - methodArgs[0] = context; - - Object instance = instances.get(method); - - invokeMethod(parent, args, player, method, instance, methodArgs, argsCount); - } - } - - protected void checkPermission(T player, Method method) throws CommandException { - if (!hasPermission(method, player)) { - throw new CommandPermissionsException(); - } - } - - public void invokeMethod(Method parent, String[] args, T player, Method method, Object instance, Object[] methodArgs, int level) throws CommandException { - try { - method.invoke(instance, methodArgs); - } catch (IllegalArgumentException | IllegalAccessException e) { - logger.log(Level.SEVERE, "Failed to execute command", e); - } catch (InvocationTargetException e) { - if (e.getCause() instanceof CommandException) { - throw (CommandException) e.getCause(); - } - - throw new WrappedCommandException(e.getCause()); - } - } - - /** - * Returns whether a player has access to a command. - * - * @param method the method - * @param player the player - * @return true if permission is granted - */ - protected boolean hasPermission(Method method, T player) { - CommandPermissions perms = method.getAnnotation(CommandPermissions.class); - if (perms == null) { - return true; - } - - for (String perm : perms.value()) { - if (hasPermission(player, perm)) { - return true; - } - } - - return false; - } - - /** - * Returns whether a player permission.. - * - * @param player the player - * @param permission the permission - * @return true if permission is granted - */ - public abstract boolean hasPermission(T player, String permission); - - /** - * Get the injector used to create new instances. This can be - * null, in which case only classes will be registered statically. - * - * @return an injector instance - */ - public Injector getInjector() { - return injector; - } - - /** - * Set the injector for creating new instances. - * - * @param injector injector or null - */ - public void setInjector(Injector injector) { - this.injector = injector; - } -} +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.minecraft.util.commands; + +import com.sk89q.util.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Manager for handling commands. This allows you to easily process commands, + * including nested commands, by correctly annotating methods of a class. + * + *

To use this, it is merely a matter of registering classes containing + * the commands (as methods with the proper annotations) with the + * manager. When you want to process a command, use one of the + * {@code execute} methods. If something is wrong, such as incorrect + * usage, insufficient permissions, or a missing command altogether, an + * exception will be raised for upstream handling.

+ * + *

Methods of a class to be registered can be static, but if an injector + * is registered with the class, the instances of the command classes + * will be created automatically and methods will be called non-statically.

+ * + *

To mark a method as a command, use {@link Command}. For nested commands, + * see {@link NestedCommand}. To handle permissions, use + * {@link CommandPermissions}.

+ * + *

This uses Java reflection extensively, but to reduce the overhead of + * reflection, command lookups are completely cached on registration. This + * allows for fast command handling. Method invocation still has to be done + * with reflection, but this is quite fast in that of itself.

+ * + * @param command sender class + */ +@SuppressWarnings("ProtectedField") +public abstract class CommandsManager { + + protected static final Logger logger = + LoggerFactory.getLogger(CommandsManager.class); + + /** + * Mapping of commands (including aliases) with a description. Root + * commands are stored under a key of null, whereas child commands are + * cached under their respective {@link Method}. The child map has + * the key of the command name (one for each alias) with the + * method. + */ + protected Map> commands = new HashMap<>(); + + /** + * Used to store the instances associated with a method. + */ + protected Map instances = new HashMap<>(); + + /** + * Mapping of commands (not including aliases) with a description. This + * is only for top level commands. + */ + protected Map descs = new HashMap<>(); + + /** + * Stores the injector used to getInstance. + */ + protected Injector injector; + + /** + * Mapping of commands (not including aliases) with a description. This + * is only for top level commands. + */ + protected Map helpMessages = new HashMap<>(); + + /** + * Register an class that contains commands (denoted by {@link Command}. + * If no dependency injector is specified, then the methods of the + * class will be registered to be called statically. Otherwise, new + * instances will be created of the command classes and methods will + * not be called statically. + * + * @param cls the class to register + */ + public void register(Class cls) { + registerMethods(cls, null); + } + + /** + * Register an class that contains commands (denoted by {@link Command}. + * If no dependency injector is specified, then the methods of the + * class will be registered to be called statically. Otherwise, new + * instances will be created of the command classes and methods will + * not be called statically. A List of {@link Command} annotations from + * registered commands is returned. + * + * @param cls the class to register + * @return A List of {@link Command} annotations from registered commands, + * for use in eg. a dynamic command registration system. + */ + public List registerAndReturn(Class cls) { + return registerMethods(cls, null); + } + + /** + * Register the methods of a class. This will automatically construct + * instances as necessary. + * + * @param cls the class to register + * @param parent the parent method + * @return Commands Registered + */ + public List registerMethods(Class cls, Method parent) { + try { + if (getInjector() == null) { + return registerMethods(cls, parent, null); + } else { + Object obj = getInjector().getInstance(cls); + return registerMethods(cls, parent, obj); + } + } catch (InvocationTargetException | InstantiationException | IllegalAccessException e) { + logger.error("Failed to register commands", e); + } + return null; + } + + /** + * Register the methods of a class. + * + * @param cls the class to register + * @param parent the parent method + * @param obj the object whose methods will become commands if they are annotated + * @return a list of commands + */ + private List registerMethods(Class cls, Method parent, Object obj) { + Map map; + List registered = new ArrayList<>(); + + // Make a new hash map to cache the commands for this class + // as looking up methods via reflection is fairly slow + if (commands.containsKey(parent)) { + map = commands.get(parent); + } else { + map = new HashMap<>(); + commands.put(parent, map); + } + + for (Method method : cls.getMethods()) { + if (!method.isAnnotationPresent(Command.class)) { + continue; + } + + boolean isStatic = Modifier.isStatic(method.getModifiers()); + + Command cmd = method.getAnnotation(Command.class); + + // Cache the aliases too + for (String alias : cmd.aliases()) { + map.put(alias, method); + } + + // We want to be able invoke with an instance + if (!isStatic) { + // Can't register this command if we don't have an instance + if (obj == null) { + continue; + } + + instances.put(method, obj); + } + + // Build a list of commands and their usage details, at least for + // root level commands + if (parent == null) { + final String commandName = cmd.aliases()[0]; + final String desc = cmd.desc(); + + final String usage = cmd.usage(); + if (usage.isEmpty()) { + descs.put(commandName, desc); + } else { + descs.put(commandName, usage + " - " + desc); + } + + String help = cmd.help(); + if (help.isEmpty()) { + help = desc; + } + + final CharSequence arguments = getArguments(cmd); + for (String alias : cmd.aliases()) { + final String helpMessage = "/" + alias + " " + arguments + "\n\n" + help; + final String key = alias.replaceAll("/", ""); + String previous = helpMessages.put(key, helpMessage); + + if (previous != null && !previous.replaceAll("^/[^ ]+ ", "").equals(helpMessage.replaceAll("^/[^ ]+ ", ""))) { + helpMessages.put(key, previous + "\n\n" + helpMessage); + } + } + + } + + // Add the command to the registered command list for return + registered.add(cmd); + + // Look for nested commands -- if there are any, those have + // to be cached too so that they can be quickly looked + // up when processing commands + if (method.isAnnotationPresent(NestedCommand.class)) { + NestedCommand nestedCmd = method.getAnnotation(NestedCommand.class); + + for (Class nestedCls : nestedCmd.value()) { + registerMethods(nestedCls, method); + } + } + } + + if (cls.getSuperclass() != null) { + registerMethods(cls.getSuperclass(), parent, obj); + } + + return registered; + } + + /** + * Checks to see whether there is a command named such at the root level. + * This will check aliases as well. + * + * @param command the command + * @return true if the command exists + */ + public boolean hasCommand(String command) { + return commands.get(null).containsKey(command.toLowerCase()); + } + + /** + * Get a list of command descriptions. This is only for root commands. + * + * @return a map of commands + */ + public Map getCommands() { + return descs; + } + + /** + * Get the mapping of methods under a parent command. + * + * @return the mapping + */ + public Map> getMethods() { + return commands; + } + + /** + * Get a map from command name to help message. This is only for root commands. + * + * @return a map of help messages for each command + */ + public Map getHelpMessages() { + return helpMessages; + } + + /** + * Get the usage string for a command. + * + * @param args the arguments + * @param level the depth of the command + * @param cmd the command annotation + * @return the usage string + */ + protected String getUsage(String[] args, int level, Command cmd) { + final StringBuilder command = new StringBuilder(); + + command.append('/'); + + for (int i = 0; i <= level; ++i) { + command.append(args[i]); + command.append(' '); + } + command.append(getArguments(cmd)); + + final String help = cmd.help(); + if (!help.isEmpty()) { + command.append("\n\n"); + command.append(help); + } + + return command.toString(); + } + + protected CharSequence getArguments(Command cmd) { + final String flags = cmd.flags(); + + final StringBuilder command2 = new StringBuilder(); + if (!flags.isEmpty()) { + String flagString = flags.replaceAll(".:", ""); + if (!flagString.isEmpty()) { + command2.append("[-"); + for (int i = 0; i < flagString.length(); ++i) { + command2.append(flagString.charAt(i)); + } + command2.append("] "); + } + } + + command2.append(cmd.usage()); + + return command2; + } + + /** + * Get the usage string for a nested command. + * + * @param args the arguments + * @param level the depth of the command + * @param method the parent method + * @param player the player + * @return the usage string + * @throws CommandException on some error + */ + protected String getNestedUsage(String[] args, int level, Method method, T player) throws CommandException { + StringBuilder command = new StringBuilder(); + + command.append("/"); + + for (int i = 0; i <= level; ++i) { + command.append(args[i]).append(" "); + } + + Map map = commands.get(method); + boolean found = false; + + command.append("<"); + + Set allowedCommands = new HashSet<>(); + + for (Map.Entry entry : map.entrySet()) { + Method childMethod = entry.getValue(); + found = true; + + if (hasPermission(childMethod, player)) { + Command childCmd = childMethod.getAnnotation(Command.class); + + allowedCommands.add(childCmd.aliases()[0]); + } + } + + if (!allowedCommands.isEmpty()) { + command.append(StringUtil.joinString(allowedCommands, "|", 0)); + } else { + if (!found) { + command.append("?"); + } else { + //command.append("action"); + throw new CommandPermissionsException(); + } + } + + command.append(">"); + + return command.toString(); + } + + /** + * Attempt to execute a command. This version takes a separate command + * name (for the root command) and then a list of following arguments. + * + * @param cmd command to run + * @param args arguments + * @param player command source + * @param methodArgs method arguments + * @throws CommandException thrown when the command throws an error + */ + public void execute(String cmd, String[] args, T player, Object... methodArgs) throws CommandException { + + String[] newArgs = new String[args.length + 1]; + System.arraycopy(args, 0, newArgs, 1, args.length); + newArgs[0] = cmd; + Object[] newMethodArgs = new Object[methodArgs.length + 1]; + System.arraycopy(methodArgs, 0, newMethodArgs, 1, methodArgs.length); + + executeMethod(null, newArgs, player, newMethodArgs, 0); + } + + /** + * Attempt to execute a command. + * + * @param args the arguments + * @param player the player + * @param methodArgs the arguments for the method + * @throws CommandException thrown on command error + */ + public void execute(String[] args, T player, Object... methodArgs) throws CommandException { + Object[] newMethodArgs = new Object[methodArgs.length + 1]; + System.arraycopy(methodArgs, 0, newMethodArgs, 1, methodArgs.length); + executeMethod(null, args, player, newMethodArgs, 0); + } + + /** + * Attempt to execute a command. + * + * @param parent the parent method + * @param args an array of arguments + * @param player the player + * @param methodArgs the array of method arguments + * @param level the depth of the command + * @throws CommandException thrown on a command error + */ + public void executeMethod(Method parent, String[] args, T player, Object[] methodArgs, int level) throws CommandException { + String cmdName = args[level]; + + Map map = commands.get(parent); + Method method = map.get(cmdName.toLowerCase()); + + if (method == null) { + if (parent == null) { // Root + throw new UnhandledCommandException(); + } else { + throw new MissingNestedCommandException("Unknown command: " + cmdName, + getNestedUsage(args, level - 1, parent, player)); + } + } + + checkPermission(player, method); + + int argsCount = args.length - 1 - level; + + // checks if we need to execute the body of the nested command method (false) + // or display the help what commands are available (true) + // this is all for an args count of 0 if it is > 0 and a NestedCommand Annotation is present + // it will always handle the methods that NestedCommand points to + // e.g.: + // - /cmd - @NestedCommand(executeBody = true) will go into the else loop and execute code in that method + // - /cmd - @NestedCommand(executeBody = true) will always go to the nested command class + // - /cmd - @NestedCommand(executeBody = false) will always go to the nested command class not matter the args + boolean executeNested = method.isAnnotationPresent(NestedCommand.class) + && (argsCount > 0 || !method.getAnnotation(NestedCommand.class).executeBody()); + + if (executeNested) { + if (argsCount == 0) { + throw new MissingNestedCommandException("Sub-command required.", + getNestedUsage(args, level, method, player)); + } else { + executeMethod(method, args, player, methodArgs, level + 1); + } + } else if (method.isAnnotationPresent(CommandAlias.class)) { + CommandAlias aCmd = method.getAnnotation(CommandAlias.class); + executeMethod(parent, aCmd.value(), player, methodArgs, level); + } else { + Command cmd = method.getAnnotation(Command.class); + + String[] newArgs = new String[args.length - level]; + System.arraycopy(args, level, newArgs, 0, args.length - level); + + final Set valueFlags = new HashSet<>(); + + char[] flags = cmd.flags().toCharArray(); + Set newFlags = new HashSet<>(); + for (int i = 0; i < flags.length; ++i) { + if (flags.length > i + 1 && flags[i + 1] == ':') { + valueFlags.add(flags[i]); + ++i; + } + newFlags.add(flags[i]); + } + + CommandContext context = new CommandContext(newArgs, valueFlags); + + if (context.argsLength() < cmd.min()) { + throw new CommandUsageException("Too few arguments.", getUsage(args, level, cmd)); + } + + if (cmd.max() != -1 && context.argsLength() > cmd.max()) { + throw new CommandUsageException("Too many arguments.", getUsage(args, level, cmd)); + } + + if (!cmd.anyFlags()) { + for (char flag : context.getFlags()) { + if (!newFlags.contains(flag)) { + throw new CommandUsageException("Unknown flag: " + flag, getUsage(args, level, cmd)); + } + } + } + + methodArgs[0] = context; + + Object instance = instances.get(method); + + invokeMethod(parent, args, player, method, instance, methodArgs, argsCount); + } + } + + protected void checkPermission(T player, Method method) throws CommandException { + if (!hasPermission(method, player)) { + throw new CommandPermissionsException(); + } + } + + public void invokeMethod(Method parent, String[] args, T player, Method method, Object instance, Object[] methodArgs, int level) throws CommandException { + try { + method.invoke(instance, methodArgs); + } catch (IllegalArgumentException | IllegalAccessException e) { + logger.error("Failed to execute command", e); + } catch (InvocationTargetException e) { + if (e.getCause() instanceof CommandException) { + throw (CommandException) e.getCause(); + } + + throw new WrappedCommandException(e.getCause()); + } + } + + /** + * Returns whether a player has access to a command. + * + * @param method the method + * @param player the player + * @return true if permission is granted + */ + protected boolean hasPermission(Method method, T player) { + CommandPermissions perms = method.getAnnotation(CommandPermissions.class); + if (perms == null) { + return true; + } + + for (String perm : perms.value()) { + if (hasPermission(player, perm)) { + return true; + } + } + + return false; + } + + /** + * Returns whether a player permission.. + * + * @param player the player + * @param permission the permission + * @return true if permission is granted + */ + public abstract boolean hasPermission(T player, String permission); + + /** + * Get the injector used to create new instances. This can be + * null, in which case only classes will be registered statically. + * + * @return an injector instance + */ + public Injector getInjector() { + return injector; + } + + /** + * Set the injector for creating new instances. + * + * @param injector injector or null + */ + public void setInjector(Injector injector) { + this.injector = injector; + } +} diff --git a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/SimpleInjector.java b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/SimpleInjector.java index eb6097512..652c69a5d 100644 --- a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/SimpleInjector.java +++ b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/SimpleInjector.java @@ -19,14 +19,15 @@ package com.sk89q.minecraft.util.commands; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; -import java.util.logging.Level; -import java.util.logging.Logger; public class SimpleInjector implements Injector { - private static final Logger log = Logger.getLogger(SimpleInjector.class.getCanonicalName()); + private static final Logger log = LoggerFactory.getLogger(SimpleInjector.class); private Object[] args; private Class[] argClasses; @@ -45,7 +46,7 @@ public class SimpleInjector implements Injector { ctr.setAccessible(true); return ctr.newInstance(args); } catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) { - log.log(Level.SEVERE, "Error initializing commands class " + clazz, e); + log.error("Error initializing commands class " + clazz, e); return null; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index 452fbe70d..bc6ed024a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -95,6 +95,8 @@ import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.biome.BaseBiome; import com.sk89q.worldedit.world.block.*; import com.sk89q.worldedit.world.weather.WeatherType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -108,12 +110,15 @@ import static com.sk89q.worldedit.regions.Regions.*; /** * An {@link Extent} that handles history, {@link BlockBag}s, change limits, * block re-ordering, and much more. Most operations in WorldEdit use this class. - *

+ * *

Most of the actual functionality is implemented with a number of other * {@link Extent}s that are chained together. For example, history is logged * using the {@link ChangeSetExtent}.

*/ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, SimpleWorld, AutoCloseable { + + private static final Logger log = LoggerFactory.getLogger(EditSession.class); + /** * Used by {@link EditSession#setBlock(BlockVector3, BlockStateHolder, Stage)} to * determine which {@link Extent}s should be bypassed. @@ -2901,8 +2906,8 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, } return BlockTypes.get((int) typeVariable.getValue()).withPropertyId((int) dataVariable.getValue()).toBaseBlock(); - } catch (final Exception e) { - Fawe.debug("Failed to create shape: " + e); + } catch (Exception e) { + log.warn("Failed to create shape", e); return null; } } @@ -3299,8 +3304,8 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, } return defaultBiomeType; - } catch (final Exception e) { - Fawe.debug("Failed to create shape: " + e); + } catch (Exception e) { + log.warn("Failed to create shape", e); return null; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java index a4cefa188..8b342d316 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java @@ -81,7 +81,6 @@ import static com.google.common.base.Preconditions.checkNotNull; */ public class LocalSession implements TextureHolder { - @Deprecated public transient static int MAX_HISTORY_SIZE = 15; // Non-session related fields @@ -1260,7 +1259,7 @@ public class LocalSession implements TextureHolder { String msg = e.getMessage(); if (msg != null && msg.length() > 256) msg = msg.substring(0, 256); this.failedCuiAttempts++; - WorldEdit.logger.warning("Error while reading CUI init message for player " + uuid + ": " + msg); + WorldEdit.logger.warn("Error while reading CUI init message: " + e.getMessage()); } } @@ -1442,4 +1441,4 @@ public class LocalSession implements TextureHolder { } -} \ No newline at end of file +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java index 3ec352d07..624aae973 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java @@ -61,6 +61,8 @@ import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.registry.BundledBlockData; import com.sk89q.worldedit.world.registry.BundledItemData; import com.sk89q.worldedit.world.registry.LegacyMapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.annotation.Nullable; import javax.script.ScriptException; @@ -76,8 +78,6 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; import static com.sk89q.worldedit.event.platform.Interaction.HIT; import static com.sk89q.worldedit.event.platform.Interaction.OPEN; @@ -97,9 +97,9 @@ import static com.sk89q.worldedit.event.platform.Interaction.OPEN; */ public final class WorldEdit { - public static final Logger logger = Logger.getLogger(WorldEdit.class.getCanonicalName()); + public static final Logger logger = LoggerFactory.getLogger(WorldEdit.class); - private final static WorldEdit instance = new WorldEdit(); + private static final WorldEdit instance = new WorldEdit(); private static String version; private final EventBus eventBus = new EventBus(); @@ -670,13 +670,13 @@ public final class WorldEdit { } catch (ScriptException e) { player.printError("Failed to execute:"); player.printRaw(e.getMessage()); - logger.log(Level.WARNING, "Failed to execute script", e); + logger.warn("Failed to execute script", e); } catch (NumberFormatException | WorldEditException e) { throw e; } catch (Throwable e) { player.printError("Failed to execute (see console):"); player.printRaw(e.getClass().getCanonicalName()); - logger.log(Level.WARNING, "Failed to execute script", e); + logger.warn("Failed to execute script", e); } finally { for (EditSession editSession : scriptContext.getEditSessions()) { editSession.flushQueue(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ChunkCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ChunkCommands.java index 542aef756..0d5646ca1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ChunkCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ChunkCommands.java @@ -35,6 +35,7 @@ import com.sk89q.worldedit.math.MathUtils; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.storage.LegacyChunkStore; import com.sk89q.worldedit.world.storage.McRegionChunkStore; + import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; @@ -184,4 +185,5 @@ public class ChunkCommands { player.printError(BBC.getPrefix() + "Shell script type must be configured: 'bat' or 'bash' expected."); } } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/NavigationCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/NavigationCommands.java index af2d20284..dac5d5371 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/NavigationCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/NavigationCommands.java @@ -19,6 +19,9 @@ package com.sk89q.worldedit.command; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.POSITION; + import com.boydti.fawe.FaweAPI; import com.boydti.fawe.config.BBC; import com.boydti.fawe.util.MathMan; @@ -35,10 +38,6 @@ import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.command.parametric.Optional; import com.sk89q.worldedit.world.World; - -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.minecraft.util.commands.Logging.LogMode.POSITION; - /** * Commands for moving the player around. */ @@ -58,11 +57,11 @@ public class NavigationCommands { } @Command( - aliases = {"unstuck", "!"}, - usage = "", - desc = "Escape from being stuck inside a block", - min = 0, - max = 0 + aliases = { "unstuck", "!" }, + usage = "", + desc = "Escape from being stuck inside a block", + min = 0, + max = 0 ) @CommandPermissions("worldedit.navigation.unstuck") public void unstuck(Player player) throws WorldEditException { @@ -234,4 +233,4 @@ public class NavigationCommands { } -} \ No newline at end of file +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java index 2ce053148..6917c7949 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java @@ -48,15 +48,18 @@ import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.extent.clipboard.io.BuiltInClipboardFormat; import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat; import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats; +import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader; import com.sk89q.worldedit.extent.clipboard.io.ClipboardWriter; import com.sk89q.worldedit.function.operation.Operations; import com.sk89q.worldedit.math.transform.Transform; import com.sk89q.worldedit.session.ClipboardHolder; import com.sk89q.worldedit.util.command.binding.Switch; import com.sk89q.worldedit.util.command.parametric.Optional; +import com.sk89q.worldedit.util.io.Closer; import com.sk89q.worldedit.util.io.file.FilenameException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; -import javax.annotation.Nullable; import java.io.*; import java.net.URI; import java.net.URISyntaxException; @@ -66,12 +69,10 @@ import java.nio.channels.ReadableByteChannel; import java.nio.file.Files; import java.util.*; import java.util.concurrent.atomic.LongAdder; -import java.util.logging.Level; -import java.util.logging.Logger; import java.util.regex.Pattern; - import static com.boydti.fawe.util.ReflectionUtils.as; +import static com.google.common.base.Preconditions.checkNotNull; /** * Commands that work with schematic files. @@ -79,7 +80,7 @@ import static com.boydti.fawe.util.ReflectionUtils.as; @Command(aliases = {"schematic", "schem", "/schematic", "/schem", "clipboard", "/clipboard"}, desc = "Commands that work with schematic files") public class SchematicCommands extends MethodCommands { - private static final Logger log = Logger.getLogger(SchematicCommands.class.getCanonicalName()); + private static final Logger log = LoggerFactory.getLogger(SchematicCommands.class); /** * Create a new instance. @@ -266,7 +267,7 @@ public class SchematicCommands extends MethodCommands { player.printError("Unknown filename: " + filename); } catch (URISyntaxException | IOException e) { player.printError("File could not be read or it does not exist: " + e.getMessage()); - log.log(Level.WARNING, "Failed to load a saved clipboard", e); + log.warn("Failed to load a saved clipboard", e); } finally { if (in != null) { try { @@ -363,7 +364,7 @@ public class SchematicCommands extends MethodCommands { } catch (IOException e) { e.printStackTrace(); player.printError("Schematic could not written: " + e.getMessage()); - log.log(Level.WARNING, "Failed to write a saved clipboard", e); + log.warn("Failed to write a saved clipboard", e); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotCommands.java index 0a433ac82..c5f019ddc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotCommands.java @@ -33,13 +33,13 @@ import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.world.snapshot.InvalidSnapshotException; import com.sk89q.worldedit.world.snapshot.Snapshot; import com.sk89q.worldedit.world.storage.MissingWorldException; + import java.io.File; import java.io.IOException; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.List; -import java.util.logging.Logger; /** * Snapshot commands. @@ -47,7 +47,6 @@ import java.util.logging.Logger; @Command(aliases = {"snapshot", "snap"}, desc = "List, load and view information related to snapshots") public class SnapshotCommands { - private static final Logger logger = Logger.getLogger("Minecraft.WorldEdit"); private static final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z"); private final WorldEdit we; @@ -93,10 +92,10 @@ public class SnapshotCommands { File dir = config.snapshotRepo.getDirectory(); try { - logger.info("WorldEdit found no snapshots: looked in: " + WorldEdit.logger.info("WorldEdit found no snapshots: looked in: " + dir.getCanonicalPath()); } catch (IOException e) { - logger.info("WorldEdit found no snapshots: looked in " + WorldEdit.logger.info("WorldEdit found no snapshots: looked in " + "(NON-RESOLVABLE PATH - does it exist?): " + dir.getPath()); } @@ -107,7 +106,7 @@ public class SnapshotCommands { } @Command( - aliases = {"use"}, + aliases = { "use" }, usage = "", desc = "Choose a snapshot to use", min = 1, @@ -150,7 +149,7 @@ public class SnapshotCommands { } @Command( - aliases = {"sel"}, + aliases = { "sel" }, usage = "", desc = "Choose the snapshot based on the list id", min = 1, @@ -197,7 +196,7 @@ public class SnapshotCommands { } @Command( - aliases = {"before"}, + aliases = { "before" }, usage = "", desc = "Choose the nearest snapshot before a date", min = 1, @@ -236,7 +235,7 @@ public class SnapshotCommands { } @Command( - aliases = {"after"}, + aliases = { "after" }, usage = "", desc = "Choose the nearest snapshot after a date", min = 1, @@ -261,7 +260,8 @@ public class SnapshotCommands { Snapshot snapshot = config.snapshotRepo.getSnapshotAfter(date, player.getWorld().getName()); if (snapshot == null) { dateFormat.setTimeZone(session.getTimeZone()); - player.printError("Couldn't find a snapshot after " + dateFormat.format(date.getTime()) + "."); + player.printError("Couldn't find a snapshot after " + + dateFormat.format(date.getTime()) + "."); } else { session.setSnapshot(snapshot); BBC.SNAPSHOT_SET.send(player, snapshot.getName()); @@ -271,4 +271,5 @@ public class SnapshotCommands { } } } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotUtilCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotUtilCommands.java index 53df86c15..5c86654f1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotUtilCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotUtilCommands.java @@ -37,18 +37,15 @@ import com.sk89q.worldedit.world.snapshot.Snapshot; import com.sk89q.worldedit.world.snapshot.SnapshotRestore; import com.sk89q.worldedit.world.storage.ChunkStore; import com.sk89q.worldedit.world.storage.MissingWorldException; + import java.io.File; import java.io.IOException; -import java.util.logging.Logger; - import static com.sk89q.minecraft.util.commands.Logging.LogMode.REGION; @Command(aliases = {}, desc = "[More Info](http://wiki.sk89q.com/wiki/WorldEdit/Snapshots)") public class SnapshotUtilCommands { - private static final Logger logger = Logger.getLogger("Minecraft.WorldEdit"); - private final WorldEdit we; public SnapshotUtilCommands(WorldEdit we) { @@ -56,7 +53,7 @@ public class SnapshotUtilCommands { } @Command( - aliases = {"restore", "/restore"}, + aliases = { "restore", "/restore" }, usage = "[snapshot]", desc = "Restore the selection from a snapshot", min = 0, @@ -99,10 +96,10 @@ public class SnapshotUtilCommands { File dir = config.snapshotRepo.getDirectory(); try { - logger.info("FAWE found no snapshots: looked in: " + WorldEdit.logger.info("WorldEdit found no snapshots: looked in: " + dir.getCanonicalPath()); } catch (IOException e) { - logger.info("FAWE found no snapshots: looked in " + WorldEdit.logger.info("WorldEdit found no snapshots: looked in " + "(NON-RESOLVABLE PATH - does it exist?): " + dir.getPath()); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/SelectionCommand.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/SelectionCommand.java index 645d1f232..59ce8e448 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/SelectionCommand.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/SelectionCommand.java @@ -81,20 +81,25 @@ public class SelectionCommand extends SimpleCommand { if (!testPermission(locals)) { throw new CommandPermissionsException(); } + Contextual operationFactory = delegate.call(args, locals); + Actor actor = locals.get(Actor.class); if (actor instanceof Player) { try { Player player = (Player) actor; LocalSession session = WorldEdit.getInstance().getSessionManager().get(player); Region selection = session.getSelection(player.getWorld()); + EditSession editSession = session.createEditSession(player); editSession.enableQueue(); locals.put(EditSession.class, editSession); session.tellVersion(player); + EditContext editContext = new EditContext(); editContext.setDestination(locals.get(EditSession.class)); editContext.setRegion(selection); + Operation operation = operationFactory.createFromContext(editContext); // Shortcut if (selection instanceof CuboidRegion && editSession.hasFastMode() && operation instanceof RegionVisitor) { @@ -191,4 +196,4 @@ public class SelectionCommand extends SimpleCommand { -} \ No newline at end of file +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java index 004dc5bb2..bf6994c11 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java @@ -19,11 +19,6 @@ package com.sk89q.worldedit.command.tool; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - import com.google.common.collect.Lists; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; @@ -38,6 +33,11 @@ import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BlockState; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + /** * A mode that cycles the data values of supported blocks. */ @@ -47,7 +47,7 @@ public class BlockDataCyler implements DoubleActionBlockTool { public boolean canUse(Actor player) { return player.hasPermission("worldedit.tool.data-cycler"); } - + private Map> selectedProperties = new HashMap<>(); private boolean handleCycle(Platform server, LocalConfiguration config, @@ -104,7 +104,8 @@ public class BlockDataCyler implements DoubleActionBlockTool { player.print("Now cycling " + currentProperty.getName()); } } - return true; + + return true; } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java index 0a7b63e6c..14cee6fe2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java @@ -19,16 +19,20 @@ package com.sk89q.worldedit.command.tool; -import com.sk89q.worldedit.function.pattern.Pattern; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extent.inventory.BlockBag; +import com.sk89q.worldedit.function.pattern.BlockPattern; +import com.sk89q.worldedit.function.pattern.Pattern; +import com.sk89q.worldedit.math.BlockVector3; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockType; /** * A mode that replaces one block. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TreePlanter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TreePlanter.java index 41353b0ad..e472f728b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TreePlanter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TreePlanter.java @@ -49,24 +49,24 @@ public class TreePlanter implements BlockTool { public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked) { EditSession editSession = session.createEditSession(player); + try { + boolean successful = false; - try { - boolean successful = false; for (int i = 0; i < 10; i++) { if (treeType.generate(editSession, clicked.add(0, 1, 0).toBlockPoint())) { successful = true; break; } } - - if (!successful) { - player.printError("A tree can't go there."); + + if (!successful) { + player.printError("A tree can't go there."); + } + } catch (MaxChangedBlocksException e) { + player.printError("Max. blocks changed reached."); + } finally { + session.remember(editSession); } - } catch (MaxChangedBlocksException e) { - player.printError("Max. blocks changed reached."); - } finally { - session.remember(editSession); - } return true; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java index cfebeaf17..12a663ed3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java @@ -21,10 +21,10 @@ package com.sk89q.worldedit.command.tool.brush; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; -import com.sk89q.worldedit.math.BlockVector3; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; +import com.sk89q.worldedit.math.BlockVector3; +import com.sk89q.worldedit.world.block.BlockTypes; public class CylinderBrush implements Brush { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java index 54247c107..dbf959e1b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java @@ -21,9 +21,9 @@ package com.sk89q.worldedit.command.tool.brush; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; -import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; +import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BlockTypes; public class HollowCylinderBrush implements Brush { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java index 9763a621a..0e89b3c16 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java @@ -21,9 +21,9 @@ package com.sk89q.worldedit.command.tool.brush; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; -import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; +import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BlockTypes; public class HollowSphereBrush implements Brush { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java index 7c38382de..d8028f2ae 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java @@ -21,9 +21,9 @@ package com.sk89q.worldedit.command.tool.brush; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; -import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; +import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BlockTypes; public class SphereBrush implements Brush { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java index 8ecbef23c..eeeb97f06 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java @@ -58,8 +58,13 @@ import com.sk89q.worldedit.util.command.fluent.CommandGraph; import com.sk89q.worldedit.util.command.fluent.DispatcherNode; import com.sk89q.worldedit.util.command.parametric.*; import com.sk89q.worldedit.util.eventbus.Subscribe; +import com.sk89q.worldedit.util.formatting.ColorCodeBuilder; +import com.sk89q.worldedit.util.formatting.component.CommandUsageBox; import com.sk89q.worldedit.util.logging.DynamicStreamHandler; import com.sk89q.worldedit.util.logging.LogFormat; +import com.sk89q.worldedit.world.World; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.annotation.Nullable; import java.io.File; @@ -69,10 +74,8 @@ import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; -import java.util.function.Supplier; import java.util.logging.FileHandler; import java.util.logging.Level; -import java.util.logging.Logger; import java.util.regex.Pattern; import static com.google.common.base.Preconditions.checkNotNull; @@ -80,14 +83,15 @@ import static com.sk89q.worldedit.util.command.composition.LegacyCommandAdapter. /** * Handles the registration and invocation of commands. - *

+ * *

This class is primarily for internal usage.

*/ public final class CommandManager { public static final Pattern COMMAND_CLEAN_PATTERN = Pattern.compile("^[/]+"); - private static final Logger log = Logger.getLogger(CommandManager.class.getCanonicalName()); - private static final Logger commandLog = Logger.getLogger(CommandManager.class.getCanonicalName() + ".CommandLog"); + private static final Logger log = LoggerFactory.getLogger(CommandManager.class); + private static final java.util.logging.Logger commandLog = + java.util.logging.Logger.getLogger(CommandManager.class.getCanonicalName() + ".CommandLog"); private static final Pattern numberFormatExceptionPattern = Pattern.compile("^For input string: \"(.*)\"$"); private final WorldEdit worldEdit; @@ -124,6 +128,7 @@ public final class CommandManager { commandLog.addHandler(dynamicHandler); dynamicHandler.setFormatter(new LogFormat()); + // Set up the commands manager builder = new ParametricBuilder(); builder.setAuthorizer(new ActorAuthorizer()); builder.setDefaultCompleter(new UserCommandCompleter(platformManager)); @@ -297,7 +302,7 @@ public final class CommandManager { } public void register(Platform platform) { - log.log(Level.FINE, "Registering commands with " + platform.getClass().getCanonicalName()); + log.info("Registering commands with " + platform.getClass().getCanonicalName()); this.platform = null; try { @@ -318,12 +323,12 @@ public final class CommandManager { File file = new File(config.getWorkingDirectory(), path); commandLog.setLevel(Level.ALL); - log.log(Level.INFO, "Logging WorldEdit commands to " + file.getAbsolutePath()); + log.info("Logging WorldEdit commands to " + file.getAbsolutePath()); try { dynamicHandler.setHandler(new FileHandler(file.getAbsolutePath(), true)); } catch (IOException e) { - log.log(Level.WARNING, "Could not use command log file " + path + ": " + e.getMessage()); + log.warn("Could not use command log file " + path + ": " + e.getMessage()); } } @@ -418,7 +423,8 @@ public final class CommandManager { return handleCommandTask(task, locals, null, null, null, null); } - private Object handleCommandTask(ThrowableSupplier task, CommandLocals locals, @Nullable Actor actor, @Nullable LocalSession session, @Nullable Set failedPermissions, @Nullable FawePlayer fp) { + private Object handleCommandTask(ThrowableSupplier task, CommandLocals locals, @Nullable + Actor actor, @Nullable LocalSession session, @Nullable Set failedPermissions, @Nullable FawePlayer fp) { Request.reset(); if (actor == null) actor = locals.get(Actor.class); if (session == null) session = locals.get(LocalSession.class); @@ -474,8 +480,8 @@ public final class CommandManager { if (message != null) { actor.printError(BBC.getPrefix() + e.getMessage()); } else { - actor.printError(BBC.getPrefix() + "An unknown FAWE error has occurred! Please see console."); - log.log(Level.SEVERE, "An unknown FAWE error occurred", e); + actor.printError("An unknown error has occurred! Please see console."); + log.error("An unknown error occurred", e); } } catch (Throwable e) { Exception faweException = FaweException.get(e); @@ -485,7 +491,7 @@ public final class CommandManager { } else { actor.printError(BBC.getPrefix() + "There was an error handling a FAWE command: [See console]"); actor.printRaw(e.getClass().getName() + ": " + e.getMessage()); - log.log(Level.SEVERE, "An unexpected error occurred while handling a FAWE command", e); + log.error("An unexpected error occurred while handling a FAWE command", e); } } finally { final EditSession editSession = locals.get(EditSession.class); @@ -552,7 +558,7 @@ public final class CommandManager { return dispatcher; } - public static Logger getLogger() { + public static java.util.logging.Logger getLogger() { return commandLog; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java index 38f4654cd..94caacaca 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java @@ -49,25 +49,25 @@ import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.eventbus.Subscribe; import com.sk89q.worldedit.world.World; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.annotation.Nullable; import java.util.*; import java.util.Map.Entry; import java.util.concurrent.atomic.AtomicBoolean; -import java.util.logging.Level; -import java.util.logging.Logger; import static com.google.common.base.Preconditions.checkNotNull; /** * Manages registered {@link Platform}s for WorldEdit. Platforms are * implementations of WorldEdit. - *

+ * *

This class is thread-safe.

*/ public class PlatformManager { - private static final Logger logger = Logger.getLogger(PlatformManager.class.getCanonicalName()); + private static final Logger logger = LoggerFactory.getLogger(PlatformManager.class); private final WorldEdit worldEdit; private final CommandManager commandManager; @@ -99,7 +99,7 @@ public class PlatformManager { public synchronized void register(Platform platform) { checkNotNull(platform); - logger.log(Level.FINE, "Got request to register " + platform.getClass() + " with WorldEdit [" + super.toString() + "]"); + logger.info("Got request to register " + platform.getClass() + " with WorldEdit [" + super.toString() + "]"); // Just add the platform to the list of platforms: we'll pick favorites // once all the platforms have been loaded @@ -108,9 +108,9 @@ public class PlatformManager { // Make sure that versions are in sync if (firstSeenVersion != null) { if (!firstSeenVersion.equals(platform.getVersion())) { - logger.log(Level.WARNING, "Multiple ports of WorldEdit are installed but they report different versions ({0} and {1}). " + + logger.warn("Multiple ports of WorldEdit are installed but they report different versions ({0} and {1}). " + "If these two versions are truly different, then you may run into unexpected crashes and errors.", - new Object[]{firstSeenVersion, platform.getVersion()}); + new Object[]{ firstSeenVersion, platform.getVersion() }); } } else { firstSeenVersion = platform.getVersion(); @@ -119,7 +119,7 @@ public class PlatformManager { /** * Unregister a platform from WorldEdit. - *

+ * *

If the platform has been chosen for any capabilities, then a new * platform will be found.

* @@ -131,7 +131,7 @@ public class PlatformManager { boolean removed = platforms.remove(platform); if (removed) { - logger.log(Level.FINE, "Unregistering " + platform.getClass().getCanonicalName() + " from WorldEdit"); + logger.info("Unregistering " + platform.getClass().getCanonicalName() + " from WorldEdit"); boolean choosePreferred = false; @@ -222,7 +222,7 @@ public class PlatformManager { /** * Get a list of loaded platforms. - *

+ * *

The returned list is a copy of the original and is mutable.

* * @return a list of platforms @@ -497,7 +497,7 @@ public class PlatformManager { return; } - final Tool tool = session.getTool(player); + Tool tool = session.getTool(player); if (tool != null && tool instanceof DoubleActionTraceTool) { if (tool.canUse(player)) { FawePlayer fp = FawePlayer.wrap(player); @@ -532,7 +532,7 @@ public class PlatformManager { return; } - final Tool tool = session.getTool(player); + Tool tool = session.getTool(player); if (tool != null && tool instanceof TraceTool) { if (tool.canUse(player)) { FawePlayer fp = FawePlayer.wrap(player); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormats.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormats.java index e2598b3f8..86961910a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormats.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormats.java @@ -74,7 +74,7 @@ public class ClipboardFormats { ClipboardFormat old = aliasMap.put(lowKey, format); if (old != null) { aliasMap.put(lowKey, old); - WorldEdit.logger.warning(format.getClass().getName() + " cannot override existing alias '" + lowKey + "' used by " + old.getClass().getName()); + WorldEdit.logger.warn(format.getClass().getName() + " cannot override existing alias '" + lowKey + "' used by " + old.getClass().getName()); } } for (String ext : format.getFileExtensions()) { @@ -311,4 +311,4 @@ public class ClipboardFormats { throw new RuntimeException(e); } } -} \ No newline at end of file +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/MCEditSchematicReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/MCEditSchematicReader.java index 94b67a3db..056bb69ac 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/MCEditSchematicReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/MCEditSchematicReader.java @@ -46,6 +46,8 @@ import com.sk89q.worldedit.world.entity.EntityType; import com.sk89q.worldedit.world.entity.EntityTypes; import com.sk89q.worldedit.world.registry.LegacyMapper; import com.sk89q.worldedit.world.storage.NBTConversions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.IOException; import java.util.ArrayList; @@ -53,7 +55,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.logging.Level; -import java.util.logging.Logger; /** * Reads schematic files that are compatible with MCEdit and other editors. @@ -67,7 +68,7 @@ public class MCEditSchematicReader extends NBTSchematicReader { // TODO Add a handler for skulls, flower pots, note blocks, etc. } - private static final Logger log = Logger.getLogger(MCEditSchematicReader.class.getCanonicalName()); + private static final Logger log = LoggerFactory.getLogger(MCEditSchematicReader.class); private final NBTInputStream inputStream; /** @@ -231,15 +232,15 @@ public class MCEditSchematicReader extends NBTSchematicReader { clipboard.setBlock(region.getMinimumPoint().add(pt), state); } } else { - log.warning("Unknown block when pasting schematic: " + blocks[index] + ":" + blockData[index] + ". Please report this issue."); + log.warn("Unknown block when pasting schematic: " + blocks[index] + ":" + blockData[index] + ". Please report this issue."); } } catch (WorldEditException e) { switch (failedBlockSets) { case 0: - log.log(Level.WARNING, "Failed to set block on a Clipboard", e); + log.warn("Failed to set block on a Clipboard", e); break; case 1: - log.log(Level.WARNING, "Failed to set block on a Clipboard (again) -- no more messages will be logged", e); + log.warn("Failed to set block on a Clipboard (again) -- no more messages will be logged", e); break; default: } @@ -269,7 +270,7 @@ public class MCEditSchematicReader extends NBTSchematicReader { BaseEntity state = new BaseEntity(entityType, compound); clipboard.createEntity(location, state); } else { - log.warning("Unknown entity when pasting schematic: " + id.toLowerCase()); + log.warn("Unknown entity when pasting schematic: " + id.toLowerCase()); } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java index 489ce802f..e4ac175f9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicReader.java @@ -26,11 +26,13 @@ import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.NBTInputStream; import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.extent.clipboard.Clipboard; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.IOException; import java.io.InputStream; import java.util.Map; import java.util.UUID; -import java.util.logging.Logger; import javax.annotation.Nullable; @@ -41,7 +43,6 @@ import static com.google.common.base.Preconditions.checkNotNull; */ public class SchematicReader implements ClipboardReader { - private static final Logger log = Logger.getLogger(SchematicReader.class.getCanonicalName()); private NBTInputStream inputStream; private InputStream rootStream; @@ -109,4 +110,4 @@ public class SchematicReader implements ClipboardReader { public void close() throws IOException { inputStream.close(); } -} \ No newline at end of file +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicReader.java index a7661ed9b..915eb0f9a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicReader.java @@ -60,6 +60,8 @@ import com.sk89q.worldedit.world.entity.EntityType; import com.sk89q.worldedit.world.entity.EntityTypes; import net.jpountz.lz4.LZ4BlockInputStream; import net.jpountz.lz4.LZ4BlockOutputStream; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.DataInputStream; import java.io.IOException; @@ -70,7 +72,6 @@ import java.util.List; import java.util.Map; import java.util.UUID; import java.util.function.BiConsumer; -import java.util.logging.Logger; import java.util.stream.Collectors; import static com.google.common.base.Preconditions.checkNotNull; @@ -86,7 +87,7 @@ public class SpongeSchematicReader extends NBTSchematicReader { // If NBT Compat handlers are needed - add them here. } - private static final Logger log = Logger.getLogger(SpongeSchematicReader.class.getCanonicalName()); + private static final Logger log = LoggerFactory.getLogger(SpongeSchematicReader.class); private final NBTInputStream inputStream; /** @@ -257,4 +258,4 @@ public class SpongeSchematicReader extends NBTSchematicReader { public void close() throws IOException { inputStream.close(); } -} \ No newline at end of file +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/CommandLoggingHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/CommandLoggingHandler.java index 256f891ec..1fb2dd55d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/CommandLoggingHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/CommandLoggingHandler.java @@ -40,6 +40,8 @@ import java.lang.reflect.Method; import java.util.logging.Handler; import java.util.logging.Logger; +import static com.google.common.base.Preconditions.checkNotNull; + /** * Logs called commands to a logger. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/ReparametrisingInterpolation.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/ReparametrisingInterpolation.java index 29a3ee5ee..23680f2bc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/ReparametrisingInterpolation.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/ReparametrisingInterpolation.java @@ -21,14 +21,15 @@ package com.sk89q.worldedit.math.interpolation; -import static com.google.common.base.Preconditions.checkNotNull; - import com.sk89q.worldedit.math.Vector3; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.List; import java.util.Map.Entry; import java.util.TreeMap; -import java.util.logging.Logger; + +import static com.google.common.base.Preconditions.checkNotNull; /** * Reparametrises another interpolation function by arc length. @@ -38,7 +39,7 @@ import java.util.logging.Logger; */ public class ReparametrisingInterpolation implements Interpolation { - private static final Logger log = Logger.getLogger(ReparametrisingInterpolation.class.getCanonicalName()); + private static final Logger log = LoggerFactory.getLogger(ReparametrisingInterpolation.class); private final Interpolation baseInterpolation; private double totalArcLength; @@ -102,7 +103,7 @@ public class ReparametrisingInterpolation implements Interpolation { Entry ceilingEntry = cache.ceilingEntry(arc); if (ceilingEntry == null) { - log.warning("Error in arcToParameter: no ceiling entry for " + arc + " found!"); + log.warn("Error in arcToParameter: no ceiling entry for " + arc + " found!"); return 0; } final double rightArc = ceilingEntry.getKey(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java index 5339db01d..2cd2fd352 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/session/SessionManager.java @@ -27,13 +27,17 @@ import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.event.platform.ConfigurationLoadEvent; +import com.sk89q.worldedit.session.request.Request; import com.sk89q.worldedit.session.storage.JsonFileSessionStore; import com.sk89q.worldedit.session.storage.SessionStore; import com.sk89q.worldedit.session.storage.VoidStore; import com.sk89q.worldedit.util.concurrency.EvenMoreExecutors; import com.sk89q.worldedit.util.eventbus.Subscribe; import com.sk89q.worldedit.world.gamemode.GameModes; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import javax.annotation.Nullable; import java.io.File; import java.io.IOException; import java.lang.ref.Reference; @@ -41,29 +45,26 @@ import java.lang.ref.SoftReference; import java.util.Iterator; import java.util.Map; import java.util.Timer; +import java.util.TimerTask; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.annotation.Nullable; import static com.google.common.base.Preconditions.checkNotNull; /** * Session manager for WorldEdit. - *

+ * *

Get a reference to one from {@link WorldEdit}.

- *

+ * *

While this class is thread-safe, the returned session may not be.

*/ public class SessionManager { - @Deprecated public static int EXPIRATION_GRACE = 600000; private static final ListeningExecutorService executorService = MoreExecutors.listeningDecorator(EvenMoreExecutors.newBoundedCachedThreadPool(0, 1, 5)); - private static final Logger log = Logger.getLogger(SessionManager.class.getCanonicalName()); + private static final Logger log = LoggerFactory.getLogger(SessionManager.class); private final Timer timer = new Timer(); private final WorldEdit worldEdit; private final Map sessions = new ConcurrentHashMap<>(8, 0.9f, 1); @@ -179,8 +180,8 @@ public class SessionManager { try { session = store.load(getKey(sessionKey)); session.postLoad(); - } catch (Throwable e) { - log.log(Level.WARNING, "Failed to load saved session", e); + } catch (IOException e) { + log.warn("Failed to load saved session", e); session = new LocalSession(); } @@ -239,7 +240,7 @@ public class SessionManager { } } } catch (IOException e) { - log.log(Level.WARNING, "Failed to write session for UUID " + getKey(key), e); + log.warn("Failed to write session for UUID " + getKey(key), e); } } } @@ -328,4 +329,4 @@ public class SessionManager { -} \ No newline at end of file +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/session/storage/JsonFileSessionStore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/session/storage/JsonFileSessionStore.java index d7b2a9893..ad8e422bf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/session/storage/JsonFileSessionStore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/session/storage/JsonFileSessionStore.java @@ -19,8 +19,6 @@ package com.sk89q.worldedit.session.storage; -import static com.google.common.base.Preconditions.checkNotNull; - import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonIOException; @@ -28,6 +26,8 @@ import com.google.gson.JsonParseException; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.util.gson.GsonUtil; import com.sk89q.worldedit.util.io.Closer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.BufferedReader; import java.io.BufferedWriter; @@ -37,8 +37,8 @@ import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.UUID; -import java.util.logging.Level; -import java.util.logging.Logger; + +import static com.google.common.base.Preconditions.checkNotNull; /** * Stores sessions as JSON files in a directory. @@ -47,7 +47,7 @@ import java.util.logging.Logger; */ public class JsonFileSessionStore implements SessionStore { - private static final Logger log = Logger.getLogger(JsonFileSessionStore.class.getCanonicalName()); + private static final Logger log = LoggerFactory.getLogger(JsonFileSessionStore.class); private final Gson gson; private final File dir; @@ -61,7 +61,7 @@ public class JsonFileSessionStore implements SessionStore { if (!dir.isDirectory()) { if (!dir.mkdirs()) { - log.log(Level.WARNING, "Failed to create directory '" + dir.getPath() + "' for sessions"); + log.warn("Failed to create directory '" + dir.getPath() + "' for sessions"); } } @@ -111,12 +111,12 @@ public class JsonFileSessionStore implements SessionStore { if (finalFile.exists()) { if (!finalFile.delete()) { - log.log(Level.WARNING, "Failed to delete " + finalFile.getPath() + " so the .tmp file can replace it"); + log.warn("Failed to delete " + finalFile.getPath() + " so the .tmp file can replace it"); } } if (!tempFile.renameTo(finalFile)) { - log.log(Level.WARNING, "Failed to rename temporary session file to " + finalFile.getPath()); + log.warn("Failed to rename temporary session file to " + finalFile.getPath()); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/PropertiesConfiguration.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/PropertiesConfiguration.java index 18a8cc806..329dff154 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/PropertiesConfiguration.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/PropertiesConfiguration.java @@ -1,283 +1,284 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -// $Id$ - -package com.sk89q.worldedit.util; - -import com.google.common.collect.Lists; -import com.sk89q.util.StringUtil; -import com.sk89q.worldedit.LocalConfiguration; -import com.sk89q.worldedit.LocalSession; -import com.sk89q.worldedit.world.block.BlockTypes; -import com.sk89q.worldedit.world.item.ItemTypes; -import com.sk89q.worldedit.world.registry.LegacyMapper; -import com.sk89q.worldedit.world.snapshot.SnapshotRepository; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Properties; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.stream.Collectors; - -/** - * Simple LocalConfiguration that loads settings using - * {@code java.util.Properties}. - */ -public class PropertiesConfiguration extends LocalConfiguration { - - private static final Logger log = Logger.getLogger(PropertiesConfiguration.class.getCanonicalName()); - - protected Properties properties; - protected File path; - - /** - * Construct the object. The configuration isn't loaded yet. - * - * @param path the path tot he configuration - */ - public PropertiesConfiguration(File path) { - this.path = path; - - properties = new Properties(); - } - - @Override - public void load() { - try (InputStream stream = new FileInputStream(path)) { - properties.load(stream); - } catch (FileNotFoundException ignored) { - } catch (IOException e) { - log.log(Level.WARNING, "Failed to read configuration", e); - } - - loadExtra(); - - profile = getBool("profile", profile); - - disallowedBlocks = - new HashSet<>(getStringSet("limits.disallowed-blocks", getDefaultDisallowedBlocks())); - allowedDataCycleBlocks = - new HashSet<>(getStringSet("limits.allowed-data-cycle-blocks", null)); - defaultChangeLimit = getInt("default-max-changed-blocks", defaultChangeLimit); - maxChangeLimit = getInt("max-changed-blocks", maxChangeLimit); - defaultMaxPolygonalPoints = getInt("default-max-polygon-points", defaultMaxPolygonalPoints); - maxPolygonalPoints = getInt("max-polygon-points", maxPolygonalPoints); - defaultMaxPolyhedronPoints = getInt("default-max-polyhedron-points", defaultMaxPolyhedronPoints); - maxPolyhedronPoints = getInt("max-polyhedron-points", maxPolyhedronPoints); - shellSaveType = getString("shell-save-type", shellSaveType); - maxRadius = getInt("max-radius", maxRadius); - maxSuperPickaxeSize = getInt("max-super-pickaxe-size", maxSuperPickaxeSize); - maxBrushRadius = getInt("max-brush-radius", maxBrushRadius); - logCommands = getBool("log-commands", logCommands); - logFile = getString("log-file", logFile); - logFormat = getString("log-format", logFormat); - registerHelp = getBool("register-help", registerHelp); - wandItem = getString("wand-item", wandItem); - try { - wandItem = LegacyMapper.getInstance().getItemFromLegacy(Integer.parseInt(wandItem)).getId(); - } catch (Throwable e) {} - superPickaxeDrop = getBool("super-pickaxe-drop-items", superPickaxeDrop); - superPickaxeManyDrop = getBool("super-pickaxe-many-drop-items", superPickaxeManyDrop); - noDoubleSlash = getBool("no-double-slash", noDoubleSlash); - useInventory = getBool("use-inventory", useInventory); - useInventoryOverride = getBool("use-inventory-override", useInventoryOverride); - useInventoryCreativeOverride = getBool("use-inventory-creative-override", useInventoryCreativeOverride); - navigationWand = getString("nav-wand-item", navigationWand); - try { - navigationWand = LegacyMapper.getInstance().getItemFromLegacy(Integer.parseInt(navigationWand)).getId(); - } catch (Throwable e) {} - navigationWandMaxDistance = getInt("nav-wand-distance", navigationWandMaxDistance); - navigationUseGlass = getBool("nav-use-glass", navigationUseGlass); - scriptTimeout = getInt("scripting-timeout", scriptTimeout); - saveDir = getString("schematic-save-dir", saveDir); - scriptsDir = getString("craftscript-dir", scriptsDir); - butcherDefaultRadius = getInt("butcher-default-radius", butcherDefaultRadius); - butcherMaxRadius = getInt("butcher-max-radius", butcherMaxRadius); - allowSymlinks = getBool("allow-symbolic-links", allowSymlinks); - - LocalSession.MAX_HISTORY_SIZE = Math.max(15, getInt("history-size", 15)); - - String snapshotsDir = getString("snapshots-dir", ""); - if (!snapshotsDir.isEmpty()) { - snapshotRepo = new SnapshotRepository(snapshotsDir); - } - - path.getParentFile().mkdirs(); - try (OutputStream output = new FileOutputStream(path)) { - properties.store(output, "Don't put comments; they get removed"); - } catch (IOException e) { - log.log(Level.WARNING, "Failed to write configuration", e); - } - } - - /** - * Called to load extra configuration. - */ - protected void loadExtra() { - } - - /** - * Get a string value. - * - * @param key the key - * @param def the default value - * @return the value - */ - protected String getString(String key, String def) { - if (def == null) { - def = ""; - } - String val = properties.getProperty(key); - if (val == null) { - properties.setProperty(key, def); - return def; - } else { - return val; - } - } - - /** - * Get a boolean value. - * - * @param key the key - * @param def the default value - * @return the value - */ - protected boolean getBool(String key, boolean def) { - String val = properties.getProperty(key); - if (val == null) { - properties.setProperty(key, def ? "true" : "false"); - return def; - } else { - return val.equalsIgnoreCase("true") - || val.equals("1"); - } - } - - /** - * Get an integer value. - * - * @param key the key - * @param def the default value - * @return the value - */ - protected int getInt(String key, int def) { - String val = properties.getProperty(key); - if (val == null) { - properties.setProperty(key, String.valueOf(def)); - return def; - } else { - try { - return Integer.parseInt(val); - } catch (NumberFormatException e) { - properties.setProperty(key, String.valueOf(def)); - return def; - } - } - } - - /** - * Get a double value. - * - * @param key the key - * @param def the default value - * @return the value - */ - protected double getDouble(String key, double def) { - String val = properties.getProperty(key); - if (val == null) { - properties.setProperty(key, String.valueOf(def)); - return def; - } else { - try { - return Double.parseDouble(val); - } catch (NumberFormatException e) { - properties.setProperty(key, String.valueOf(def)); - return def; - } - } - } - - /** - * Get a double value. - * - * @param key the key - * @param def the default value - * @return the value - */ - protected Set getIntSet(String key, int[] def) { - String val = properties.getProperty(key); - if (val == null) { - properties.setProperty(key, StringUtil.joinString(def, ",", 0)); - Set set = new HashSet<>(); - for (int i : def) { - set.add(i); - } - return set; - } else { - Set set = new HashSet<>(); - String[] parts = val.split(","); - for (String part : parts) { - try { - int v = Integer.parseInt(part.trim()); - set.add(v); - } catch (NumberFormatException ignored) { - } - } - return set; - } - } - - /** - * Get a String set. - * - * @param key the key - * @param def the default value - * @return the value - */ - protected Set getStringSet(String key, String[] def) { - String val = properties.getProperty(key); - if (val == null) { - properties.setProperty(key, StringUtil.joinString(def, ",", 0)); - return new HashSet<>(Arrays.asList(def)); - } else { - Set set = new HashSet<>(); - String[] parts = val.split(","); - for (String part : parts) { - try { - String v = part.trim(); - set.add(v); - } catch (NumberFormatException ignored) { - } - } - return set; - } - } - -} \ No newline at end of file +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +// $Id$ + +package com.sk89q.worldedit.util; + +import com.sk89q.util.StringUtil; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.util.report.Unreported; +import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.world.item.ItemTypes; +import com.sk89q.worldedit.world.registry.LegacyMapper; +import com.sk89q.worldedit.world.snapshot.SnapshotRepository; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Properties; +import java.util.Set; + +/** + * Simple LocalConfiguration that loads settings using + * {@code java.util.Properties}. + */ +public class PropertiesConfiguration extends LocalConfiguration { + + @Unreported private static final Logger log = LoggerFactory.getLogger(PropertiesConfiguration.class); + + @Unreported protected Properties properties; + @Unreported protected File path; + + /** + * Construct the object. The configuration isn't loaded yet. + * + * @param path the path tot he configuration + */ + public PropertiesConfiguration(File path) { + this.path = path; + + properties = new Properties(); + } + + @Override + public void load() { + try (InputStream stream = new FileInputStream(path)) { + properties.load(stream); + } catch (FileNotFoundException ignored) { + } catch (IOException e) { + log.warn("Failed to read configuration", e); + } + + loadExtra(); + + profile = getBool("profile", profile); + + disallowedBlocks = + new HashSet<>(getStringSet("limits.disallowed-blocks", getDefaultDisallowedBlocks())); + allowedDataCycleBlocks = + new HashSet<>(getStringSet("limits.allowed-data-cycle-blocks", null)); + defaultChangeLimit = getInt("default-max-changed-blocks", defaultChangeLimit); + maxChangeLimit = getInt("max-changed-blocks", maxChangeLimit); + defaultMaxPolygonalPoints = getInt("default-max-polygon-points", defaultMaxPolygonalPoints); + maxPolygonalPoints = getInt("max-polygon-points", maxPolygonalPoints); + defaultMaxPolyhedronPoints = getInt("default-max-polyhedron-points", defaultMaxPolyhedronPoints); + maxPolyhedronPoints = getInt("max-polyhedron-points", maxPolyhedronPoints); + shellSaveType = getString("shell-save-type", shellSaveType); + maxRadius = getInt("max-radius", maxRadius); + maxSuperPickaxeSize = getInt("max-super-pickaxe-size", maxSuperPickaxeSize); + maxBrushRadius = getInt("max-brush-radius", maxBrushRadius); + logCommands = getBool("log-commands", logCommands); + logFile = getString("log-file", logFile); + logFormat = getString("log-format", logFormat); + registerHelp = getBool("register-help", registerHelp); + wandItem = getString("wand-item", wandItem); + try { + wandItem = LegacyMapper.getInstance().getItemFromLegacy(Integer.parseInt(wandItem)).getId(); + } catch (Throwable e) { + } + superPickaxeDrop = getBool("super-pickaxe-drop-items", superPickaxeDrop); + superPickaxeManyDrop = getBool("super-pickaxe-many-drop-items", superPickaxeManyDrop); + noDoubleSlash = getBool("no-double-slash", noDoubleSlash); + useInventory = getBool("use-inventory", useInventory); + useInventoryOverride = getBool("use-inventory-override", useInventoryOverride); + useInventoryCreativeOverride = getBool("use-inventory-creative-override", useInventoryCreativeOverride); + navigationWand = getString("nav-wand-item", navigationWand); + try { + navigationWand = LegacyMapper.getInstance().getItemFromLegacy(Integer.parseInt(navigationWand)).getId(); + } catch (Throwable e) { + } + navigationWandMaxDistance = getInt("nav-wand-distance", navigationWandMaxDistance); + navigationUseGlass = getBool("nav-use-glass", navigationUseGlass); + scriptTimeout = getInt("scripting-timeout", scriptTimeout); + saveDir = getString("schematic-save-dir", saveDir); + scriptsDir = getString("craftscript-dir", scriptsDir); + butcherDefaultRadius = getInt("butcher-default-radius", butcherDefaultRadius); + butcherMaxRadius = getInt("butcher-max-radius", butcherMaxRadius); + allowSymlinks = getBool("allow-symbolic-links", allowSymlinks); + + LocalSession.MAX_HISTORY_SIZE = Math.max(15, getInt("history-size", 15)); + + String snapshotsDir = getString("snapshots-dir", ""); + if (!snapshotsDir.isEmpty()) { + snapshotRepo = new SnapshotRepository(snapshotsDir); + } + + path.getParentFile().mkdirs(); + try (OutputStream output = new FileOutputStream(path)) { + properties.store(output, "Don't put comments; they get removed"); + } catch (IOException e) { + log.warn("Failed to write configuration", e); + } + } + + /** + * Called to load extra configuration. + */ + protected void loadExtra() { + } + + /** + * Get a string value. + * + * @param key the key + * @param def the default value + * @return the value + */ + protected String getString(String key, String def) { + if (def == null) { + def = ""; + } + String val = properties.getProperty(key); + if (val == null) { + properties.setProperty(key, def); + return def; + } else { + return val; + } + } + + /** + * Get a boolean value. + * + * @param key the key + * @param def the default value + * @return the value + */ + protected boolean getBool(String key, boolean def) { + String val = properties.getProperty(key); + if (val == null) { + properties.setProperty(key, def ? "true" : "false"); + return def; + } else { + return val.equalsIgnoreCase("true") + || val.equals("1"); + } + } + + /** + * Get an integer value. + * + * @param key the key + * @param def the default value + * @return the value + */ + protected int getInt(String key, int def) { + String val = properties.getProperty(key); + if (val == null) { + properties.setProperty(key, String.valueOf(def)); + return def; + } else { + try { + return Integer.parseInt(val); + } catch (NumberFormatException e) { + properties.setProperty(key, String.valueOf(def)); + return def; + } + } + } + + /** + * Get a double value. + * + * @param key the key + * @param def the default value + * @return the value + */ + protected double getDouble(String key, double def) { + String val = properties.getProperty(key); + if (val == null) { + properties.setProperty(key, String.valueOf(def)); + return def; + } else { + try { + return Double.parseDouble(val); + } catch (NumberFormatException e) { + properties.setProperty(key, String.valueOf(def)); + return def; + } + } + } + + /** + * Get a double value. + * + * @param key the key + * @param def the default value + * @return the value + */ + protected Set getIntSet(String key, int[] def) { + String val = properties.getProperty(key); + if (val == null) { + properties.setProperty(key, StringUtil.joinString(def, ",", 0)); + Set set = new HashSet<>(); + for (int i : def) { + set.add(i); + } + return set; + } else { + Set set = new HashSet<>(); + String[] parts = val.split(","); + for (String part : parts) { + try { + int v = Integer.parseInt(part.trim()); + set.add(v); + } catch (NumberFormatException ignored) { + } + } + return set; + } + } + + /** + * Get a String set. + * + * @param key the key + * @param def the default value + * @return the value + */ + protected Set getStringSet(String key, String[] def) { + String val = properties.getProperty(key); + if (val == null) { + properties.setProperty(key, StringUtil.joinString(def, ",", 0)); + return new HashSet<>(Arrays.asList(def)); + } else { + Set set = new HashSet<>(); + String[] parts = val.split(","); + for (String part : parts) { + try { + String v = part.trim(); + set.add(v); + } catch (NumberFormatException ignored) { + } + } + return set; + } + } + +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java index fba4fc67e..0719eeca0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/YAMLConfiguration.java @@ -26,11 +26,10 @@ import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.session.SessionManager; import com.sk89q.worldedit.util.report.Unreported; import com.sk89q.worldedit.world.snapshot.SnapshotRepository; +import org.slf4j.Logger; import java.io.IOException; import java.util.HashSet; -import java.util.logging.Level; -import java.util.logging.Logger; /** * A less simple implementation of {@link LocalConfiguration} @@ -51,7 +50,7 @@ public class YAMLConfiguration extends LocalConfiguration { try { config.load(); } catch (IOException e) { - logger.log(Level.WARNING, "Error loading WorldEdit configuration", e); + logger.warn("Error loading WorldEdit configuration", e); } profile = config.getBoolean("debug", profile); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/EventBus.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/EventBus.java index d8cbe8b20..d97c090ea 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/EventBus.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/EventBus.java @@ -19,13 +19,13 @@ package com.sk89q.worldedit.util.eventbus; -import static com.google.common.base.Preconditions.checkNotNull; - import com.google.common.collect.Multimap; import com.google.common.collect.Multimaps; import com.google.common.collect.SetMultimap; import com.google.common.eventbus.DeadEvent; import com.sk89q.worldedit.internal.annotation.RequiresNewerGuava; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; @@ -36,8 +36,8 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; + +import static com.google.common.base.Preconditions.checkNotNull; /** * Dispatches events to listeners, and provides ways for listeners to register @@ -53,7 +53,7 @@ import java.util.logging.Logger; */ public class EventBus { - private final Logger logger = Logger.getLogger(EventBus.class.getCanonicalName()); + private final Logger logger = LoggerFactory.getLogger(EventBus.class); private final SetMultimap, EventHandler> handlersByType = Multimaps.newSetMultimap(new HashMap<>(), this::newHandlerSet); @@ -186,8 +186,7 @@ public class EventBus { try { handler.handleEvent(event); } catch (InvocationTargetException e) { - logger.log(Level.SEVERE, - "Could not dispatch event: " + event + " to handler " + handler, e); + logger.error("Could not dispatch event: " + event + " to handler " + handler, e); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/io/Closer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/io/Closer.java index 26ef6a0f9..1b7aceda3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/io/Closer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/io/Closer.java @@ -19,23 +19,23 @@ package com.sk89q.worldedit.util.io; -import static com.google.common.base.Preconditions.checkNotNull; - import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Throwables; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.Closeable; import java.io.IOException; import java.lang.reflect.Method; import java.util.ArrayDeque; import java.util.Deque; -import java.util.logging.Level; -import java.util.logging.Logger; import java.util.zip.ZipFile; +import static com.google.common.base.Preconditions.checkNotNull; + public final class Closer implements Closeable { - private static final Logger logger = Logger.getLogger(Closer.class.getCanonicalName()); + private static final Logger logger = LoggerFactory.getLogger(Closer.class); /** * The suppressor implementation to use for the current Java version. @@ -218,7 +218,7 @@ public final class Closer implements Closeable { @Override public void suppress(Object closeable, Throwable thrown, Throwable suppressed) { // log to the same place as Closeables - logger.log(Level.WARNING, "Suppressing exception thrown when closing " + closeable, suppressed); + logger.warn("Suppressing exception thrown when closing " + closeable, suppressed); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/WorldEditPrefixHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/WorldEditPrefixHandler.java index f2c8a0754..6922987c4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/WorldEditPrefixHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/WorldEditPrefixHandler.java @@ -53,7 +53,8 @@ public final class WorldEditPrefixHandler extends Handler { * @param name the logger name */ public static void register(String name) { - Logger.getLogger(name).addHandler(new WorldEditPrefixHandler()); + //todo fix this + //Logger.getLogger(name).addHandler(new WorldEditPrefixHandler()); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/paste/ActorCallbackPaste.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/paste/ActorCallbackPaste.java index e87e440bf..b906a5813 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/paste/ActorCallbackPaste.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/paste/ActorCallbackPaste.java @@ -26,14 +26,14 @@ import com.sk89q.worldedit.command.util.AsyncCommandHelper; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.util.command.parametric.ExceptionConverter; import com.sk89q.worldedit.util.task.Supervisor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.net.URL; -import java.util.logging.Level; -import java.util.logging.Logger; public class ActorCallbackPaste { - private static final Logger LOGGER = Logger.getLogger(ActorCallbackPaste.class.getSimpleName()); + private static final Logger LOGGER = LoggerFactory.getLogger(ActorCallbackPaste.class); private ActorCallbackPaste() { } @@ -62,7 +62,7 @@ public static void pastebin(Supervisor supervisor, final Actor sender, String co @Override public void onFailure(Throwable throwable) { - LOGGER.log(Level.WARNING, "Failed to submit pastebin", throwable); + LOGGER.warn("Failed to submit pastebin", throwable); sender.printError("Failed to submit to a pastebin. Please see console for the error."); } }); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/report/ShallowObjectReport.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/report/ShallowObjectReport.java index bb4abb1f3..18085bc0b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/report/ShallowObjectReport.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/report/ShallowObjectReport.java @@ -19,16 +19,17 @@ package com.sk89q.worldedit.util.report; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.lang.reflect.Field; import java.lang.reflect.Modifier; -import java.util.logging.Level; -import java.util.logging.Logger; import static com.google.common.base.Preconditions.checkNotNull; public class ShallowObjectReport extends DataReport { - private static final Logger log = Logger.getLogger(ShallowObjectReport.class.getCanonicalName()); + private static final Logger log = LoggerFactory.getLogger(ShallowObjectReport.class); public ShallowObjectReport(String title, Object object) { super(title); @@ -52,7 +53,7 @@ public class ShallowObjectReport extends DataReport { Object value = field.get(object); append(field.getName(), String.valueOf(value)); } catch (IllegalAccessException e) { - log.log(Level.WARNING, "Failed to get value of '" + field.getName() + "' on " + type); + log.warn("Failed to get value of '" + field.getName() + "' on " + type); } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/AnvilChunk.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/AnvilChunk.java index 2710fddd0..8dbb5e737 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/AnvilChunk.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/AnvilChunk.java @@ -260,7 +260,7 @@ public class AnvilChunk implements Chunk { BlockState state = LegacyMapper.getInstance().getBlockFromLegacy(id, data); if (state == null) { - WorldEdit.logger.warning("Unknown legacy block " + id + ":" + data + " found when loading legacy anvil chunk."); + WorldEdit.logger.warn("Unknown legacy block " + id + ":" + data + " found when loading legacy anvil chunk."); return BlockTypes.AIR.getDefaultState().toBaseBlock(); } if (state.getMaterial().hasContainer()) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java index add26e1c0..b4667709d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/chunk/OldChunk.java @@ -183,7 +183,7 @@ public class OldChunk implements Chunk { BlockState state = LegacyMapper.getInstance().getBlockFromLegacy(id, dataVal); if (state == null) { - WorldEdit.logger.warning("Unknown legacy block " + id + ":" + dataVal + " found when loading legacy anvil chunk."); + WorldEdit.logger.warn("Unknown legacy block " + id + ":" + dataVal + " found when loading legacy anvil chunk."); return BlockTypes.AIR.getDefaultState().toBaseBlock(); } if (state.getBlockType().getMaterial().hasContainer()) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java index 9023fefd5..88b714b10 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockData.java @@ -24,7 +24,10 @@ import com.google.gson.*; import com.google.gson.reflect.TypeToken; import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.util.gson.VectorAdapter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import javax.annotation.Nullable; import java.io.IOException; import java.lang.reflect.Type; import java.net.URL; @@ -32,10 +35,6 @@ import java.nio.charset.Charset; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.annotation.Nullable; /** * Provides block data based on the built-in block database that is bundled @@ -50,7 +49,7 @@ import javax.annotation.Nullable; */ public class BundledBlockData { - private static final Logger log = Logger.getLogger(BundledBlockData.class.getCanonicalName()); + private static final Logger log = LoggerFactory.getLogger(BundledBlockData.class); private static BundledBlockData INSTANCE; private final Map idMap = new HashMap<>(); @@ -62,7 +61,7 @@ public class BundledBlockData { try { loadFromResource(); } catch (Throwable e) { - log.log(Level.WARNING, "Failed to load the built-in block registry", e); + log.warn("Failed to load the built-in block registry", e); } } @@ -152,4 +151,4 @@ public class BundledBlockData { public SimpleBlockMaterial material = new SimpleBlockMaterial(); } -} \ No newline at end of file +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java index 2867b2e56..4bdac0c8a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemData.java @@ -25,17 +25,16 @@ import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.util.gson.VectorAdapter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import javax.annotation.Nullable; import java.io.IOException; import java.net.URL; import java.nio.charset.Charset; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.annotation.Nullable; /** * Provides item data based on the built-in item database that is bundled @@ -50,7 +49,7 @@ import javax.annotation.Nullable; */ public class BundledItemData { - private static final Logger log = Logger.getLogger(BundledItemData.class.getCanonicalName()); + private static final Logger log = LoggerFactory.getLogger(BundledItemData.class); private static BundledItemData INSTANCE; private final Map idMap = new HashMap<>(); @@ -62,7 +61,7 @@ public class BundledItemData { try { loadFromResource(); } catch (Throwable e) { - log.log(Level.WARNING, "Failed to load the built-in item registry", e); + log.warn("Failed to load the built-in item registry", e); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java index 369578dfa..d0d129101 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java @@ -40,22 +40,22 @@ import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.item.ItemTypes; -import com.sk89q.worldedit.extension.input.ParserContext; -import com.sk89q.worldedit.util.gson.VectorAdapter; import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import javax.annotation.Nullable; import java.io.IOException; import java.net.URL; import java.nio.charset.Charset; +import java.util.Arrays; import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.annotation.Nullable; +import static com.google.common.base.Preconditions.checkNotNull; public class LegacyMapper { - private static final Logger log = Logger.getLogger(LegacyMapper.class.getCanonicalName()); + private static final Logger log = LoggerFactory.getLogger(LegacyMapper.class); private static LegacyMapper INSTANCE; private final Int2ObjectArrayMap blockStateToLegacyId4Data = new Int2ObjectArrayMap<>(); @@ -70,8 +70,7 @@ public class LegacyMapper { try { loadFromResource(); } catch (Throwable e) { - e.printStackTrace(); - log.log(Level.WARNING, "Failed to load the built-in legacy id registry", e); + log.warn("Failed to load the built-in legacy id registry", e); } } @@ -110,7 +109,7 @@ public class LegacyMapper { blockStateToLegacyId4Data.put(blockState.getInternalId(), (Integer) combinedId); blockStateToLegacyId4Data.putIfAbsent(blockState.getInternalBlockTypeId(), combinedId); } catch (Exception e) { - log.fine("Unknown block: " + blockEntry.getValue()); + log.warn("Unknown block: " + blockEntry.getValue()); } } for (int id = 0; id < 256; id++) { @@ -127,7 +126,7 @@ public class LegacyMapper { try { itemMap.put(getCombinedId(itemEntry.getKey()), ItemTypes.get(itemEntry.getValue())); } catch (Exception e) { - log.fine("Unknown item: " + itemEntry.getValue()); + log.warn("Unknown item: " + itemEntry.getValue()); } } } @@ -232,7 +231,7 @@ public class LegacyMapper { try { return BlockTypes.get(plotBlock.toString()).getDefaultState().toBaseBlock(); }catch(Throwable failed) { - log.severe("Unable to convert StringPlotBlock " + plotBlock + " to BaseBlock!"); + log.error("Unable to convert StringPlotBlock " + plotBlock + " to BaseBlock!"); failed.printStackTrace(); return null; } @@ -240,12 +239,12 @@ public class LegacyMapper { try { return new BaseBlock(((LegacyPlotBlock)plotBlock).getId(), ((LegacyPlotBlock)plotBlock).getData()); }catch(Throwable failed) { - log.severe("Unable to convert LegacyPlotBlock " + plotBlock + " to BaseBlock!"); + log.error("Unable to convert LegacyPlotBlock " + plotBlock + " to BaseBlock!"); failed.printStackTrace(); return null; } }else { - log.severe("Unable to convert LegacyPlotBlock " + plotBlock + " to BaseBlock!"); + log.error("Unable to convert LegacyPlotBlock " + plotBlock + " to BaseBlock!"); return null; } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/Snapshot.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/Snapshot.java index 58525a7d2..0af2b6e18 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/Snapshot.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/Snapshot.java @@ -29,11 +29,12 @@ import com.sk89q.worldedit.world.storage.TrueZipLegacyChunkStore; import com.sk89q.worldedit.world.storage.TrueZipMcRegionChunkStore; import com.sk89q.worldedit.world.storage.ZippedLegacyChunkStore; import com.sk89q.worldedit.world.storage.ZippedMcRegionChunkStore; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.File; import java.io.IOException; import java.util.Calendar; -import java.util.logging.Logger; import java.util.zip.ZipFile; /** @@ -41,7 +42,7 @@ import java.util.zip.ZipFile; */ public class Snapshot implements Comparable { - protected static Logger logger = Logger.getLogger(Snapshot.class.getCanonicalName()); + protected static Logger logger = LoggerFactory.getLogger(Snapshot.class); protected File file; protected String name; diff --git a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/legacy.json b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/legacy.json index 7a5f42453..cb97197ae 100644 --- a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/legacy.json +++ b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/legacy.json @@ -404,7 +404,6 @@ "61:11": "minecraft:furnace[facing=south,lit=false]", "61:12": "minecraft:furnace[facing=west,lit=false]", "61:13": "minecraft:furnace[facing=east,lit=false]", - "62:0": "minecraft:lit_furnace", "62:2": "minecraft:furnace[facing=north,lit=true]", "62:3": "minecraft:furnace[facing=south,lit=true]", "62:4": "minecraft:furnace[facing=west,lit=true]", @@ -1849,7 +1848,7 @@ "48:0": "minecraft:mossy_cobblestone", "49:0": "minecraft:obsidian", "50:0": "minecraft:torch", - "52:0": "minecraft:mob_spawner", + "52:0": "minecraft:spawner", "53:0": "minecraft:oak_stairs", "54:0": "minecraft:chest", "56:0": "minecraft:diamond_ore", @@ -2393,4 +2392,4 @@ "2266:0": "minecraft:music_disc_11", "2267:0": "minecraft:music_disc_wait" } -} \ No newline at end of file +} diff --git a/worldedit-core/src/test/java/com/sk89q/minecraft/util/commands/CommandContextTest.java b/worldedit-core/src/test/java/com/sk89q/minecraft/util/commands/CommandContextTest.java index 025981e6e..555c83889 100644 --- a/worldedit-core/src/test/java/com/sk89q/minecraft/util/commands/CommandContextTest.java +++ b/worldedit-core/src/test/java/com/sk89q/minecraft/util/commands/CommandContextTest.java @@ -21,17 +21,21 @@ package com.sk89q.minecraft.util.commands; import org.junit.Before; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.Arrays; import java.util.HashSet; -import java.util.logging.Level; -import java.util.logging.Logger; -import static org.junit.Assert.*; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; public class CommandContextTest { - private static final Logger log = Logger.getLogger(CommandContextTest.class.getCanonicalName()); + private static final Logger log = LoggerFactory.getLogger(CommandContextTest.class); private static final String firstCmdString = "herpderp -opw testers \"mani world\" 'another thing' because something"; CommandContext firstCommand; @@ -40,7 +44,7 @@ public class CommandContextTest { try { firstCommand = new CommandContext(firstCmdString, new HashSet<>(Arrays.asList('o', 'w'))); } catch (CommandException e) { - log.log(Level.WARNING, "Error", e); + log.warn("Error", e); fail("Unexpected exception when creating CommandContext"); } } @@ -79,7 +83,7 @@ public class CommandContextTest { new CommandContext(cmd); new CommandContext(cmd2); } catch (CommandException e) { - log.log(Level.WARNING, "Error", e); + log.warn("Error", e); fail("Error creating CommandContext"); } } @@ -90,7 +94,7 @@ public class CommandContextTest { try { new CommandContext(cmd); } catch (CommandException e) { - log.log(Level.WARNING, "Error", e); + log.warn("Error", e); fail("Error creating CommandContext"); } } @@ -101,7 +105,7 @@ public class CommandContextTest { try { new CommandContext(cmd); } catch (CommandException e) { - log.log(Level.WARNING, "Error", e); + log.warn("Error", e); fail("Error creating CommandContext"); } } @@ -115,7 +119,7 @@ public class CommandContextTest { CommandContext context2 = new CommandContext("r hello -f world"); assertTrue(context2.hasFlag('f')); } catch (CommandException e) { - log.log(Level.WARNING, "Error", e); + log.warn("Error", e); fail("Error creating CommandContext"); } } @@ -131,7 +135,7 @@ public class CommandContextTest { CommandContext context2 = new CommandContext("pm name \"hello world\" foo bar"); assertEquals("\"hello world\" foo bar", context2.getJoinedStrings(1)); } catch (CommandException e) { - log.log(Level.WARNING, "Error", e); + log.warn("Error", e); fail("Error creating CommandContext"); } } @@ -143,7 +147,7 @@ public class CommandContextTest { assertArrayEquals(new String[] { "foo", "bar", "baz" }, context.getSlice(0)); } catch (CommandException e) { - log.log(Level.WARNING, "Error", e); + log.warn("Error", e); fail("Error creating CommandContext"); } } @@ -154,7 +158,7 @@ public class CommandContextTest { CommandContext context = new CommandContext("region flag xmas blocked-cmds \"\""); assertEquals(context.argsLength(), 3); } catch (CommandException e) { - log.log(Level.WARNING, "Error", e); + log.warn("Error", e); fail("Error creating CommandContext"); } } diff --git a/worldedit-forge/build.gradle b/worldedit-forge/build.gradle index f5c6e0f7d..cdbd5ce60 100644 --- a/worldedit-forge/build.gradle +++ b/worldedit-forge/build.gradle @@ -16,6 +16,7 @@ apply plugin: 'net.minecraftforge.gradle.forge' dependencies { compile project(':worldedit-core') + compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.11.2' compile 'org.spongepowered:spongeapi:6.0.0-SNAPSHOT' testCompile group: 'org.mockito', name: 'mockito-core', version: '1.9.0-rc1' } diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/adapter/SpongeImplLoader.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/adapter/SpongeImplLoader.java index dac72425e..7f5bb0f84 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/adapter/SpongeImplLoader.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/adapter/SpongeImplLoader.java @@ -21,6 +21,8 @@ package com.sk89q.worldedit.sponge.adapter; import com.google.common.collect.Lists; import com.sk89q.worldedit.util.io.Closer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.File; import java.io.IOException; @@ -30,15 +32,13 @@ import java.util.Enumeration; import java.util.List; import java.util.jar.JarEntry; import java.util.jar.JarFile; -import java.util.logging.Level; -import java.util.logging.Logger; /** * Loads Sponge implementation adapters. */ public class SpongeImplLoader { - private static final Logger log = Logger.getLogger(SpongeImplLoader.class.getCanonicalName()); + private static final Logger log = LoggerFactory.getLogger(SpongeImplLoader.class); private final List adapterCandidates = new ArrayList<>(); private String customCandidate; @@ -71,7 +71,7 @@ public class SpongeImplLoader { if (className != null) { customCandidate = className; adapterCandidates.add(className); - log.log(Level.INFO, "-Dworldedit.sponge.adapter used to add " + className + " to the list of available Sponge adapters"); + log.info("-Dworldedit.sponge.adapter used to add " + className + " to the list of available Sponge adapters"); } } @@ -157,18 +157,18 @@ public class SpongeImplLoader { if (SpongeImplAdapter.class.isAssignableFrom(cls)) { suitableAdapters.add((SpongeImplAdapter) cls.newInstance()); } else { - log.log(Level.WARNING, "Failed to load the Sponge adapter class '" + className + + log.warn("Failed to load the Sponge adapter class '" + className + "' because it does not implement " + SpongeImplAdapter.class.getCanonicalName()); } } catch (ClassNotFoundException e) { - log.log(Level.WARNING, "Failed to load the Sponge adapter class '" + className + + log.warn("Failed to load the Sponge adapter class '" + className + "' that is not supposed to be missing", e); } catch (IllegalAccessException e) { - log.log(Level.WARNING, "Failed to load the Sponge adapter class '" + className + + log.warn("Failed to load the Sponge adapter class '" + className + "' that is not supposed to be raising this error", e); } catch (Throwable e) { if (className.equals(customCandidate)) { - log.log(Level.WARNING, "Failed to load the Sponge adapter class '" + className + "'", e); + log.warn("Failed to load the Sponge adapter class '" + className + "'", e); } } } From 122236f6c7835ff8e74c1c9e51c6c0e09ca38caf Mon Sep 17 00:00:00 2001 From: matt <4009945+MattBDev@users.noreply.github.com> Date: Tue, 2 Apr 2019 23:36:32 -0400 Subject: [PATCH 07/11] Too lazy to write a commit message --- .../java/com/sk89q/worldedit/EditSession.java | 39 ++-- .../extension/platform/PlatformManager.java | 179 +++++++----------- .../function/pattern/BlockPattern.java | 3 +- .../sk89q/worldedit/math/BlockVector3.java | 4 +- .../com/sk89q/worldedit/math/Vector3.java | 31 ++- 5 files changed, 111 insertions(+), 145 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index bc6ed024a..3181fde02 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -1221,20 +1221,12 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, @Override public BlockVector3 getMinimumPoint() { - if (extent != null) { - return this.extent.getMinimumPoint(); - } else { - return BlockVector3.at(-30000000, 0, -30000000); - } + return getWorld().getMinimumPoint(); } @Override public BlockVector3 getMaximumPoint() { - if (extent != null) { - return this.extent.getMaximumPoint(); - } else { - return BlockVector3.at(30000000, 255, 30000000); - } + return getWorld().getMaximumPoint(); } @Override @@ -1364,7 +1356,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, * @return the number of blocks that matched the pattern */ public int countBlocks(final Region region, final Set searchBlocks) { - final Mask mask = new BlockMaskBuilder().addBlocks(searchBlocks).build(extent); + Mask mask = new BlockMaskBuilder().addBlocks(searchBlocks).build(extent); RegionVisitor visitor = new RegionVisitor(region, new RegionFunction() { @Override public boolean apply(BlockVector3 position) throws WorldEditException { @@ -1516,10 +1508,11 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, checkArgument(apothem >= 1, "apothem >= 1"); checkArgument(height >= 1, "height >= 1"); - final Region region = new CuboidRegion(this.getWorld(), // Causes clamping of Y range + Region region = new CuboidRegion( + getWorld(), // Causes clamping of Y range position.add(-apothem + 1, 0, -apothem + 1), position.add(apothem - 1, height - 1, apothem - 1)); - final Pattern pattern = BlockTypes.AIR.getDefaultState(); - return this.setBlocks(region, pattern); + Pattern pattern = new BlockPattern(BlockTypes.AIR.getDefaultState()); + return setBlocks(region, pattern); } /** @@ -1536,10 +1529,10 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, checkArgument(apothem >= 1, "apothem >= 1"); checkArgument(height >= 1, "height >= 1"); - final Region region = new CuboidRegion(this.getWorld(), // Causes clamping of Y range + Region region = new CuboidRegion(getWorld(), // Causes clamping of Y range position.add(-apothem + 1, 0, -apothem + 1), position.add(apothem - 1, -height + 1, apothem - 1)); - final Pattern pattern = BlockTypes.AIR.getDefaultState(); - return this.setBlocks(region, pattern); + Pattern pattern = new BlockPattern(BlockTypes.AIR.getDefaultState()); + return setBlocks(region, pattern); } /** @@ -1629,9 +1622,8 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, Operations.completeBlindly(visitor); this.changes += visitor.getAffected(); } else { - Iterator iter = region.iterator(); - while (iter.hasNext()) { - if (this.extent.setBlock(iter.next(), block)) { + for (BlockVector3 blockVector3 : region) { + if (this.extent.setBlock(blockVector3, block)) { changes++; } } @@ -1704,8 +1696,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ - @SuppressWarnings("deprecation") - public int replaceBlocks(final Region region, final Mask mask, final Pattern pattern) { + public int replaceBlocks(Region region, Mask mask, Pattern pattern) throws MaxChangedBlocksException { checkNotNull(region); checkNotNull(mask); checkNotNull(pattern); @@ -3363,9 +3354,9 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, } private void setExistingBlocks(BlockVector3 pos1, BlockVector3 pos2) { - for (int x = (int) pos1.getX(); x <= (int) pos2.getX(); x++) { + for (int x = pos1.getX(); x <= pos2.getX(); x++) { for (int z = pos1.getBlockZ(); z <= pos2.getBlockZ(); z++) { - for (int y = (int) pos1.getY(); y <= (int) pos2.getY(); y++) { + for (int y = pos1.getY(); y <= pos2.getY(); y++) { int from = queue.getCombinedId4Data(x, y, z); queue.setBlock(x, y, z, from); if (BlockTypes.getFromStateId(from).getMaterial().hasContainer()) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java index 94caacaca..207947a9e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java @@ -43,6 +43,7 @@ import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.event.platform.*; import com.sk89q.worldedit.extension.platform.permission.ActorSelectorLimits; import com.sk89q.worldedit.math.BlockVector3; +import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.regions.RegionSelector; import com.sk89q.worldedit.session.request.Request; import com.sk89q.worldedit.util.HandSide; @@ -276,7 +277,7 @@ public class PlatformManager { /** * Get the current configuration. - *

+ * *

If no platform has been registered yet, then a default configuration * will be returned.

* @@ -304,142 +305,113 @@ public class PlatformManager { public void handleBlockInteract(BlockInteractEvent event) { // Create a proxy actor with a potentially different world for // making changes to the world - Request.reset(); - final Actor actor = createProxyActor(event.getCause()); + Actor actor = createProxyActor(event.getCause()); + + Location location = event.getLocation(); + try { - final Location location = event.getLocation(); - final BlockVector3 vector = location.toBlockPoint(); + Vector3 vector = location.toVector(); // At this time, only handle interaction from players if (actor instanceof Player) { - final LocalSession session = worldEdit.getSessionManager().get(actor); - Player playerActor = (Player) actor; + Player player = (Player) actor; + LocalSession session = worldEdit.getSessionManager().get(actor); + Request.reset(); VirtualWorld virtual = session.getVirtualWorld(); if (virtual != null) { - virtual.handleBlockInteract(playerActor, vector, event); + virtual.handleBlockInteract(player, vector.toBlockPoint(), event); if (event.isCancelled()) return; } if (event.getType() == Interaction.HIT) { - if (session.isToolControlEnabled() && playerActor.getItemInHand(HandSide.MAIN_HAND).getType().getId().equals(getConfiguration().wandItem)) { - FawePlayer fp = FawePlayer.wrap(playerActor); + if (player.getItemInHand(HandSide.MAIN_HAND).getType().getId().equals(getConfiguration().wandItem)) { + if (!session.isToolControlEnabled()) { + return; + } if (!actor.hasPermission("worldedit.selection.pos")) { return; } - final RegionSelector selector = session.getRegionSelector(playerActor.getWorld()); - final Player player = new LocationMaskedPlayerWrapper(PlayerWrapper.wrap((Player) actor), ((Player) actor).getLocation()); - fp.runAction(new Runnable() { - @Override - public void run() { - if (selector.selectPrimary(vector, ActorSelectorLimits.forActor(player))) { - selector.explainPrimarySelection(actor, session, vector); - } + FawePlayer fp = FawePlayer.wrap(player); + RegionSelector selector = session.getRegionSelector(player.getWorld()); + final Player maskedPlayerWrapper = + new LocationMaskedPlayerWrapper(PlayerWrapper.wrap((Player) actor), + ((Player) actor).getLocation()); + BlockVector3 blockPoint = vector.toBlockPoint(); + fp.runAction(() -> { + if (selector.selectPrimary(blockPoint, + ActorSelectorLimits.forActor(maskedPlayerWrapper))) { + selector + .explainPrimarySelection(actor, session, blockPoint); } }, false, true); event.setCancelled(true); return; } - if (session.hasSuperPickAxe() && playerActor.isHoldingPickAxe()) { + if (player.isHoldingPickAxe() && session.hasSuperPickAxe()) { final BlockTool superPickaxe = session.getSuperPickaxe(); - if (superPickaxe != null && superPickaxe.canUse(playerActor)) { - FawePlayer fp = FawePlayer.wrap(playerActor); - final Player player = new LocationMaskedPlayerWrapper(PlayerWrapper.wrap((Player) actor), ((Player) actor).getLocation()); - fp.runAction(new Runnable() { - @Override - public void run() { - reset(superPickaxe).actPrimary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), player, session, location); - } - }, false, true); + if (superPickaxe != null && superPickaxe.canUse(player)) { + FawePlayer fp = FawePlayer.wrap(player); + final Player maskedPlayerWrapper = new LocationMaskedPlayerWrapper(PlayerWrapper.wrap((Player) actor), ((Player) actor).getLocation()); + fp.runAction(() -> reset(superPickaxe).actPrimary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), maskedPlayerWrapper, session, location), false, true); event.setCancelled(true); return; } } -//<<<<<<< HEAD - final Tool tool = session.getTool(playerActor); - if (tool != null && tool instanceof DoubleActionBlockTool) { - if (tool.canUse(playerActor)) { - FawePlayer fp = FawePlayer.wrap(playerActor); - final Player player = new LocationMaskedPlayerWrapper(PlayerWrapper.wrap((Player) actor), ((Player) actor).getLocation()); - fp.runAction(new Runnable() { - @Override - public void run() { - reset(((DoubleActionBlockTool) tool)).actSecondary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), player, session, location); - } - }, false, true); + Tool tool = session.getTool(player.getItemInHand(HandSide.MAIN_HAND).getType()); + if (tool instanceof DoubleActionBlockTool) { + if (tool.canUse(player)) { + FawePlayer fp = FawePlayer.wrap(player); + final Player maskedPlayerWrapper = new LocationMaskedPlayerWrapper(PlayerWrapper.wrap((Player) actor), ((Player) actor).getLocation()); + fp.runAction(() -> reset(((DoubleActionBlockTool) tool)).actSecondary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), maskedPlayerWrapper, session, location), false, true); event.setCancelled(true); return; } -//======= -// -// RegionSelector selector = session.getRegionSelector(player.getWorld()); -// -// BlockVector3 blockPoint = vector.toBlockPoint(); -// if (selector.selectPrimary(blockPoint, ActorSelectorLimits.forActor(player))) { -// selector.explainPrimarySelection(actor, session, blockPoint); -//>>>>>>> 399e0ad5... Refactor vector system to be cleaner } } else if (event.getType() == Interaction.OPEN) { - if (session.isToolControlEnabled() && playerActor.getItemInHand(HandSide.MAIN_HAND).getType().getId().equals(getConfiguration().wandItem)) { - FawePlayer fp = FawePlayer.wrap(playerActor); + if (player.getItemInHand(HandSide.MAIN_HAND).getType().getId().equals(getConfiguration().wandItem)) { + if (!session.isToolControlEnabled()) { + return; + } if (!actor.hasPermission("worldedit.selection.pos")) { return; } + FawePlayer fp = FawePlayer.wrap(player); if (fp.checkAction()) { - final RegionSelector selector = session.getRegionSelector(playerActor.getWorld()); - final Player player = new LocationMaskedPlayerWrapper(PlayerWrapper.wrap((Player) actor), ((Player) actor).getLocation()); - fp.runAction(new Runnable() { - @Override - public void run() { - if (selector.selectSecondary(vector, ActorSelectorLimits.forActor(player))) { - selector.explainSecondarySelection(actor, session, vector); - } + RegionSelector selector = session.getRegionSelector(player.getWorld()); + Player maskedPlayerWrapper = new LocationMaskedPlayerWrapper( + PlayerWrapper.wrap((Player) actor), + ((Player) actor).getLocation()); + BlockVector3 blockPoint = vector.toBlockPoint(); + fp.runAction(() -> { + if (selector.selectSecondary(blockPoint, + ActorSelectorLimits.forActor(maskedPlayerWrapper))) { + selector.explainSecondarySelection(actor, session, + blockPoint); } }, false, true); } event.setCancelled(true); return; } - -//<<<<<<< HEAD - final Tool tool = session.getTool(playerActor); - if (tool != null && tool instanceof BlockTool) { - if (tool.canUse(playerActor)) { - FawePlayer fp = FawePlayer.wrap(playerActor); + Tool tool = session.getTool(player.getItemInHand(HandSide.MAIN_HAND).getType()); + if (tool instanceof BlockTool) { + if (tool.canUse(player)) { + FawePlayer fp = FawePlayer.wrap(player); if (fp.checkAction()) { - final Player player = new LocationMaskedPlayerWrapper(PlayerWrapper.wrap((Player) actor), ((Player) actor).getLocation()); - fp.runAction(new Runnable() { - @Override - public void run() { - if (tool instanceof BrushTool) { - ((BlockTool) tool).actPrimary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), player, session, location); - } else { - reset((BlockTool) tool).actPrimary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), player, session, location); - } + final Player maskedPlayerWrapper = new LocationMaskedPlayerWrapper(PlayerWrapper.wrap((Player) actor), ((Player) actor).getLocation()); + fp.runAction(() -> { + if (tool instanceof BrushTool) { + ((BlockTool) tool).actPrimary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), maskedPlayerWrapper, session, location); + } else { + reset((BlockTool) tool).actPrimary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), maskedPlayerWrapper, session, location); } }, false, true); event.setCancelled(true); return; } } -//======= -// RegionSelector selector = session.getRegionSelector(player.getWorld()); -// BlockVector3 blockPoint = vector.toBlockPoint(); -// if (selector.selectSecondary(blockPoint, ActorSelectorLimits.forActor(player))) { -// selector.explainSecondarySelection(actor, session, blockPoint); -// } -// -// event.setCancelled(true); -// return; -// } -// -// Tool tool = session.getTool(player.getItemInHand(HandSide.MAIN_HAND).getType()); -// if (tool instanceof BlockTool) { -// if (tool.canUse(player)) { -// ((BlockTool) tool).actPrimary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), player, session, location); -// event.setCancelled(true); -//>>>>>>> 399e0ad5... Refactor vector system to be cleaner } } } @@ -459,7 +431,6 @@ public class PlatformManager { } } - @SuppressWarnings("deprecation") @Subscribe public void handlePlayerInput(PlayerInputEvent event) { // Create a proxy actor with a potentially different world for @@ -477,7 +448,7 @@ public class PlatformManager { try { switch (event.getInputType()) { case PRIMARY: { - if (player.getItemInHand(HandSide.MAIN_HAND).getType().equals(getConfiguration().navigationWand)) { + if (player.getItemInHand(HandSide.MAIN_HAND).getType().getId().equals(getConfiguration().navigationWand)) { if (getConfiguration().navigationWandMaxDistance <= 0) { return; } @@ -497,16 +468,11 @@ public class PlatformManager { return; } - Tool tool = session.getTool(player); - if (tool != null && tool instanceof DoubleActionTraceTool) { + Tool tool = session.getTool(player.getItemInHand(HandSide.MAIN_HAND).getType()); + if (tool instanceof DoubleActionTraceTool) { if (tool.canUse(player)) { FawePlayer fp = FawePlayer.wrap(player); - fp.runAsyncIfFree(new Runnable() { - @Override - public void run() { - reset((DoubleActionTraceTool) tool).actSecondary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), player, session); - } - }); + fp.runAsyncIfFree(() -> reset((DoubleActionTraceTool) tool).actSecondary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), player, session)); event.setCancelled(true); return; } @@ -515,7 +481,7 @@ public class PlatformManager { } case SECONDARY: { - if (player.getItemInHand(HandSide.MAIN_HAND).getType().equals(getConfiguration().navigationWand)) { + if (player.getItemInHand(HandSide.MAIN_HAND).getType().getId().equals(getConfiguration().navigationWand)) { if (getConfiguration().navigationWandMaxDistance <= 0) { return; } @@ -532,16 +498,11 @@ public class PlatformManager { return; } - Tool tool = session.getTool(player); - if (tool != null && tool instanceof TraceTool) { + Tool tool = session.getTool(player.getItemInHand(HandSide.MAIN_HAND).getType()); + if (tool instanceof TraceTool) { if (tool.canUse(player)) { FawePlayer fp = FawePlayer.wrap(player); - fp.runAction(new Runnable() { - @Override - public void run() { - reset((TraceTool) tool).actPrimary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), player, session); - } - }, false, true); + fp.runAction(() -> reset((TraceTool) tool).actPrimary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), player, session), false, true); event.setCancelled(true); return; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/BlockPattern.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/BlockPattern.java index 7a41cc062..8f0560364 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/BlockPattern.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/pattern/BlockPattern.java @@ -27,8 +27,7 @@ import com.sk89q.worldedit.world.block.BlockStateHolder; /** * A pattern that returns the same {@link BaseBlock} each time. */ -@Deprecated -public class BlockPattern implements Pattern { +public class BlockPattern extends AbstractPattern { private BaseBlock block; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/BlockVector3.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/BlockVector3.java index 367efdb69..d9dba5d55 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/BlockVector3.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/BlockVector3.java @@ -29,7 +29,7 @@ import java.util.Comparator; /** * An immutable 3-dimensional vector. */ -public class BlockVector3 { +public final class BlockVector3 { public static final BlockVector3 ZERO = new BlockVector3(0, 0, 0); public static final BlockVector3 UNIT_X = new BlockVector3(1, 0, 0); @@ -641,4 +641,4 @@ public class BlockVector3 { return "(" + x + ", " + y + ", " + z + ")"; } -} \ No newline at end of file +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/Vector3.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/Vector3.java index 172a75687..37b626664 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/Vector3.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/Vector3.java @@ -31,7 +31,7 @@ import java.util.Comparator; /** * An immutable 3-dimensional vector. */ -public class Vector3 { +public final class Vector3 { public static final Vector3 ZERO = new Vector3(0, 0, 0); public static final Vector3 UNIT_X = new Vector3(1, 0, 0); @@ -40,6 +40,21 @@ public class Vector3 { public static final Vector3 ONE = new Vector3(1, 1, 1); public static Vector3 at(double x, double y, double z) { + // switch for efficiency on typical cases + // in MC y is rarely 0/1 on selections + int yTrunc = (int) y; + switch (yTrunc) { + case 0: + if (x == 0 && y == 0 && z == 0) { + return ZERO; + } + break; + case 1: + if (x == 1 && y == 1 && z == 1) { + return ONE; + } + break; + } return new Vector3(x, y, z); } @@ -622,26 +637,26 @@ public class Vector3 { @Override public boolean equals(Object obj) { - if (obj == this) return true; if (!(obj instanceof Vector3)) { return false; } Vector3 other = (Vector3) obj; - return other.getX() == this.getX() && other.getZ() == this.getZ() && other.getY() == this.getY(); + return other.x == this.x && other.y == this.y && other.z == this.z; } @Override public int hashCode() { - return ((int) getX() ^ ((int) getZ() << 16)) ^ ((int) getY() << 30); + int hash = 17; + hash = 31 * hash + Double.hashCode(x); + hash = 31 * hash + Double.hashCode(y); + hash = 31 * hash + Double.hashCode(z); + return hash; } @Override public String toString() { - String x = (getX() == getBlockX() ? "" + getBlockX() : "" + getX()); - String y = (getY() == getBlockY() ? "" + getBlockY() : "" + getY()); - String z = (getZ() == getBlockZ() ? "" + getBlockZ() : "" + getZ()); return "(" + x + ", " + y + ", " + z + ")"; } -} \ No newline at end of file +} From 2407f9246f892d81f4f7703fe2d943e93c050a66 Mon Sep 17 00:00:00 2001 From: matt <4009945+MattBDev@users.noreply.github.com> Date: Wed, 3 Apr 2019 00:21:42 -0400 Subject: [PATCH 08/11] How did it compile locally? --- .../src/main/java/com/sk89q/worldedit/math/BlockVector3.java | 2 +- .../src/main/java/com/sk89q/worldedit/math/Vector3.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/BlockVector3.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/BlockVector3.java index d9dba5d55..0d6447ceb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/BlockVector3.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/BlockVector3.java @@ -29,7 +29,7 @@ import java.util.Comparator; /** * An immutable 3-dimensional vector. */ -public final class BlockVector3 { +public class BlockVector3 { public static final BlockVector3 ZERO = new BlockVector3(0, 0, 0); public static final BlockVector3 UNIT_X = new BlockVector3(1, 0, 0); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/Vector3.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/Vector3.java index 37b626664..e5157e939 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/Vector3.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/Vector3.java @@ -31,7 +31,7 @@ import java.util.Comparator; /** * An immutable 3-dimensional vector. */ -public final class Vector3 { +public class Vector3 { public static final Vector3 ZERO = new Vector3(0, 0, 0); public static final Vector3 UNIT_X = new Vector3(1, 0, 0); From 9fbcbc7cea2186016753c0cd49e9e33d5fd7e1c7 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Wed, 3 Apr 2019 15:40:31 +1100 Subject: [PATCH 09/11] not As there are actual commands that will only accept blocks --- .../sk89q/worldedit/command/RegionCommands.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java index ea648056d..ecb0ed78a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java @@ -227,7 +227,7 @@ public class RegionCommands extends MethodCommands { @Command( aliases = {"/line"}, - usage = " [thickness]", + usage = " [thickness]", desc = "Draws a line segment between cuboid selection corners", help = "Draws a line segment between cuboid selection corners.\n" + @@ -261,7 +261,7 @@ public class RegionCommands extends MethodCommands { @Command( aliases = {"/curve", "/spline"}, - usage = " [thickness]", + usage = " [thickness]", desc = "Draws a spline through selected points", help = "Draws a spline through selected points.\n" + @@ -343,7 +343,7 @@ public class RegionCommands extends MethodCommands { @Command( aliases = {"/overlay"}, - usage = "", + usage = "", desc = "Set a block on top of blocks in the region", min = 1, max = 1 @@ -393,7 +393,7 @@ public class RegionCommands extends MethodCommands { @Command( aliases = {"/center", "/middle"}, - usage = "", + usage = "", desc = "Set the center block(s)", min = 1, max = 1 @@ -423,7 +423,7 @@ public class RegionCommands extends MethodCommands { @Command( aliases = {"/walls"}, - usage = "", + usage = "", desc = "Build the four sides of the selection", min = 1, max = 1 @@ -439,7 +439,7 @@ public class RegionCommands extends MethodCommands { @Command( aliases = {"/faces", "/outline"}, - usage = "", + usage = "", desc = "Build the walls, ceiling, and floor of a selection", min = 1, max = 1 @@ -735,7 +735,7 @@ public class RegionCommands extends MethodCommands { @Command( aliases = {"/hollow"}, - usage = "[[ ]]", + usage = "[[ ]]", desc = "Hollows out the object contained in this selection", help = "Hollows out the object contained in this selection.\n" + From 929ef4313ab155fe2dae5c895ea5b939898fc692 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Thu, 4 Apr 2019 00:29:44 +1100 Subject: [PATCH 10/11] Link to contributors in splash text --- splash.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/splash.txt b/splash.txt index c63b561f2..6513022a7 100644 --- a/splash.txt +++ b/splash.txt @@ -7,7 +7,7 @@ | | / _____ \ \ /\ / | |____ |__| /__/ \__\ \__/ \__/ |_______| -======= By Empire92 and WorldEdit team ======= +======== Authors https://git.io/fjIDU ======== If you encounter trouble: - Run `build` in a separate Gradle run From 6f3888a9639dc4c32ced7cc044878e9577af5871 Mon Sep 17 00:00:00 2001 From: matt <4009945+MattBDev@users.noreply.github.com> Date: Wed, 3 Apr 2019 12:17:24 -0400 Subject: [PATCH 11/11] Fixes #91 --- build.gradle | 5 +++-- worldedit-bukkit/build.gradle | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index ac4274c38..853a547fe 100644 --- a/build.gradle +++ b/build.gradle @@ -10,18 +10,19 @@ buildscript { resolutionStrategy { force 'com.google.guava:guava:21.0' force 'org.ow2.asm:asm:6.0_BETA' + force 'commons-io:commons-io:2.4' } } dependencies { classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4' - classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.7.5' - classpath 'org.ajoberstar:gradle-git:1.7.2' + classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.8.1' } } plugins { id 'net.minecrell.licenser' version '0.4.1' apply false + id "org.ajoberstar.grgit" version "2.3.0" } apply plugin: 'java' diff --git a/worldedit-bukkit/build.gradle b/worldedit-bukkit/build.gradle index 1e315e6b1..2e4f7c8cf 100644 --- a/worldedit-bukkit/build.gradle +++ b/worldedit-bukkit/build.gradle @@ -80,7 +80,10 @@ task copyFiles { shadowJar { dependencies { + relocate "org.slf4j", "com.sk89q.worldedit.slf4j" include(dependency(':worldedit-core')) + include(dependency('org.slf4j:slf4j-api')) + include(dependency("org.slf4j:slf4j-jdk14")) } archiveName = "${parent.name}-${project.name.replaceAll("worldedit-", "")}-${parent.version}.jar" destinationDir = file '../target'