From cbaa9cd2a05125620a6ceeed2d009c419c58652c Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Thu, 16 May 2024 23:12:06 -0400 Subject: [PATCH] Block refactory --- .../world/GeyserSpigotBlockPlaceListener.java | 3 +- .../GeyserSpigotNativeWorldManager.java | 3 +- .../manager/GeyserSpigotWorldManager.java | 8 +- .../java/org/geysermc/geyser/GeyserImpl.java | 13 + .../geyser/entity/type/FishingHookEntity.java | 3 +- .../erosion/GeyserboundPacketHandlerImpl.java | 3 +- .../geyser/level/block/BlockStateValues.java | 21 +- .../geysermc/geyser/level/block/Blocks.java | 2820 +++++++++++++++++ .../level/block/property/ChestType.java | 34 + .../level/block/property/Properties.java | 146 + .../geyser/level/block/property/Property.java | 43 + .../geyser/level/block/type/BannerBlock.java | 39 + .../geyser/level/block/type/BedBlock.java | 39 + .../geyser/level/block/type/Block.java | 152 + .../geyser/level/block/type/BlockState.java | 64 + .../geyser/registry/BlockRegistries.java | 12 +- .../geyser/registry/ListRegistry.java | 103 + .../populator/BlockRegistryPopulator.java | 2 - .../geyser/session/GeyserSession.java | 3 - .../geyser/session/cache/ChunkCache.java | 13 +- .../inventory/ShulkerInventoryTranslator.java | 3 +- .../chest/DoubleChestInventoryTranslator.java | 7 +- .../entity/BannerBlockEntityTranslator.java | 10 +- .../entity/BeaconBlockEntityTranslator.java | 3 +- .../entity/BedBlockEntityTranslator.java | 12 +- .../block/entity/BedrockOnlyBlockEntity.java | 3 +- .../block/entity/BlockEntityTranslator.java | 5 +- .../BrushableBlockEntityTranslator.java | 7 +- .../entity/CampfireBlockEntityTranslator.java | 3 +- .../CommandBlockBlockEntityTranslator.java | 7 +- .../DecoratedPotBlockEntityTranslator.java | 3 +- .../DoubleChestBlockEntityTranslator.java | 46 +- .../entity/EmptyBlockEntityTranslator.java | 3 +- .../EndGatewayBlockEntityTranslator.java | 3 +- .../FlowerPotBlockEntityTranslator.java | 7 +- .../JigsawBlockBlockEntityTranslator.java | 5 +- .../level/block/entity/PistonBlockEntity.java | 15 +- .../ShulkerBoxBlockEntityTranslator.java | 12 +- .../entity/SignBlockEntityTranslator.java | 3 +- .../entity/SkullBlockEntityTranslator.java | 15 +- .../entity/SpawnerBlockEntityTranslator.java | 5 +- .../StructureBlockBlockEntityTranslator.java | 5 +- .../TrialSpawnerBlockEntityTranslator.java | 3 +- .../BedrockBlockPickRequestTranslator.java | 3 +- ...BedrockInventoryTransactionTranslator.java | 3 +- .../player/BedrockActionTranslator.java | 3 +- .../level/JavaBlockEntityDataTranslator.java | 11 +- .../java/level/JavaBlockEventTranslator.java | 3 +- .../java/level/JavaExplodeTranslator.java | 3 +- .../JavaLevelChunkWithLightTranslator.java | 13 +- .../org/geysermc/geyser/util/ChunkUtils.java | 14 +- .../org/geysermc/geyser/util/SoundUtils.java | 3 +- .../geysermc/geyser/util/StatisticsUtils.java | 9 +- gradle/libs.versions.toml | 3 +- 54 files changed, 3620 insertions(+), 157 deletions(-) create mode 100644 core/src/main/java/org/geysermc/geyser/level/block/Blocks.java create mode 100644 core/src/main/java/org/geysermc/geyser/level/block/property/ChestType.java create mode 100644 core/src/main/java/org/geysermc/geyser/level/block/property/Properties.java create mode 100644 core/src/main/java/org/geysermc/geyser/level/block/property/Property.java create mode 100644 core/src/main/java/org/geysermc/geyser/level/block/type/BannerBlock.java create mode 100644 core/src/main/java/org/geysermc/geyser/level/block/type/BedBlock.java create mode 100644 core/src/main/java/org/geysermc/geyser/level/block/type/Block.java create mode 100644 core/src/main/java/org/geysermc/geyser/level/block/type/BlockState.java create mode 100644 core/src/main/java/org/geysermc/geyser/registry/ListRegistry.java diff --git a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/GeyserSpigotBlockPlaceListener.java b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/GeyserSpigotBlockPlaceListener.java index 71aba11f9..b5f4bd4f9 100644 --- a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/GeyserSpigotBlockPlaceListener.java +++ b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/GeyserSpigotBlockPlaceListener.java @@ -34,6 +34,7 @@ import org.bukkit.event.Listener; import org.bukkit.event.block.BlockPlaceEvent; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.level.block.BlockStateValues; +import org.geysermc.geyser.level.block.type.Block; import org.geysermc.geyser.platform.spigot.world.manager.GeyserSpigotWorldManager; import org.geysermc.geyser.registry.BlockRegistries; import org.geysermc.geyser.session.GeyserSession; @@ -59,7 +60,7 @@ public class GeyserSpigotBlockPlaceListener implements Listener { event.getBlockPlaced().getX(), event.getBlockPlaced().getY(), event.getBlockPlaced().getZ()))); } else { String javaBlockId = event.getBlockPlaced().getBlockData().getAsString(); - placeBlockSoundPacket.setExtraData(session.getBlockMappings().getBedrockBlockId(BlockRegistries.JAVA_IDENTIFIER_TO_ID.get().getOrDefault(javaBlockId, BlockStateValues.JAVA_AIR_ID))); + placeBlockSoundPacket.setExtraData(session.getBlockMappings().getBedrockBlockId(BlockRegistries.JAVA_IDENTIFIER_TO_ID.get().getOrDefault(javaBlockId, Block.JAVA_AIR_ID))); } placeBlockSoundPacket.setIdentifier(":"); session.sendUpstreamPacket(placeBlockSoundPacket); diff --git a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotNativeWorldManager.java b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotNativeWorldManager.java index 45e84d254..c99ca4e78 100644 --- a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotNativeWorldManager.java +++ b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotNativeWorldManager.java @@ -34,6 +34,7 @@ import org.geysermc.geyser.adapters.WorldAdapter; import org.geysermc.geyser.adapters.paper.PaperAdapters; import org.geysermc.geyser.adapters.spigot.SpigotAdapters; import org.geysermc.geyser.level.block.BlockStateValues; +import org.geysermc.geyser.level.block.type.Block; import org.geysermc.geyser.session.GeyserSession; public class GeyserSpigotNativeWorldManager extends GeyserSpigotWorldManager { @@ -52,7 +53,7 @@ public class GeyserSpigotNativeWorldManager extends GeyserSpigotWorldManager { public int getBlockAt(GeyserSession session, int x, int y, int z) { Player player = Bukkit.getPlayer(session.getPlayerEntity().getUsername()); if (player == null) { - return BlockStateValues.JAVA_AIR_ID; + return Block.JAVA_AIR_ID; } return adapter.getBlockAt(player.getWorld(), x, y, z); } diff --git a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotWorldManager.java b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotWorldManager.java index 47086d36c..a04c60126 100644 --- a/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotWorldManager.java +++ b/bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotWorldManager.java @@ -70,12 +70,12 @@ public class GeyserSpigotWorldManager extends WorldManager { public int getBlockAt(GeyserSession session, int x, int y, int z) { Player bukkitPlayer; if ((bukkitPlayer = Bukkit.getPlayer(session.getPlayerEntity().getUsername())) == null) { - return BlockStateValues.JAVA_AIR_ID; + return org.geysermc.geyser.level.block.type.Block.JAVA_AIR_ID; } World world = bukkitPlayer.getWorld(); if (!world.isChunkLoaded(x >> 4, z >> 4)) { // If the chunk isn't loaded, how could we even be here? - return BlockStateValues.JAVA_AIR_ID; + return org.geysermc.geyser.level.block.type.Block.JAVA_AIR_ID; } return getBlockNetworkId(world.getBlockAt(x, y, z)); @@ -86,9 +86,9 @@ public class GeyserSpigotWorldManager extends WorldManager { // Terrible behavior, but this is basically what's always been happening behind the scenes anyway. CompletableFuture blockData = new CompletableFuture<>(); Bukkit.getRegionScheduler().execute(this.plugin, block.getLocation(), () -> blockData.complete(block.getBlockData().getAsString())); - return BlockRegistries.JAVA_IDENTIFIER_TO_ID.getOrDefault(blockData.join(), BlockStateValues.JAVA_AIR_ID); + return BlockRegistries.JAVA_IDENTIFIER_TO_ID.getOrDefault(blockData.join(), org.geysermc.geyser.level.block.type.Block.JAVA_AIR_ID); } - return BlockRegistries.JAVA_IDENTIFIER_TO_ID.getOrDefault(block.getBlockData().getAsString(), BlockStateValues.JAVA_AIR_ID); + return BlockRegistries.JAVA_IDENTIFIER_TO_ID.getOrDefault(block.getBlockData().getAsString(), org.geysermc.geyser.level.block.type.Block.JAVA_AIR_ID); } @Override diff --git a/core/src/main/java/org/geysermc/geyser/GeyserImpl.java b/core/src/main/java/org/geysermc/geyser/GeyserImpl.java index a60a14ea0..4f572ef63 100644 --- a/core/src/main/java/org/geysermc/geyser/GeyserImpl.java +++ b/core/src/main/java/org/geysermc/geyser/GeyserImpl.java @@ -69,6 +69,7 @@ import org.geysermc.geyser.event.GeyserEventBus; import org.geysermc.geyser.extension.GeyserExtensionManager; import org.geysermc.geyser.impl.MinecraftVersionImpl; import org.geysermc.geyser.level.WorldManager; +import org.geysermc.geyser.level.block.Blocks; import org.geysermc.geyser.network.GameProtocol; import org.geysermc.geyser.network.netty.GeyserServer; import org.geysermc.geyser.registry.BlockRegistries; @@ -256,6 +257,18 @@ public class GeyserImpl implements GeyserApi { } VersionCheckUtils.checkForOutdatedJava(logger); + + Blocks.VAULT.javaId(); + for (int i = 0; i < BlockRegistries.JAVA_BLOCKS.get().length; i++) { + String cleanIdentifier = BlockRegistries.JAVA_BLOCKS.get(i).getCleanJavaIdentifier(); + String newIdentifier = BlockRegistries.BLOCK_STATES.get(i).block().javaIdentifier(); + if (!cleanIdentifier.equals(newIdentifier)) { + System.out.println("Check block " + BlockRegistries.BLOCK_STATES.get(i).block().javaIdentifier()); + break; + } + } + System.out.println(BlockRegistries.JAVA_BLOCKS.get().length); + System.out.println(BlockRegistries.BLOCK_STATES.get().size()); } private void startInstance() { diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/FishingHookEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/FishingHookEntity.java index f4c0cea36..26a64bcae 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/FishingHookEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/FishingHookEntity.java @@ -33,6 +33,7 @@ import org.geysermc.erosion.util.BlockPositionIterator; import org.geysermc.geyser.entity.EntityDefinitions; import org.geysermc.geyser.entity.type.player.PlayerEntity; import org.geysermc.geyser.level.block.BlockStateValues; +import org.geysermc.geyser.level.block.type.Block; import org.geysermc.geyser.level.physics.BoundingBox; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.collision.BlockCollision; @@ -162,7 +163,7 @@ public class FishingHookEntity extends ThrowableEntity { */ protected boolean isInAir() { int block = session.getGeyser().getWorldManager().getBlockAt(session, position.toInt()); - return block == BlockStateValues.JAVA_AIR_ID; + return block == Block.JAVA_AIR_ID; } @Override diff --git a/core/src/main/java/org/geysermc/geyser/erosion/GeyserboundPacketHandlerImpl.java b/core/src/main/java/org/geysermc/geyser/erosion/GeyserboundPacketHandlerImpl.java index 7d5bba1e8..b76dc0b85 100644 --- a/core/src/main/java/org/geysermc/geyser/erosion/GeyserboundPacketHandlerImpl.java +++ b/core/src/main/java/org/geysermc/geyser/erosion/GeyserboundPacketHandlerImpl.java @@ -43,6 +43,7 @@ import org.geysermc.erosion.packet.backendbound.BackendboundInitializePacket; import org.geysermc.erosion.packet.backendbound.BackendboundPacket; import org.geysermc.erosion.packet.geyserbound.*; import org.geysermc.geyser.level.block.BlockStateValues; +import org.geysermc.geyser.level.block.type.Block; import org.geysermc.geyser.level.physics.Direction; import org.geysermc.geyser.network.GameProtocol; import org.geysermc.geyser.session.GeyserSession; @@ -119,7 +120,7 @@ public final class GeyserboundPacketHandlerImpl extends AbstractGeyserboundPacke } CompletableFuture future = this.asyncPendingLookups.remove(transactionId); if (future != null) { - future.complete(BlockStateValues.JAVA_AIR_ID); + future.complete(Block.JAVA_AIR_ID); } } diff --git a/core/src/main/java/org/geysermc/geyser/level/block/BlockStateValues.java b/core/src/main/java/org/geysermc/geyser/level/block/BlockStateValues.java index 52759c709..205486ced 100644 --- a/core/src/main/java/org/geysermc/geyser/level/block/BlockStateValues.java +++ b/core/src/main/java/org/geysermc/geyser/level/block/BlockStateValues.java @@ -29,6 +29,7 @@ import com.fasterxml.jackson.databind.JsonNode; import it.unimi.dsi.fastutil.ints.*; import it.unimi.dsi.fastutil.objects.Object2IntMap; import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; +import org.geysermc.geyser.level.block.type.Block; import org.geysermc.geyser.level.physics.Direction; import org.geysermc.geyser.level.physics.PistonBehavior; import org.geysermc.geyser.registry.BlockRegistries; @@ -48,7 +49,6 @@ public final class BlockStateValues { private static final Int2IntMap BANNER_COLORS = new FixedInt2IntMap(); private static final Int2ByteMap BED_COLORS = new FixedInt2ByteMap(); private static final Int2IntMap BRUSH_PROGRESS = new Int2IntOpenHashMap(); - private static final Int2ByteMap COMMAND_BLOCK_VALUES = new Int2ByteOpenHashMap(); private static final Int2ObjectMap DOUBLE_CHEST_VALUES = new Int2ObjectOpenHashMap<>(); private static final Int2ObjectMap FLOWER_POT_VALUES = new Int2ObjectOpenHashMap<>(); private static final IntSet HORIZONTAL_FACING_JIGSAWS = new IntOpenHashSet(); @@ -110,11 +110,6 @@ public final class BlockStateValues { } } - if (javaId.contains("command_block")) { - COMMAND_BLOCK_VALUES.put(javaBlockState, javaId.contains("conditional=true") ? (byte) 1 : (byte) 0); - return; - } - if (blockData.get("double_chest_position") != null) { boolean isX = (blockData.get("x") != null); boolean isDirectionPositive = ((blockData.get("x") != null && blockData.get("x").asBoolean()) || @@ -277,16 +272,6 @@ public final class BlockStateValues { return ALL_CAULDRONS.contains(state); } - /** - * The block state in Java and Bedrock both contain the conditional bit, however command block block entity tags - * in Bedrock need the conditional information. - * - * @return the list of all command blocks and if they are conditional (1 or 0) - */ - public static Int2ByteMap getCommandBlockValues() { - return COMMAND_BLOCK_VALUES; - } - /** * All double chest values are part of the block state in Java and part of the block entity tag in Bedrock. * This gives the DoubleChestValue that can be calculated into the final tag. @@ -356,7 +341,7 @@ public final class BlockStateValues { * @return Block state for the piston head */ public static int getPistonHead(Direction direction) { - return PISTON_HEADS.getOrDefault(direction, BlockStateValues.JAVA_AIR_ID); + return PISTON_HEADS.getOrDefault(direction, Block.JAVA_AIR_ID); } /** @@ -420,7 +405,7 @@ public final class BlockStateValues { } public static boolean canPistonMoveBlock(int javaId, boolean isPushing) { - if (javaId == JAVA_AIR_ID) { + if (javaId == Block.JAVA_AIR_ID) { return true; } // Pistons can only be moved if they aren't extended diff --git a/core/src/main/java/org/geysermc/geyser/level/block/Blocks.java b/core/src/main/java/org/geysermc/geyser/level/block/Blocks.java new file mode 100644 index 000000000..426895269 --- /dev/null +++ b/core/src/main/java/org/geysermc/geyser/level/block/Blocks.java @@ -0,0 +1,2820 @@ +/* + * Copyright (c) 2024 GeyserMC. http://geysermc.org + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * @author GeyserMC + * @link https://github.com/GeyserMC/Geyser + */ + +package org.geysermc.geyser.level.block; + +import org.geysermc.geyser.level.block.type.BannerBlock; +import org.geysermc.geyser.level.block.type.BedBlock; +import org.geysermc.geyser.level.block.type.Block; +import org.geysermc.geyser.level.physics.Axis; +import org.geysermc.geyser.level.physics.Direction; +import org.geysermc.geyser.registry.BlockRegistries; + +import static org.geysermc.geyser.level.block.property.Properties.*; +import static org.geysermc.geyser.level.block.type.Block.builder; + +@SuppressWarnings("unused") +public final class Blocks { + public static final Block AIR = register(new Block("air", builder())); + public static final Block STONE = register(new Block("stone", builder())); + public static final Block GRANITE = register(new Block("granite", builder())); + public static final Block POLISHED_GRANITE = register(new Block("polished_granite", builder())); + public static final Block DIORITE = register(new Block("diorite", builder())); + public static final Block POLISHED_DIORITE = register(new Block("polished_diorite", builder())); + public static final Block ANDESITE = register(new Block("andesite", builder())); + public static final Block POLISHED_ANDESITE = register(new Block("polished_andesite", builder())); + public static final Block GRASS_BLOCK = register(new Block("grass_block", builder() + .booleanState(SNOWY))); + public static final Block DIRT = register(new Block("dirt", builder())); + public static final Block COARSE_DIRT = register(new Block("coarse_dirt", builder())); + public static final Block PODZOL = register(new Block("podzol", builder() + .booleanState(SNOWY))); + public static final Block COBBLESTONE = register(new Block("cobblestone", builder())); + public static final Block OAK_PLANKS = register(new Block("oak_planks", builder())); + public static final Block SPRUCE_PLANKS = register(new Block("spruce_planks", builder())); + public static final Block BIRCH_PLANKS = register(new Block("birch_planks", builder())); + public static final Block JUNGLE_PLANKS = register(new Block("jungle_planks", builder())); + public static final Block ACACIA_PLANKS = register(new Block("acacia_planks", builder())); + public static final Block CHERRY_PLANKS = register(new Block("cherry_planks", builder())); + public static final Block DARK_OAK_PLANKS = register(new Block("dark_oak_planks", builder())); + public static final Block MANGROVE_PLANKS = register(new Block("mangrove_planks", builder())); + public static final Block BAMBOO_PLANKS = register(new Block("bamboo_planks", builder())); + public static final Block BAMBOO_MOSAIC = register(new Block("bamboo_mosaic", builder())); + public static final Block OAK_SAPLING = register(new Block("oak_sapling", builder() + .intState(STAGE, 0, 1))); + public static final Block SPRUCE_SAPLING = register(new Block("spruce_sapling", builder() + .intState(STAGE, 0, 1))); + public static final Block BIRCH_SAPLING = register(new Block("birch_sapling", builder() + .intState(STAGE, 0, 1))); + public static final Block JUNGLE_SAPLING = register(new Block("jungle_sapling", builder() + .intState(STAGE, 0, 1))); + public static final Block ACACIA_SAPLING = register(new Block("acacia_sapling", builder() + .intState(STAGE, 0, 1))); + public static final Block CHERRY_SAPLING = register(new Block("cherry_sapling", builder() + .intState(STAGE, 0, 1))); + public static final Block DARK_OAK_SAPLING = register(new Block("dark_oak_sapling", builder() + .intState(STAGE, 0, 1))); + public static final Block MANGROVE_PROPAGULE = register(new Block("mangrove_propagule", builder() + .intState(AGE_4, 0, 4) + .booleanState(HANGING) + .intState(STAGE, 0, 1) + .booleanState(WATERLOGGED))); + public static final Block BEDROCK = register(new Block("bedrock", builder())); + public static final Block WATER = register(new Block("water", builder() + .intState(LEVEL, 0, 15))); + public static final Block LAVA = register(new Block("lava", builder() + .intState(LEVEL, 0, 15))); + public static final Block SAND = register(new Block("sand", builder())); + public static final Block SUSPICIOUS_SAND = register(new Block("suspicious_sand", builder() + .intState(DUSTED, 0, 3))); + public static final Block RED_SAND = register(new Block("red_sand", builder())); + public static final Block GRAVEL = register(new Block("gravel", builder())); + public static final Block SUSPICIOUS_GRAVEL = register(new Block("suspicious_gravel", builder() + .intState(DUSTED, 0, 3))); + public static final Block GOLD_ORE = register(new Block("gold_ore", builder())); + public static final Block DEEPSLATE_GOLD_ORE = register(new Block("deepslate_gold_ore", builder())); + public static final Block IRON_ORE = register(new Block("iron_ore", builder())); + public static final Block DEEPSLATE_IRON_ORE = register(new Block("deepslate_iron_ore", builder())); + public static final Block COAL_ORE = register(new Block("coal_ore", builder())); + public static final Block DEEPSLATE_COAL_ORE = register(new Block("deepslate_coal_ore", builder())); + public static final Block NETHER_GOLD_ORE = register(new Block("nether_gold_ore", builder())); + public static final Block OAK_LOG = register(new Block("oak_log", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block SPRUCE_LOG = register(new Block("spruce_log", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block BIRCH_LOG = register(new Block("birch_log", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block JUNGLE_LOG = register(new Block("jungle_log", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block ACACIA_LOG = register(new Block("acacia_log", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block CHERRY_LOG = register(new Block("cherry_log", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block DARK_OAK_LOG = register(new Block("dark_oak_log", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block MANGROVE_LOG = register(new Block("mangrove_log", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block MANGROVE_ROOTS = register(new Block("mangrove_roots", builder() + .booleanState(WATERLOGGED))); + public static final Block MUDDY_MANGROVE_ROOTS = register(new Block("muddy_mangrove_roots", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block BAMBOO_BLOCK = register(new Block("bamboo_block", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block STRIPPED_SPRUCE_LOG = register(new Block("stripped_spruce_log", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block STRIPPED_BIRCH_LOG = register(new Block("stripped_birch_log", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block STRIPPED_JUNGLE_LOG = register(new Block("stripped_jungle_log", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block STRIPPED_ACACIA_LOG = register(new Block("stripped_acacia_log", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block STRIPPED_CHERRY_LOG = register(new Block("stripped_cherry_log", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block STRIPPED_DARK_OAK_LOG = register(new Block("stripped_dark_oak_log", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block STRIPPED_OAK_LOG = register(new Block("stripped_oak_log", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block STRIPPED_MANGROVE_LOG = register(new Block("stripped_mangrove_log", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block STRIPPED_BAMBOO_BLOCK = register(new Block("stripped_bamboo_block", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block OAK_WOOD = register(new Block("oak_wood", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block SPRUCE_WOOD = register(new Block("spruce_wood", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block BIRCH_WOOD = register(new Block("birch_wood", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block JUNGLE_WOOD = register(new Block("jungle_wood", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block ACACIA_WOOD = register(new Block("acacia_wood", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block CHERRY_WOOD = register(new Block("cherry_wood", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block DARK_OAK_WOOD = register(new Block("dark_oak_wood", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block MANGROVE_WOOD = register(new Block("mangrove_wood", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block STRIPPED_OAK_WOOD = register(new Block("stripped_oak_wood", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block STRIPPED_SPRUCE_WOOD = register(new Block("stripped_spruce_wood", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block STRIPPED_BIRCH_WOOD = register(new Block("stripped_birch_wood", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block STRIPPED_JUNGLE_WOOD = register(new Block("stripped_jungle_wood", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block STRIPPED_ACACIA_WOOD = register(new Block("stripped_acacia_wood", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block STRIPPED_CHERRY_WOOD = register(new Block("stripped_cherry_wood", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block STRIPPED_DARK_OAK_WOOD = register(new Block("stripped_dark_oak_wood", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block STRIPPED_MANGROVE_WOOD = register(new Block("stripped_mangrove_wood", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block OAK_LEAVES = register(new Block("oak_leaves", builder() + .intState(DISTANCE, 1, 7) + .booleanState(PERSISTENT) + .booleanState(WATERLOGGED))); + public static final Block SPRUCE_LEAVES = register(new Block("spruce_leaves", builder() + .intState(DISTANCE, 1, 7) + .booleanState(PERSISTENT) + .booleanState(WATERLOGGED))); + public static final Block BIRCH_LEAVES = register(new Block("birch_leaves", builder() + .intState(DISTANCE, 1, 7) + .booleanState(PERSISTENT) + .booleanState(WATERLOGGED))); + public static final Block JUNGLE_LEAVES = register(new Block("jungle_leaves", builder() + .intState(DISTANCE, 1, 7) + .booleanState(PERSISTENT) + .booleanState(WATERLOGGED))); + public static final Block ACACIA_LEAVES = register(new Block("acacia_leaves", builder() + .intState(DISTANCE, 1, 7) + .booleanState(PERSISTENT) + .booleanState(WATERLOGGED))); + public static final Block CHERRY_LEAVES = register(new Block("cherry_leaves", builder() + .intState(DISTANCE, 1, 7) + .booleanState(PERSISTENT) + .booleanState(WATERLOGGED))); + public static final Block DARK_OAK_LEAVES = register(new Block("dark_oak_leaves", builder() + .intState(DISTANCE, 1, 7) + .booleanState(PERSISTENT) + .booleanState(WATERLOGGED))); + public static final Block MANGROVE_LEAVES = register(new Block("mangrove_leaves", builder() + .intState(DISTANCE, 1, 7) + .booleanState(PERSISTENT) + .booleanState(WATERLOGGED))); + public static final Block AZALEA_LEAVES = register(new Block("azalea_leaves", builder() + .intState(DISTANCE, 1, 7) + .booleanState(PERSISTENT) + .booleanState(WATERLOGGED))); + public static final Block FLOWERING_AZALEA_LEAVES = register(new Block("flowering_azalea_leaves", builder() + .intState(DISTANCE, 1, 7) + .booleanState(PERSISTENT) + .booleanState(WATERLOGGED))); + public static final Block SPONGE = register(new Block("sponge", builder())); + public static final Block WET_SPONGE = register(new Block("wet_sponge", builder())); + public static final Block GLASS = register(new Block("glass", builder())); + public static final Block LAPIS_ORE = register(new Block("lapis_ore", builder())); + public static final Block DEEPSLATE_LAPIS_ORE = register(new Block("deepslate_lapis_ore", builder())); + public static final Block LAPIS_BLOCK = register(new Block("lapis_block", builder())); + public static final Block DISPENSER = register(new Block("dispenser", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN) + .booleanState(TRIGGERED))); + public static final Block SANDSTONE = register(new Block("sandstone", builder())); + public static final Block CHISELED_SANDSTONE = register(new Block("chiseled_sandstone", builder())); + public static final Block CUT_SANDSTONE = register(new Block("cut_sandstone", builder())); + public static final Block NOTE_BLOCK = register(new Block("note_block", builder() + .enumState(NOTEBLOCK_INSTRUMENT, "harp", "basedrum", "snare", "hat", "bass", "flute", "bell", "guitar", "chime", "xylophone", "iron_xylophone", "cow_bell", "didgeridoo", "bit", "banjo", "pling", "zombie", "skeleton", "creeper", "dragon", "wither_skeleton", "piglin", "custom_head") + .intState(NOTE, 0, 24) + .booleanState(POWERED))); + public static final Block WHITE_BED = register(new BedBlock("white_bed", 0, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(OCCUPIED) + .enumState(BED_PART, "head", "foot"))); + public static final Block ORANGE_BED = register(new BedBlock("orange_bed", 1, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(OCCUPIED) + .enumState(BED_PART, "head", "foot"))); + public static final Block MAGENTA_BED = register(new BedBlock("magenta_bed", 2, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(OCCUPIED) + .enumState(BED_PART, "head", "foot"))); + public static final Block LIGHT_BLUE_BED = register(new BedBlock("light_blue_bed", 3, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(OCCUPIED) + .enumState(BED_PART, "head", "foot"))); + public static final Block YELLOW_BED = register(new BedBlock("yellow_bed", 4, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(OCCUPIED) + .enumState(BED_PART, "head", "foot"))); + public static final Block LIME_BED = register(new BedBlock("lime_bed", 5, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(OCCUPIED) + .enumState(BED_PART, "head", "foot"))); + public static final Block PINK_BED = register(new BedBlock("pink_bed", 6, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(OCCUPIED) + .enumState(BED_PART, "head", "foot"))); + public static final Block GRAY_BED = register(new BedBlock("gray_bed", 7, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(OCCUPIED) + .enumState(BED_PART, "head", "foot"))); + public static final Block LIGHT_GRAY_BED = register(new BedBlock("light_gray_bed", 8, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(OCCUPIED) + .enumState(BED_PART, "head", "foot"))); + public static final Block CYAN_BED = register(new BedBlock("cyan_bed", 9, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(OCCUPIED) + .enumState(BED_PART, "head", "foot"))); + public static final Block PURPLE_BED = register(new BedBlock("purple_bed", 10, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(OCCUPIED) + .enumState(BED_PART, "head", "foot"))); + public static final Block BLUE_BED = register(new BedBlock("blue_bed", 11, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(OCCUPIED) + .enumState(BED_PART, "head", "foot"))); + public static final Block BROWN_BED = register(new BedBlock("brown_bed", 12, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(OCCUPIED) + .enumState(BED_PART, "head", "foot"))); + public static final Block GREEN_BED = register(new BedBlock("green_bed", 13, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(OCCUPIED) + .enumState(BED_PART, "head", "foot"))); + public static final Block RED_BED = register(new BedBlock("red_bed", 14, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(OCCUPIED) + .enumState(BED_PART, "head", "foot"))); + public static final Block BLACK_BED = register(new BedBlock("black_bed", 15, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(OCCUPIED) + .enumState(BED_PART, "head", "foot"))); + public static final Block POWERED_RAIL = register(new Block("powered_rail", builder() + .booleanState(POWERED) + .enumState(RAIL_SHAPE_STRAIGHT, "north_south", "east_west", "ascending_east", "ascending_west", "ascending_north", "ascending_south") + .booleanState(WATERLOGGED))); + public static final Block DETECTOR_RAIL = register(new Block("detector_rail", builder() + .booleanState(POWERED) + .enumState(RAIL_SHAPE_STRAIGHT, "north_south", "east_west", "ascending_east", "ascending_west", "ascending_north", "ascending_south") + .booleanState(WATERLOGGED))); + public static final Block STICKY_PISTON = register(new Block("sticky_piston", builder() + .booleanState(EXTENDED) + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN))); + public static final Block COBWEB = register(new Block("cobweb", builder())); + public static final Block SHORT_GRASS = register(new Block("short_grass", builder())); + public static final Block FERN = register(new Block("fern", builder())); + public static final Block DEAD_BUSH = register(new Block("dead_bush", builder())); + public static final Block SEAGRASS = register(new Block("seagrass", builder())); + public static final Block TALL_SEAGRASS = register(new Block("tall_seagrass", builder() + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower"))); + public static final Block PISTON = register(new Block("piston", builder() + .booleanState(EXTENDED) + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN))); + public static final Block PISTON_HEAD = register(new Block("piston_head", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN) + .booleanState(SHORT) + .enumState(PISTON_TYPE, "normal", "sticky"))); + public static final Block WHITE_WOOL = register(new Block("white_wool", builder())); + public static final Block ORANGE_WOOL = register(new Block("orange_wool", builder())); + public static final Block MAGENTA_WOOL = register(new Block("magenta_wool", builder())); + public static final Block LIGHT_BLUE_WOOL = register(new Block("light_blue_wool", builder())); + public static final Block YELLOW_WOOL = register(new Block("yellow_wool", builder())); + public static final Block LIME_WOOL = register(new Block("lime_wool", builder())); + public static final Block PINK_WOOL = register(new Block("pink_wool", builder())); + public static final Block GRAY_WOOL = register(new Block("gray_wool", builder())); + public static final Block LIGHT_GRAY_WOOL = register(new Block("light_gray_wool", builder())); + public static final Block CYAN_WOOL = register(new Block("cyan_wool", builder())); + public static final Block PURPLE_WOOL = register(new Block("purple_wool", builder())); + public static final Block BLUE_WOOL = register(new Block("blue_wool", builder())); + public static final Block BROWN_WOOL = register(new Block("brown_wool", builder())); + public static final Block GREEN_WOOL = register(new Block("green_wool", builder())); + public static final Block RED_WOOL = register(new Block("red_wool", builder())); + public static final Block BLACK_WOOL = register(new Block("black_wool", builder())); + public static final Block MOVING_PISTON = register(new Block("moving_piston", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN) + .enumState(PISTON_TYPE, "normal", "sticky"))); + public static final Block DANDELION = register(new Block("dandelion", builder())); + public static final Block TORCHFLOWER = register(new Block("torchflower", builder())); + public static final Block POPPY = register(new Block("poppy", builder())); + public static final Block BLUE_ORCHID = register(new Block("blue_orchid", builder())); + public static final Block ALLIUM = register(new Block("allium", builder())); + public static final Block AZURE_BLUET = register(new Block("azure_bluet", builder())); + public static final Block RED_TULIP = register(new Block("red_tulip", builder())); + public static final Block ORANGE_TULIP = register(new Block("orange_tulip", builder())); + public static final Block WHITE_TULIP = register(new Block("white_tulip", builder())); + public static final Block PINK_TULIP = register(new Block("pink_tulip", builder())); + public static final Block OXEYE_DAISY = register(new Block("oxeye_daisy", builder())); + public static final Block CORNFLOWER = register(new Block("cornflower", builder())); + public static final Block WITHER_ROSE = register(new Block("wither_rose", builder())); + public static final Block LILY_OF_THE_VALLEY = register(new Block("lily_of_the_valley", builder())); + public static final Block BROWN_MUSHROOM = register(new Block("brown_mushroom", builder())); + public static final Block RED_MUSHROOM = register(new Block("red_mushroom", builder())); + public static final Block GOLD_BLOCK = register(new Block("gold_block", builder())); + public static final Block IRON_BLOCK = register(new Block("iron_block", builder())); + public static final Block BRICKS = register(new Block("bricks", builder())); + public static final Block TNT = register(new Block("tnt", builder() + .booleanState(UNSTABLE))); + public static final Block BOOKSHELF = register(new Block("bookshelf", builder())); + public static final Block CHISELED_BOOKSHELF = register(new Block("chiseled_bookshelf", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(CHISELED_BOOKSHELF_SLOT_0_OCCUPIED) + .booleanState(CHISELED_BOOKSHELF_SLOT_1_OCCUPIED) + .booleanState(CHISELED_BOOKSHELF_SLOT_2_OCCUPIED) + .booleanState(CHISELED_BOOKSHELF_SLOT_3_OCCUPIED) + .booleanState(CHISELED_BOOKSHELF_SLOT_4_OCCUPIED) + .booleanState(CHISELED_BOOKSHELF_SLOT_5_OCCUPIED))); + public static final Block MOSSY_COBBLESTONE = register(new Block("mossy_cobblestone", builder())); + public static final Block OBSIDIAN = register(new Block("obsidian", builder())); + public static final Block TORCH = register(new Block("torch", builder())); + public static final Block WALL_TORCH = register(new Block("wall_torch", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block FIRE = register(new Block("fire", builder() + .intState(AGE_15, 0, 15) + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(UP) + .booleanState(WEST))); + public static final Block SOUL_FIRE = register(new Block("soul_fire", builder())); + public static final Block SPAWNER = register(new Block("spawner", builder())); + public static final Block OAK_STAIRS = register(new Block("oak_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block CHEST = register(new Block("chest", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(CHEST_TYPE, "single", "left", "right") + .booleanState(WATERLOGGED))); + public static final Block REDSTONE_WIRE = register(new Block("redstone_wire", builder() + .enumState(EAST_REDSTONE, "up", "side", "none") + .enumState(NORTH_REDSTONE, "up", "side", "none") + .intState(POWER, 0, 15) + .enumState(SOUTH_REDSTONE, "up", "side", "none") + .enumState(WEST_REDSTONE, "up", "side", "none"))); + public static final Block DIAMOND_ORE = register(new Block("diamond_ore", builder())); + public static final Block DEEPSLATE_DIAMOND_ORE = register(new Block("deepslate_diamond_ore", builder())); + public static final Block DIAMOND_BLOCK = register(new Block("diamond_block", builder())); + public static final Block CRAFTING_TABLE = register(new Block("crafting_table", builder())); + public static final Block WHEAT = register(new Block("wheat", builder() + .intState(AGE_7, 0, 7))); + public static final Block FARMLAND = register(new Block("farmland", builder() + .intState(MOISTURE, 0, 7))); + public static final Block FURNACE = register(new Block("furnace", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(LIT))); + public static final Block OAK_SIGN = register(new Block("oak_sign", builder() + .intState(ROTATION_16, 0, 15) + .booleanState(WATERLOGGED))); + public static final Block SPRUCE_SIGN = register(new Block("spruce_sign", builder() + .intState(ROTATION_16, 0, 15) + .booleanState(WATERLOGGED))); + public static final Block BIRCH_SIGN = register(new Block("birch_sign", builder() + .intState(ROTATION_16, 0, 15) + .booleanState(WATERLOGGED))); + public static final Block ACACIA_SIGN = register(new Block("acacia_sign", builder() + .intState(ROTATION_16, 0, 15) + .booleanState(WATERLOGGED))); + public static final Block CHERRY_SIGN = register(new Block("cherry_sign", builder() + .intState(ROTATION_16, 0, 15) + .booleanState(WATERLOGGED))); + public static final Block JUNGLE_SIGN = register(new Block("jungle_sign", builder() + .intState(ROTATION_16, 0, 15) + .booleanState(WATERLOGGED))); + public static final Block DARK_OAK_SIGN = register(new Block("dark_oak_sign", builder() + .intState(ROTATION_16, 0, 15) + .booleanState(WATERLOGGED))); + public static final Block MANGROVE_SIGN = register(new Block("mangrove_sign", builder() + .intState(ROTATION_16, 0, 15) + .booleanState(WATERLOGGED))); + public static final Block BAMBOO_SIGN = register(new Block("bamboo_sign", builder() + .intState(ROTATION_16, 0, 15) + .booleanState(WATERLOGGED))); + public static final Block OAK_DOOR = register(new Block("oak_door", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower") + .enumState(DOOR_HINGE, "left", "right") + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block LADDER = register(new Block("ladder", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block RAIL = register(new Block("rail", builder() + .enumState(RAIL_SHAPE, "north_south", "east_west", "ascending_east", "ascending_west", "ascending_north", "ascending_south", "south_east", "south_west", "north_west", "north_east") + .booleanState(WATERLOGGED))); + public static final Block COBBLESTONE_STAIRS = register(new Block("cobblestone_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block OAK_WALL_SIGN = register(new Block("oak_wall_sign", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block SPRUCE_WALL_SIGN = register(new Block("spruce_wall_sign", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block BIRCH_WALL_SIGN = register(new Block("birch_wall_sign", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block ACACIA_WALL_SIGN = register(new Block("acacia_wall_sign", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block CHERRY_WALL_SIGN = register(new Block("cherry_wall_sign", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block JUNGLE_WALL_SIGN = register(new Block("jungle_wall_sign", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block DARK_OAK_WALL_SIGN = register(new Block("dark_oak_wall_sign", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block MANGROVE_WALL_SIGN = register(new Block("mangrove_wall_sign", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block BAMBOO_WALL_SIGN = register(new Block("bamboo_wall_sign", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block OAK_HANGING_SIGN = register(new Block("oak_hanging_sign", builder() + .booleanState(ATTACHED) + .intState(ROTATION_16, 0, 15) + .booleanState(WATERLOGGED))); + public static final Block SPRUCE_HANGING_SIGN = register(new Block("spruce_hanging_sign", builder() + .booleanState(ATTACHED) + .intState(ROTATION_16, 0, 15) + .booleanState(WATERLOGGED))); + public static final Block BIRCH_HANGING_SIGN = register(new Block("birch_hanging_sign", builder() + .booleanState(ATTACHED) + .intState(ROTATION_16, 0, 15) + .booleanState(WATERLOGGED))); + public static final Block ACACIA_HANGING_SIGN = register(new Block("acacia_hanging_sign", builder() + .booleanState(ATTACHED) + .intState(ROTATION_16, 0, 15) + .booleanState(WATERLOGGED))); + public static final Block CHERRY_HANGING_SIGN = register(new Block("cherry_hanging_sign", builder() + .booleanState(ATTACHED) + .intState(ROTATION_16, 0, 15) + .booleanState(WATERLOGGED))); + public static final Block JUNGLE_HANGING_SIGN = register(new Block("jungle_hanging_sign", builder() + .booleanState(ATTACHED) + .intState(ROTATION_16, 0, 15) + .booleanState(WATERLOGGED))); + public static final Block DARK_OAK_HANGING_SIGN = register(new Block("dark_oak_hanging_sign", builder() + .booleanState(ATTACHED) + .intState(ROTATION_16, 0, 15) + .booleanState(WATERLOGGED))); + public static final Block CRIMSON_HANGING_SIGN = register(new Block("crimson_hanging_sign", builder() + .booleanState(ATTACHED) + .intState(ROTATION_16, 0, 15) + .booleanState(WATERLOGGED))); + public static final Block WARPED_HANGING_SIGN = register(new Block("warped_hanging_sign", builder() + .booleanState(ATTACHED) + .intState(ROTATION_16, 0, 15) + .booleanState(WATERLOGGED))); + public static final Block MANGROVE_HANGING_SIGN = register(new Block("mangrove_hanging_sign", builder() + .booleanState(ATTACHED) + .intState(ROTATION_16, 0, 15) + .booleanState(WATERLOGGED))); + public static final Block BAMBOO_HANGING_SIGN = register(new Block("bamboo_hanging_sign", builder() + .booleanState(ATTACHED) + .intState(ROTATION_16, 0, 15) + .booleanState(WATERLOGGED))); + public static final Block OAK_WALL_HANGING_SIGN = register(new Block("oak_wall_hanging_sign", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block SPRUCE_WALL_HANGING_SIGN = register(new Block("spruce_wall_hanging_sign", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block BIRCH_WALL_HANGING_SIGN = register(new Block("birch_wall_hanging_sign", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block ACACIA_WALL_HANGING_SIGN = register(new Block("acacia_wall_hanging_sign", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block CHERRY_WALL_HANGING_SIGN = register(new Block("cherry_wall_hanging_sign", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block JUNGLE_WALL_HANGING_SIGN = register(new Block("jungle_wall_hanging_sign", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block DARK_OAK_WALL_HANGING_SIGN = register(new Block("dark_oak_wall_hanging_sign", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block MANGROVE_WALL_HANGING_SIGN = register(new Block("mangrove_wall_hanging_sign", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block CRIMSON_WALL_HANGING_SIGN = register(new Block("crimson_wall_hanging_sign", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block WARPED_WALL_HANGING_SIGN = register(new Block("warped_wall_hanging_sign", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block BAMBOO_WALL_HANGING_SIGN = register(new Block("bamboo_wall_hanging_sign", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block LEVER = register(new Block("lever", builder() + .enumState(ATTACH_FACE, "floor", "wall", "ceiling") + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(POWERED))); + public static final Block STONE_PRESSURE_PLATE = register(new Block("stone_pressure_plate", builder() + .booleanState(POWERED))); + public static final Block IRON_DOOR = register(new Block("iron_door", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower") + .enumState(DOOR_HINGE, "left", "right") + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block OAK_PRESSURE_PLATE = register(new Block("oak_pressure_plate", builder() + .booleanState(POWERED))); + public static final Block SPRUCE_PRESSURE_PLATE = register(new Block("spruce_pressure_plate", builder() + .booleanState(POWERED))); + public static final Block BIRCH_PRESSURE_PLATE = register(new Block("birch_pressure_plate", builder() + .booleanState(POWERED))); + public static final Block JUNGLE_PRESSURE_PLATE = register(new Block("jungle_pressure_plate", builder() + .booleanState(POWERED))); + public static final Block ACACIA_PRESSURE_PLATE = register(new Block("acacia_pressure_plate", builder() + .booleanState(POWERED))); + public static final Block CHERRY_PRESSURE_PLATE = register(new Block("cherry_pressure_plate", builder() + .booleanState(POWERED))); + public static final Block DARK_OAK_PRESSURE_PLATE = register(new Block("dark_oak_pressure_plate", builder() + .booleanState(POWERED))); + public static final Block MANGROVE_PRESSURE_PLATE = register(new Block("mangrove_pressure_plate", builder() + .booleanState(POWERED))); + public static final Block BAMBOO_PRESSURE_PLATE = register(new Block("bamboo_pressure_plate", builder() + .booleanState(POWERED))); + public static final Block REDSTONE_ORE = register(new Block("redstone_ore", builder() + .booleanState(LIT))); + public static final Block DEEPSLATE_REDSTONE_ORE = register(new Block("deepslate_redstone_ore", builder() + .booleanState(LIT))); + public static final Block REDSTONE_TORCH = register(new Block("redstone_torch", builder() + .booleanState(LIT))); + public static final Block REDSTONE_WALL_TORCH = register(new Block("redstone_wall_torch", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(LIT))); + public static final Block STONE_BUTTON = register(new Block("stone_button", builder() + .enumState(ATTACH_FACE, "floor", "wall", "ceiling") + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(POWERED))); + public static final Block SNOW = register(new Block("snow", builder() + .intState(LAYERS, 1, 8))); + public static final Block ICE = register(new Block("ice", builder())); + public static final Block SNOW_BLOCK = register(new Block("snow_block", builder())); + public static final Block CACTUS = register(new Block("cactus", builder() + .intState(AGE_15, 0, 15))); + public static final Block CLAY = register(new Block("clay", builder())); + public static final Block SUGAR_CANE = register(new Block("sugar_cane", builder() + .intState(AGE_15, 0, 15))); + public static final Block JUKEBOX = register(new Block("jukebox", builder() + .booleanState(HAS_RECORD))); + public static final Block OAK_FENCE = register(new Block("oak_fence", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block NETHERRACK = register(new Block("netherrack", builder())); + public static final Block SOUL_SAND = register(new Block("soul_sand", builder())); + public static final Block SOUL_SOIL = register(new Block("soul_soil", builder())); + public static final Block BASALT = register(new Block("basalt", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block POLISHED_BASALT = register(new Block("polished_basalt", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block SOUL_TORCH = register(new Block("soul_torch", builder())); + public static final Block SOUL_WALL_TORCH = register(new Block("soul_wall_torch", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block GLOWSTONE = register(new Block("glowstone", builder())); + public static final Block NETHER_PORTAL = register(new Block("nether_portal", builder() + .enumState(HORIZONTAL_AXIS, Axis.X, Axis.Z))); + public static final Block CARVED_PUMPKIN = register(new Block("carved_pumpkin", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block JACK_O_LANTERN = register(new Block("jack_o_lantern", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block CAKE = register(new Block("cake", builder() + .intState(BITES, 0, 6))); + public static final Block REPEATER = register(new Block("repeater", builder() + .intState(DELAY, 1, 4) + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(LOCKED) + .booleanState(POWERED))); + public static final Block WHITE_STAINED_GLASS = register(new Block("white_stained_glass", builder())); + public static final Block ORANGE_STAINED_GLASS = register(new Block("orange_stained_glass", builder())); + public static final Block MAGENTA_STAINED_GLASS = register(new Block("magenta_stained_glass", builder())); + public static final Block LIGHT_BLUE_STAINED_GLASS = register(new Block("light_blue_stained_glass", builder())); + public static final Block YELLOW_STAINED_GLASS = register(new Block("yellow_stained_glass", builder())); + public static final Block LIME_STAINED_GLASS = register(new Block("lime_stained_glass", builder())); + public static final Block PINK_STAINED_GLASS = register(new Block("pink_stained_glass", builder())); + public static final Block GRAY_STAINED_GLASS = register(new Block("gray_stained_glass", builder())); + public static final Block LIGHT_GRAY_STAINED_GLASS = register(new Block("light_gray_stained_glass", builder())); + public static final Block CYAN_STAINED_GLASS = register(new Block("cyan_stained_glass", builder())); + public static final Block PURPLE_STAINED_GLASS = register(new Block("purple_stained_glass", builder())); + public static final Block BLUE_STAINED_GLASS = register(new Block("blue_stained_glass", builder())); + public static final Block BROWN_STAINED_GLASS = register(new Block("brown_stained_glass", builder())); + public static final Block GREEN_STAINED_GLASS = register(new Block("green_stained_glass", builder())); + public static final Block RED_STAINED_GLASS = register(new Block("red_stained_glass", builder())); + public static final Block BLACK_STAINED_GLASS = register(new Block("black_stained_glass", builder())); + public static final Block OAK_TRAPDOOR = register(new Block("oak_trapdoor", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .booleanState(OPEN) + .booleanState(POWERED) + .booleanState(WATERLOGGED))); + public static final Block SPRUCE_TRAPDOOR = register(new Block("spruce_trapdoor", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .booleanState(OPEN) + .booleanState(POWERED) + .booleanState(WATERLOGGED))); + public static final Block BIRCH_TRAPDOOR = register(new Block("birch_trapdoor", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .booleanState(OPEN) + .booleanState(POWERED) + .booleanState(WATERLOGGED))); + public static final Block JUNGLE_TRAPDOOR = register(new Block("jungle_trapdoor", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .booleanState(OPEN) + .booleanState(POWERED) + .booleanState(WATERLOGGED))); + public static final Block ACACIA_TRAPDOOR = register(new Block("acacia_trapdoor", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .booleanState(OPEN) + .booleanState(POWERED) + .booleanState(WATERLOGGED))); + public static final Block CHERRY_TRAPDOOR = register(new Block("cherry_trapdoor", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .booleanState(OPEN) + .booleanState(POWERED) + .booleanState(WATERLOGGED))); + public static final Block DARK_OAK_TRAPDOOR = register(new Block("dark_oak_trapdoor", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .booleanState(OPEN) + .booleanState(POWERED) + .booleanState(WATERLOGGED))); + public static final Block MANGROVE_TRAPDOOR = register(new Block("mangrove_trapdoor", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .booleanState(OPEN) + .booleanState(POWERED) + .booleanState(WATERLOGGED))); + public static final Block BAMBOO_TRAPDOOR = register(new Block("bamboo_trapdoor", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .booleanState(OPEN) + .booleanState(POWERED) + .booleanState(WATERLOGGED))); + public static final Block STONE_BRICKS = register(new Block("stone_bricks", builder())); + public static final Block MOSSY_STONE_BRICKS = register(new Block("mossy_stone_bricks", builder())); + public static final Block CRACKED_STONE_BRICKS = register(new Block("cracked_stone_bricks", builder())); + public static final Block CHISELED_STONE_BRICKS = register(new Block("chiseled_stone_bricks", builder())); + public static final Block PACKED_MUD = register(new Block("packed_mud", builder())); + public static final Block MUD_BRICKS = register(new Block("mud_bricks", builder())); + public static final Block INFESTED_STONE = register(new Block("infested_stone", builder())); + public static final Block INFESTED_COBBLESTONE = register(new Block("infested_cobblestone", builder())); + public static final Block INFESTED_STONE_BRICKS = register(new Block("infested_stone_bricks", builder())); + public static final Block INFESTED_MOSSY_STONE_BRICKS = register(new Block("infested_mossy_stone_bricks", builder())); + public static final Block INFESTED_CRACKED_STONE_BRICKS = register(new Block("infested_cracked_stone_bricks", builder())); + public static final Block INFESTED_CHISELED_STONE_BRICKS = register(new Block("infested_chiseled_stone_bricks", builder())); + public static final Block BROWN_MUSHROOM_BLOCK = register(new Block("brown_mushroom_block", builder() + .booleanState(DOWN) + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(UP) + .booleanState(WEST))); + public static final Block RED_MUSHROOM_BLOCK = register(new Block("red_mushroom_block", builder() + .booleanState(DOWN) + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(UP) + .booleanState(WEST))); + public static final Block MUSHROOM_STEM = register(new Block("mushroom_stem", builder() + .booleanState(DOWN) + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(UP) + .booleanState(WEST))); + public static final Block IRON_BARS = register(new Block("iron_bars", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block CHAIN = register(new Block("chain", builder() + .enumState(AXIS, Axis.VALUES) + .booleanState(WATERLOGGED))); + public static final Block GLASS_PANE = register(new Block("glass_pane", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block PUMPKIN = register(new Block("pumpkin", builder())); + public static final Block MELON = register(new Block("melon", builder())); + public static final Block ATTACHED_PUMPKIN_STEM = register(new Block("attached_pumpkin_stem", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block ATTACHED_MELON_STEM = register(new Block("attached_melon_stem", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block PUMPKIN_STEM = register(new Block("pumpkin_stem", builder() + .intState(AGE_7, 0, 7))); + public static final Block MELON_STEM = register(new Block("melon_stem", builder() + .intState(AGE_7, 0, 7))); + public static final Block VINE = register(new Block("vine", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(UP) + .booleanState(WEST))); + public static final Block GLOW_LICHEN = register(new Block("glow_lichen", builder() + .booleanState(DOWN) + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(UP) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block OAK_FENCE_GATE = register(new Block("oak_fence_gate", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(IN_WALL) + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block BRICK_STAIRS = register(new Block("brick_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block STONE_BRICK_STAIRS = register(new Block("stone_brick_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block MUD_BRICK_STAIRS = register(new Block("mud_brick_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block MYCELIUM = register(new Block("mycelium", builder() + .booleanState(SNOWY))); + public static final Block LILY_PAD = register(new Block("lily_pad", builder())); + public static final Block NETHER_BRICKS = register(new Block("nether_bricks", builder())); + public static final Block NETHER_BRICK_FENCE = register(new Block("nether_brick_fence", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block NETHER_BRICK_STAIRS = register(new Block("nether_brick_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block NETHER_WART = register(new Block("nether_wart", builder() + .intState(AGE_3, 0, 3))); + public static final Block ENCHANTING_TABLE = register(new Block("enchanting_table", builder())); + public static final Block BREWING_STAND = register(new Block("brewing_stand", builder() + .booleanState(HAS_BOTTLE_0) + .booleanState(HAS_BOTTLE_1) + .booleanState(HAS_BOTTLE_2))); + public static final Block CAULDRON = register(new Block("cauldron", builder())); + public static final Block WATER_CAULDRON = register(new Block("water_cauldron", builder() + .intState(LEVEL_CAULDRON, 1, 3))); + public static final Block LAVA_CAULDRON = register(new Block("lava_cauldron", builder())); + public static final Block POWDER_SNOW_CAULDRON = register(new Block("powder_snow_cauldron", builder() + .intState(LEVEL_CAULDRON, 1, 3))); + public static final Block END_PORTAL = register(new Block("end_portal", builder())); + public static final Block END_PORTAL_FRAME = register(new Block("end_portal_frame", builder() + .booleanState(EYE) + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block END_STONE = register(new Block("end_stone", builder())); + public static final Block DRAGON_EGG = register(new Block("dragon_egg", builder())); + public static final Block REDSTONE_LAMP = register(new Block("redstone_lamp", builder() + .booleanState(LIT))); + public static final Block COCOA = register(new Block("cocoa", builder() + .intState(AGE_2, 0, 2) + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block SANDSTONE_STAIRS = register(new Block("sandstone_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block EMERALD_ORE = register(new Block("emerald_ore", builder())); + public static final Block DEEPSLATE_EMERALD_ORE = register(new Block("deepslate_emerald_ore", builder())); + public static final Block ENDER_CHEST = register(new Block("ender_chest", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block TRIPWIRE_HOOK = register(new Block("tripwire_hook", builder() + .booleanState(ATTACHED) + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(POWERED))); + public static final Block TRIPWIRE = register(new Block("tripwire", builder() + .booleanState(ATTACHED) + .booleanState(DISARMED) + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(POWERED) + .booleanState(SOUTH) + .booleanState(WEST))); + public static final Block EMERALD_BLOCK = register(new Block("emerald_block", builder())); + public static final Block SPRUCE_STAIRS = register(new Block("spruce_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block BIRCH_STAIRS = register(new Block("birch_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block JUNGLE_STAIRS = register(new Block("jungle_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block COMMAND_BLOCK = register(new Block("command_block", builder() + .booleanState(CONDITIONAL) + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN))); + public static final Block BEACON = register(new Block("beacon", builder())); + public static final Block COBBLESTONE_WALL = register(new Block("cobblestone_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block MOSSY_COBBLESTONE_WALL = register(new Block("mossy_cobblestone_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block FLOWER_POT = register(new Block("flower_pot", builder())); + public static final Block POTTED_TORCHFLOWER = register(new Block("potted_torchflower", builder())); + public static final Block POTTED_OAK_SAPLING = register(new Block("potted_oak_sapling", builder())); + public static final Block POTTED_SPRUCE_SAPLING = register(new Block("potted_spruce_sapling", builder())); + public static final Block POTTED_BIRCH_SAPLING = register(new Block("potted_birch_sapling", builder())); + public static final Block POTTED_JUNGLE_SAPLING = register(new Block("potted_jungle_sapling", builder())); + public static final Block POTTED_ACACIA_SAPLING = register(new Block("potted_acacia_sapling", builder())); + public static final Block POTTED_CHERRY_SAPLING = register(new Block("potted_cherry_sapling", builder())); + public static final Block POTTED_DARK_OAK_SAPLING = register(new Block("potted_dark_oak_sapling", builder())); + public static final Block POTTED_MANGROVE_PROPAGULE = register(new Block("potted_mangrove_propagule", builder())); + public static final Block POTTED_FERN = register(new Block("potted_fern", builder())); + public static final Block POTTED_DANDELION = register(new Block("potted_dandelion", builder())); + public static final Block POTTED_POPPY = register(new Block("potted_poppy", builder())); + public static final Block POTTED_BLUE_ORCHID = register(new Block("potted_blue_orchid", builder())); + public static final Block POTTED_ALLIUM = register(new Block("potted_allium", builder())); + public static final Block POTTED_AZURE_BLUET = register(new Block("potted_azure_bluet", builder())); + public static final Block POTTED_RED_TULIP = register(new Block("potted_red_tulip", builder())); + public static final Block POTTED_ORANGE_TULIP = register(new Block("potted_orange_tulip", builder())); + public static final Block POTTED_WHITE_TULIP = register(new Block("potted_white_tulip", builder())); + public static final Block POTTED_PINK_TULIP = register(new Block("potted_pink_tulip", builder())); + public static final Block POTTED_OXEYE_DAISY = register(new Block("potted_oxeye_daisy", builder())); + public static final Block POTTED_CORNFLOWER = register(new Block("potted_cornflower", builder())); + public static final Block POTTED_LILY_OF_THE_VALLEY = register(new Block("potted_lily_of_the_valley", builder())); + public static final Block POTTED_WITHER_ROSE = register(new Block("potted_wither_rose", builder())); + public static final Block POTTED_RED_MUSHROOM = register(new Block("potted_red_mushroom", builder())); + public static final Block POTTED_BROWN_MUSHROOM = register(new Block("potted_brown_mushroom", builder())); + public static final Block POTTED_DEAD_BUSH = register(new Block("potted_dead_bush", builder())); + public static final Block POTTED_CACTUS = register(new Block("potted_cactus", builder())); + public static final Block CARROTS = register(new Block("carrots", builder() + .intState(AGE_7, 0, 7))); + public static final Block POTATOES = register(new Block("potatoes", builder() + .intState(AGE_7, 0, 7))); + public static final Block OAK_BUTTON = register(new Block("oak_button", builder() + .enumState(ATTACH_FACE, "floor", "wall", "ceiling") + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(POWERED))); + public static final Block SPRUCE_BUTTON = register(new Block("spruce_button", builder() + .enumState(ATTACH_FACE, "floor", "wall", "ceiling") + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(POWERED))); + public static final Block BIRCH_BUTTON = register(new Block("birch_button", builder() + .enumState(ATTACH_FACE, "floor", "wall", "ceiling") + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(POWERED))); + public static final Block JUNGLE_BUTTON = register(new Block("jungle_button", builder() + .enumState(ATTACH_FACE, "floor", "wall", "ceiling") + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(POWERED))); + public static final Block ACACIA_BUTTON = register(new Block("acacia_button", builder() + .enumState(ATTACH_FACE, "floor", "wall", "ceiling") + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(POWERED))); + public static final Block CHERRY_BUTTON = register(new Block("cherry_button", builder() + .enumState(ATTACH_FACE, "floor", "wall", "ceiling") + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(POWERED))); + public static final Block DARK_OAK_BUTTON = register(new Block("dark_oak_button", builder() + .enumState(ATTACH_FACE, "floor", "wall", "ceiling") + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(POWERED))); + public static final Block MANGROVE_BUTTON = register(new Block("mangrove_button", builder() + .enumState(ATTACH_FACE, "floor", "wall", "ceiling") + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(POWERED))); + public static final Block BAMBOO_BUTTON = register(new Block("bamboo_button", builder() + .enumState(ATTACH_FACE, "floor", "wall", "ceiling") + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(POWERED))); + public static final Block SKELETON_SKULL = register(new Block("skeleton_skull", builder() + .booleanState(POWERED) + .intState(ROTATION_16, 0, 15))); + public static final Block SKELETON_WALL_SKULL = register(new Block("skeleton_wall_skull", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(POWERED))); + public static final Block WITHER_SKELETON_SKULL = register(new Block("wither_skeleton_skull", builder() + .booleanState(POWERED) + .intState(ROTATION_16, 0, 15))); + public static final Block WITHER_SKELETON_WALL_SKULL = register(new Block("wither_skeleton_wall_skull", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(POWERED))); + public static final Block ZOMBIE_HEAD = register(new Block("zombie_head", builder() + .booleanState(POWERED) + .intState(ROTATION_16, 0, 15))); + public static final Block ZOMBIE_WALL_HEAD = register(new Block("zombie_wall_head", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(POWERED))); + public static final Block PLAYER_HEAD = register(new Block("player_head", builder() + .booleanState(POWERED) + .intState(ROTATION_16, 0, 15))); + public static final Block PLAYER_WALL_HEAD = register(new Block("player_wall_head", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(POWERED))); + public static final Block CREEPER_HEAD = register(new Block("creeper_head", builder() + .booleanState(POWERED) + .intState(ROTATION_16, 0, 15))); + public static final Block CREEPER_WALL_HEAD = register(new Block("creeper_wall_head", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(POWERED))); + public static final Block DRAGON_HEAD = register(new Block("dragon_head", builder() + .booleanState(POWERED) + .intState(ROTATION_16, 0, 15))); + public static final Block DRAGON_WALL_HEAD = register(new Block("dragon_wall_head", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(POWERED))); + public static final Block PIGLIN_HEAD = register(new Block("piglin_head", builder() + .booleanState(POWERED) + .intState(ROTATION_16, 0, 15))); + public static final Block PIGLIN_WALL_HEAD = register(new Block("piglin_wall_head", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(POWERED))); + public static final Block ANVIL = register(new Block("anvil", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block CHIPPED_ANVIL = register(new Block("chipped_anvil", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block DAMAGED_ANVIL = register(new Block("damaged_anvil", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block TRAPPED_CHEST = register(new Block("trapped_chest", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(CHEST_TYPE, "single", "left", "right") + .booleanState(WATERLOGGED))); + public static final Block LIGHT_WEIGHTED_PRESSURE_PLATE = register(new Block("light_weighted_pressure_plate", builder() + .intState(POWER, 0, 15))); + public static final Block HEAVY_WEIGHTED_PRESSURE_PLATE = register(new Block("heavy_weighted_pressure_plate", builder() + .intState(POWER, 0, 15))); + public static final Block COMPARATOR = register(new Block("comparator", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(MODE_COMPARATOR, "compare", "subtract") + .booleanState(POWERED))); + public static final Block DAYLIGHT_DETECTOR = register(new Block("daylight_detector", builder() + .booleanState(INVERTED) + .intState(POWER, 0, 15))); + public static final Block REDSTONE_BLOCK = register(new Block("redstone_block", builder())); + public static final Block NETHER_QUARTZ_ORE = register(new Block("nether_quartz_ore", builder())); + public static final Block HOPPER = register(new Block("hopper", builder() + .booleanState(ENABLED) + .enumState(FACING_HOPPER, Direction.DOWN, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block QUARTZ_BLOCK = register(new Block("quartz_block", builder())); + public static final Block CHISELED_QUARTZ_BLOCK = register(new Block("chiseled_quartz_block", builder())); + public static final Block QUARTZ_PILLAR = register(new Block("quartz_pillar", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block QUARTZ_STAIRS = register(new Block("quartz_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block ACTIVATOR_RAIL = register(new Block("activator_rail", builder() + .booleanState(POWERED) + .enumState(RAIL_SHAPE_STRAIGHT, "north_south", "east_west", "ascending_east", "ascending_west", "ascending_north", "ascending_south") + .booleanState(WATERLOGGED))); + public static final Block DROPPER = register(new Block("dropper", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN) + .booleanState(TRIGGERED))); + public static final Block WHITE_TERRACOTTA = register(new Block("white_terracotta", builder())); + public static final Block ORANGE_TERRACOTTA = register(new Block("orange_terracotta", builder())); + public static final Block MAGENTA_TERRACOTTA = register(new Block("magenta_terracotta", builder())); + public static final Block LIGHT_BLUE_TERRACOTTA = register(new Block("light_blue_terracotta", builder())); + public static final Block YELLOW_TERRACOTTA = register(new Block("yellow_terracotta", builder())); + public static final Block LIME_TERRACOTTA = register(new Block("lime_terracotta", builder())); + public static final Block PINK_TERRACOTTA = register(new Block("pink_terracotta", builder())); + public static final Block GRAY_TERRACOTTA = register(new Block("gray_terracotta", builder())); + public static final Block LIGHT_GRAY_TERRACOTTA = register(new Block("light_gray_terracotta", builder())); + public static final Block CYAN_TERRACOTTA = register(new Block("cyan_terracotta", builder())); + public static final Block PURPLE_TERRACOTTA = register(new Block("purple_terracotta", builder())); + public static final Block BLUE_TERRACOTTA = register(new Block("blue_terracotta", builder())); + public static final Block BROWN_TERRACOTTA = register(new Block("brown_terracotta", builder())); + public static final Block GREEN_TERRACOTTA = register(new Block("green_terracotta", builder())); + public static final Block RED_TERRACOTTA = register(new Block("red_terracotta", builder())); + public static final Block BLACK_TERRACOTTA = register(new Block("black_terracotta", builder())); + public static final Block WHITE_STAINED_GLASS_PANE = register(new Block("white_stained_glass_pane", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block ORANGE_STAINED_GLASS_PANE = register(new Block("orange_stained_glass_pane", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block MAGENTA_STAINED_GLASS_PANE = register(new Block("magenta_stained_glass_pane", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block LIGHT_BLUE_STAINED_GLASS_PANE = register(new Block("light_blue_stained_glass_pane", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block YELLOW_STAINED_GLASS_PANE = register(new Block("yellow_stained_glass_pane", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block LIME_STAINED_GLASS_PANE = register(new Block("lime_stained_glass_pane", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block PINK_STAINED_GLASS_PANE = register(new Block("pink_stained_glass_pane", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block GRAY_STAINED_GLASS_PANE = register(new Block("gray_stained_glass_pane", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block LIGHT_GRAY_STAINED_GLASS_PANE = register(new Block("light_gray_stained_glass_pane", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block CYAN_STAINED_GLASS_PANE = register(new Block("cyan_stained_glass_pane", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block PURPLE_STAINED_GLASS_PANE = register(new Block("purple_stained_glass_pane", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block BLUE_STAINED_GLASS_PANE = register(new Block("blue_stained_glass_pane", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block BROWN_STAINED_GLASS_PANE = register(new Block("brown_stained_glass_pane", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block GREEN_STAINED_GLASS_PANE = register(new Block("green_stained_glass_pane", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block RED_STAINED_GLASS_PANE = register(new Block("red_stained_glass_pane", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block BLACK_STAINED_GLASS_PANE = register(new Block("black_stained_glass_pane", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block ACACIA_STAIRS = register(new Block("acacia_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block CHERRY_STAIRS = register(new Block("cherry_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block DARK_OAK_STAIRS = register(new Block("dark_oak_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block MANGROVE_STAIRS = register(new Block("mangrove_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block BAMBOO_STAIRS = register(new Block("bamboo_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block BAMBOO_MOSAIC_STAIRS = register(new Block("bamboo_mosaic_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block SLIME_BLOCK = register(new Block("slime_block", builder())); + public static final Block BARRIER = register(new Block("barrier", builder() + .booleanState(WATERLOGGED))); + public static final Block LIGHT = register(new Block("light", builder() + .intState(LEVEL, 0, 15) + .booleanState(WATERLOGGED))); + public static final Block IRON_TRAPDOOR = register(new Block("iron_trapdoor", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .booleanState(OPEN) + .booleanState(POWERED) + .booleanState(WATERLOGGED))); + public static final Block PRISMARINE = register(new Block("prismarine", builder())); + public static final Block PRISMARINE_BRICKS = register(new Block("prismarine_bricks", builder())); + public static final Block DARK_PRISMARINE = register(new Block("dark_prismarine", builder())); + public static final Block PRISMARINE_STAIRS = register(new Block("prismarine_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block PRISMARINE_BRICK_STAIRS = register(new Block("prismarine_brick_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block DARK_PRISMARINE_STAIRS = register(new Block("dark_prismarine_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block PRISMARINE_SLAB = register(new Block("prismarine_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block PRISMARINE_BRICK_SLAB = register(new Block("prismarine_brick_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block DARK_PRISMARINE_SLAB = register(new Block("dark_prismarine_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block SEA_LANTERN = register(new Block("sea_lantern", builder())); + public static final Block HAY_BLOCK = register(new Block("hay_block", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block WHITE_CARPET = register(new Block("white_carpet", builder())); + public static final Block ORANGE_CARPET = register(new Block("orange_carpet", builder())); + public static final Block MAGENTA_CARPET = register(new Block("magenta_carpet", builder())); + public static final Block LIGHT_BLUE_CARPET = register(new Block("light_blue_carpet", builder())); + public static final Block YELLOW_CARPET = register(new Block("yellow_carpet", builder())); + public static final Block LIME_CARPET = register(new Block("lime_carpet", builder())); + public static final Block PINK_CARPET = register(new Block("pink_carpet", builder())); + public static final Block GRAY_CARPET = register(new Block("gray_carpet", builder())); + public static final Block LIGHT_GRAY_CARPET = register(new Block("light_gray_carpet", builder())); + public static final Block CYAN_CARPET = register(new Block("cyan_carpet", builder())); + public static final Block PURPLE_CARPET = register(new Block("purple_carpet", builder())); + public static final Block BLUE_CARPET = register(new Block("blue_carpet", builder())); + public static final Block BROWN_CARPET = register(new Block("brown_carpet", builder())); + public static final Block GREEN_CARPET = register(new Block("green_carpet", builder())); + public static final Block RED_CARPET = register(new Block("red_carpet", builder())); + public static final Block BLACK_CARPET = register(new Block("black_carpet", builder())); + public static final Block TERRACOTTA = register(new Block("terracotta", builder())); + public static final Block COAL_BLOCK = register(new Block("coal_block", builder())); + public static final Block PACKED_ICE = register(new Block("packed_ice", builder())); + public static final Block SUNFLOWER = register(new Block("sunflower", builder() + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower"))); + public static final Block LILAC = register(new Block("lilac", builder() + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower"))); + public static final Block ROSE_BUSH = register(new Block("rose_bush", builder() + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower"))); + public static final Block PEONY = register(new Block("peony", builder() + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower"))); + public static final Block TALL_GRASS = register(new Block("tall_grass", builder() + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower"))); + public static final Block LARGE_FERN = register(new Block("large_fern", builder() + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower"))); + public static final Block WHITE_BANNER = register(new BannerBlock("white_banner", 0, builder() + .intState(ROTATION_16, 0, 15))); + public static final Block ORANGE_BANNER = register(new BannerBlock("orange_banner", 1, builder() + .intState(ROTATION_16, 0, 15))); + public static final Block MAGENTA_BANNER = register(new BannerBlock("magenta_banner", 2, builder() + .intState(ROTATION_16, 0, 15))); + public static final Block LIGHT_BLUE_BANNER = register(new BannerBlock("light_blue_banner", 3, builder() + .intState(ROTATION_16, 0, 15))); + public static final Block YELLOW_BANNER = register(new BannerBlock("yellow_banner", 4, builder() + .intState(ROTATION_16, 0, 15))); + public static final Block LIME_BANNER = register(new BannerBlock("lime_banner", 5, builder() + .intState(ROTATION_16, 0, 15))); + public static final Block PINK_BANNER = register(new BannerBlock("pink_banner", 6, builder() + .intState(ROTATION_16, 0, 15))); + public static final Block GRAY_BANNER = register(new BannerBlock("gray_banner", 7, builder() + .intState(ROTATION_16, 0, 15))); + public static final Block LIGHT_GRAY_BANNER = register(new BannerBlock("light_gray_banner", 8, builder() + .intState(ROTATION_16, 0, 15))); + public static final Block CYAN_BANNER = register(new BannerBlock("cyan_banner", 9, builder() + .intState(ROTATION_16, 0, 15))); + public static final Block PURPLE_BANNER = register(new BannerBlock("purple_banner", 10, builder() + .intState(ROTATION_16, 0, 15))); + public static final Block BLUE_BANNER = register(new BannerBlock("blue_banner", 11, builder() + .intState(ROTATION_16, 0, 15))); + public static final Block BROWN_BANNER = register(new BannerBlock("brown_banner", 12, builder() + .intState(ROTATION_16, 0, 15))); + public static final Block GREEN_BANNER = register(new BannerBlock("green_banner", 13, builder() + .intState(ROTATION_16, 0, 15))); + public static final Block RED_BANNER = register(new BannerBlock("red_banner", 14, builder() + .intState(ROTATION_16, 0, 15))); + public static final Block BLACK_BANNER = register(new BannerBlock("black_banner", 15, builder() + .intState(ROTATION_16, 0, 15))); + public static final Block WHITE_WALL_BANNER = register(new BannerBlock("white_wall_banner", 0, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block ORANGE_WALL_BANNER = register(new BannerBlock("orange_wall_banner", 1, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block MAGENTA_WALL_BANNER = register(new BannerBlock("magenta_wall_banner", 2, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block LIGHT_BLUE_WALL_BANNER = register(new BannerBlock("light_blue_wall_banner", 3, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block YELLOW_WALL_BANNER = register(new BannerBlock("yellow_wall_banner", 4, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block LIME_WALL_BANNER = register(new BannerBlock("lime_wall_banner", 5, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block PINK_WALL_BANNER = register(new BannerBlock("pink_wall_banner", 6, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block GRAY_WALL_BANNER = register(new BannerBlock("gray_wall_banner", 7, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block LIGHT_GRAY_WALL_BANNER = register(new BannerBlock("light_gray_wall_banner", 8, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block CYAN_WALL_BANNER = register(new BannerBlock("cyan_wall_banner", 9, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block PURPLE_WALL_BANNER = register(new BannerBlock("purple_wall_banner", 10, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block BLUE_WALL_BANNER = register(new BannerBlock("blue_wall_banner", 11, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block BROWN_WALL_BANNER = register(new BannerBlock("brown_wall_banner", 12, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block GREEN_WALL_BANNER = register(new BannerBlock("green_wall_banner", 13, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block RED_WALL_BANNER = register(new BannerBlock("red_wall_banner", 14, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block BLACK_WALL_BANNER = register(new BannerBlock("black_wall_banner", 15, builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block RED_SANDSTONE = register(new Block("red_sandstone", builder())); + public static final Block CHISELED_RED_SANDSTONE = register(new Block("chiseled_red_sandstone", builder())); + public static final Block CUT_RED_SANDSTONE = register(new Block("cut_red_sandstone", builder())); + public static final Block RED_SANDSTONE_STAIRS = register(new Block("red_sandstone_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block OAK_SLAB = register(new Block("oak_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block SPRUCE_SLAB = register(new Block("spruce_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block BIRCH_SLAB = register(new Block("birch_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block JUNGLE_SLAB = register(new Block("jungle_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block ACACIA_SLAB = register(new Block("acacia_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block CHERRY_SLAB = register(new Block("cherry_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block DARK_OAK_SLAB = register(new Block("dark_oak_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block MANGROVE_SLAB = register(new Block("mangrove_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block BAMBOO_SLAB = register(new Block("bamboo_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block BAMBOO_MOSAIC_SLAB = register(new Block("bamboo_mosaic_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block STONE_SLAB = register(new Block("stone_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block SMOOTH_STONE_SLAB = register(new Block("smooth_stone_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block SANDSTONE_SLAB = register(new Block("sandstone_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block CUT_SANDSTONE_SLAB = register(new Block("cut_sandstone_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block PETRIFIED_OAK_SLAB = register(new Block("petrified_oak_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block COBBLESTONE_SLAB = register(new Block("cobblestone_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block BRICK_SLAB = register(new Block("brick_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block STONE_BRICK_SLAB = register(new Block("stone_brick_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block MUD_BRICK_SLAB = register(new Block("mud_brick_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block NETHER_BRICK_SLAB = register(new Block("nether_brick_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block QUARTZ_SLAB = register(new Block("quartz_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block RED_SANDSTONE_SLAB = register(new Block("red_sandstone_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block CUT_RED_SANDSTONE_SLAB = register(new Block("cut_red_sandstone_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block PURPUR_SLAB = register(new Block("purpur_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block SMOOTH_STONE = register(new Block("smooth_stone", builder())); + public static final Block SMOOTH_SANDSTONE = register(new Block("smooth_sandstone", builder())); + public static final Block SMOOTH_QUARTZ = register(new Block("smooth_quartz", builder())); + public static final Block SMOOTH_RED_SANDSTONE = register(new Block("smooth_red_sandstone", builder())); + public static final Block SPRUCE_FENCE_GATE = register(new Block("spruce_fence_gate", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(IN_WALL) + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block BIRCH_FENCE_GATE = register(new Block("birch_fence_gate", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(IN_WALL) + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block JUNGLE_FENCE_GATE = register(new Block("jungle_fence_gate", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(IN_WALL) + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block ACACIA_FENCE_GATE = register(new Block("acacia_fence_gate", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(IN_WALL) + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block CHERRY_FENCE_GATE = register(new Block("cherry_fence_gate", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(IN_WALL) + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block DARK_OAK_FENCE_GATE = register(new Block("dark_oak_fence_gate", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(IN_WALL) + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block MANGROVE_FENCE_GATE = register(new Block("mangrove_fence_gate", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(IN_WALL) + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block BAMBOO_FENCE_GATE = register(new Block("bamboo_fence_gate", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(IN_WALL) + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block SPRUCE_FENCE = register(new Block("spruce_fence", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block BIRCH_FENCE = register(new Block("birch_fence", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block JUNGLE_FENCE = register(new Block("jungle_fence", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block ACACIA_FENCE = register(new Block("acacia_fence", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block CHERRY_FENCE = register(new Block("cherry_fence", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block DARK_OAK_FENCE = register(new Block("dark_oak_fence", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block MANGROVE_FENCE = register(new Block("mangrove_fence", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block BAMBOO_FENCE = register(new Block("bamboo_fence", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block SPRUCE_DOOR = register(new Block("spruce_door", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower") + .enumState(DOOR_HINGE, "left", "right") + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block BIRCH_DOOR = register(new Block("birch_door", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower") + .enumState(DOOR_HINGE, "left", "right") + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block JUNGLE_DOOR = register(new Block("jungle_door", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower") + .enumState(DOOR_HINGE, "left", "right") + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block ACACIA_DOOR = register(new Block("acacia_door", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower") + .enumState(DOOR_HINGE, "left", "right") + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block CHERRY_DOOR = register(new Block("cherry_door", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower") + .enumState(DOOR_HINGE, "left", "right") + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block DARK_OAK_DOOR = register(new Block("dark_oak_door", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower") + .enumState(DOOR_HINGE, "left", "right") + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block MANGROVE_DOOR = register(new Block("mangrove_door", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower") + .enumState(DOOR_HINGE, "left", "right") + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block BAMBOO_DOOR = register(new Block("bamboo_door", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower") + .enumState(DOOR_HINGE, "left", "right") + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block END_ROD = register(new Block("end_rod", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN))); + public static final Block CHORUS_PLANT = register(new Block("chorus_plant", builder() + .booleanState(DOWN) + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(UP) + .booleanState(WEST))); + public static final Block CHORUS_FLOWER = register(new Block("chorus_flower", builder() + .intState(AGE_5, 0, 5))); + public static final Block PURPUR_BLOCK = register(new Block("purpur_block", builder())); + public static final Block PURPUR_PILLAR = register(new Block("purpur_pillar", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block PURPUR_STAIRS = register(new Block("purpur_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block END_STONE_BRICKS = register(new Block("end_stone_bricks", builder())); + public static final Block TORCHFLOWER_CROP = register(new Block("torchflower_crop", builder() + .intState(AGE_1, 0, 1))); + public static final Block PITCHER_CROP = register(new Block("pitcher_crop", builder() + .intState(AGE_4, 0, 4) + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower"))); + public static final Block PITCHER_PLANT = register(new Block("pitcher_plant", builder() + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower"))); + public static final Block BEETROOTS = register(new Block("beetroots", builder() + .intState(AGE_3, 0, 3))); + public static final Block DIRT_PATH = register(new Block("dirt_path", builder())); + public static final Block END_GATEWAY = register(new Block("end_gateway", builder())); + public static final Block REPEATING_COMMAND_BLOCK = register(new Block("repeating_command_block", builder() + .booleanState(CONDITIONAL) + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN))); + public static final Block CHAIN_COMMAND_BLOCK = register(new Block("chain_command_block", builder() + .booleanState(CONDITIONAL) + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN))); + public static final Block FROSTED_ICE = register(new Block("frosted_ice", builder() + .intState(AGE_3, 0, 3))); + public static final Block MAGMA_BLOCK = register(new Block("magma_block", builder())); + public static final Block NETHER_WART_BLOCK = register(new Block("nether_wart_block", builder())); + public static final Block RED_NETHER_BRICKS = register(new Block("red_nether_bricks", builder())); + public static final Block BONE_BLOCK = register(new Block("bone_block", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block STRUCTURE_VOID = register(new Block("structure_void", builder())); + public static final Block OBSERVER = register(new Block("observer", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN) + .booleanState(POWERED))); + public static final Block SHULKER_BOX = register(new Block("shulker_box", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN))); + public static final Block WHITE_SHULKER_BOX = register(new Block("white_shulker_box", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN))); + public static final Block ORANGE_SHULKER_BOX = register(new Block("orange_shulker_box", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN))); + public static final Block MAGENTA_SHULKER_BOX = register(new Block("magenta_shulker_box", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN))); + public static final Block LIGHT_BLUE_SHULKER_BOX = register(new Block("light_blue_shulker_box", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN))); + public static final Block YELLOW_SHULKER_BOX = register(new Block("yellow_shulker_box", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN))); + public static final Block LIME_SHULKER_BOX = register(new Block("lime_shulker_box", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN))); + public static final Block PINK_SHULKER_BOX = register(new Block("pink_shulker_box", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN))); + public static final Block GRAY_SHULKER_BOX = register(new Block("gray_shulker_box", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN))); + public static final Block LIGHT_GRAY_SHULKER_BOX = register(new Block("light_gray_shulker_box", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN))); + public static final Block CYAN_SHULKER_BOX = register(new Block("cyan_shulker_box", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN))); + public static final Block PURPLE_SHULKER_BOX = register(new Block("purple_shulker_box", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN))); + public static final Block BLUE_SHULKER_BOX = register(new Block("blue_shulker_box", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN))); + public static final Block BROWN_SHULKER_BOX = register(new Block("brown_shulker_box", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN))); + public static final Block GREEN_SHULKER_BOX = register(new Block("green_shulker_box", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN))); + public static final Block RED_SHULKER_BOX = register(new Block("red_shulker_box", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN))); + public static final Block BLACK_SHULKER_BOX = register(new Block("black_shulker_box", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN))); + public static final Block WHITE_GLAZED_TERRACOTTA = register(new Block("white_glazed_terracotta", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block ORANGE_GLAZED_TERRACOTTA = register(new Block("orange_glazed_terracotta", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block MAGENTA_GLAZED_TERRACOTTA = register(new Block("magenta_glazed_terracotta", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block LIGHT_BLUE_GLAZED_TERRACOTTA = register(new Block("light_blue_glazed_terracotta", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block YELLOW_GLAZED_TERRACOTTA = register(new Block("yellow_glazed_terracotta", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block LIME_GLAZED_TERRACOTTA = register(new Block("lime_glazed_terracotta", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block PINK_GLAZED_TERRACOTTA = register(new Block("pink_glazed_terracotta", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block GRAY_GLAZED_TERRACOTTA = register(new Block("gray_glazed_terracotta", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block LIGHT_GRAY_GLAZED_TERRACOTTA = register(new Block("light_gray_glazed_terracotta", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block CYAN_GLAZED_TERRACOTTA = register(new Block("cyan_glazed_terracotta", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block PURPLE_GLAZED_TERRACOTTA = register(new Block("purple_glazed_terracotta", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block BLUE_GLAZED_TERRACOTTA = register(new Block("blue_glazed_terracotta", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block BROWN_GLAZED_TERRACOTTA = register(new Block("brown_glazed_terracotta", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block GREEN_GLAZED_TERRACOTTA = register(new Block("green_glazed_terracotta", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block RED_GLAZED_TERRACOTTA = register(new Block("red_glazed_terracotta", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block BLACK_GLAZED_TERRACOTTA = register(new Block("black_glazed_terracotta", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block WHITE_CONCRETE = register(new Block("white_concrete", builder())); + public static final Block ORANGE_CONCRETE = register(new Block("orange_concrete", builder())); + public static final Block MAGENTA_CONCRETE = register(new Block("magenta_concrete", builder())); + public static final Block LIGHT_BLUE_CONCRETE = register(new Block("light_blue_concrete", builder())); + public static final Block YELLOW_CONCRETE = register(new Block("yellow_concrete", builder())); + public static final Block LIME_CONCRETE = register(new Block("lime_concrete", builder())); + public static final Block PINK_CONCRETE = register(new Block("pink_concrete", builder())); + public static final Block GRAY_CONCRETE = register(new Block("gray_concrete", builder())); + public static final Block LIGHT_GRAY_CONCRETE = register(new Block("light_gray_concrete", builder())); + public static final Block CYAN_CONCRETE = register(new Block("cyan_concrete", builder())); + public static final Block PURPLE_CONCRETE = register(new Block("purple_concrete", builder())); + public static final Block BLUE_CONCRETE = register(new Block("blue_concrete", builder())); + public static final Block BROWN_CONCRETE = register(new Block("brown_concrete", builder())); + public static final Block GREEN_CONCRETE = register(new Block("green_concrete", builder())); + public static final Block RED_CONCRETE = register(new Block("red_concrete", builder())); + public static final Block BLACK_CONCRETE = register(new Block("black_concrete", builder())); + public static final Block WHITE_CONCRETE_POWDER = register(new Block("white_concrete_powder", builder())); + public static final Block ORANGE_CONCRETE_POWDER = register(new Block("orange_concrete_powder", builder())); + public static final Block MAGENTA_CONCRETE_POWDER = register(new Block("magenta_concrete_powder", builder())); + public static final Block LIGHT_BLUE_CONCRETE_POWDER = register(new Block("light_blue_concrete_powder", builder())); + public static final Block YELLOW_CONCRETE_POWDER = register(new Block("yellow_concrete_powder", builder())); + public static final Block LIME_CONCRETE_POWDER = register(new Block("lime_concrete_powder", builder())); + public static final Block PINK_CONCRETE_POWDER = register(new Block("pink_concrete_powder", builder())); + public static final Block GRAY_CONCRETE_POWDER = register(new Block("gray_concrete_powder", builder())); + public static final Block LIGHT_GRAY_CONCRETE_POWDER = register(new Block("light_gray_concrete_powder", builder())); + public static final Block CYAN_CONCRETE_POWDER = register(new Block("cyan_concrete_powder", builder())); + public static final Block PURPLE_CONCRETE_POWDER = register(new Block("purple_concrete_powder", builder())); + public static final Block BLUE_CONCRETE_POWDER = register(new Block("blue_concrete_powder", builder())); + public static final Block BROWN_CONCRETE_POWDER = register(new Block("brown_concrete_powder", builder())); + public static final Block GREEN_CONCRETE_POWDER = register(new Block("green_concrete_powder", builder())); + public static final Block RED_CONCRETE_POWDER = register(new Block("red_concrete_powder", builder())); + public static final Block BLACK_CONCRETE_POWDER = register(new Block("black_concrete_powder", builder())); + public static final Block KELP = register(new Block("kelp", builder() + .intState(AGE_25, 0, 25))); + public static final Block KELP_PLANT = register(new Block("kelp_plant", builder())); + public static final Block DRIED_KELP_BLOCK = register(new Block("dried_kelp_block", builder())); + public static final Block TURTLE_EGG = register(new Block("turtle_egg", builder() + .intState(EGGS, 1, 4) + .intState(HATCH, 0, 2))); + public static final Block SNIFFER_EGG = register(new Block("sniffer_egg", builder() + .intState(HATCH, 0, 2))); + public static final Block DEAD_TUBE_CORAL_BLOCK = register(new Block("dead_tube_coral_block", builder())); + public static final Block DEAD_BRAIN_CORAL_BLOCK = register(new Block("dead_brain_coral_block", builder())); + public static final Block DEAD_BUBBLE_CORAL_BLOCK = register(new Block("dead_bubble_coral_block", builder())); + public static final Block DEAD_FIRE_CORAL_BLOCK = register(new Block("dead_fire_coral_block", builder())); + public static final Block DEAD_HORN_CORAL_BLOCK = register(new Block("dead_horn_coral_block", builder())); + public static final Block TUBE_CORAL_BLOCK = register(new Block("tube_coral_block", builder())); + public static final Block BRAIN_CORAL_BLOCK = register(new Block("brain_coral_block", builder())); + public static final Block BUBBLE_CORAL_BLOCK = register(new Block("bubble_coral_block", builder())); + public static final Block FIRE_CORAL_BLOCK = register(new Block("fire_coral_block", builder())); + public static final Block HORN_CORAL_BLOCK = register(new Block("horn_coral_block", builder())); + public static final Block DEAD_TUBE_CORAL = register(new Block("dead_tube_coral", builder() + .booleanState(WATERLOGGED))); + public static final Block DEAD_BRAIN_CORAL = register(new Block("dead_brain_coral", builder() + .booleanState(WATERLOGGED))); + public static final Block DEAD_BUBBLE_CORAL = register(new Block("dead_bubble_coral", builder() + .booleanState(WATERLOGGED))); + public static final Block DEAD_FIRE_CORAL = register(new Block("dead_fire_coral", builder() + .booleanState(WATERLOGGED))); + public static final Block DEAD_HORN_CORAL = register(new Block("dead_horn_coral", builder() + .booleanState(WATERLOGGED))); + public static final Block TUBE_CORAL = register(new Block("tube_coral", builder() + .booleanState(WATERLOGGED))); + public static final Block BRAIN_CORAL = register(new Block("brain_coral", builder() + .booleanState(WATERLOGGED))); + public static final Block BUBBLE_CORAL = register(new Block("bubble_coral", builder() + .booleanState(WATERLOGGED))); + public static final Block FIRE_CORAL = register(new Block("fire_coral", builder() + .booleanState(WATERLOGGED))); + public static final Block HORN_CORAL = register(new Block("horn_coral", builder() + .booleanState(WATERLOGGED))); + public static final Block DEAD_TUBE_CORAL_FAN = register(new Block("dead_tube_coral_fan", builder() + .booleanState(WATERLOGGED))); + public static final Block DEAD_BRAIN_CORAL_FAN = register(new Block("dead_brain_coral_fan", builder() + .booleanState(WATERLOGGED))); + public static final Block DEAD_BUBBLE_CORAL_FAN = register(new Block("dead_bubble_coral_fan", builder() + .booleanState(WATERLOGGED))); + public static final Block DEAD_FIRE_CORAL_FAN = register(new Block("dead_fire_coral_fan", builder() + .booleanState(WATERLOGGED))); + public static final Block DEAD_HORN_CORAL_FAN = register(new Block("dead_horn_coral_fan", builder() + .booleanState(WATERLOGGED))); + public static final Block TUBE_CORAL_FAN = register(new Block("tube_coral_fan", builder() + .booleanState(WATERLOGGED))); + public static final Block BRAIN_CORAL_FAN = register(new Block("brain_coral_fan", builder() + .booleanState(WATERLOGGED))); + public static final Block BUBBLE_CORAL_FAN = register(new Block("bubble_coral_fan", builder() + .booleanState(WATERLOGGED))); + public static final Block FIRE_CORAL_FAN = register(new Block("fire_coral_fan", builder() + .booleanState(WATERLOGGED))); + public static final Block HORN_CORAL_FAN = register(new Block("horn_coral_fan", builder() + .booleanState(WATERLOGGED))); + public static final Block DEAD_TUBE_CORAL_WALL_FAN = register(new Block("dead_tube_coral_wall_fan", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block DEAD_BRAIN_CORAL_WALL_FAN = register(new Block("dead_brain_coral_wall_fan", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block DEAD_BUBBLE_CORAL_WALL_FAN = register(new Block("dead_bubble_coral_wall_fan", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block DEAD_FIRE_CORAL_WALL_FAN = register(new Block("dead_fire_coral_wall_fan", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block DEAD_HORN_CORAL_WALL_FAN = register(new Block("dead_horn_coral_wall_fan", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block TUBE_CORAL_WALL_FAN = register(new Block("tube_coral_wall_fan", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block BRAIN_CORAL_WALL_FAN = register(new Block("brain_coral_wall_fan", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block BUBBLE_CORAL_WALL_FAN = register(new Block("bubble_coral_wall_fan", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block FIRE_CORAL_WALL_FAN = register(new Block("fire_coral_wall_fan", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block HORN_CORAL_WALL_FAN = register(new Block("horn_coral_wall_fan", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block SEA_PICKLE = register(new Block("sea_pickle", builder() + .intState(PICKLES, 1, 4) + .booleanState(WATERLOGGED))); + public static final Block BLUE_ICE = register(new Block("blue_ice", builder())); + public static final Block CONDUIT = register(new Block("conduit", builder() + .booleanState(WATERLOGGED))); + public static final Block BAMBOO_SAPLING = register(new Block("bamboo_sapling", builder())); + public static final Block BAMBOO = register(new Block("bamboo", builder() + .intState(AGE_1, 0, 1) + .enumState(BAMBOO_LEAVES, "none", "small", "large") + .intState(STAGE, 0, 1))); + public static final Block POTTED_BAMBOO = register(new Block("potted_bamboo", builder())); + public static final Block VOID_AIR = register(new Block("void_air", builder())); + public static final Block CAVE_AIR = register(new Block("cave_air", builder())); + public static final Block BUBBLE_COLUMN = register(new Block("bubble_column", builder() + .booleanState(DRAG))); + public static final Block POLISHED_GRANITE_STAIRS = register(new Block("polished_granite_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block SMOOTH_RED_SANDSTONE_STAIRS = register(new Block("smooth_red_sandstone_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block MOSSY_STONE_BRICK_STAIRS = register(new Block("mossy_stone_brick_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block POLISHED_DIORITE_STAIRS = register(new Block("polished_diorite_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block MOSSY_COBBLESTONE_STAIRS = register(new Block("mossy_cobblestone_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block END_STONE_BRICK_STAIRS = register(new Block("end_stone_brick_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block STONE_STAIRS = register(new Block("stone_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block SMOOTH_SANDSTONE_STAIRS = register(new Block("smooth_sandstone_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block SMOOTH_QUARTZ_STAIRS = register(new Block("smooth_quartz_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block GRANITE_STAIRS = register(new Block("granite_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block ANDESITE_STAIRS = register(new Block("andesite_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block RED_NETHER_BRICK_STAIRS = register(new Block("red_nether_brick_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block POLISHED_ANDESITE_STAIRS = register(new Block("polished_andesite_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block DIORITE_STAIRS = register(new Block("diorite_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block POLISHED_GRANITE_SLAB = register(new Block("polished_granite_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block SMOOTH_RED_SANDSTONE_SLAB = register(new Block("smooth_red_sandstone_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block MOSSY_STONE_BRICK_SLAB = register(new Block("mossy_stone_brick_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block POLISHED_DIORITE_SLAB = register(new Block("polished_diorite_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block MOSSY_COBBLESTONE_SLAB = register(new Block("mossy_cobblestone_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block END_STONE_BRICK_SLAB = register(new Block("end_stone_brick_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block SMOOTH_SANDSTONE_SLAB = register(new Block("smooth_sandstone_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block SMOOTH_QUARTZ_SLAB = register(new Block("smooth_quartz_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block GRANITE_SLAB = register(new Block("granite_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block ANDESITE_SLAB = register(new Block("andesite_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block RED_NETHER_BRICK_SLAB = register(new Block("red_nether_brick_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block POLISHED_ANDESITE_SLAB = register(new Block("polished_andesite_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block DIORITE_SLAB = register(new Block("diorite_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block BRICK_WALL = register(new Block("brick_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block PRISMARINE_WALL = register(new Block("prismarine_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block RED_SANDSTONE_WALL = register(new Block("red_sandstone_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block MOSSY_STONE_BRICK_WALL = register(new Block("mossy_stone_brick_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block GRANITE_WALL = register(new Block("granite_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block STONE_BRICK_WALL = register(new Block("stone_brick_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block MUD_BRICK_WALL = register(new Block("mud_brick_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block NETHER_BRICK_WALL = register(new Block("nether_brick_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block ANDESITE_WALL = register(new Block("andesite_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block RED_NETHER_BRICK_WALL = register(new Block("red_nether_brick_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block SANDSTONE_WALL = register(new Block("sandstone_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block END_STONE_BRICK_WALL = register(new Block("end_stone_brick_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block DIORITE_WALL = register(new Block("diorite_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block SCAFFOLDING = register(new Block("scaffolding", builder() + .booleanState(BOTTOM) + .intState(STABILITY_DISTANCE, 0, 7) + .booleanState(WATERLOGGED))); + public static final Block LOOM = register(new Block("loom", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block BARREL = register(new Block("barrel", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN) + .booleanState(OPEN))); + public static final Block SMOKER = register(new Block("smoker", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(LIT))); + public static final Block BLAST_FURNACE = register(new Block("blast_furnace", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(LIT))); + public static final Block CARTOGRAPHY_TABLE = register(new Block("cartography_table", builder())); + public static final Block FLETCHING_TABLE = register(new Block("fletching_table", builder())); + public static final Block GRINDSTONE = register(new Block("grindstone", builder() + .enumState(ATTACH_FACE, "floor", "wall", "ceiling") + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block LECTERN = register(new Block("lectern", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(HAS_BOOK) + .booleanState(POWERED))); + public static final Block SMITHING_TABLE = register(new Block("smithing_table", builder())); + public static final Block STONECUTTER = register(new Block("stonecutter", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST))); + public static final Block BELL = register(new Block("bell", builder() + .enumState(BELL_ATTACHMENT, "floor", "ceiling", "single_wall", "double_wall") + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(POWERED))); + public static final Block LANTERN = register(new Block("lantern", builder() + .booleanState(HANGING) + .booleanState(WATERLOGGED))); + public static final Block SOUL_LANTERN = register(new Block("soul_lantern", builder() + .booleanState(HANGING) + .booleanState(WATERLOGGED))); + public static final Block CAMPFIRE = register(new Block("campfire", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(LIT) + .booleanState(SIGNAL_FIRE) + .booleanState(WATERLOGGED))); + public static final Block SOUL_CAMPFIRE = register(new Block("soul_campfire", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(LIT) + .booleanState(SIGNAL_FIRE) + .booleanState(WATERLOGGED))); + public static final Block SWEET_BERRY_BUSH = register(new Block("sweet_berry_bush", builder() + .intState(AGE_3, 0, 3))); + public static final Block WARPED_STEM = register(new Block("warped_stem", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block STRIPPED_WARPED_STEM = register(new Block("stripped_warped_stem", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block WARPED_HYPHAE = register(new Block("warped_hyphae", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block STRIPPED_WARPED_HYPHAE = register(new Block("stripped_warped_hyphae", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block WARPED_NYLIUM = register(new Block("warped_nylium", builder())); + public static final Block WARPED_FUNGUS = register(new Block("warped_fungus", builder())); + public static final Block WARPED_WART_BLOCK = register(new Block("warped_wart_block", builder())); + public static final Block WARPED_ROOTS = register(new Block("warped_roots", builder())); + public static final Block NETHER_SPROUTS = register(new Block("nether_sprouts", builder())); + public static final Block CRIMSON_STEM = register(new Block("crimson_stem", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block STRIPPED_CRIMSON_STEM = register(new Block("stripped_crimson_stem", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block CRIMSON_HYPHAE = register(new Block("crimson_hyphae", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block STRIPPED_CRIMSON_HYPHAE = register(new Block("stripped_crimson_hyphae", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block CRIMSON_NYLIUM = register(new Block("crimson_nylium", builder())); + public static final Block CRIMSON_FUNGUS = register(new Block("crimson_fungus", builder())); + public static final Block SHROOMLIGHT = register(new Block("shroomlight", builder())); + public static final Block WEEPING_VINES = register(new Block("weeping_vines", builder() + .intState(AGE_25, 0, 25))); + public static final Block WEEPING_VINES_PLANT = register(new Block("weeping_vines_plant", builder())); + public static final Block TWISTING_VINES = register(new Block("twisting_vines", builder() + .intState(AGE_25, 0, 25))); + public static final Block TWISTING_VINES_PLANT = register(new Block("twisting_vines_plant", builder())); + public static final Block CRIMSON_ROOTS = register(new Block("crimson_roots", builder())); + public static final Block CRIMSON_PLANKS = register(new Block("crimson_planks", builder())); + public static final Block WARPED_PLANKS = register(new Block("warped_planks", builder())); + public static final Block CRIMSON_SLAB = register(new Block("crimson_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block WARPED_SLAB = register(new Block("warped_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block CRIMSON_PRESSURE_PLATE = register(new Block("crimson_pressure_plate", builder() + .booleanState(POWERED))); + public static final Block WARPED_PRESSURE_PLATE = register(new Block("warped_pressure_plate", builder() + .booleanState(POWERED))); + public static final Block CRIMSON_FENCE = register(new Block("crimson_fence", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block WARPED_FENCE = register(new Block("warped_fence", builder() + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block CRIMSON_TRAPDOOR = register(new Block("crimson_trapdoor", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .booleanState(OPEN) + .booleanState(POWERED) + .booleanState(WATERLOGGED))); + public static final Block WARPED_TRAPDOOR = register(new Block("warped_trapdoor", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .booleanState(OPEN) + .booleanState(POWERED) + .booleanState(WATERLOGGED))); + public static final Block CRIMSON_FENCE_GATE = register(new Block("crimson_fence_gate", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(IN_WALL) + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block WARPED_FENCE_GATE = register(new Block("warped_fence_gate", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(IN_WALL) + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block CRIMSON_STAIRS = register(new Block("crimson_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block WARPED_STAIRS = register(new Block("warped_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block CRIMSON_BUTTON = register(new Block("crimson_button", builder() + .enumState(ATTACH_FACE, "floor", "wall", "ceiling") + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(POWERED))); + public static final Block WARPED_BUTTON = register(new Block("warped_button", builder() + .enumState(ATTACH_FACE, "floor", "wall", "ceiling") + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(POWERED))); + public static final Block CRIMSON_DOOR = register(new Block("crimson_door", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower") + .enumState(DOOR_HINGE, "left", "right") + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block WARPED_DOOR = register(new Block("warped_door", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower") + .enumState(DOOR_HINGE, "left", "right") + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block CRIMSON_SIGN = register(new Block("crimson_sign", builder() + .intState(ROTATION_16, 0, 15) + .booleanState(WATERLOGGED))); + public static final Block WARPED_SIGN = register(new Block("warped_sign", builder() + .intState(ROTATION_16, 0, 15) + .booleanState(WATERLOGGED))); + public static final Block CRIMSON_WALL_SIGN = register(new Block("crimson_wall_sign", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block WARPED_WALL_SIGN = register(new Block("warped_wall_sign", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block STRUCTURE_BLOCK = register(new Block("structure_block", builder() + .enumState(STRUCTUREBLOCK_MODE, "save", "load", "corner", "data"))); + public static final Block JIGSAW = register(new Block("jigsaw", builder() + .enumState(ORIENTATION, "down_east", "down_north", "down_south", "down_west", "up_east", "up_north", "up_south", "up_west", "west_up", "east_up", "north_up", "south_up"))); + public static final Block COMPOSTER = register(new Block("composter", builder() + .intState(LEVEL_COMPOSTER, 0, 8))); + public static final Block TARGET = register(new Block("target", builder() + .intState(POWER, 0, 15))); + public static final Block BEE_NEST = register(new Block("bee_nest", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .intState(LEVEL_HONEY, 0, 5))); + public static final Block BEEHIVE = register(new Block("beehive", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .intState(LEVEL_HONEY, 0, 5))); + public static final Block HONEY_BLOCK = register(new Block("honey_block", builder())); + public static final Block HONEYCOMB_BLOCK = register(new Block("honeycomb_block", builder())); + public static final Block NETHERITE_BLOCK = register(new Block("netherite_block", builder())); + public static final Block ANCIENT_DEBRIS = register(new Block("ancient_debris", builder())); + public static final Block CRYING_OBSIDIAN = register(new Block("crying_obsidian", builder())); + public static final Block RESPAWN_ANCHOR = register(new Block("respawn_anchor", builder() + .intState(RESPAWN_ANCHOR_CHARGES, 0, 4))); + public static final Block POTTED_CRIMSON_FUNGUS = register(new Block("potted_crimson_fungus", builder())); + public static final Block POTTED_WARPED_FUNGUS = register(new Block("potted_warped_fungus", builder())); + public static final Block POTTED_CRIMSON_ROOTS = register(new Block("potted_crimson_roots", builder())); + public static final Block POTTED_WARPED_ROOTS = register(new Block("potted_warped_roots", builder())); + public static final Block LODESTONE = register(new Block("lodestone", builder())); + public static final Block BLACKSTONE = register(new Block("blackstone", builder())); + public static final Block BLACKSTONE_STAIRS = register(new Block("blackstone_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block BLACKSTONE_WALL = register(new Block("blackstone_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block BLACKSTONE_SLAB = register(new Block("blackstone_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block POLISHED_BLACKSTONE = register(new Block("polished_blackstone", builder())); + public static final Block POLISHED_BLACKSTONE_BRICKS = register(new Block("polished_blackstone_bricks", builder())); + public static final Block CRACKED_POLISHED_BLACKSTONE_BRICKS = register(new Block("cracked_polished_blackstone_bricks", builder())); + public static final Block CHISELED_POLISHED_BLACKSTONE = register(new Block("chiseled_polished_blackstone", builder())); + public static final Block POLISHED_BLACKSTONE_BRICK_SLAB = register(new Block("polished_blackstone_brick_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block POLISHED_BLACKSTONE_BRICK_STAIRS = register(new Block("polished_blackstone_brick_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block POLISHED_BLACKSTONE_BRICK_WALL = register(new Block("polished_blackstone_brick_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block GILDED_BLACKSTONE = register(new Block("gilded_blackstone", builder())); + public static final Block POLISHED_BLACKSTONE_STAIRS = register(new Block("polished_blackstone_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block POLISHED_BLACKSTONE_SLAB = register(new Block("polished_blackstone_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block POLISHED_BLACKSTONE_PRESSURE_PLATE = register(new Block("polished_blackstone_pressure_plate", builder() + .booleanState(POWERED))); + public static final Block POLISHED_BLACKSTONE_BUTTON = register(new Block("polished_blackstone_button", builder() + .enumState(ATTACH_FACE, "floor", "wall", "ceiling") + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(POWERED))); + public static final Block POLISHED_BLACKSTONE_WALL = register(new Block("polished_blackstone_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block CHISELED_NETHER_BRICKS = register(new Block("chiseled_nether_bricks", builder())); + public static final Block CRACKED_NETHER_BRICKS = register(new Block("cracked_nether_bricks", builder())); + public static final Block QUARTZ_BRICKS = register(new Block("quartz_bricks", builder())); + public static final Block CANDLE = register(new Block("candle", builder() + .intState(CANDLES, 1, 4) + .booleanState(LIT) + .booleanState(WATERLOGGED))); + public static final Block WHITE_CANDLE = register(new Block("white_candle", builder() + .intState(CANDLES, 1, 4) + .booleanState(LIT) + .booleanState(WATERLOGGED))); + public static final Block ORANGE_CANDLE = register(new Block("orange_candle", builder() + .intState(CANDLES, 1, 4) + .booleanState(LIT) + .booleanState(WATERLOGGED))); + public static final Block MAGENTA_CANDLE = register(new Block("magenta_candle", builder() + .intState(CANDLES, 1, 4) + .booleanState(LIT) + .booleanState(WATERLOGGED))); + public static final Block LIGHT_BLUE_CANDLE = register(new Block("light_blue_candle", builder() + .intState(CANDLES, 1, 4) + .booleanState(LIT) + .booleanState(WATERLOGGED))); + public static final Block YELLOW_CANDLE = register(new Block("yellow_candle", builder() + .intState(CANDLES, 1, 4) + .booleanState(LIT) + .booleanState(WATERLOGGED))); + public static final Block LIME_CANDLE = register(new Block("lime_candle", builder() + .intState(CANDLES, 1, 4) + .booleanState(LIT) + .booleanState(WATERLOGGED))); + public static final Block PINK_CANDLE = register(new Block("pink_candle", builder() + .intState(CANDLES, 1, 4) + .booleanState(LIT) + .booleanState(WATERLOGGED))); + public static final Block GRAY_CANDLE = register(new Block("gray_candle", builder() + .intState(CANDLES, 1, 4) + .booleanState(LIT) + .booleanState(WATERLOGGED))); + public static final Block LIGHT_GRAY_CANDLE = register(new Block("light_gray_candle", builder() + .intState(CANDLES, 1, 4) + .booleanState(LIT) + .booleanState(WATERLOGGED))); + public static final Block CYAN_CANDLE = register(new Block("cyan_candle", builder() + .intState(CANDLES, 1, 4) + .booleanState(LIT) + .booleanState(WATERLOGGED))); + public static final Block PURPLE_CANDLE = register(new Block("purple_candle", builder() + .intState(CANDLES, 1, 4) + .booleanState(LIT) + .booleanState(WATERLOGGED))); + public static final Block BLUE_CANDLE = register(new Block("blue_candle", builder() + .intState(CANDLES, 1, 4) + .booleanState(LIT) + .booleanState(WATERLOGGED))); + public static final Block BROWN_CANDLE = register(new Block("brown_candle", builder() + .intState(CANDLES, 1, 4) + .booleanState(LIT) + .booleanState(WATERLOGGED))); + public static final Block GREEN_CANDLE = register(new Block("green_candle", builder() + .intState(CANDLES, 1, 4) + .booleanState(LIT) + .booleanState(WATERLOGGED))); + public static final Block RED_CANDLE = register(new Block("red_candle", builder() + .intState(CANDLES, 1, 4) + .booleanState(LIT) + .booleanState(WATERLOGGED))); + public static final Block BLACK_CANDLE = register(new Block("black_candle", builder() + .intState(CANDLES, 1, 4) + .booleanState(LIT) + .booleanState(WATERLOGGED))); + public static final Block CANDLE_CAKE = register(new Block("candle_cake", builder() + .booleanState(LIT))); + public static final Block WHITE_CANDLE_CAKE = register(new Block("white_candle_cake", builder() + .booleanState(LIT))); + public static final Block ORANGE_CANDLE_CAKE = register(new Block("orange_candle_cake", builder() + .booleanState(LIT))); + public static final Block MAGENTA_CANDLE_CAKE = register(new Block("magenta_candle_cake", builder() + .booleanState(LIT))); + public static final Block LIGHT_BLUE_CANDLE_CAKE = register(new Block("light_blue_candle_cake", builder() + .booleanState(LIT))); + public static final Block YELLOW_CANDLE_CAKE = register(new Block("yellow_candle_cake", builder() + .booleanState(LIT))); + public static final Block LIME_CANDLE_CAKE = register(new Block("lime_candle_cake", builder() + .booleanState(LIT))); + public static final Block PINK_CANDLE_CAKE = register(new Block("pink_candle_cake", builder() + .booleanState(LIT))); + public static final Block GRAY_CANDLE_CAKE = register(new Block("gray_candle_cake", builder() + .booleanState(LIT))); + public static final Block LIGHT_GRAY_CANDLE_CAKE = register(new Block("light_gray_candle_cake", builder() + .booleanState(LIT))); + public static final Block CYAN_CANDLE_CAKE = register(new Block("cyan_candle_cake", builder() + .booleanState(LIT))); + public static final Block PURPLE_CANDLE_CAKE = register(new Block("purple_candle_cake", builder() + .booleanState(LIT))); + public static final Block BLUE_CANDLE_CAKE = register(new Block("blue_candle_cake", builder() + .booleanState(LIT))); + public static final Block BROWN_CANDLE_CAKE = register(new Block("brown_candle_cake", builder() + .booleanState(LIT))); + public static final Block GREEN_CANDLE_CAKE = register(new Block("green_candle_cake", builder() + .booleanState(LIT))); + public static final Block RED_CANDLE_CAKE = register(new Block("red_candle_cake", builder() + .booleanState(LIT))); + public static final Block BLACK_CANDLE_CAKE = register(new Block("black_candle_cake", builder() + .booleanState(LIT))); + public static final Block AMETHYST_BLOCK = register(new Block("amethyst_block", builder())); + public static final Block BUDDING_AMETHYST = register(new Block("budding_amethyst", builder())); + public static final Block AMETHYST_CLUSTER = register(new Block("amethyst_cluster", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN) + .booleanState(WATERLOGGED))); + public static final Block LARGE_AMETHYST_BUD = register(new Block("large_amethyst_bud", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN) + .booleanState(WATERLOGGED))); + public static final Block MEDIUM_AMETHYST_BUD = register(new Block("medium_amethyst_bud", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN) + .booleanState(WATERLOGGED))); + public static final Block SMALL_AMETHYST_BUD = register(new Block("small_amethyst_bud", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN) + .booleanState(WATERLOGGED))); + public static final Block TUFF = register(new Block("tuff", builder())); + public static final Block TUFF_SLAB = register(new Block("tuff_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block TUFF_STAIRS = register(new Block("tuff_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block TUFF_WALL = register(new Block("tuff_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block POLISHED_TUFF = register(new Block("polished_tuff", builder())); + public static final Block POLISHED_TUFF_SLAB = register(new Block("polished_tuff_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block POLISHED_TUFF_STAIRS = register(new Block("polished_tuff_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block POLISHED_TUFF_WALL = register(new Block("polished_tuff_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block CHISELED_TUFF = register(new Block("chiseled_tuff", builder())); + public static final Block TUFF_BRICKS = register(new Block("tuff_bricks", builder())); + public static final Block TUFF_BRICK_SLAB = register(new Block("tuff_brick_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block TUFF_BRICK_STAIRS = register(new Block("tuff_brick_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block TUFF_BRICK_WALL = register(new Block("tuff_brick_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block CHISELED_TUFF_BRICKS = register(new Block("chiseled_tuff_bricks", builder())); + public static final Block CALCITE = register(new Block("calcite", builder())); + public static final Block TINTED_GLASS = register(new Block("tinted_glass", builder())); + public static final Block POWDER_SNOW = register(new Block("powder_snow", builder())); + public static final Block SCULK_SENSOR = register(new Block("sculk_sensor", builder() + .intState(POWER, 0, 15) + .enumState(SCULK_SENSOR_PHASE, "inactive", "active", "cooldown") + .booleanState(WATERLOGGED))); + public static final Block CALIBRATED_SCULK_SENSOR = register(new Block("calibrated_sculk_sensor", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .intState(POWER, 0, 15) + .enumState(SCULK_SENSOR_PHASE, "inactive", "active", "cooldown") + .booleanState(WATERLOGGED))); + public static final Block SCULK = register(new Block("sculk", builder())); + public static final Block SCULK_VEIN = register(new Block("sculk_vein", builder() + .booleanState(DOWN) + .booleanState(EAST) + .booleanState(NORTH) + .booleanState(SOUTH) + .booleanState(UP) + .booleanState(WATERLOGGED) + .booleanState(WEST))); + public static final Block SCULK_CATALYST = register(new Block("sculk_catalyst", builder() + .booleanState(BLOOM))); + public static final Block SCULK_SHRIEKER = register(new Block("sculk_shrieker", builder() + .booleanState(CAN_SUMMON) + .booleanState(SHRIEKING) + .booleanState(WATERLOGGED))); + public static final Block COPPER_BLOCK = register(new Block("copper_block", builder())); + public static final Block EXPOSED_COPPER = register(new Block("exposed_copper", builder())); + public static final Block WEATHERED_COPPER = register(new Block("weathered_copper", builder())); + public static final Block OXIDIZED_COPPER = register(new Block("oxidized_copper", builder())); + public static final Block COPPER_ORE = register(new Block("copper_ore", builder())); + public static final Block DEEPSLATE_COPPER_ORE = register(new Block("deepslate_copper_ore", builder())); + public static final Block OXIDIZED_CUT_COPPER = register(new Block("oxidized_cut_copper", builder())); + public static final Block WEATHERED_CUT_COPPER = register(new Block("weathered_cut_copper", builder())); + public static final Block EXPOSED_CUT_COPPER = register(new Block("exposed_cut_copper", builder())); + public static final Block CUT_COPPER = register(new Block("cut_copper", builder())); + public static final Block OXIDIZED_CHISELED_COPPER = register(new Block("oxidized_chiseled_copper", builder())); + public static final Block WEATHERED_CHISELED_COPPER = register(new Block("weathered_chiseled_copper", builder())); + public static final Block EXPOSED_CHISELED_COPPER = register(new Block("exposed_chiseled_copper", builder())); + public static final Block CHISELED_COPPER = register(new Block("chiseled_copper", builder())); + public static final Block WAXED_OXIDIZED_CHISELED_COPPER = register(new Block("waxed_oxidized_chiseled_copper", builder())); + public static final Block WAXED_WEATHERED_CHISELED_COPPER = register(new Block("waxed_weathered_chiseled_copper", builder())); + public static final Block WAXED_EXPOSED_CHISELED_COPPER = register(new Block("waxed_exposed_chiseled_copper", builder())); + public static final Block WAXED_CHISELED_COPPER = register(new Block("waxed_chiseled_copper", builder())); + public static final Block OXIDIZED_CUT_COPPER_STAIRS = register(new Block("oxidized_cut_copper_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block WEATHERED_CUT_COPPER_STAIRS = register(new Block("weathered_cut_copper_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block EXPOSED_CUT_COPPER_STAIRS = register(new Block("exposed_cut_copper_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block CUT_COPPER_STAIRS = register(new Block("cut_copper_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block OXIDIZED_CUT_COPPER_SLAB = register(new Block("oxidized_cut_copper_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block WEATHERED_CUT_COPPER_SLAB = register(new Block("weathered_cut_copper_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block EXPOSED_CUT_COPPER_SLAB = register(new Block("exposed_cut_copper_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block CUT_COPPER_SLAB = register(new Block("cut_copper_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block WAXED_COPPER_BLOCK = register(new Block("waxed_copper_block", builder())); + public static final Block WAXED_WEATHERED_COPPER = register(new Block("waxed_weathered_copper", builder())); + public static final Block WAXED_EXPOSED_COPPER = register(new Block("waxed_exposed_copper", builder())); + public static final Block WAXED_OXIDIZED_COPPER = register(new Block("waxed_oxidized_copper", builder())); + public static final Block WAXED_OXIDIZED_CUT_COPPER = register(new Block("waxed_oxidized_cut_copper", builder())); + public static final Block WAXED_WEATHERED_CUT_COPPER = register(new Block("waxed_weathered_cut_copper", builder())); + public static final Block WAXED_EXPOSED_CUT_COPPER = register(new Block("waxed_exposed_cut_copper", builder())); + public static final Block WAXED_CUT_COPPER = register(new Block("waxed_cut_copper", builder())); + public static final Block WAXED_OXIDIZED_CUT_COPPER_STAIRS = register(new Block("waxed_oxidized_cut_copper_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block WAXED_WEATHERED_CUT_COPPER_STAIRS = register(new Block("waxed_weathered_cut_copper_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block WAXED_EXPOSED_CUT_COPPER_STAIRS = register(new Block("waxed_exposed_cut_copper_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block WAXED_CUT_COPPER_STAIRS = register(new Block("waxed_cut_copper_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block WAXED_OXIDIZED_CUT_COPPER_SLAB = register(new Block("waxed_oxidized_cut_copper_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block WAXED_WEATHERED_CUT_COPPER_SLAB = register(new Block("waxed_weathered_cut_copper_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block WAXED_EXPOSED_CUT_COPPER_SLAB = register(new Block("waxed_exposed_cut_copper_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block WAXED_CUT_COPPER_SLAB = register(new Block("waxed_cut_copper_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block COPPER_DOOR = register(new Block("copper_door", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower") + .enumState(DOOR_HINGE, "left", "right") + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block EXPOSED_COPPER_DOOR = register(new Block("exposed_copper_door", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower") + .enumState(DOOR_HINGE, "left", "right") + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block OXIDIZED_COPPER_DOOR = register(new Block("oxidized_copper_door", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower") + .enumState(DOOR_HINGE, "left", "right") + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block WEATHERED_COPPER_DOOR = register(new Block("weathered_copper_door", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower") + .enumState(DOOR_HINGE, "left", "right") + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block WAXED_COPPER_DOOR = register(new Block("waxed_copper_door", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower") + .enumState(DOOR_HINGE, "left", "right") + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block WAXED_EXPOSED_COPPER_DOOR = register(new Block("waxed_exposed_copper_door", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower") + .enumState(DOOR_HINGE, "left", "right") + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block WAXED_OXIDIZED_COPPER_DOOR = register(new Block("waxed_oxidized_copper_door", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower") + .enumState(DOOR_HINGE, "left", "right") + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block WAXED_WEATHERED_COPPER_DOOR = register(new Block("waxed_weathered_copper_door", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower") + .enumState(DOOR_HINGE, "left", "right") + .booleanState(OPEN) + .booleanState(POWERED))); + public static final Block COPPER_TRAPDOOR = register(new Block("copper_trapdoor", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .booleanState(OPEN) + .booleanState(POWERED) + .booleanState(WATERLOGGED))); + public static final Block EXPOSED_COPPER_TRAPDOOR = register(new Block("exposed_copper_trapdoor", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .booleanState(OPEN) + .booleanState(POWERED) + .booleanState(WATERLOGGED))); + public static final Block OXIDIZED_COPPER_TRAPDOOR = register(new Block("oxidized_copper_trapdoor", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .booleanState(OPEN) + .booleanState(POWERED) + .booleanState(WATERLOGGED))); + public static final Block WEATHERED_COPPER_TRAPDOOR = register(new Block("weathered_copper_trapdoor", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .booleanState(OPEN) + .booleanState(POWERED) + .booleanState(WATERLOGGED))); + public static final Block WAXED_COPPER_TRAPDOOR = register(new Block("waxed_copper_trapdoor", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .booleanState(OPEN) + .booleanState(POWERED) + .booleanState(WATERLOGGED))); + public static final Block WAXED_EXPOSED_COPPER_TRAPDOOR = register(new Block("waxed_exposed_copper_trapdoor", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .booleanState(OPEN) + .booleanState(POWERED) + .booleanState(WATERLOGGED))); + public static final Block WAXED_OXIDIZED_COPPER_TRAPDOOR = register(new Block("waxed_oxidized_copper_trapdoor", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .booleanState(OPEN) + .booleanState(POWERED) + .booleanState(WATERLOGGED))); + public static final Block WAXED_WEATHERED_COPPER_TRAPDOOR = register(new Block("waxed_weathered_copper_trapdoor", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .booleanState(OPEN) + .booleanState(POWERED) + .booleanState(WATERLOGGED))); + public static final Block COPPER_GRATE = register(new Block("copper_grate", builder() + .booleanState(WATERLOGGED))); + public static final Block EXPOSED_COPPER_GRATE = register(new Block("exposed_copper_grate", builder() + .booleanState(WATERLOGGED))); + public static final Block WEATHERED_COPPER_GRATE = register(new Block("weathered_copper_grate", builder() + .booleanState(WATERLOGGED))); + public static final Block OXIDIZED_COPPER_GRATE = register(new Block("oxidized_copper_grate", builder() + .booleanState(WATERLOGGED))); + public static final Block WAXED_COPPER_GRATE = register(new Block("waxed_copper_grate", builder() + .booleanState(WATERLOGGED))); + public static final Block WAXED_EXPOSED_COPPER_GRATE = register(new Block("waxed_exposed_copper_grate", builder() + .booleanState(WATERLOGGED))); + public static final Block WAXED_WEATHERED_COPPER_GRATE = register(new Block("waxed_weathered_copper_grate", builder() + .booleanState(WATERLOGGED))); + public static final Block WAXED_OXIDIZED_COPPER_GRATE = register(new Block("waxed_oxidized_copper_grate", builder() + .booleanState(WATERLOGGED))); + public static final Block COPPER_BULB = register(new Block("copper_bulb", builder() + .booleanState(LIT) + .booleanState(POWERED))); + public static final Block EXPOSED_COPPER_BULB = register(new Block("exposed_copper_bulb", builder() + .booleanState(LIT) + .booleanState(POWERED))); + public static final Block WEATHERED_COPPER_BULB = register(new Block("weathered_copper_bulb", builder() + .booleanState(LIT) + .booleanState(POWERED))); + public static final Block OXIDIZED_COPPER_BULB = register(new Block("oxidized_copper_bulb", builder() + .booleanState(LIT) + .booleanState(POWERED))); + public static final Block WAXED_COPPER_BULB = register(new Block("waxed_copper_bulb", builder() + .booleanState(LIT) + .booleanState(POWERED))); + public static final Block WAXED_EXPOSED_COPPER_BULB = register(new Block("waxed_exposed_copper_bulb", builder() + .booleanState(LIT) + .booleanState(POWERED))); + public static final Block WAXED_WEATHERED_COPPER_BULB = register(new Block("waxed_weathered_copper_bulb", builder() + .booleanState(LIT) + .booleanState(POWERED))); + public static final Block WAXED_OXIDIZED_COPPER_BULB = register(new Block("waxed_oxidized_copper_bulb", builder() + .booleanState(LIT) + .booleanState(POWERED))); + public static final Block LIGHTNING_ROD = register(new Block("lightning_rod", builder() + .enumState(FACING, Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN) + .booleanState(POWERED) + .booleanState(WATERLOGGED))); + public static final Block POINTED_DRIPSTONE = register(new Block("pointed_dripstone", builder() + .enumState(DRIPSTONE_THICKNESS, "tip_merge", "tip", "frustum", "middle", "base") + .enumState(VERTICAL_DIRECTION, Direction.UP, Direction.DOWN) + .booleanState(WATERLOGGED))); + public static final Block DRIPSTONE_BLOCK = register(new Block("dripstone_block", builder())); + public static final Block CAVE_VINES = register(new Block("cave_vines", builder() + .intState(AGE_25, 0, 25) + .booleanState(BERRIES))); + public static final Block CAVE_VINES_PLANT = register(new Block("cave_vines_plant", builder() + .booleanState(BERRIES))); + public static final Block SPORE_BLOSSOM = register(new Block("spore_blossom", builder())); + public static final Block AZALEA = register(new Block("azalea", builder())); + public static final Block FLOWERING_AZALEA = register(new Block("flowering_azalea", builder())); + public static final Block MOSS_CARPET = register(new Block("moss_carpet", builder())); + public static final Block PINK_PETALS = register(new Block("pink_petals", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .intState(FLOWER_AMOUNT, 1, 4))); + public static final Block MOSS_BLOCK = register(new Block("moss_block", builder())); + public static final Block BIG_DRIPLEAF = register(new Block("big_dripleaf", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(TILT, "none", "unstable", "partial", "full") + .booleanState(WATERLOGGED))); + public static final Block BIG_DRIPLEAF_STEM = register(new Block("big_dripleaf_stem", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block SMALL_DRIPLEAF = register(new Block("small_dripleaf", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(DOUBLE_BLOCK_HALF, "upper", "lower") + .booleanState(WATERLOGGED))); + public static final Block HANGING_ROOTS = register(new Block("hanging_roots", builder() + .booleanState(WATERLOGGED))); + public static final Block ROOTED_DIRT = register(new Block("rooted_dirt", builder())); + public static final Block MUD = register(new Block("mud", builder())); + public static final Block DEEPSLATE = register(new Block("deepslate", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block COBBLED_DEEPSLATE = register(new Block("cobbled_deepslate", builder())); + public static final Block COBBLED_DEEPSLATE_STAIRS = register(new Block("cobbled_deepslate_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block COBBLED_DEEPSLATE_SLAB = register(new Block("cobbled_deepslate_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block COBBLED_DEEPSLATE_WALL = register(new Block("cobbled_deepslate_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block POLISHED_DEEPSLATE = register(new Block("polished_deepslate", builder())); + public static final Block POLISHED_DEEPSLATE_STAIRS = register(new Block("polished_deepslate_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block POLISHED_DEEPSLATE_SLAB = register(new Block("polished_deepslate_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block POLISHED_DEEPSLATE_WALL = register(new Block("polished_deepslate_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block DEEPSLATE_TILES = register(new Block("deepslate_tiles", builder())); + public static final Block DEEPSLATE_TILE_STAIRS = register(new Block("deepslate_tile_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block DEEPSLATE_TILE_SLAB = register(new Block("deepslate_tile_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block DEEPSLATE_TILE_WALL = register(new Block("deepslate_tile_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block DEEPSLATE_BRICKS = register(new Block("deepslate_bricks", builder())); + public static final Block DEEPSLATE_BRICK_STAIRS = register(new Block("deepslate_brick_stairs", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .enumState(HALF, "top", "bottom") + .enumState(STAIRS_SHAPE, "straight", "inner_left", "inner_right", "outer_left", "outer_right") + .booleanState(WATERLOGGED))); + public static final Block DEEPSLATE_BRICK_SLAB = register(new Block("deepslate_brick_slab", builder() + .enumState(SLAB_TYPE, "top", "bottom", "double") + .booleanState(WATERLOGGED))); + public static final Block DEEPSLATE_BRICK_WALL = register(new Block("deepslate_brick_wall", builder() + .enumState(EAST_WALL, "none", "low", "tall") + .enumState(NORTH_WALL, "none", "low", "tall") + .enumState(SOUTH_WALL, "none", "low", "tall") + .booleanState(UP) + .booleanState(WATERLOGGED) + .enumState(WEST_WALL, "none", "low", "tall"))); + public static final Block CHISELED_DEEPSLATE = register(new Block("chiseled_deepslate", builder())); + public static final Block CRACKED_DEEPSLATE_BRICKS = register(new Block("cracked_deepslate_bricks", builder())); + public static final Block CRACKED_DEEPSLATE_TILES = register(new Block("cracked_deepslate_tiles", builder())); + public static final Block INFESTED_DEEPSLATE = register(new Block("infested_deepslate", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block SMOOTH_BASALT = register(new Block("smooth_basalt", builder())); + public static final Block RAW_IRON_BLOCK = register(new Block("raw_iron_block", builder())); + public static final Block RAW_COPPER_BLOCK = register(new Block("raw_copper_block", builder())); + public static final Block RAW_GOLD_BLOCK = register(new Block("raw_gold_block", builder())); + public static final Block POTTED_AZALEA_BUSH = register(new Block("potted_azalea_bush", builder())); + public static final Block POTTED_FLOWERING_AZALEA_BUSH = register(new Block("potted_flowering_azalea_bush", builder())); + public static final Block OCHRE_FROGLIGHT = register(new Block("ochre_froglight", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block VERDANT_FROGLIGHT = register(new Block("verdant_froglight", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block PEARLESCENT_FROGLIGHT = register(new Block("pearlescent_froglight", builder() + .enumState(AXIS, Axis.VALUES))); + public static final Block FROGSPAWN = register(new Block("frogspawn", builder())); + public static final Block REINFORCED_DEEPSLATE = register(new Block("reinforced_deepslate", builder())); + public static final Block DECORATED_POT = register(new Block("decorated_pot", builder() + .booleanState(CRACKED) + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(WATERLOGGED))); + public static final Block CRAFTER = register(new Block("crafter", builder() + .booleanState(CRAFTING) + .enumState(ORIENTATION, "down_east", "down_north", "down_south", "down_west", "up_east", "up_north", "up_south", "up_west", "west_up", "east_up", "north_up", "south_up") + .booleanState(TRIGGERED))); + public static final Block TRIAL_SPAWNER = register(new Block("trial_spawner", builder() + .booleanState(OMINOUS) + .enumState(TRIAL_SPAWNER_STATE, "inactive", "waiting_for_players", "active", "waiting_for_reward_ejection", "ejecting_reward", "cooldown"))); + public static final Block VAULT = register(new Block("vault", builder() + .enumState(HORIZONTAL_FACING, Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST) + .booleanState(OMINOUS) + .enumState(VAULT_STATE, "inactive", "active", "unlocking", "ejecting"))); + public static final Block HEAVY_CORE = register(new Block("heavy_core", builder() + .booleanState(WATERLOGGED))); + + private static T register(T block) { + BlockRegistries.JAVA_BLOCKS_TO_RENAME.get().add(block); + return block; + } + + private Blocks() { + } +} diff --git a/core/src/main/java/org/geysermc/geyser/level/block/property/ChestType.java b/core/src/main/java/org/geysermc/geyser/level/block/property/ChestType.java new file mode 100644 index 000000000..c206f127c --- /dev/null +++ b/core/src/main/java/org/geysermc/geyser/level/block/property/ChestType.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2024 GeyserMC. http://geysermc.org + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * @author GeyserMC + * @link https://github.com/GeyserMC/Geyser + */ + +package org.geysermc.geyser.level.block.property; + +public enum ChestType { + SINGLE, + LEFT, + RIGHT; + + public static final ChestType[] VALUES = values(); +} diff --git a/core/src/main/java/org/geysermc/geyser/level/block/property/Properties.java b/core/src/main/java/org/geysermc/geyser/level/block/property/Properties.java new file mode 100644 index 000000000..bbb6f8fe3 --- /dev/null +++ b/core/src/main/java/org/geysermc/geyser/level/block/property/Properties.java @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2024 GeyserMC. http://geysermc.org + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * @author GeyserMC + * @link https://github.com/GeyserMC/Geyser + */ + +package org.geysermc.geyser.level.block.property; + +import org.geysermc.geyser.level.physics.Axis; +import org.geysermc.geyser.level.physics.Direction; + +public final class Properties { + public static final Property ATTACHED = Property.create("attached"); + public static final Property BOTTOM = Property.create("bottom"); + public static final Property CONDITIONAL = Property.create("conditional"); + public static final Property DISARMED = Property.create("disarmed"); + public static final Property DRAG = Property.create("drag"); + public static final Property ENABLED = Property.create("enabled"); + public static final Property EXTENDED = Property.create("extended"); + public static final Property EYE = Property.create("eye"); + public static final Property FALLING = Property.create("falling"); + public static final Property HANGING = Property.create("hanging"); + public static final Property HAS_BOTTLE_0 = Property.create("has_bottle_0"); + public static final Property HAS_BOTTLE_1 = Property.create("has_bottle_1"); + public static final Property HAS_BOTTLE_2 = Property.create("has_bottle_2"); + public static final Property HAS_RECORD = Property.create("has_record"); + public static final Property HAS_BOOK = Property.create("has_book"); + public static final Property INVERTED = Property.create("inverted"); + public static final Property IN_WALL = Property.create("in_wall"); + public static final Property LIT = Property.create("lit"); + public static final Property LOCKED = Property.create("locked"); + public static final Property OCCUPIED = Property.create("occupied"); + public static final Property OPEN = Property.create("open"); + public static final Property PERSISTENT = Property.create("persistent"); + public static final Property POWERED = Property.create("powered"); + public static final Property SHORT = Property.create("short"); + public static final Property SIGNAL_FIRE = Property.create("signal_fire"); + public static final Property SNOWY = Property.create("snowy"); + public static final Property TRIGGERED = Property.create("triggered"); + public static final Property UNSTABLE = Property.create("unstable"); + public static final Property WATERLOGGED = Property.create("waterlogged"); + public static final Property BERRIES = Property.create("berries"); + public static final Property BLOOM = Property.create("bloom"); + public static final Property SHRIEKING = Property.create("shrieking"); + public static final Property CAN_SUMMON = Property.create("can_summon"); + public static final Property HORIZONTAL_AXIS = Property.create("axis"); + public static final Property AXIS = Property.create("axis"); + public static final Property UP = Property.create("up"); + public static final Property DOWN = Property.create("down"); + public static final Property NORTH = Property.create("north"); + public static final Property EAST = Property.create("east"); + public static final Property SOUTH = Property.create("south"); + public static final Property WEST = Property.create("west"); + public static final Property FACING = Property.create("facing"); + public static final Property FACING_HOPPER = Property.create("facing"); + public static final Property HORIZONTAL_FACING = Property.create("facing"); + public static final Property FLOWER_AMOUNT = Property.create("flower_amount"); + public static final Property ORIENTATION = Property.create("orientation"); + public static final Property ATTACH_FACE = Property.create("face"); + public static final Property BELL_ATTACHMENT = Property.create("attachment"); + public static final Property EAST_WALL = Property.create("east"); + public static final Property NORTH_WALL = Property.create("north"); + public static final Property SOUTH_WALL = Property.create("south"); + public static final Property WEST_WALL = Property.create("west"); + public static final Property EAST_REDSTONE = Property.create("east"); + public static final Property NORTH_REDSTONE = Property.create("north"); + public static final Property SOUTH_REDSTONE = Property.create("south"); + public static final Property WEST_REDSTONE = Property.create("west"); + public static final Property DOUBLE_BLOCK_HALF = Property.create("half"); + public static final Property HALF = Property.create("half"); + public static final Property RAIL_SHAPE = Property.create("shape"); + public static final Property RAIL_SHAPE_STRAIGHT = Property.create("shape"); + public static final Property AGE_1 = Property.create("age"); + public static final Property AGE_2 = Property.create("age"); + public static final Property AGE_3 = Property.create("age"); + public static final Property AGE_4 = Property.create("age"); + public static final Property AGE_5 = Property.create("age"); + public static final Property AGE_7 = Property.create("age"); + public static final Property AGE_15 = Property.create("age"); + public static final Property AGE_25 = Property.create("age"); + public static final Property BITES = Property.create("bites"); + public static final Property CANDLES = Property.create("candles"); + public static final Property DELAY = Property.create("delay"); + public static final Property DISTANCE = Property.create("distance"); + public static final Property EGGS = Property.create("eggs"); + public static final Property HATCH = Property.create("hatch"); + public static final Property LAYERS = Property.create("layers"); + public static final Property LEVEL_CAULDRON = Property.create("level"); + public static final Property LEVEL_COMPOSTER = Property.create("level"); + public static final Property LEVEL_FLOWING = Property.create("level"); + public static final Property LEVEL_HONEY = Property.create("honey_level"); + public static final Property LEVEL = Property.create("level"); + public static final Property MOISTURE = Property.create("moisture"); + public static final Property NOTE = Property.create("note"); + public static final Property PICKLES = Property.create("pickles"); + public static final Property POWER = Property.create("power"); + public static final Property STAGE = Property.create("stage"); + public static final Property STABILITY_DISTANCE = Property.create("distance"); + public static final Property RESPAWN_ANCHOR_CHARGES = Property.create("charges"); + public static final Property ROTATION_16 = Property.create("rotation"); + public static final Property BED_PART = Property.create("part"); + public static final Property CHEST_TYPE = Property.create("type"); + public static final Property MODE_COMPARATOR = Property.create("mode"); + public static final Property DOOR_HINGE = Property.create("hinge"); + public static final Property NOTEBLOCK_INSTRUMENT = Property.create("instrument"); + public static final Property PISTON_TYPE = Property.create("type"); + public static final Property SLAB_TYPE = Property.create("type"); + public static final Property STAIRS_SHAPE = Property.create("shape"); + public static final Property STRUCTUREBLOCK_MODE = Property.create("mode"); + public static final Property BAMBOO_LEAVES = Property.create("leaves"); + public static final Property TILT = Property.create("tilt"); + public static final Property VERTICAL_DIRECTION = Property.create("vertical_direction"); + public static final Property DRIPSTONE_THICKNESS = Property.create("thickness"); + public static final Property SCULK_SENSOR_PHASE = Property.create("sculk_sensor_phase"); + public static final Property CHISELED_BOOKSHELF_SLOT_0_OCCUPIED = Property.create("slot_0_occupied"); + public static final Property CHISELED_BOOKSHELF_SLOT_1_OCCUPIED = Property.create("slot_1_occupied"); + public static final Property CHISELED_BOOKSHELF_SLOT_2_OCCUPIED = Property.create("slot_2_occupied"); + public static final Property CHISELED_BOOKSHELF_SLOT_3_OCCUPIED = Property.create("slot_3_occupied"); + public static final Property CHISELED_BOOKSHELF_SLOT_4_OCCUPIED = Property.create("slot_4_occupied"); + public static final Property CHISELED_BOOKSHELF_SLOT_5_OCCUPIED = Property.create("slot_5_occupied"); + public static final Property DUSTED = Property.create("dusted"); + public static final Property CRACKED = Property.create("cracked"); + public static final Property CRAFTING = Property.create("crafting"); + public static final Property TRIAL_SPAWNER_STATE = Property.create("trial_spawner_state"); + public static final Property VAULT_STATE = Property.create("vault_state"); + public static final Property OMINOUS = Property.create("ominous"); +} diff --git a/core/src/main/java/org/geysermc/geyser/level/block/property/Property.java b/core/src/main/java/org/geysermc/geyser/level/block/property/Property.java new file mode 100644 index 000000000..da68c54e4 --- /dev/null +++ b/core/src/main/java/org/geysermc/geyser/level/block/property/Property.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 GeyserMC. http://geysermc.org + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * @author GeyserMC + * @link https://github.com/GeyserMC/Geyser + */ + +package org.geysermc.geyser.level.block.property; + +public class Property> { + private final String name; + + public Property(String name) { + this.name = name; + } + + @Override + public String toString() { + return getClass().getSimpleName() + "[" + name + "]"; + } + + public static > Property create(String name) { + return new Property<>(name); + } +} diff --git a/core/src/main/java/org/geysermc/geyser/level/block/type/BannerBlock.java b/core/src/main/java/org/geysermc/geyser/level/block/type/BannerBlock.java new file mode 100644 index 000000000..481004baa --- /dev/null +++ b/core/src/main/java/org/geysermc/geyser/level/block/type/BannerBlock.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2024 GeyserMC. http://geysermc.org + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * @author GeyserMC + * @link https://github.com/GeyserMC/Geyser + */ + +package org.geysermc.geyser.level.block.type; + +public class BannerBlock extends Block { + private final int dyeColor; + + public BannerBlock(String javaIdentifier, int dyeColor, Builder builder) { + super(javaIdentifier, builder); + this.dyeColor = dyeColor; + } + + public int dyeColor() { + return dyeColor; + } +} diff --git a/core/src/main/java/org/geysermc/geyser/level/block/type/BedBlock.java b/core/src/main/java/org/geysermc/geyser/level/block/type/BedBlock.java new file mode 100644 index 000000000..e72dbdafa --- /dev/null +++ b/core/src/main/java/org/geysermc/geyser/level/block/type/BedBlock.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2024 GeyserMC. http://geysermc.org + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * @author GeyserMC + * @link https://github.com/GeyserMC/Geyser + */ + +package org.geysermc.geyser.level.block.type; + +public class BedBlock extends Block { + private final int dyeColor; + + public BedBlock(String javaIdentifier, int dyeColor, Builder builder) { + super(javaIdentifier, builder); + this.dyeColor = dyeColor; + } + + public int dyeColor() { + return dyeColor; + } +} diff --git a/core/src/main/java/org/geysermc/geyser/level/block/type/Block.java b/core/src/main/java/org/geysermc/geyser/level/block/type/Block.java new file mode 100644 index 000000000..459f4a5af --- /dev/null +++ b/core/src/main/java/org/geysermc/geyser/level/block/type/Block.java @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2024 GeyserMC. http://geysermc.org + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * @author GeyserMC + * @link https://github.com/GeyserMC/Geyser + */ + +package org.geysermc.geyser.level.block.type; + +import it.unimi.dsi.fastutil.Pair; +import it.unimi.dsi.fastutil.ints.IntArrayList; +import it.unimi.dsi.fastutil.ints.IntList; +import it.unimi.dsi.fastutil.objects.Reference2ObjectArrayMap; +import it.unimi.dsi.fastutil.objects.Reference2ObjectMap; +import org.geysermc.geyser.level.block.property.Property; +import org.geysermc.geyser.registry.BlockRegistries; +import org.geysermc.mcprotocollib.protocol.data.game.Identifier; + +import java.util.*; +import java.util.stream.Stream; + +public class Block { + public static final int JAVA_AIR_ID = 0; + + private final String javaIdentifier; + private int javaId = -1; + + public Block(String javaIdentifier, Builder builder) { + this.javaIdentifier = Identifier.formalize(javaIdentifier).intern(); + builder.build(this); + } + + public String javaIdentifier() { + return javaIdentifier; + } + + public int javaId() { + return javaId; + } + + public void setJavaId(int javaId) { + if (this.javaId != -1) { + throw new RuntimeException("Block ID has already been set!"); + } + this.javaId = javaId; + } + + @Override + public String toString() { + return "Item{" + + "javaIdentifier='" + javaIdentifier + '\'' + + ", javaId=" + javaId + + '}'; + } + + public static Builder builder() { + return new Builder(); + } + + public static final class Builder { + private final Map, List>> states = new LinkedHashMap<>(); + + /** + * For states that we're just tracking for mirroring Java states. + */ + public Builder enumState(Property property, String... values) { + states.put(property, List.of(values)); + return this; + } + + @SafeVarargs + public final > Builder enumState(Property property, T... enums) { + states.put(property, List.of(enums)); + return this; + } + + public Builder booleanState(Property property) { + states.put(property, List.of(Boolean.TRUE, Boolean.FALSE)); // Make this list a static constant if it'll survive past initialization + return this; + } + + public Builder intState(Property property, int low, int high) { + IntList list = new IntArrayList(); + // There is a state for every number between the low and high. + for (int i = low; i <= high; i++) { + list.add(i); + } + states.put(property, List.copyOf(list)); // Boxing reasons for that copy I guess. + return this; + } + + private void build(Block block) { + if (states.isEmpty()) { + BlockRegistries.BLOCK_STATES.get().add(new BlockState(block, BlockRegistries.BLOCK_STATES.get().size())); + } else { + // Think of this stream as another list containing, at the start, one empty list. + // It's two collections. Not a stream from the empty list. + Stream, Comparable>>> stream = Stream.of(Collections.emptyList()); + for (var state : this.states.entrySet()) { + // OK, so here's how I understand this works. Because this was staring at vanilla Java code trying + // to figure out exactly how it works so we don't have any discrepencies. + // For each existing pair in the list, a new list is created, adding one of the new values. + // Property up [true/false] would exist as true and false + // Both entries will get duplicated, adding down, true and false. + stream = stream.flatMap(aPreviousPropertiesList -> + // So the above is a list. It may be empty if this is the first property, + // or it may be populated if this is not the first property. + // We're about to create a new stream, each with a new list, + // for every previous property + state.getValue().stream().map(value -> { + var newProperties = new ArrayList<>(aPreviousPropertiesList); + newProperties.add(Pair.of(state.getKey(), value)); + return newProperties; + })); + } + + // Now we have a list of Pairs. Each list is a block state! + // If we have two boolean properties: up [true/false] and down [true/false], + // We'll see [up=true,down=true], [up=false,down=true], [up=true,down=false], [up=false,down=false] + stream.forEach(properties -> { + Reference2ObjectMap, Comparable> propertyMap = new Reference2ObjectArrayMap<>(properties.size()); + for (int i = 0; i < properties.size(); i++) { + Pair, Comparable> property = properties.get(i); + propertyMap.put(property.key(), property.value()); + } + BlockRegistries.BLOCK_STATES.get().add(new BlockState(block, BlockRegistries.BLOCK_STATES.get().size(), propertyMap)); + }); + } + } + + private Builder() { + } + } +} diff --git a/core/src/main/java/org/geysermc/geyser/level/block/type/BlockState.java b/core/src/main/java/org/geysermc/geyser/level/block/type/BlockState.java new file mode 100644 index 000000000..936b711e4 --- /dev/null +++ b/core/src/main/java/org/geysermc/geyser/level/block/type/BlockState.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2024 GeyserMC. http://geysermc.org + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * @author GeyserMC + * @link https://github.com/GeyserMC/Geyser + */ + +package org.geysermc.geyser.level.block.type; + +import it.unimi.dsi.fastutil.objects.Reference2ObjectMap; +import it.unimi.dsi.fastutil.objects.Reference2ObjectMaps; +import org.geysermc.geyser.level.block.property.Property; +import org.geysermc.geyser.registry.BlockRegistries; + +public final class BlockState { + private final Block block; + private final int javaId; + private final Reference2ObjectMap, Comparable> states; + + BlockState(Block block, int javaId) { + this(block, javaId, Reference2ObjectMaps.emptyMap()); + } + + BlockState(Block block, int javaId, Reference2ObjectMap, Comparable> states) { + this.block = block; + this.javaId = javaId; + this.states = states; + } + + public > T getValue(Property property) { + //noinspection unchecked + return (T) states.get(property); + } + + public Block block() { + return block; + } + + public int javaId() { + return javaId; + } + + public static BlockState of(int javaId) { + return BlockRegistries.BLOCK_STATES.get(javaId); + } +} diff --git a/core/src/main/java/org/geysermc/geyser/registry/BlockRegistries.java b/core/src/main/java/org/geysermc/geyser/registry/BlockRegistries.java index aa9d6fc36..54a36dc12 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/BlockRegistries.java +++ b/core/src/main/java/org/geysermc/geyser/registry/BlockRegistries.java @@ -34,6 +34,8 @@ import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import org.geysermc.geyser.api.block.custom.CustomBlockData; import org.geysermc.geyser.api.block.custom.CustomBlockState; import org.geysermc.geyser.api.block.custom.nonvanilla.JavaBlockState; +import org.geysermc.geyser.level.block.type.Block; +import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.registry.loader.CollisionRegistryLoader; import org.geysermc.geyser.registry.loader.RegistryLoaders; import org.geysermc.geyser.registry.populator.BlockRegistryPopulator; @@ -44,8 +46,8 @@ import org.geysermc.geyser.registry.type.BlockMappings; import org.geysermc.geyser.registry.type.CustomSkull; import org.geysermc.geyser.translator.collision.BlockCollision; +import java.util.ArrayList; import java.util.BitSet; - import java.util.Set; /** @@ -58,6 +60,14 @@ public class BlockRegistries { */ public static final VersionedRegistry BLOCKS = VersionedRegistry.create(RegistryLoaders.empty(Int2ObjectOpenHashMap::new)); + /** + * A registry which stores Java IDs to Java {@link BlockState}s, each with their specific state differences and a link + * to the overarching block. + */ + public static final ListRegistry BLOCK_STATES = ListRegistry.create(RegistryLoaders.empty(ArrayList::new)); + + public static final ListRegistry JAVA_BLOCKS_TO_RENAME = ListRegistry.create(RegistryLoaders.empty(ArrayList::new)); + /** * A mapped registry which stores Java to Bedrock block identifiers. */ diff --git a/core/src/main/java/org/geysermc/geyser/registry/ListRegistry.java b/core/src/main/java/org/geysermc/geyser/registry/ListRegistry.java new file mode 100644 index 000000000..bb5d2538c --- /dev/null +++ b/core/src/main/java/org/geysermc/geyser/registry/ListRegistry.java @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2024 GeyserMC. http://geysermc.org + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * @author GeyserMC + * @link https://github.com/GeyserMC/Geyser + */ + +package org.geysermc.geyser.registry; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.geysermc.geyser.registry.loader.RegistryLoader; + +import java.util.List; + +public class ListRegistry extends Registry> { + /** + * Creates a new instance of this class with the given input and + * {@link RegistryLoader}. The input specified is what the registry + * loader needs to take in. + * + * @param input the input + * @param registryLoader the registry loader + */ + protected ListRegistry(I input, RegistryLoader> registryLoader) { + super(input, registryLoader); + } + + /** + * Returns the value registered by the given index. + * + * @param index the index + * @return the value registered by the given index. + */ + @Nullable + public M get(int index) { + if (index >= this.mappings.size()) { + return null; + } + + return this.mappings.get(index); + } + + /** + * Returns the value registered by the given index or the default value + * specified if null. + * + * @param index the index + * @param defaultValue the default value + * @return the value registered by the given key or the default value + * specified if null. + */ + public M getOrDefault(int index, M defaultValue) { + M value = this.get(index); + if (value == null) { + return defaultValue; + } + + return value; + } + + /** + * Registers a new value into this registry with the given index. + * + * @param index the index + * @param value the value + * @return a new value into this registry with the given index. + */ + public M register(int index, M value) { + return this.mappings.set(index, value); + } + + /** + * Creates a new array registry with the given {@link RegistryLoader}. The + * input type is not specified here, meaning the loader return type is either + * predefined, or the registry is populated at a later point. + * + * @param registryLoader the registry loader + * @param the input type + * @param the returned mappings type + * @return a new registry with the given RegistryLoader supplier + */ + public static ListRegistry create(RegistryLoader> registryLoader) { + return new ListRegistry(null, registryLoader); + } +} diff --git a/core/src/main/java/org/geysermc/geyser/registry/populator/BlockRegistryPopulator.java b/core/src/main/java/org/geysermc/geyser/registry/populator/BlockRegistryPopulator.java index e76edc059..ace110f78 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/populator/BlockRegistryPopulator.java +++ b/core/src/main/java/org/geysermc/geyser/registry/populator/BlockRegistryPopulator.java @@ -582,8 +582,6 @@ public final class BlockRegistryPopulator { } } - BlockRegistries.CLEAN_JAVA_IDENTIFIERS.set(cleanIdentifiers.toArray(new String[0])); - BLOCKS_JSON = blocksJson; JsonNode blockInteractionsJson; diff --git a/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java b/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java index c0ff1fb71..144cd9f27 100644 --- a/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java +++ b/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java @@ -1592,9 +1592,6 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource { startGamePacket.setRewindHistorySize(0); startGamePacket.setServerAuthoritativeBlockBreaking(false); - // Entity properties for older versions - startGamePacket.getExperiments().add(new ExperimentData("upcoming_creator_features", true)); - upstream.sendPacket(startGamePacket); } diff --git a/core/src/main/java/org/geysermc/geyser/session/cache/ChunkCache.java b/core/src/main/java/org/geysermc/geyser/session/cache/ChunkCache.java index e3a9cba89..7b279857a 100644 --- a/core/src/main/java/org/geysermc/geyser/session/cache/ChunkCache.java +++ b/core/src/main/java/org/geysermc/geyser/session/cache/ChunkCache.java @@ -25,6 +25,7 @@ package org.geysermc.geyser.session.cache; +import org.geysermc.geyser.level.block.type.Block; import org.geysermc.mcprotocollib.protocol.data.game.chunk.DataPalette; import it.unimi.dsi.fastutil.longs.Long2ObjectMap; import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; @@ -92,11 +93,11 @@ public class ChunkCache { DataPalette palette = chunk.sections()[(y - minY) >> 4]; if (palette == null) { - if (block != BlockStateValues.JAVA_AIR_ID) { + if (block != Block.JAVA_AIR_ID) { // A previously empty chunk, which is no longer empty as a block has been added to it palette = DataPalette.createForChunk(); // Fixes the chunk assuming that all blocks is the `block` variable we are updating. /shrug - palette.getPalette().stateToId(BlockStateValues.JAVA_AIR_ID); + palette.getPalette().stateToId(Block.JAVA_AIR_ID); chunk.sections()[(y - minY) >> 4] = palette; } else { // Nothing to update @@ -109,17 +110,17 @@ public class ChunkCache { public int getBlockAt(int x, int y, int z) { if (!cache) { - return BlockStateValues.JAVA_AIR_ID; + return Block.JAVA_AIR_ID; } GeyserChunk column = this.getChunk(x >> 4, z >> 4); if (column == null) { - return BlockStateValues.JAVA_AIR_ID; + return Block.JAVA_AIR_ID; } if (y < minY || ((y - minY) >> 4) > column.sections().length - 1) { // Y likely goes above or below the height limit of this world - return BlockStateValues.JAVA_AIR_ID; + return Block.JAVA_AIR_ID; } DataPalette chunk = column.sections()[(y - minY) >> 4]; @@ -127,7 +128,7 @@ public class ChunkCache { return chunk.get(x & 0xF, y & 0xF, z & 0xF); } - return BlockStateValues.JAVA_AIR_ID; + return Block.JAVA_AIR_ID; } public void removeChunk(int chunkX, int chunkZ) { diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/ShulkerInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/ShulkerInventoryTranslator.java index f9879499a..795eba101 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/ShulkerInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/ShulkerInventoryTranslator.java @@ -35,6 +35,7 @@ import org.geysermc.geyser.inventory.BedrockContainerSlot; import org.geysermc.geyser.inventory.Inventory; import org.geysermc.geyser.inventory.holder.BlockInventoryHolder; import org.geysermc.geyser.inventory.updater.ContainerInventoryUpdater; +import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.registry.Registries; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.level.block.entity.BlockEntityTranslator; @@ -58,7 +59,7 @@ public class ShulkerInventoryTranslator extends AbstractBlockInventoryTranslator .putInt("z", position.getZ()) .putString("CustomName", inventory.getTitle()); // Don't reset facing property - shulkerBoxTranslator.translateTag(session, tag, null, javaBlockState); + shulkerBoxTranslator.translateTag(session, tag, null, BlockState.of(javaBlockState)); BlockEntityDataPacket dataPacket = new BlockEntityDataPacket(); dataPacket.setData(tag.build()); diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/chest/DoubleChestInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/chest/DoubleChestInventoryTranslator.java index 498bd418b..cb973fa18 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/chest/DoubleChestInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/chest/DoubleChestInventoryTranslator.java @@ -36,8 +36,7 @@ import org.cloudburstmc.protocol.bedrock.packet.ContainerOpenPacket; import org.cloudburstmc.protocol.bedrock.packet.UpdateBlockPacket; import org.geysermc.geyser.inventory.Container; import org.geysermc.geyser.inventory.Inventory; -import org.geysermc.geyser.level.block.BlockStateValues; -import org.geysermc.geyser.level.block.DoubleChestValue; +import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.registry.BlockRegistries; import org.geysermc.geyser.registry.type.BlockMapping; import org.geysermc.geyser.session.GeyserSession; @@ -72,8 +71,8 @@ public class DoubleChestInventoryTranslator extends ChestInventoryTranslator { .putString("CustomName", inventory.getTitle()) .putString("id", "Chest"); - DoubleChestValue chestValue = BlockStateValues.getDoubleChestValues().get(javaBlockId); - DoubleChestBlockEntityTranslator.translateChestValue(tag, chestValue, + BlockState blockState = BlockState.of(javaBlockId); + DoubleChestBlockEntityTranslator.translateChestValue(tag, blockState, session.getLastInteractionBlockPosition().getX(), session.getLastInteractionBlockPosition().getZ()); BlockEntityDataPacket dataPacket = new BlockEntityDataPacket(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BannerBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BannerBlockEntityTranslator.java index 81f58214c..8b6f627e1 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BannerBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BannerBlockEntityTranslator.java @@ -30,7 +30,8 @@ import org.cloudburstmc.nbt.NbtMap; import org.cloudburstmc.nbt.NbtMapBuilder; import org.cloudburstmc.nbt.NbtType; import org.geysermc.geyser.item.type.BannerItem; -import org.geysermc.geyser.level.block.BlockStateValues; +import org.geysermc.geyser.level.block.type.BannerBlock; +import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.mcprotocollib.protocol.data.game.level.block.BlockEntityType; @@ -39,10 +40,9 @@ import java.util.List; @BlockEntity(type = BlockEntityType.BANNER) public class BannerBlockEntityTranslator extends BlockEntityTranslator implements RequiresBlockState { @Override - public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, @Nullable NbtMap javaNbt, int blockState) { - int bannerColor = BlockStateValues.getBannerColor(blockState); - if (bannerColor != -1) { - bedrockNbt.putInt("Base", 15 - bannerColor); + public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, @Nullable NbtMap javaNbt, BlockState blockState) { + if (blockState.block() instanceof BannerBlock banner) { + bedrockNbt.putInt("Base", 15 - banner.dyeColor()); } if (javaNbt == null) { diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BeaconBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BeaconBlockEntityTranslator.java index f7dee2864..9b5248785 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BeaconBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BeaconBlockEntityTranslator.java @@ -27,13 +27,14 @@ package org.geysermc.geyser.translator.level.block.entity; import org.cloudburstmc.nbt.NbtMap; import org.cloudburstmc.nbt.NbtMapBuilder; +import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.mcprotocollib.protocol.data.game.level.block.BlockEntityType; @BlockEntity(type = BlockEntityType.BEACON) public class BeaconBlockEntityTranslator extends BlockEntityTranslator { @Override - public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, int blockState) { + public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, BlockState blockState) { int primary = javaNbt.getInt("primary"); // The effects here generally map one-to-one Java <-> Bedrock. Only the newer ones get more complicated bedrockNbt.putInt("primary", primary == -1 ? 0 : primary); diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BedBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BedBlockEntityTranslator.java index 720ffea3c..7622e6d28 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BedBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BedBlockEntityTranslator.java @@ -27,19 +27,15 @@ package org.geysermc.geyser.translator.level.block.entity; import org.cloudburstmc.nbt.NbtMap; import org.cloudburstmc.nbt.NbtMapBuilder; -import org.geysermc.geyser.level.block.BlockStateValues; +import org.geysermc.geyser.level.block.type.BedBlock; +import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.mcprotocollib.protocol.data.game.level.block.BlockEntityType; @BlockEntity(type = BlockEntityType.BED) public class BedBlockEntityTranslator extends BlockEntityTranslator implements RequiresBlockState { @Override - public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, int blockState) { - byte bedcolor = BlockStateValues.getBedColor(blockState); - // Just in case... - if (bedcolor == -1) { - bedcolor = 0; - } - bedrockNbt.putByte("color", bedcolor); + public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, BlockState blockState) { + bedrockNbt.putByte("color", (byte) (blockState.block() instanceof BedBlock bed ? bed.dyeColor() : 0)); } } diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BedrockOnlyBlockEntity.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BedrockOnlyBlockEntity.java index 051986473..01e2d3e74 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BedrockOnlyBlockEntity.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BedrockOnlyBlockEntity.java @@ -31,6 +31,7 @@ import org.cloudburstmc.nbt.NbtList; import org.cloudburstmc.nbt.NbtMap; import org.cloudburstmc.nbt.NbtType; import org.geysermc.geyser.level.block.BlockStateValues; +import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.session.GeyserSession; /** @@ -50,7 +51,7 @@ public interface BedrockOnlyBlockEntity extends RequiresBlockState { * @param blockState The Java block state. * @param position The Bedrock block position. */ - void updateBlock(GeyserSession session, int blockState, Vector3i position); + void updateBlock(GeyserSession session, BlockState blockState, Vector3i position); /** * Get the tag of the Bedrock-only block entity diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BlockEntityTranslator.java index 6df7781be..5def51e01 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BlockEntityTranslator.java @@ -28,6 +28,7 @@ package org.geysermc.geyser.translator.level.block.entity; import org.checkerframework.checker.nullness.qual.Nullable; import org.cloudburstmc.nbt.NbtMap; import org.cloudburstmc.nbt.NbtMapBuilder; +import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.BlockEntityUtils; import org.geysermc.mcprotocollib.protocol.data.game.level.block.BlockEntityType; @@ -39,9 +40,9 @@ public abstract class BlockEntityTranslator { protected BlockEntityTranslator() { } - public abstract void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, int blockState); + public abstract void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, BlockState blockState); - public NbtMap getBlockEntityTag(GeyserSession session, BlockEntityType type, int x, int y, int z, @Nullable NbtMap javaNbt, int blockState) { + public NbtMap getBlockEntityTag(GeyserSession session, BlockEntityType type, int x, int y, int z, @Nullable NbtMap javaNbt, BlockState blockState) { NbtMapBuilder tagBuilder = getConstantBedrockTag(type, x, y, z); if (javaNbt != null || this instanceof RequiresBlockState) { // Always process tags if the block state is part of the tag. diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BrushableBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BrushableBlockEntityTranslator.java index b4012236b..f0d632041 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BrushableBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BrushableBlockEntityTranslator.java @@ -29,7 +29,8 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.cloudburstmc.nbt.NbtMap; import org.cloudburstmc.nbt.NbtMapBuilder; import org.geysermc.geyser.item.Items; -import org.geysermc.geyser.level.block.BlockStateValues; +import org.geysermc.geyser.level.block.property.Properties; +import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.registry.type.ItemMapping; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.mcprotocollib.protocol.data.game.level.block.BlockEntityType; @@ -38,7 +39,7 @@ import org.geysermc.mcprotocollib.protocol.data.game.level.block.BlockEntityType public class BrushableBlockEntityTranslator extends BlockEntityTranslator implements RequiresBlockState { @Override - public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, @Nullable NbtMap javaNbt, int blockState) { + public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, @Nullable NbtMap javaNbt, BlockState blockState) { if (javaNbt == null) { return; } @@ -70,6 +71,6 @@ public class BrushableBlockEntityTranslator extends BlockEntityTranslator implem // controls which side the item protrudes from bedrockNbt.putByte("brush_direction", hitDirection); // controls how much the item protrudes - bedrockNbt.putInt("brush_count", BlockStateValues.getBrushProgress(blockState)); + bedrockNbt.putInt("brush_count", blockState.getValue(Properties.DUSTED)); } } diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/CampfireBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/CampfireBlockEntityTranslator.java index 699319bb6..fb71a84cc 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/CampfireBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/CampfireBlockEntityTranslator.java @@ -28,6 +28,7 @@ package org.geysermc.geyser.translator.level.block.entity; import org.cloudburstmc.nbt.NbtMap; import org.cloudburstmc.nbt.NbtMapBuilder; import org.cloudburstmc.nbt.NbtType; +import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.registry.type.ItemMapping; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.item.BedrockItemBuilder; @@ -38,7 +39,7 @@ import java.util.List; @BlockEntity(type = BlockEntityType.CAMPFIRE) public class CampfireBlockEntityTranslator extends BlockEntityTranslator { @Override - public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, int blockState) { + public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, BlockState blockState) { List items = javaNbt.getList("Items", NbtType.COMPOUND); if (items != null) { int i = 1; diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/CommandBlockBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/CommandBlockBlockEntityTranslator.java index 0e00a19a8..b363de530 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/CommandBlockBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/CommandBlockBlockEntityTranslator.java @@ -27,7 +27,8 @@ package org.geysermc.geyser.translator.level.block.entity; import org.cloudburstmc.nbt.NbtMap; import org.cloudburstmc.nbt.NbtMapBuilder; -import org.geysermc.geyser.level.block.BlockStateValues; +import org.geysermc.geyser.level.block.property.Properties; +import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.text.MessageTranslator; import org.geysermc.mcprotocollib.protocol.data.game.level.block.BlockEntityType; @@ -35,12 +36,12 @@ import org.geysermc.mcprotocollib.protocol.data.game.level.block.BlockEntityType @BlockEntity(type = BlockEntityType.COMMAND_BLOCK) public class CommandBlockBlockEntityTranslator extends BlockEntityTranslator implements RequiresBlockState { @Override - public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, int blockState) { + public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, BlockState blockState) { if (javaNbt == null || javaNbt.size() < 5) { return; // These values aren't here } // Java infers from the block state, but Bedrock needs it in the tag - bedrockNbt.putByte("conditionalMode", BlockStateValues.getCommandBlockValues().getOrDefault(blockState, (byte) 0)); + bedrockNbt.putBoolean("conditionalMode", blockState.getValue(Properties.CONDITIONAL)); // Java and Bedrock values bedrockNbt.putByte("conditionMet", javaNbt.getByte("conditionMet")); bedrockNbt.putByte("auto", javaNbt.getByte("auto")); diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/DecoratedPotBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/DecoratedPotBlockEntityTranslator.java index b24558b45..33c884c55 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/DecoratedPotBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/DecoratedPotBlockEntityTranslator.java @@ -28,6 +28,7 @@ package org.geysermc.geyser.translator.level.block.entity; import org.cloudburstmc.nbt.NbtMap; import org.cloudburstmc.nbt.NbtMapBuilder; import org.cloudburstmc.nbt.NbtType; +import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.mcprotocollib.protocol.data.game.level.block.BlockEntityType; @@ -35,7 +36,7 @@ import org.geysermc.mcprotocollib.protocol.data.game.level.block.BlockEntityType public class DecoratedPotBlockEntityTranslator extends BlockEntityTranslator { @Override - public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, int blockState) { + public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, BlockState blockState) { if (javaNbt == null) { return; } diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/DoubleChestBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/DoubleChestBlockEntityTranslator.java index dcb39d22c..63c5f71f3 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/DoubleChestBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/DoubleChestBlockEntityTranslator.java @@ -29,7 +29,9 @@ import org.cloudburstmc.math.vector.Vector3i; import org.cloudburstmc.nbt.NbtMap; import org.cloudburstmc.nbt.NbtMapBuilder; import org.geysermc.geyser.level.block.BlockStateValues; -import org.geysermc.geyser.level.block.DoubleChestValue; +import org.geysermc.geyser.level.block.property.Properties; +import org.geysermc.geyser.level.block.type.BlockState; +import org.geysermc.geyser.level.physics.Direction; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.BlockEntityUtils; import org.geysermc.mcprotocollib.protocol.data.game.level.block.BlockEntityType; @@ -45,52 +47,40 @@ public class DoubleChestBlockEntityTranslator extends BlockEntityTranslator impl } @Override - public void updateBlock(GeyserSession session, int blockState, Vector3i position) { + public void updateBlock(GeyserSession session, BlockState blockState, Vector3i position) { NbtMapBuilder tagBuilder = getConstantBedrockTag(BlockEntityUtils.getBedrockBlockEntityId(BlockEntityType.CHEST), position.getX(), position.getY(), position.getZ()); translateTag(session, tagBuilder, null, blockState); BlockEntityUtils.updateBlockEntity(session, tagBuilder.build(), position); } @Override - public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, int blockState) { - DoubleChestValue chestValues = BlockStateValues.getDoubleChestValues().get(blockState); - if (chestValues != null) { - int x = (int) bedrockNbt.get("x"); - int z = (int) bedrockNbt.get("z"); - translateChestValue(bedrockNbt, chestValues, x, z); - } + public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, BlockState blockState) { + int x = (int) bedrockNbt.get("x"); + int z = (int) bedrockNbt.get("z"); + translateChestValue(bedrockNbt, blockState, x, z); } /** * Add Bedrock block entity tags to a NbtMap based on Java properties * * @param builder the NbtMapBuilder to apply properties to - * @param chestValues the position properties of this double chest + * @param state the BlockState of this double chest * @param x the x position of this chest pair * @param z the z position of this chest pair */ - public static void translateChestValue(NbtMapBuilder builder, DoubleChestValue chestValues, int x, int z) { + public static void translateChestValue(NbtMapBuilder builder, BlockState state, int x, int z) { // Calculate the position of the other chest based on the Java block state - if (chestValues.isFacingEast()) { - if (chestValues.isDirectionPositive()) { - // East - z = z + (chestValues.isLeft() ? 1 : -1); - } else { - // West - z = z + (chestValues.isLeft() ? -1 : 1); - } - } else { - if (chestValues.isDirectionPositive()) { - // South - x = x + (chestValues.isLeft() ? -1 : 1); - } else { - // North - x = x + (chestValues.isLeft() ? 1 : -1); - } + Direction facing = state.getValue(Properties.HORIZONTAL_FACING); + boolean isLeft = state.getValue(Properties.CHEST_TYPE).equals("left"); //TODO enum + switch (facing) { + case EAST -> z = z + (isLeft ? 1 : -1); + case WEST -> z = z + (isLeft ? -1 : 1); + case SOUTH -> x = x + (isLeft ? -1 : 1); + case NORTH -> x = x + (isLeft ? 1 : -1); } builder.putInt("pairx", x); builder.putInt("pairz", z); - if (!chestValues.isLeft()) { + if (!isLeft) { builder.putInt("pairlead", (byte) 1); } } diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/EmptyBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/EmptyBlockEntityTranslator.java index 9ce0aff0a..88029dc2d 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/EmptyBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/EmptyBlockEntityTranslator.java @@ -27,10 +27,11 @@ package org.geysermc.geyser.translator.level.block.entity; import org.cloudburstmc.nbt.NbtMap; import org.cloudburstmc.nbt.NbtMapBuilder; +import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.session.GeyserSession; public class EmptyBlockEntityTranslator extends BlockEntityTranslator { @Override - public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, int blockState) { + public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, BlockState blockState) { } } diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/EndGatewayBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/EndGatewayBlockEntityTranslator.java index 97428eec1..36731bdff 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/EndGatewayBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/EndGatewayBlockEntityTranslator.java @@ -31,13 +31,14 @@ import org.cloudburstmc.nbt.NbtList; import org.cloudburstmc.nbt.NbtMap; import org.cloudburstmc.nbt.NbtMapBuilder; import org.cloudburstmc.nbt.NbtType; +import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.mcprotocollib.protocol.data.game.level.block.BlockEntityType; @BlockEntity(type = BlockEntityType.END_GATEWAY) public class EndGatewayBlockEntityTranslator extends BlockEntityTranslator { @Override - public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, int blockState) { + public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, BlockState blockState) { bedrockNbt.putInt("Age", (int) javaNbt.getLong("Age")); // Java sometimes does not provide this tag, but Bedrock crashes if it doesn't exist // Linked coordinates diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/FlowerPotBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/FlowerPotBlockEntityTranslator.java index 074fff6ef..0a60b0f32 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/FlowerPotBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/FlowerPotBlockEntityTranslator.java @@ -30,6 +30,7 @@ import org.cloudburstmc.nbt.NbtMap; import org.cloudburstmc.nbt.NbtMapBuilder; import org.cloudburstmc.protocol.bedrock.packet.UpdateBlockPacket; import org.geysermc.geyser.level.block.BlockStateValues; +import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.BlockEntityUtils; @@ -75,12 +76,12 @@ public class FlowerPotBlockEntityTranslator implements BedrockOnlyBlockEntity { } @Override - public void updateBlock(GeyserSession session, int blockState, Vector3i position) { - NbtMap tag = getTag(session, blockState, position); + public void updateBlock(GeyserSession session, BlockState blockState, Vector3i position) { + NbtMap tag = getTag(session, blockState.javaId(), position); BlockEntityUtils.updateBlockEntity(session, tag, position); UpdateBlockPacket updateBlockPacket = new UpdateBlockPacket(); updateBlockPacket.setDataLayer(0); - updateBlockPacket.setDefinition(session.getBlockMappings().getBedrockBlock(blockState)); + updateBlockPacket.setDefinition(session.getBlockMappings().getBedrockBlock(blockState.javaId())); updateBlockPacket.setBlockPosition(position); updateBlockPacket.getFlags().add(UpdateBlockPacket.Flag.NEIGHBORS); updateBlockPacket.getFlags().add(UpdateBlockPacket.Flag.NETWORK); diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/JigsawBlockBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/JigsawBlockBlockEntityTranslator.java index 53f32682c..51f5565b7 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/JigsawBlockBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/JigsawBlockBlockEntityTranslator.java @@ -29,13 +29,14 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.cloudburstmc.nbt.NbtMap; import org.cloudburstmc.nbt.NbtMapBuilder; import org.geysermc.geyser.level.block.BlockStateValues; +import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.mcprotocollib.protocol.data.game.level.block.BlockEntityType; @BlockEntity(type = BlockEntityType.JIGSAW) public class JigsawBlockBlockEntityTranslator extends BlockEntityTranslator implements RequiresBlockState { @Override - public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, @Nullable NbtMap javaNbt, int blockState) { + public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, @Nullable NbtMap javaNbt, BlockState blockState) { if (javaNbt == null) { return; } @@ -46,7 +47,7 @@ public class JigsawBlockBlockEntityTranslator extends BlockEntityTranslator impl } else { // Tag is not present in at least 1.14.4 Paper // Minecraft 1.18.1 deliberately has a fallback here, but not for any other value - bedrockNbt.putString("joint", BlockStateValues.getHorizontalFacingJigsaws().contains(blockState) ? "aligned" : "rollable"); + bedrockNbt.putString("joint", BlockStateValues.getHorizontalFacingJigsaws().contains(blockState.javaId()) ? "aligned" : "rollable"); // TODO } bedrockNbt.putString("name", javaNbt.getString("name")); bedrockNbt.putString("target_pool", javaNbt.getString("target_pool")); diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/PistonBlockEntity.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/PistonBlockEntity.java index 78e71000a..e09f6ae42 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/PistonBlockEntity.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/PistonBlockEntity.java @@ -25,6 +25,7 @@ package org.geysermc.geyser.translator.level.block.entity; +import org.geysermc.geyser.level.block.type.Block; import org.geysermc.mcprotocollib.protocol.data.game.level.block.value.PistonValueType; import org.cloudburstmc.math.vector.Vector3d; import org.cloudburstmc.math.vector.Vector3f; @@ -222,10 +223,10 @@ public class PistonBlockEntity { Vector3i blockInFront = position.add(orientation.getUnitVector()); int blockId = session.getGeyser().getWorldManager().getBlockAt(session, blockInFront); if (BlockStateValues.isPistonHead(blockId)) { - ChunkUtils.updateBlock(session, BlockStateValues.JAVA_AIR_ID, blockInFront); - } else if ((session.getGeyser().getPlatformType() == PlatformType.SPIGOT || session.getErosionHandler().isActive()) && blockId == BlockStateValues.JAVA_AIR_ID) { + ChunkUtils.updateBlock(session, Block.JAVA_AIR_ID, blockInFront); + } else if ((session.getGeyser().getPlatformType() == PlatformType.SPIGOT || session.getErosionHandler().isActive()) && blockId == Block.JAVA_AIR_ID) { // Spigot removes the piston head from the cache, but we need to send the block update ourselves - ChunkUtils.updateBlock(session, BlockStateValues.JAVA_AIR_ID, blockInFront); + ChunkUtils.updateBlock(session, Block.JAVA_AIR_ID, blockInFront); } } @@ -255,7 +256,7 @@ public class PistonBlockEntity { continue; } int blockId = session.getGeyser().getWorldManager().getBlockAt(session, blockPos); - if (blockId == BlockStateValues.JAVA_AIR_ID) { + if (blockId == Block.JAVA_AIR_ID) { continue; } if (BlockStateValues.canPistonMoveBlock(blockId, action == PistonValueType.PUSHING)) { @@ -278,7 +279,7 @@ public class PistonBlockEntity { continue; } int adjacentBlockId = session.getGeyser().getWorldManager().getBlockAt(session, adjacentPos); - if (adjacentBlockId != BlockStateValues.JAVA_AIR_ID && BlockStateValues.isBlockAttached(blockId, adjacentBlockId) && BlockStateValues.canPistonMoveBlock(adjacentBlockId, false)) { + if (adjacentBlockId != Block.JAVA_AIR_ID && BlockStateValues.isBlockAttached(blockId, adjacentBlockId) && BlockStateValues.canPistonMoveBlock(adjacentBlockId, false)) { // If it is another slime/honey block we need to check its adjacent blocks if (BlockStateValues.isBlockSticky(adjacentBlockId)) { blocksToCheck.add(adjacentPos); @@ -322,7 +323,7 @@ public class PistonBlockEntity { */ private void removeBlocks() { for (Vector3i blockPos : attachedBlocks.keySet()) { - ChunkUtils.updateBlock(session, BlockStateValues.JAVA_AIR_ID, blockPos); + ChunkUtils.updateBlock(session, Block.JAVA_AIR_ID, blockPos); } if (action != PistonValueType.PUSHING) { removePistonHead(); @@ -560,7 +561,7 @@ public class PistonBlockEntity { if (blockPos.equals(getPistonHeadPos())) { return BlockStateValues.getPistonHead(orientation); } else { - return attachedBlocks.getOrDefault(blockPos, BlockStateValues.JAVA_AIR_ID); + return attachedBlocks.getOrDefault(blockPos, Block.JAVA_AIR_ID); } } diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/ShulkerBoxBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/ShulkerBoxBlockEntityTranslator.java index ba2ddd815..e6d19e492 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/ShulkerBoxBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/ShulkerBoxBlockEntityTranslator.java @@ -28,7 +28,8 @@ package org.geysermc.geyser.translator.level.block.entity; import org.checkerframework.checker.nullness.qual.Nullable; import org.cloudburstmc.nbt.NbtMap; import org.cloudburstmc.nbt.NbtMapBuilder; -import org.geysermc.geyser.level.block.BlockStateValues; +import org.geysermc.geyser.level.block.property.Properties; +import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.inventory.ShulkerInventoryTranslator; import org.geysermc.mcprotocollib.protocol.data.game.level.block.BlockEntityType; @@ -40,12 +41,7 @@ public class ShulkerBoxBlockEntityTranslator extends BlockEntityTranslator imple * where {@code tag} is passed as null. */ @Override - public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, @Nullable NbtMap javaNbt, int blockState) { - byte direction = BlockStateValues.getShulkerBoxDirection(blockState); - // Just in case... - if (direction == -1) { - direction = 1; - } - bedrockNbt.putByte("facing", direction); + public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, @Nullable NbtMap javaNbt, BlockState blockState) { + bedrockNbt.putByte("facing", (byte) blockState.getValue(Properties.FACING).ordinal()); } } diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/SignBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/SignBlockEntityTranslator.java index bbf0dbcb3..2a1ccb639 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/SignBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/SignBlockEntityTranslator.java @@ -28,6 +28,7 @@ package org.geysermc.geyser.translator.level.block.entity; import org.cloudburstmc.nbt.NbtMap; import org.cloudburstmc.nbt.NbtMapBuilder; import org.cloudburstmc.nbt.NbtType; +import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.text.ChatColor; import org.geysermc.geyser.translator.text.MessageTranslator; @@ -73,7 +74,7 @@ public class SignBlockEntityTranslator extends BlockEntityTranslator { } @Override - public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, int blockState) { + public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, BlockState blockState) { bedrockNbt.putCompound("FrontText", translateSide(javaNbt.getCompound("front_text"))); bedrockNbt.putCompound("BackText", translateSide(javaNbt.getCompound("back_text"))); bedrockNbt.putBoolean("IsWaxed", javaNbt.getBoolean("is_waxed")); diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/SkullBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/SkullBlockEntityTranslator.java index b1ab017e8..c03ae8ef0 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/SkullBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/SkullBlockEntityTranslator.java @@ -34,6 +34,8 @@ import org.cloudburstmc.protocol.bedrock.data.definitions.BlockDefinition; import org.cloudburstmc.protocol.bedrock.packet.UpdateBlockPacket; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.level.block.BlockStateValues; +import org.geysermc.geyser.level.block.property.Properties; +import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.session.cache.SkullCache; import org.geysermc.geyser.skin.SkinProvider; @@ -50,16 +52,19 @@ import java.util.concurrent.ExecutionException; public class SkullBlockEntityTranslator extends BlockEntityTranslator implements RequiresBlockState { @Override - public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, int blockState) { - byte skullVariant = BlockStateValues.getSkullVariant(blockState); - float rotation = BlockStateValues.getSkullRotation(blockState) * 22.5f; + public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, BlockState blockState) { + byte skullVariant = BlockStateValues.getSkullVariant(blockState.javaId()); // TODO // Just in case... if (skullVariant == -1) { skullVariant = 0; } - bedrockNbt.putFloat("Rotation", rotation); + Integer rotation = blockState.getValue(Properties.ROTATION_16); + if (rotation != null) { + // Could be a wall skull block + bedrockNbt.putFloat("Rotation", rotation * 22.5f); + } bedrockNbt.putByte("SkullType", skullVariant); - if (BlockStateValues.isSkullPowered(blockState)) { + if (blockState.getValue(Properties.POWERED)) { bedrockNbt.putBoolean("MouthMoving", true); } } diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/SpawnerBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/SpawnerBlockEntityTranslator.java index edf71d384..4b6a630ba 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/SpawnerBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/SpawnerBlockEntityTranslator.java @@ -32,6 +32,7 @@ import org.cloudburstmc.nbt.NbtMap; import org.cloudburstmc.nbt.NbtMapBuilder; import org.cloudburstmc.protocol.bedrock.packet.UpdateBlockPacket; import org.geysermc.geyser.entity.EntityDefinition; +import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.registry.Registries; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.mcprotocollib.protocol.data.game.level.block.BlockEntityType; @@ -40,7 +41,7 @@ import org.geysermc.mcprotocollib.protocol.data.game.level.block.BlockEntityType public class SpawnerBlockEntityTranslator extends BlockEntityTranslator { @Override - public NbtMap getBlockEntityTag(GeyserSession session, BlockEntityType type, int x, int y, int z, @Nullable NbtMap javaNbt, int blockState) { + public NbtMap getBlockEntityTag(GeyserSession session, BlockEntityType type, int x, int y, int z, @Nullable NbtMap javaNbt, BlockState blockState) { if (javaNbt == null) { return super.getBlockEntityTag(session, type, x, y, z, javaNbt, blockState); } @@ -70,7 +71,7 @@ public class SpawnerBlockEntityTranslator extends BlockEntityTranslator { } @Override - public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, int blockState) { + public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, BlockState blockState) { Object current; // TODO use primitive get and put methods diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/StructureBlockBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/StructureBlockBlockEntityTranslator.java index 4bb9c5676..79fb3da6b 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/StructureBlockBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/StructureBlockBlockEntityTranslator.java @@ -32,6 +32,7 @@ import org.cloudburstmc.nbt.NbtMapBuilder; import org.cloudburstmc.protocol.bedrock.data.structure.StructureMirror; import org.cloudburstmc.protocol.bedrock.data.structure.StructureRotation; import org.cloudburstmc.protocol.bedrock.packet.UpdateBlockPacket; +import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.StructureBlockUtils; import org.geysermc.mcprotocollib.protocol.data.game.level.block.BlockEntityType; @@ -40,7 +41,7 @@ import org.geysermc.mcprotocollib.protocol.data.game.level.block.BlockEntityType public class StructureBlockBlockEntityTranslator extends BlockEntityTranslator { @Override - public NbtMap getBlockEntityTag(GeyserSession session, BlockEntityType type, int x, int y, int z, @Nullable NbtMap javaNbt, int blockState) { + public NbtMap getBlockEntityTag(GeyserSession session, BlockEntityType type, int x, int y, int z, @Nullable NbtMap javaNbt, BlockState blockState) { if (javaNbt == null) { return super.getBlockEntityTag(session, type, x, y, z, javaNbt, blockState); } @@ -73,7 +74,7 @@ public class StructureBlockBlockEntityTranslator extends BlockEntityTranslator { } @Override - public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, int blockState) { + public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, BlockState blockState) { if (javaNbt.size() < 5) { return; // These values aren't here } diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/TrialSpawnerBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/TrialSpawnerBlockEntityTranslator.java index ff3f89f3f..a4c158a15 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/TrialSpawnerBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/TrialSpawnerBlockEntityTranslator.java @@ -27,6 +27,7 @@ package org.geysermc.geyser.translator.level.block.entity; import org.cloudburstmc.nbt.NbtMap; import org.cloudburstmc.nbt.NbtMapBuilder; +import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.mcprotocollib.protocol.data.game.level.block.BlockEntityType; @@ -34,7 +35,7 @@ import org.geysermc.mcprotocollib.protocol.data.game.level.block.BlockEntityType public class TrialSpawnerBlockEntityTranslator extends BlockEntityTranslator { @Override - public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, int blockState) { + public void translateTag(GeyserSession session, NbtMapBuilder bedrockNbt, NbtMap javaNbt, BlockState blockState) { if (javaNbt == null) { return; } diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockBlockPickRequestTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockBlockPickRequestTranslator.java index 35c46ffd2..9cb3fb455 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockBlockPickRequestTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockBlockPickRequestTranslator.java @@ -25,6 +25,7 @@ package org.geysermc.geyser.translator.protocol.bedrock; +import org.geysermc.geyser.level.block.type.Block; import org.geysermc.mcprotocollib.protocol.data.game.item.ItemStack; import org.cloudburstmc.math.vector.Vector3i; import org.cloudburstmc.protocol.bedrock.packet.BlockPickRequestPacket; @@ -48,7 +49,7 @@ public class BedrockBlockPickRequestTranslator extends PacketTranslator> 4) - yOffset]; - int blockState = section.get(x, y & 0xF, z); + BlockState blockState = BlockRegistries.BLOCK_STATES.get(section.get(x, y & 0xF, z)); - if (type == BlockEntityType.LECTERN && BlockStateValues.getLecternBookStates().get(blockState)) { + if (type == BlockEntityType.LECTERN && blockState.getValue(Properties.HAS_BOOK)) { // If getLecternBookStates is false, let's just treat it like a normal block entity // Fill in tag with a default value NbtMapBuilder lecternTag = LecternUtils.getBaseLecternTag(x + chunkBlockX, y, z + chunkBlockZ, 1); @@ -419,7 +422,7 @@ public class JavaLevelChunkWithLightTranslator extends PacketTranslator> 4) - (bedrockDimension.minY() >> 4); int subChunkIndex = (y >> 4) + (bedrockDimension.minY() >> 4); diff --git a/core/src/main/java/org/geysermc/geyser/util/ChunkUtils.java b/core/src/main/java/org/geysermc/geyser/util/ChunkUtils.java index 379162540..a1e956ace 100644 --- a/core/src/main/java/org/geysermc/geyser/util/ChunkUtils.java +++ b/core/src/main/java/org/geysermc/geyser/util/ChunkUtils.java @@ -41,6 +41,8 @@ import org.geysermc.geyser.entity.type.ItemFrameEntity; import org.geysermc.geyser.level.BedrockDimension; import org.geysermc.geyser.level.JavaDimension; import org.geysermc.geyser.level.block.BlockStateValues; +import org.geysermc.geyser.level.block.type.Block; +import org.geysermc.geyser.level.block.type.BlockState; import org.geysermc.geyser.level.chunk.BlockStorage; import org.geysermc.geyser.level.chunk.GeyserChunkSection; import org.geysermc.geyser.level.chunk.bitarray.SingletonBitArray; @@ -50,8 +52,6 @@ import org.geysermc.geyser.session.cache.SkullCache; import org.geysermc.geyser.text.GeyserLocale; import org.geysermc.geyser.translator.level.block.entity.BedrockOnlyBlockEntity; -import static org.geysermc.geyser.level.block.BlockStateValues.JAVA_AIR_ID; - @UtilityClass public class ChunkUtils { @@ -130,7 +130,7 @@ public class ChunkUtils { // Checks for item frames so they aren't tripped up and removed ItemFrameEntity itemFrameEntity = ItemFrameEntity.getItemFrameEntity(session, position); if (itemFrameEntity != null) { - if (blockState == JAVA_AIR_ID) { // Item frame is still present and no block overrides that; refresh it + if (blockState == Block.JAVA_AIR_ID) { // Item frame is still present and no block overrides that; refresh it itemFrameEntity.updateBlock(true); // Still update the chunk cache with the new block if updateBlock is called return; @@ -180,21 +180,21 @@ public class ChunkUtils { BlockDefinition aboveBedrockExtendedCollisionDefinition = session.getBlockMappings().getExtendedCollisionBoxes().get(blockState); int belowBlock = session.getGeyser().getWorldManager().getBlockAt(session, position.getX(), position.getY() - 1, position.getZ()); BlockDefinition belowBedrockExtendedCollisionDefinition = session.getBlockMappings().getExtendedCollisionBoxes().get(belowBlock); - if (belowBedrockExtendedCollisionDefinition != null && blockState == BlockStateValues.JAVA_AIR_ID) { + if (belowBedrockExtendedCollisionDefinition != null && blockState == Block.JAVA_AIR_ID) { UpdateBlockPacket updateBlockPacket = new UpdateBlockPacket(); updateBlockPacket.setDataLayer(0); updateBlockPacket.setBlockPosition(position); updateBlockPacket.setDefinition(belowBedrockExtendedCollisionDefinition); updateBlockPacket.getFlags().add(UpdateBlockPacket.Flag.NETWORK); session.sendUpstreamPacket(updateBlockPacket); - } else if (aboveBedrockExtendedCollisionDefinition != null && aboveBlock == BlockStateValues.JAVA_AIR_ID) { + } else if (aboveBedrockExtendedCollisionDefinition != null && aboveBlock == Block.JAVA_AIR_ID) { UpdateBlockPacket updateBlockPacket = new UpdateBlockPacket(); updateBlockPacket.setDataLayer(0); updateBlockPacket.setBlockPosition(position.add(0, 1, 0)); updateBlockPacket.setDefinition(aboveBedrockExtendedCollisionDefinition); updateBlockPacket.getFlags().add(UpdateBlockPacket.Flag.NETWORK); session.sendUpstreamPacket(updateBlockPacket); - } else if (aboveBlock == BlockStateValues.JAVA_AIR_ID) { + } else if (aboveBlock == Block.JAVA_AIR_ID) { UpdateBlockPacket updateBlockPacket = new UpdateBlockPacket(); updateBlockPacket.setDataLayer(0); updateBlockPacket.setBlockPosition(position.add(0, 1, 0)); @@ -211,7 +211,7 @@ public class ChunkUtils { for (BedrockOnlyBlockEntity bedrockOnlyBlockEntity : BlockEntityUtils.BEDROCK_ONLY_BLOCK_ENTITIES) { if (bedrockOnlyBlockEntity.isBlock(blockState)) { // Flower pots are block entities only in Bedrock and are not updated anywhere else like note blocks - bedrockOnlyBlockEntity.updateBlock(session, blockState, position); + bedrockOnlyBlockEntity.updateBlock(session, BlockState.of(blockState), position); //TODO blockState break; //No block will be a part of two classes } } diff --git a/core/src/main/java/org/geysermc/geyser/util/SoundUtils.java b/core/src/main/java/org/geysermc/geyser/util/SoundUtils.java index 85f8fc704..7559347e9 100644 --- a/core/src/main/java/org/geysermc/geyser/util/SoundUtils.java +++ b/core/src/main/java/org/geysermc/geyser/util/SoundUtils.java @@ -34,6 +34,7 @@ import org.cloudburstmc.protocol.bedrock.packet.LevelSoundEventPacket; import org.cloudburstmc.protocol.bedrock.packet.PlaySoundPacket; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.level.block.BlockStateValues; +import org.geysermc.geyser.level.block.type.Block; import org.geysermc.geyser.registry.BlockRegistries; import org.geysermc.geyser.registry.Registries; import org.geysermc.geyser.registry.type.SoundMapping; @@ -147,7 +148,7 @@ public final class SoundUtils { soundPacket.setExtraData(soundMapping.getExtraData() + (int)(Math.round((Math.log10(pitch) / Math.log10(2)) * 12)) + 12); } else if (sound == SoundEvent.PLACE && soundMapping.getExtraData() == -1) { if (!soundMapping.getIdentifier().equals(":")) { - int javaId = BlockRegistries.JAVA_IDENTIFIER_TO_ID.get().getOrDefault(soundMapping.getIdentifier(), BlockStateValues.JAVA_AIR_ID); + int javaId = BlockRegistries.JAVA_IDENTIFIER_TO_ID.get().getOrDefault(soundMapping.getIdentifier(), Block.JAVA_AIR_ID); soundPacket.setExtraData(session.getBlockMappings().getBedrockBlockId(javaId)); } else { session.getGeyser().getLogger().debug("PLACE sound mapping identifier was invalid! Please report: " + soundMapping); diff --git a/core/src/main/java/org/geysermc/geyser/util/StatisticsUtils.java b/core/src/main/java/org/geysermc/geyser/util/StatisticsUtils.java index 96328bcdd..8f9be0b98 100644 --- a/core/src/main/java/org/geysermc/geyser/util/StatisticsUtils.java +++ b/core/src/main/java/org/geysermc/geyser/util/StatisticsUtils.java @@ -29,6 +29,7 @@ import it.unimi.dsi.fastutil.objects.Object2IntMap; import org.geysermc.cumulus.form.SimpleForm; import org.geysermc.cumulus.util.FormImage; import org.geysermc.geyser.item.type.Item; +import org.geysermc.geyser.level.block.type.Block; import org.geysermc.geyser.registry.BlockRegistries; import org.geysermc.geyser.registry.Registries; import org.geysermc.geyser.session.GeyserSession; @@ -93,10 +94,10 @@ public class StatisticsUtils { for (Object2IntMap.Entry entry : session.getStatistics().object2IntEntrySet()) { if (entry.getKey() instanceof BreakBlockStatistic statistic) { - String identifier = BlockRegistries.CLEAN_JAVA_IDENTIFIERS.get(statistic.getId()); - if (identifier != null) { - String block = identifier.replace("minecraft:", "block.minecraft."); - content.add(block + ": " + entry.getIntValue()); + Block block = BlockRegistries.JAVA_BLOCKS_TO_RENAME.get(statistic.getId()); + if (block != null) { + String identifier = block.javaIdentifier().replace("minecraft:", "block.minecraft."); + content.add(identifier + ": " + entry.getIntValue()); } } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0500a31be..0f0845137 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -65,6 +65,7 @@ fastutil-int-byte-maps = { group = "com.nukkitx.fastutil", name = "fastutil-int- fastutil-int-boolean-maps = { group = "com.nukkitx.fastutil", name = "fastutil-int-boolean-maps", version.ref = "fastutil" } fastutil-object-int-maps = { group = "com.nukkitx.fastutil", name = "fastutil-object-int-maps", version.ref = "fastutil" } fastutil-object-object-maps = { group = "com.nukkitx.fastutil", name = "fastutil-object-object-maps", version.ref = "fastutil" } +fastutil-reference-object-maps = { group = "com.nukkitx.fastutil", name = "fastutil-reference-object-maps", version.ref = "fastutil" } adventure-text-serializer-gson = { group = "net.kyori", name = "adventure-text-serializer-gson", version.ref = "adventure" } # Remove when we remove our Adventure bump adventure-text-serializer-legacy = { group = "net.kyori", name = "adventure-text-serializer-legacy", version.ref = "adventure" } @@ -142,7 +143,7 @@ blossom = { id = "net.kyori.blossom", version.ref = "blossom" } [bundles] jackson = [ "jackson-annotations", "jackson-core", "jackson-dataformat-yaml" ] -fastutil = [ "fastutil-int-int-maps", "fastutil-int-long-maps", "fastutil-int-byte-maps", "fastutil-int-boolean-maps", "fastutil-object-int-maps", "fastutil-object-object-maps" ] +fastutil = [ "fastutil-int-int-maps", "fastutil-int-long-maps", "fastutil-int-byte-maps", "fastutil-int-boolean-maps", "fastutil-object-int-maps", "fastutil-object-object-maps", "fastutil-reference-object-maps" ] adventure = [ "adventure-text-serializer-gson", "adventure-text-serializer-legacy", "adventure-text-serializer-plain" ] log4j = [ "log4j-api", "log4j-core", "log4j-slf4j2-impl" ] jline = [ "jline-terminal", "jline-terminal-jna", "jline-reader" ]