Introduce next-generation StringToItemParser

this isn't specced up with some of the finer features of LegacyStringToItemParser such as metadata parsing, but those are still a work in progress (and probably limited to specific items like durable stuff).
The goal is to unbind these aliases from legacy internal IDs, while also providing a nice flexible way for plugins to add their own items and aliases to the existing system.

This system allows mapping a string to any item at all, irrespective of state, internal IDs, or any of that nonsense. This means it's finally possible to have stuff like lapis_lazuli and bone_meal aliases in commands.
This commit is contained in:
Dylan K. Taylor 2021-08-23 00:38:53 +01:00
parent 044b2f54ac
commit 22316976fa
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
3 changed files with 889 additions and 2 deletions

View File

@ -28,6 +28,7 @@ use pocketmine\command\CommandSender;
use pocketmine\command\utils\InvalidCommandSyntaxException;
use pocketmine\item\LegacyStringToItemParser;
use pocketmine\item\LegacyStringToItemParserException;
use pocketmine\item\StringToItemParser;
use pocketmine\lang\KnownTranslationFactory;
use pocketmine\lang\KnownTranslationKeys;
use pocketmine\permission\DefaultPermissionNames;
@ -81,7 +82,7 @@ class ClearCommand extends VanillaCommand{
$maxCount = -1;
if(isset($args[1])){
try{
$item = LegacyStringToItemParser::getInstance()->parse($args[1]);
$item = StringToItemParser::getInstance()->parse($args[1]) ?? LegacyStringToItemParser::getInstance()->parse($args[1]);
if(isset($args[2])){
$item->setCount($maxCount = $this->getInteger($sender, $args[2], 0));

View File

@ -28,6 +28,7 @@ use pocketmine\command\CommandSender;
use pocketmine\command\utils\InvalidCommandSyntaxException;
use pocketmine\item\LegacyStringToItemParser;
use pocketmine\item\LegacyStringToItemParserException;
use pocketmine\item\StringToItemParser;
use pocketmine\lang\KnownTranslationFactory;
use pocketmine\lang\KnownTranslationKeys;
use pocketmine\nbt\JsonNbtParser;
@ -65,7 +66,7 @@ class GiveCommand extends VanillaCommand{
}
try{
$item = LegacyStringToItemParser::getInstance()->parse($args[1]);
$item = StringToItemParser::getInstance()->parse($args[1]) ?? LegacyStringToItemParser::getInstance()->parse($args[1]);
}catch(LegacyStringToItemParserException $e){
$sender->sendMessage(KnownTranslationFactory::commands_give_item_notFound($args[1])->prefix(TextFormat::RED));
return true;

View File

@ -0,0 +1,885 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\item;
use pocketmine\block\Block;
use pocketmine\block\utils\CoralType;
use pocketmine\block\utils\SlabType;
use pocketmine\block\VanillaBlocks;
use pocketmine\utils\SingletonTrait;
use function array_keys;
use function str_replace;
use function strtolower;
use function trim;
/**
* Handles parsing items from strings. This is used to interpret names from the /give command (and others).
* Custom aliases may be registered.
* Note that the aliases should be user-friendly, i.e. easily readable and writable.
*/
final class StringToItemParser{
use SingletonTrait;
/**
* @var \Closure[]
* @phpstan-var array<string, \Closure(string $input) : Item>
*/
private array $callbackMap = [];
private static function make() : self{
$result = new self;
$result->registerBlock("acacia_button", fn() => VanillaBlocks::ACACIA_BUTTON());
$result->registerBlock("acacia_door", fn() => VanillaBlocks::ACACIA_DOOR());
$result->registerBlock("acacia_door_block", fn() => VanillaBlocks::ACACIA_DOOR());
$result->registerBlock("acacia_fence_gate", fn() => VanillaBlocks::ACACIA_FENCE_GATE());
$result->registerBlock("acacia_pressure_plate", fn() => VanillaBlocks::ACACIA_PRESSURE_PLATE());
$result->registerBlock("acacia_sign", fn() => VanillaBlocks::ACACIA_SIGN());
$result->registerBlock("acacia_stairs", fn() => VanillaBlocks::ACACIA_STAIRS());
$result->registerBlock("acacia_standing_sign", fn() => VanillaBlocks::ACACIA_SIGN());
$result->registerBlock("acacia_trapdoor", fn() => VanillaBlocks::ACACIA_TRAPDOOR());
$result->registerBlock("acacia_wall_sign", fn() => VanillaBlocks::ACACIA_WALL_SIGN());
$result->registerBlock("acacia_wood_stairs", fn() => VanillaBlocks::ACACIA_STAIRS());
$result->registerBlock("acacia_wooden_stairs", fn() => VanillaBlocks::ACACIA_STAIRS());
$result->registerBlock("activator_rail", fn() => VanillaBlocks::ACTIVATOR_RAIL());
$result->registerBlock("active_redstone_lamp", fn() => VanillaBlocks::REDSTONE_LAMP()->setPowered(true));
$result->registerBlock("air", fn() => VanillaBlocks::AIR());
$result->registerBlock("andesite_stairs", fn() => VanillaBlocks::ANDESITE_STAIRS());
$result->registerBlock("anvil", fn() => VanillaBlocks::ANVIL());
$result->registerBlock("ateupd_block", fn() => VanillaBlocks::INFO_UPDATE2());
$result->registerBlock("bamboo", fn() => VanillaBlocks::BAMBOO_SAPLING());
$result->registerBlock("bamboo_sapling", fn() => VanillaBlocks::BAMBOO_SAPLING());
$result->registerBlock("banner", fn() => VanillaBlocks::BANNER());
$result->registerBlock("barrel", fn() => VanillaBlocks::BARREL());
$result->registerBlock("barrier", fn() => VanillaBlocks::BARRIER());
$result->registerBlock("beacon", fn() => VanillaBlocks::BEACON());
$result->registerBlock("bed_block", fn() => VanillaBlocks::BED());
$result->registerBlock("bedrock", fn() => VanillaBlocks::BEDROCK());
$result->registerBlock("beetroot_block", fn() => VanillaBlocks::BEETROOTS());
$result->registerBlock("bell", fn() => VanillaBlocks::BELL());
$result->registerBlock("birch_button", fn() => VanillaBlocks::BIRCH_BUTTON());
$result->registerBlock("birch_door", fn() => VanillaBlocks::BIRCH_DOOR());
$result->registerBlock("birch_door_block", fn() => VanillaBlocks::BIRCH_DOOR());
$result->registerBlock("birch_fence_gate", fn() => VanillaBlocks::BIRCH_FENCE_GATE());
$result->registerBlock("birch_pressure_plate", fn() => VanillaBlocks::BIRCH_PRESSURE_PLATE());
$result->registerBlock("birch_sign", fn() => VanillaBlocks::BIRCH_SIGN());
$result->registerBlock("birch_stairs", fn() => VanillaBlocks::BIRCH_STAIRS());
$result->registerBlock("birch_standing_sign", fn() => VanillaBlocks::BIRCH_SIGN());
$result->registerBlock("birch_trapdoor", fn() => VanillaBlocks::BIRCH_TRAPDOOR());
$result->registerBlock("birch_wall_sign", fn() => VanillaBlocks::BIRCH_WALL_SIGN());
$result->registerBlock("birch_wood_stairs", fn() => VanillaBlocks::BIRCH_STAIRS());
$result->registerBlock("birch_wooden_stairs", fn() => VanillaBlocks::BIRCH_STAIRS());
$result->registerBlock("black_glazed_terracotta", fn() => VanillaBlocks::BLACK_GLAZED_TERRACOTTA());
$result->registerBlock("blast_furnace", fn() => VanillaBlocks::BLAST_FURNACE());
$result->registerBlock("blue_glazed_terracotta", fn() => VanillaBlocks::BLUE_GLAZED_TERRACOTTA());
$result->registerBlock("blue_ice", fn() => VanillaBlocks::BLUE_ICE());
$result->registerBlock("bone_block", fn() => VanillaBlocks::BONE_BLOCK());
$result->registerBlock("bookshelf", fn() => VanillaBlocks::BOOKSHELF());
$result->registerBlock("brewing_stand", fn() => VanillaBlocks::BREWING_STAND());
$result->registerBlock("brewing_stand_block", fn() => VanillaBlocks::BREWING_STAND());
$result->registerBlock("brick_block", fn() => VanillaBlocks::BRICKS());
$result->registerBlock("brick_stairs", fn() => VanillaBlocks::BRICK_STAIRS());
$result->registerBlock("bricks", fn() => VanillaBlocks::BRICKS());
$result->registerBlock("bricks_block", fn() => VanillaBlocks::BRICKS());
$result->registerBlock("brown_glazed_terracotta", fn() => VanillaBlocks::BROWN_GLAZED_TERRACOTTA());
$result->registerBlock("brown_mushroom", fn() => VanillaBlocks::BROWN_MUSHROOM());
$result->registerBlock("brown_mushroom_block", fn() => VanillaBlocks::BROWN_MUSHROOM_BLOCK());
$result->registerBlock("burning_furnace", fn() => VanillaBlocks::FURNACE());
$result->registerBlock("bush", fn() => VanillaBlocks::DEAD_BUSH());
$result->registerBlock("cactus", fn() => VanillaBlocks::CACTUS());
$result->registerBlock("cake", fn() => VanillaBlocks::CAKE());
$result->registerBlock("cake_block", fn() => VanillaBlocks::CAKE());
$result->registerBlock("carpet", fn() => VanillaBlocks::CARPET());
$result->registerBlock("carrot_block", fn() => VanillaBlocks::CARROTS());
$result->registerBlock("carrots", fn() => VanillaBlocks::CARROTS());
$result->registerBlock("carved_pumpkin", fn() => VanillaBlocks::CARVED_PUMPKIN());
$result->registerBlock("chemical_heat", fn() => VanillaBlocks::CHEMICAL_HEAT());
$result->registerBlock("chemistry_table", fn() => VanillaBlocks::COMPOUND_CREATOR());
$result->registerBlock("chest", fn() => VanillaBlocks::CHEST());
$result->registerBlock("clay_block", fn() => VanillaBlocks::CLAY());
$result->registerBlock("coal_block", fn() => VanillaBlocks::COAL());
$result->registerBlock("coal_ore", fn() => VanillaBlocks::COAL_ORE());
$result->registerBlock("cobble", fn() => VanillaBlocks::COBBLESTONE());
$result->registerBlock("cobble_stairs", fn() => VanillaBlocks::COBBLESTONE_STAIRS());
$result->registerBlock("cobble_wall", fn() => VanillaBlocks::COBBLESTONE_WALL());
$result->registerBlock("cobblestone", fn() => VanillaBlocks::COBBLESTONE());
$result->registerBlock("cobblestone_stairs", fn() => VanillaBlocks::COBBLESTONE_STAIRS());
$result->registerBlock("cobblestone_wall", fn() => VanillaBlocks::COBBLESTONE_WALL());
$result->registerBlock("cobweb", fn() => VanillaBlocks::COBWEB());
$result->registerBlock("cocoa", fn() => VanillaBlocks::COCOA_POD());
$result->registerBlock("cocoa_block", fn() => VanillaBlocks::COCOA_POD());
$result->registerBlock("cocoa_pods", fn() => VanillaBlocks::COCOA_POD());
$result->registerBlock("colored_torch_bp", fn() => VanillaBlocks::BLUE_TORCH());
$result->registerBlock("colored_torch_rg", fn() => VanillaBlocks::RED_TORCH());
$result->registerBlock("comparator", fn() => VanillaBlocks::REDSTONE_COMPARATOR());
$result->registerBlock("comparator_block", fn() => VanillaBlocks::REDSTONE_COMPARATOR());
$result->registerBlock("concrete", fn() => VanillaBlocks::CONCRETE());
$result->registerBlock("concrete_powder", fn() => VanillaBlocks::CONCRETE_POWDER());
$result->registerBlock("concretepowder", fn() => VanillaBlocks::CONCRETE_POWDER());
$result->registerBlock("coral", fn() => VanillaBlocks::CORAL());
$result->registerBlock("coral_block", fn() => VanillaBlocks::CORAL_BLOCK());
$result->registerBlock("coral_fan", fn() => VanillaBlocks::CORAL_FAN());
$result->registerBlock("coral_fan_dead", fn() => VanillaBlocks::CORAL_FAN()->setCoralType(CoralType::TUBE())->setDead(true));
$result->registerBlock("coral_fan_hang", fn() => VanillaBlocks::WALL_CORAL_FAN());
$result->registerBlock("coral_fan_hang2", fn() => VanillaBlocks::WALL_CORAL_FAN()->setCoralType(CoralType::BUBBLE()));
$result->registerBlock("coral_fan_hang3", fn() => VanillaBlocks::WALL_CORAL_FAN()->setCoralType(CoralType::HORN()));
$result->registerBlock("crafting_table", fn() => VanillaBlocks::CRAFTING_TABLE());
$result->registerBlock("cyan_glazed_terracotta", fn() => VanillaBlocks::CYAN_GLAZED_TERRACOTTA());
$result->registerBlock("dandelion", fn() => VanillaBlocks::DANDELION());
$result->registerBlock("dark_oak_button", fn() => VanillaBlocks::DARK_OAK_BUTTON());
$result->registerBlock("dark_oak_door", fn() => VanillaBlocks::DARK_OAK_DOOR());
$result->registerBlock("dark_oak_door_block", fn() => VanillaBlocks::DARK_OAK_DOOR());
$result->registerBlock("dark_oak_fence_gate", fn() => VanillaBlocks::DARK_OAK_FENCE_GATE());
$result->registerBlock("dark_oak_pressure_plate", fn() => VanillaBlocks::DARK_OAK_PRESSURE_PLATE());
$result->registerBlock("dark_oak_stairs", fn() => VanillaBlocks::DARK_OAK_STAIRS());
$result->registerBlock("dark_oak_trapdoor", fn() => VanillaBlocks::DARK_OAK_TRAPDOOR());
$result->registerBlock("dark_oak_wood_stairs", fn() => VanillaBlocks::DARK_OAK_STAIRS());
$result->registerBlock("dark_oak_wooden_stairs", fn() => VanillaBlocks::DARK_OAK_STAIRS());
$result->registerBlock("dark_prismarine_stairs", fn() => VanillaBlocks::DARK_PRISMARINE_STAIRS());
$result->registerBlock("darkoak_sign", fn() => VanillaBlocks::DARK_OAK_SIGN());
$result->registerBlock("darkoak_standing_sign", fn() => VanillaBlocks::DARK_OAK_SIGN());
$result->registerBlock("darkoak_wall_sign", fn() => VanillaBlocks::DARK_OAK_WALL_SIGN());
$result->registerBlock("daylight_detector", fn() => VanillaBlocks::DAYLIGHT_SENSOR());
$result->registerBlock("daylight_detector_inverted", fn() => VanillaBlocks::DAYLIGHT_SENSOR()->setInverted(true));
$result->registerBlock("daylight_sensor", fn() => VanillaBlocks::DAYLIGHT_SENSOR());
$result->registerBlock("daylight_sensor_inverted", fn() => VanillaBlocks::DAYLIGHT_SENSOR()->setInverted(true));
$result->registerBlock("dead_bush", fn() => VanillaBlocks::DEAD_BUSH());
$result->registerBlock("deadbush", fn() => VanillaBlocks::DEAD_BUSH());
$result->registerBlock("detector_rail", fn() => VanillaBlocks::DETECTOR_RAIL());
$result->registerBlock("diamond_block", fn() => VanillaBlocks::DIAMOND());
$result->registerBlock("diamond_ore", fn() => VanillaBlocks::DIAMOND_ORE());
$result->registerBlock("diorite_stairs", fn() => VanillaBlocks::DIORITE_STAIRS());
$result->registerBlock("dirt", fn() => VanillaBlocks::DIRT());
$result->registerBlock("door_block", fn() => VanillaBlocks::OAK_DOOR());
$result->registerBlock("double_plant", fn() => VanillaBlocks::SUNFLOWER());
$result->registerBlock("double_red_sandstone_slab", fn() => VanillaBlocks::RED_SANDSTONE_SLAB()->setSlabType(SlabType::DOUBLE()));
$result->registerBlock("double_slab", fn() => VanillaBlocks::STONE_SLAB()->setSlabType(SlabType::DOUBLE()));
$result->registerBlock("double_slabs", fn() => VanillaBlocks::STONE_SLAB()->setSlabType(SlabType::DOUBLE()));
$result->registerBlock("double_stone_slab", fn() => VanillaBlocks::STONE_SLAB()->setSlabType(SlabType::DOUBLE()));
$result->registerBlock("double_stone_slab2", fn() => VanillaBlocks::RED_SANDSTONE_SLAB()->setSlabType(SlabType::DOUBLE()));
$result->registerBlock("double_stone_slab3", fn() => VanillaBlocks::END_STONE_BRICK_SLAB()->setSlabType(SlabType::DOUBLE()));
$result->registerBlock("double_stone_slab4", fn() => VanillaBlocks::MOSSY_STONE_BRICK_SLAB()->setSlabType(SlabType::DOUBLE()));
$result->registerBlock("double_wood_slab", fn() => VanillaBlocks::OAK_SLAB()->setSlabType(SlabType::DOUBLE()));
$result->registerBlock("double_wood_slabs", fn() => VanillaBlocks::OAK_SLAB()->setSlabType(SlabType::DOUBLE()));
$result->registerBlock("double_wooden_slab", fn() => VanillaBlocks::OAK_SLAB()->setSlabType(SlabType::DOUBLE()));
$result->registerBlock("double_wooden_slabs", fn() => VanillaBlocks::OAK_SLAB()->setSlabType(SlabType::DOUBLE()));
$result->registerBlock("dragon_egg", fn() => VanillaBlocks::DRAGON_EGG());
$result->registerBlock("dried_kelp_block", fn() => VanillaBlocks::DRIED_KELP());
$result->registerBlock("element_0", fn() => VanillaBlocks::ELEMENT_ZERO());
$result->registerBlock("element_1", fn() => VanillaBlocks::ELEMENT_HYDROGEN());
$result->registerBlock("element_10", fn() => VanillaBlocks::ELEMENT_NEON());
$result->registerBlock("element_100", fn() => VanillaBlocks::ELEMENT_FERMIUM());
$result->registerBlock("element_101", fn() => VanillaBlocks::ELEMENT_MENDELEVIUM());
$result->registerBlock("element_102", fn() => VanillaBlocks::ELEMENT_NOBELIUM());
$result->registerBlock("element_103", fn() => VanillaBlocks::ELEMENT_LAWRENCIUM());
$result->registerBlock("element_104", fn() => VanillaBlocks::ELEMENT_RUTHERFORDIUM());
$result->registerBlock("element_105", fn() => VanillaBlocks::ELEMENT_DUBNIUM());
$result->registerBlock("element_106", fn() => VanillaBlocks::ELEMENT_SEABORGIUM());
$result->registerBlock("element_107", fn() => VanillaBlocks::ELEMENT_BOHRIUM());
$result->registerBlock("element_108", fn() => VanillaBlocks::ELEMENT_HASSIUM());
$result->registerBlock("element_109", fn() => VanillaBlocks::ELEMENT_MEITNERIUM());
$result->registerBlock("element_11", fn() => VanillaBlocks::ELEMENT_SODIUM());
$result->registerBlock("element_110", fn() => VanillaBlocks::ELEMENT_DARMSTADTIUM());
$result->registerBlock("element_111", fn() => VanillaBlocks::ELEMENT_ROENTGENIUM());
$result->registerBlock("element_112", fn() => VanillaBlocks::ELEMENT_COPERNICIUM());
$result->registerBlock("element_113", fn() => VanillaBlocks::ELEMENT_NIHONIUM());
$result->registerBlock("element_114", fn() => VanillaBlocks::ELEMENT_FLEROVIUM());
$result->registerBlock("element_115", fn() => VanillaBlocks::ELEMENT_MOSCOVIUM());
$result->registerBlock("element_116", fn() => VanillaBlocks::ELEMENT_LIVERMORIUM());
$result->registerBlock("element_117", fn() => VanillaBlocks::ELEMENT_TENNESSINE());
$result->registerBlock("element_118", fn() => VanillaBlocks::ELEMENT_OGANESSON());
$result->registerBlock("element_12", fn() => VanillaBlocks::ELEMENT_MAGNESIUM());
$result->registerBlock("element_13", fn() => VanillaBlocks::ELEMENT_ALUMINUM());
$result->registerBlock("element_14", fn() => VanillaBlocks::ELEMENT_SILICON());
$result->registerBlock("element_15", fn() => VanillaBlocks::ELEMENT_PHOSPHORUS());
$result->registerBlock("element_16", fn() => VanillaBlocks::ELEMENT_SULFUR());
$result->registerBlock("element_17", fn() => VanillaBlocks::ELEMENT_CHLORINE());
$result->registerBlock("element_18", fn() => VanillaBlocks::ELEMENT_ARGON());
$result->registerBlock("element_19", fn() => VanillaBlocks::ELEMENT_POTASSIUM());
$result->registerBlock("element_2", fn() => VanillaBlocks::ELEMENT_HELIUM());
$result->registerBlock("element_20", fn() => VanillaBlocks::ELEMENT_CALCIUM());
$result->registerBlock("element_21", fn() => VanillaBlocks::ELEMENT_SCANDIUM());
$result->registerBlock("element_22", fn() => VanillaBlocks::ELEMENT_TITANIUM());
$result->registerBlock("element_23", fn() => VanillaBlocks::ELEMENT_VANADIUM());
$result->registerBlock("element_24", fn() => VanillaBlocks::ELEMENT_CHROMIUM());
$result->registerBlock("element_25", fn() => VanillaBlocks::ELEMENT_MANGANESE());
$result->registerBlock("element_26", fn() => VanillaBlocks::ELEMENT_IRON());
$result->registerBlock("element_27", fn() => VanillaBlocks::ELEMENT_COBALT());
$result->registerBlock("element_28", fn() => VanillaBlocks::ELEMENT_NICKEL());
$result->registerBlock("element_29", fn() => VanillaBlocks::ELEMENT_COPPER());
$result->registerBlock("element_3", fn() => VanillaBlocks::ELEMENT_LITHIUM());
$result->registerBlock("element_30", fn() => VanillaBlocks::ELEMENT_ZINC());
$result->registerBlock("element_31", fn() => VanillaBlocks::ELEMENT_GALLIUM());
$result->registerBlock("element_32", fn() => VanillaBlocks::ELEMENT_GERMANIUM());
$result->registerBlock("element_33", fn() => VanillaBlocks::ELEMENT_ARSENIC());
$result->registerBlock("element_34", fn() => VanillaBlocks::ELEMENT_SELENIUM());
$result->registerBlock("element_35", fn() => VanillaBlocks::ELEMENT_BROMINE());
$result->registerBlock("element_36", fn() => VanillaBlocks::ELEMENT_KRYPTON());
$result->registerBlock("element_37", fn() => VanillaBlocks::ELEMENT_RUBIDIUM());
$result->registerBlock("element_38", fn() => VanillaBlocks::ELEMENT_STRONTIUM());
$result->registerBlock("element_39", fn() => VanillaBlocks::ELEMENT_YTTRIUM());
$result->registerBlock("element_4", fn() => VanillaBlocks::ELEMENT_BERYLLIUM());
$result->registerBlock("element_40", fn() => VanillaBlocks::ELEMENT_ZIRCONIUM());
$result->registerBlock("element_41", fn() => VanillaBlocks::ELEMENT_NIOBIUM());
$result->registerBlock("element_42", fn() => VanillaBlocks::ELEMENT_MOLYBDENUM());
$result->registerBlock("element_43", fn() => VanillaBlocks::ELEMENT_TECHNETIUM());
$result->registerBlock("element_44", fn() => VanillaBlocks::ELEMENT_RUTHENIUM());
$result->registerBlock("element_45", fn() => VanillaBlocks::ELEMENT_RHODIUM());
$result->registerBlock("element_46", fn() => VanillaBlocks::ELEMENT_PALLADIUM());
$result->registerBlock("element_47", fn() => VanillaBlocks::ELEMENT_SILVER());
$result->registerBlock("element_48", fn() => VanillaBlocks::ELEMENT_CADMIUM());
$result->registerBlock("element_49", fn() => VanillaBlocks::ELEMENT_INDIUM());
$result->registerBlock("element_5", fn() => VanillaBlocks::ELEMENT_BORON());
$result->registerBlock("element_50", fn() => VanillaBlocks::ELEMENT_TIN());
$result->registerBlock("element_51", fn() => VanillaBlocks::ELEMENT_ANTIMONY());
$result->registerBlock("element_52", fn() => VanillaBlocks::ELEMENT_TELLURIUM());
$result->registerBlock("element_53", fn() => VanillaBlocks::ELEMENT_IODINE());
$result->registerBlock("element_54", fn() => VanillaBlocks::ELEMENT_XENON());
$result->registerBlock("element_55", fn() => VanillaBlocks::ELEMENT_CESIUM());
$result->registerBlock("element_56", fn() => VanillaBlocks::ELEMENT_BARIUM());
$result->registerBlock("element_57", fn() => VanillaBlocks::ELEMENT_LANTHANUM());
$result->registerBlock("element_58", fn() => VanillaBlocks::ELEMENT_CERIUM());
$result->registerBlock("element_59", fn() => VanillaBlocks::ELEMENT_PRASEODYMIUM());
$result->registerBlock("element_6", fn() => VanillaBlocks::ELEMENT_CARBON());
$result->registerBlock("element_60", fn() => VanillaBlocks::ELEMENT_NEODYMIUM());
$result->registerBlock("element_61", fn() => VanillaBlocks::ELEMENT_PROMETHIUM());
$result->registerBlock("element_62", fn() => VanillaBlocks::ELEMENT_SAMARIUM());
$result->registerBlock("element_63", fn() => VanillaBlocks::ELEMENT_EUROPIUM());
$result->registerBlock("element_64", fn() => VanillaBlocks::ELEMENT_GADOLINIUM());
$result->registerBlock("element_65", fn() => VanillaBlocks::ELEMENT_TERBIUM());
$result->registerBlock("element_66", fn() => VanillaBlocks::ELEMENT_DYSPROSIUM());
$result->registerBlock("element_67", fn() => VanillaBlocks::ELEMENT_HOLMIUM());
$result->registerBlock("element_68", fn() => VanillaBlocks::ELEMENT_ERBIUM());
$result->registerBlock("element_69", fn() => VanillaBlocks::ELEMENT_THULIUM());
$result->registerBlock("element_7", fn() => VanillaBlocks::ELEMENT_NITROGEN());
$result->registerBlock("element_70", fn() => VanillaBlocks::ELEMENT_YTTERBIUM());
$result->registerBlock("element_71", fn() => VanillaBlocks::ELEMENT_LUTETIUM());
$result->registerBlock("element_72", fn() => VanillaBlocks::ELEMENT_HAFNIUM());
$result->registerBlock("element_73", fn() => VanillaBlocks::ELEMENT_TANTALUM());
$result->registerBlock("element_74", fn() => VanillaBlocks::ELEMENT_TUNGSTEN());
$result->registerBlock("element_75", fn() => VanillaBlocks::ELEMENT_RHENIUM());
$result->registerBlock("element_76", fn() => VanillaBlocks::ELEMENT_OSMIUM());
$result->registerBlock("element_77", fn() => VanillaBlocks::ELEMENT_IRIDIUM());
$result->registerBlock("element_78", fn() => VanillaBlocks::ELEMENT_PLATINUM());
$result->registerBlock("element_79", fn() => VanillaBlocks::ELEMENT_GOLD());
$result->registerBlock("element_8", fn() => VanillaBlocks::ELEMENT_OXYGEN());
$result->registerBlock("element_80", fn() => VanillaBlocks::ELEMENT_MERCURY());
$result->registerBlock("element_81", fn() => VanillaBlocks::ELEMENT_THALLIUM());
$result->registerBlock("element_82", fn() => VanillaBlocks::ELEMENT_LEAD());
$result->registerBlock("element_83", fn() => VanillaBlocks::ELEMENT_BISMUTH());
$result->registerBlock("element_84", fn() => VanillaBlocks::ELEMENT_POLONIUM());
$result->registerBlock("element_85", fn() => VanillaBlocks::ELEMENT_ASTATINE());
$result->registerBlock("element_86", fn() => VanillaBlocks::ELEMENT_RADON());
$result->registerBlock("element_87", fn() => VanillaBlocks::ELEMENT_FRANCIUM());
$result->registerBlock("element_88", fn() => VanillaBlocks::ELEMENT_RADIUM());
$result->registerBlock("element_89", fn() => VanillaBlocks::ELEMENT_ACTINIUM());
$result->registerBlock("element_9", fn() => VanillaBlocks::ELEMENT_FLUORINE());
$result->registerBlock("element_90", fn() => VanillaBlocks::ELEMENT_THORIUM());
$result->registerBlock("element_91", fn() => VanillaBlocks::ELEMENT_PROTACTINIUM());
$result->registerBlock("element_92", fn() => VanillaBlocks::ELEMENT_URANIUM());
$result->registerBlock("element_93", fn() => VanillaBlocks::ELEMENT_NEPTUNIUM());
$result->registerBlock("element_94", fn() => VanillaBlocks::ELEMENT_PLUTONIUM());
$result->registerBlock("element_95", fn() => VanillaBlocks::ELEMENT_AMERICIUM());
$result->registerBlock("element_96", fn() => VanillaBlocks::ELEMENT_CURIUM());
$result->registerBlock("element_97", fn() => VanillaBlocks::ELEMENT_BERKELIUM());
$result->registerBlock("element_98", fn() => VanillaBlocks::ELEMENT_CALIFORNIUM());
$result->registerBlock("element_99", fn() => VanillaBlocks::ELEMENT_EINSTEINIUM());
$result->registerBlock("emerald_block", fn() => VanillaBlocks::EMERALD());
$result->registerBlock("emerald_ore", fn() => VanillaBlocks::EMERALD_ORE());
$result->registerBlock("enchant_table", fn() => VanillaBlocks::ENCHANTING_TABLE());
$result->registerBlock("enchanting_table", fn() => VanillaBlocks::ENCHANTING_TABLE());
$result->registerBlock("enchantment_table", fn() => VanillaBlocks::ENCHANTING_TABLE());
$result->registerBlock("end_brick_stairs", fn() => VanillaBlocks::END_STONE_BRICK_STAIRS());
$result->registerBlock("end_bricks", fn() => VanillaBlocks::END_STONE_BRICKS());
$result->registerBlock("end_portal_frame", fn() => VanillaBlocks::END_PORTAL_FRAME());
$result->registerBlock("end_rod", fn() => VanillaBlocks::END_ROD());
$result->registerBlock("end_stone", fn() => VanillaBlocks::END_STONE());
$result->registerBlock("ender_chest", fn() => VanillaBlocks::ENDER_CHEST());
$result->registerBlock("farmland", fn() => VanillaBlocks::FARMLAND());
$result->registerBlock("fence", fn() => VanillaBlocks::OAK_FENCE());
$result->registerBlock("fence_gate", fn() => VanillaBlocks::OAK_FENCE_GATE());
$result->registerBlock("fence_gate_acacia", fn() => VanillaBlocks::ACACIA_FENCE_GATE());
$result->registerBlock("fence_gate_birch", fn() => VanillaBlocks::BIRCH_FENCE_GATE());
$result->registerBlock("fence_gate_dark_oak", fn() => VanillaBlocks::DARK_OAK_FENCE_GATE());
$result->registerBlock("fence_gate_jungle", fn() => VanillaBlocks::JUNGLE_FENCE_GATE());
$result->registerBlock("fence_gate_spruce", fn() => VanillaBlocks::SPRUCE_FENCE_GATE());
$result->registerBlock("fire", fn() => VanillaBlocks::FIRE());
$result->registerBlock("flower_pot", fn() => VanillaBlocks::FLOWER_POT());
$result->registerBlock("flower_pot_block", fn() => VanillaBlocks::FLOWER_POT());
$result->registerBlock("flowing_lava", fn() => VanillaBlocks::LAVA());
$result->registerBlock("flowing_water", fn() => VanillaBlocks::WATER());
$result->registerBlock("frame", fn() => VanillaBlocks::ITEM_FRAME());
$result->registerBlock("frame_block", fn() => VanillaBlocks::ITEM_FRAME());
$result->registerBlock("frosted_ice", fn() => VanillaBlocks::FROSTED_ICE());
$result->registerBlock("furnace", fn() => VanillaBlocks::FURNACE());
$result->registerBlock("glass", fn() => VanillaBlocks::GLASS());
$result->registerBlock("glass_pane", fn() => VanillaBlocks::GLASS_PANE());
$result->registerBlock("glass_panel", fn() => VanillaBlocks::GLASS_PANE());
$result->registerBlock("glowing_obsidian", fn() => VanillaBlocks::GLOWING_OBSIDIAN());
$result->registerBlock("glowing_redstone_ore", fn() => VanillaBlocks::REDSTONE_ORE()->setLit(true));
$result->registerBlock("glowingobsidian", fn() => VanillaBlocks::GLOWING_OBSIDIAN());
$result->registerBlock("glowstone", fn() => VanillaBlocks::GLOWSTONE());
$result->registerBlock("glowstone_block", fn() => VanillaBlocks::GLOWSTONE());
$result->registerBlock("gold_block", fn() => VanillaBlocks::GOLD());
$result->registerBlock("gold_ore", fn() => VanillaBlocks::GOLD_ORE());
$result->registerBlock("gold_pressure_plate", fn() => VanillaBlocks::WEIGHTED_PRESSURE_PLATE_LIGHT());
$result->registerBlock("golden_rail", fn() => VanillaBlocks::POWERED_RAIL());
$result->registerBlock("granite_stairs", fn() => VanillaBlocks::GRANITE_STAIRS());
$result->registerBlock("grass", fn() => VanillaBlocks::GRASS());
$result->registerBlock("grass_path", fn() => VanillaBlocks::GRASS_PATH());
$result->registerBlock("gravel", fn() => VanillaBlocks::GRAVEL());
$result->registerBlock("gray_glazed_terracotta", fn() => VanillaBlocks::GRAY_GLAZED_TERRACOTTA());
$result->registerBlock("green_glazed_terracotta", fn() => VanillaBlocks::GREEN_GLAZED_TERRACOTTA());
$result->registerBlock("hard_glass", fn() => VanillaBlocks::HARDENED_GLASS());
$result->registerBlock("hard_glass_pane", fn() => VanillaBlocks::HARDENED_GLASS_PANE());
$result->registerBlock("hard_stained_glass", fn() => VanillaBlocks::STAINED_HARDENED_GLASS());
$result->registerBlock("hard_stained_glass_pane", fn() => VanillaBlocks::STAINED_HARDENED_GLASS_PANE());
$result->registerBlock("hardened_clay", fn() => VanillaBlocks::HARDENED_CLAY());
$result->registerBlock("hay_bale", fn() => VanillaBlocks::HAY_BALE());
$result->registerBlock("hay_block", fn() => VanillaBlocks::HAY_BALE());
$result->registerBlock("heavy_weighted_pressure_plate", fn() => VanillaBlocks::WEIGHTED_PRESSURE_PLATE_HEAVY());
$result->registerBlock("hopper", fn() => VanillaBlocks::HOPPER());
$result->registerBlock("hopper_block", fn() => VanillaBlocks::HOPPER());
$result->registerBlock("ice", fn() => VanillaBlocks::ICE());
$result->registerBlock("inactive_redstone_lamp", fn() => VanillaBlocks::REDSTONE_LAMP());
$result->registerBlock("info_reserved6", fn() => VanillaBlocks::RESERVED6());
$result->registerBlock("info_update", fn() => VanillaBlocks::INFO_UPDATE());
$result->registerBlock("info_update2", fn() => VanillaBlocks::INFO_UPDATE2());
$result->registerBlock("inverted_daylight_sensor", fn() => VanillaBlocks::DAYLIGHT_SENSOR()->setInverted(true));
$result->registerBlock("invisible_bedrock", fn() => VanillaBlocks::INVISIBLE_BEDROCK());
$result->registerBlock("invisiblebedrock", fn() => VanillaBlocks::INVISIBLE_BEDROCK());
$result->registerBlock("iron_bar", fn() => VanillaBlocks::IRON_BARS());
$result->registerBlock("iron_bars", fn() => VanillaBlocks::IRON_BARS());
$result->registerBlock("iron_block", fn() => VanillaBlocks::IRON());
$result->registerBlock("iron_door", fn() => VanillaBlocks::IRON_DOOR());
$result->registerBlock("iron_door_block", fn() => VanillaBlocks::IRON_DOOR());
$result->registerBlock("iron_ore", fn() => VanillaBlocks::IRON_ORE());
$result->registerBlock("iron_pressure_plate", fn() => VanillaBlocks::WEIGHTED_PRESSURE_PLATE_HEAVY());
$result->registerBlock("iron_trapdoor", fn() => VanillaBlocks::IRON_TRAPDOOR());
$result->registerBlock("item_frame", fn() => VanillaBlocks::ITEM_FRAME());
$result->registerBlock("item_frame_block", fn() => VanillaBlocks::ITEM_FRAME());
$result->registerBlock("jack_o_lantern", fn() => VanillaBlocks::LIT_PUMPKIN());
$result->registerBlock("jukebox", fn() => VanillaBlocks::JUKEBOX());
$result->registerBlock("jungle_button", fn() => VanillaBlocks::JUNGLE_BUTTON());
$result->registerBlock("jungle_door", fn() => VanillaBlocks::JUNGLE_DOOR());
$result->registerBlock("jungle_door_block", fn() => VanillaBlocks::JUNGLE_DOOR());
$result->registerBlock("jungle_fence_gate", fn() => VanillaBlocks::JUNGLE_FENCE_GATE());
$result->registerBlock("jungle_pressure_plate", fn() => VanillaBlocks::JUNGLE_PRESSURE_PLATE());
$result->registerBlock("jungle_sign", fn() => VanillaBlocks::JUNGLE_SIGN());
$result->registerBlock("jungle_stairs", fn() => VanillaBlocks::JUNGLE_STAIRS());
$result->registerBlock("jungle_standing_sign", fn() => VanillaBlocks::JUNGLE_SIGN());
$result->registerBlock("jungle_trapdoor", fn() => VanillaBlocks::JUNGLE_TRAPDOOR());
$result->registerBlock("jungle_wall_sign", fn() => VanillaBlocks::JUNGLE_WALL_SIGN());
$result->registerBlock("ladder", fn() => VanillaBlocks::LADDER());
$result->registerBlock("lantern", fn() => VanillaBlocks::LANTERN());
$result->registerBlock("lapis_block", fn() => VanillaBlocks::LAPIS_LAZULI());
$result->registerBlock("lapis_ore", fn() => VanillaBlocks::LAPIS_LAZULI_ORE());
$result->registerBlock("lava", fn() => VanillaBlocks::LAVA());
$result->registerBlock("leave", fn() => VanillaBlocks::OAK_LEAVES());
$result->registerBlock("leave2", fn() => VanillaBlocks::ACACIA_LEAVES());
$result->registerBlock("leaves", fn() => VanillaBlocks::OAK_LEAVES());
$result->registerBlock("leaves2", fn() => VanillaBlocks::ACACIA_LEAVES());
$result->registerBlock("lever", fn() => VanillaBlocks::LEVER());
$result->registerBlock("light_blue_glazed_terracotta", fn() => VanillaBlocks::LIGHT_BLUE_GLAZED_TERRACOTTA());
$result->registerBlock("light_weighted_pressure_plate", fn() => VanillaBlocks::WEIGHTED_PRESSURE_PLATE_LIGHT());
$result->registerBlock("lily_pad", fn() => VanillaBlocks::LILY_PAD());
$result->registerBlock("lime_glazed_terracotta", fn() => VanillaBlocks::LIME_GLAZED_TERRACOTTA());
$result->registerBlock("lit_blast_furnace", fn() => VanillaBlocks::BLAST_FURNACE());
$result->registerBlock("lit_furnace", fn() => VanillaBlocks::FURNACE());
$result->registerBlock("lit_pumpkin", fn() => VanillaBlocks::LIT_PUMPKIN());
$result->registerBlock("lit_redstone_lamp", fn() => VanillaBlocks::REDSTONE_LAMP()->setPowered(true));
$result->registerBlock("lit_redstone_ore", fn() => VanillaBlocks::REDSTONE_ORE()->setLit(true));
$result->registerBlock("lit_redstone_torch", fn() => VanillaBlocks::REDSTONE_TORCH());
$result->registerBlock("lit_smoker", fn() => VanillaBlocks::SMOKER());
$result->registerBlock("log", fn() => VanillaBlocks::OAK_LOG());
$result->registerBlock("log2", fn() => VanillaBlocks::ACACIA_LOG());
$result->registerBlock("loom", fn() => VanillaBlocks::LOOM());
$result->registerBlock("magenta_glazed_terracotta", fn() => VanillaBlocks::MAGENTA_GLAZED_TERRACOTTA());
$result->registerBlock("magma", fn() => VanillaBlocks::MAGMA());
$result->registerBlock("melon_block", fn() => VanillaBlocks::MELON());
$result->registerBlock("melon_stem", fn() => VanillaBlocks::MELON_STEM());
$result->registerBlock("mob_head_block", fn() => VanillaBlocks::MOB_HEAD());
$result->registerBlock("mob_spawner", fn() => VanillaBlocks::MONSTER_SPAWNER());
$result->registerBlock("monster_egg", fn() => VanillaBlocks::INFESTED_STONE());
$result->registerBlock("monster_egg_block", fn() => VanillaBlocks::INFESTED_STONE());
$result->registerBlock("monster_spawner", fn() => VanillaBlocks::MONSTER_SPAWNER());
$result->registerBlock("moss_stone", fn() => VanillaBlocks::MOSSY_COBBLESTONE());
$result->registerBlock("mossy_cobblestone", fn() => VanillaBlocks::MOSSY_COBBLESTONE());
$result->registerBlock("mossy_cobblestone_stairs", fn() => VanillaBlocks::MOSSY_COBBLESTONE_STAIRS());
$result->registerBlock("mossy_stone", fn() => VanillaBlocks::MOSSY_COBBLESTONE());
$result->registerBlock("mossy_stone_brick_stairs", fn() => VanillaBlocks::MOSSY_STONE_BRICK_STAIRS());
$result->registerBlock("mycelium", fn() => VanillaBlocks::MYCELIUM());
$result->registerBlock("nether_brick_block", fn() => VanillaBlocks::NETHER_BRICKS());
$result->registerBlock("nether_brick_fence", fn() => VanillaBlocks::NETHER_BRICK_FENCE());
$result->registerBlock("nether_brick_stairs", fn() => VanillaBlocks::NETHER_BRICK_STAIRS());
$result->registerBlock("nether_bricks", fn() => VanillaBlocks::NETHER_BRICKS());
$result->registerBlock("nether_bricks_stairs", fn() => VanillaBlocks::NETHER_BRICK_STAIRS());
$result->registerBlock("nether_quartz_ore", fn() => VanillaBlocks::NETHER_QUARTZ_ORE());
$result->registerBlock("nether_reactor", fn() => VanillaBlocks::NETHER_REACTOR_CORE());
$result->registerBlock("nether_wart", fn() => VanillaBlocks::NETHER_WART());
$result->registerBlock("nether_wart_block", fn() => VanillaBlocks::NETHER_WART_BLOCK());
$result->registerBlock("nether_wart_plant", fn() => VanillaBlocks::NETHER_WART());
$result->registerBlock("netherrack", fn() => VanillaBlocks::NETHERRACK());
$result->registerBlock("netherreactor", fn() => VanillaBlocks::NETHER_REACTOR_CORE());
$result->registerBlock("normal_stone_stairs", fn() => VanillaBlocks::STONE_STAIRS());
$result->registerBlock("note_block", fn() => VanillaBlocks::NOTE_BLOCK());
$result->registerBlock("noteblock", fn() => VanillaBlocks::NOTE_BLOCK());
$result->registerBlock("oak_door", fn() => VanillaBlocks::OAK_DOOR());
$result->registerBlock("oak_door_block", fn() => VanillaBlocks::OAK_DOOR());
$result->registerBlock("oak_fence_gate", fn() => VanillaBlocks::OAK_FENCE_GATE());
$result->registerBlock("oak_stairs", fn() => VanillaBlocks::OAK_STAIRS());
$result->registerBlock("oak_wood_stairs", fn() => VanillaBlocks::OAK_STAIRS());
$result->registerBlock("oak_wooden_stairs", fn() => VanillaBlocks::OAK_STAIRS());
$result->registerBlock("obsidian", fn() => VanillaBlocks::OBSIDIAN());
$result->registerBlock("orange_glazed_terracotta", fn() => VanillaBlocks::ORANGE_GLAZED_TERRACOTTA());
$result->registerBlock("packed_ice", fn() => VanillaBlocks::PACKED_ICE());
$result->registerBlock("pink_glazed_terracotta", fn() => VanillaBlocks::PINK_GLAZED_TERRACOTTA());
$result->registerBlock("plank", fn() => VanillaBlocks::OAK_PLANKS());
$result->registerBlock("planks", fn() => VanillaBlocks::OAK_PLANKS());
$result->registerBlock("podzol", fn() => VanillaBlocks::PODZOL());
$result->registerBlock("polished_andesite_stairs", fn() => VanillaBlocks::POLISHED_ANDESITE_STAIRS());
$result->registerBlock("polished_diorite_stairs", fn() => VanillaBlocks::POLISHED_DIORITE_STAIRS());
$result->registerBlock("polished_granite_stairs", fn() => VanillaBlocks::POLISHED_GRANITE_STAIRS());
$result->registerBlock("poppy", fn() => VanillaBlocks::POPPY());
$result->registerBlock("portal", fn() => VanillaBlocks::NETHER_PORTAL());
$result->registerBlock("portal_block", fn() => VanillaBlocks::NETHER_PORTAL());
$result->registerBlock("potato_block", fn() => VanillaBlocks::POTATOES());
$result->registerBlock("potatoes", fn() => VanillaBlocks::POTATOES());
$result->registerBlock("powered_comparator", fn() => VanillaBlocks::REDSTONE_COMPARATOR());
$result->registerBlock("powered_comparator_block", fn() => VanillaBlocks::REDSTONE_COMPARATOR());
$result->registerBlock("powered_rail", fn() => VanillaBlocks::POWERED_RAIL());
$result->registerBlock("powered_repeater", fn() => VanillaBlocks::REDSTONE_REPEATER()->setPowered(true));
$result->registerBlock("powered_repeater_block", fn() => VanillaBlocks::REDSTONE_REPEATER()->setPowered(true));
$result->registerBlock("prismarine", fn() => VanillaBlocks::PRISMARINE());
$result->registerBlock("prismarine_bricks_stairs", fn() => VanillaBlocks::PRISMARINE_BRICKS_STAIRS());
$result->registerBlock("prismarine_stairs", fn() => VanillaBlocks::PRISMARINE_STAIRS());
$result->registerBlock("pumpkin", fn() => VanillaBlocks::PUMPKIN());
$result->registerBlock("pumpkin_stem", fn() => VanillaBlocks::PUMPKIN_STEM());
$result->registerBlock("purple_glazed_terracotta", fn() => VanillaBlocks::PURPLE_GLAZED_TERRACOTTA());
$result->registerBlock("purpur_block", fn() => VanillaBlocks::PURPUR());
$result->registerBlock("purpur_stairs", fn() => VanillaBlocks::PURPUR_STAIRS());
$result->registerBlock("quartz_block", fn() => VanillaBlocks::QUARTZ());
$result->registerBlock("quartz_ore", fn() => VanillaBlocks::NETHER_QUARTZ_ORE());
$result->registerBlock("quartz_stairs", fn() => VanillaBlocks::QUARTZ_STAIRS());
$result->registerBlock("rail", fn() => VanillaBlocks::RAIL());
$result->registerBlock("red_flower", fn() => VanillaBlocks::POPPY());
$result->registerBlock("red_glazed_terracotta", fn() => VanillaBlocks::RED_GLAZED_TERRACOTTA());
$result->registerBlock("red_mushroom", fn() => VanillaBlocks::RED_MUSHROOM());
$result->registerBlock("red_mushroom_block", fn() => VanillaBlocks::RED_MUSHROOM_BLOCK());
$result->registerBlock("red_nether_brick", fn() => VanillaBlocks::RED_NETHER_BRICKS());
$result->registerBlock("red_nether_brick_stairs", fn() => VanillaBlocks::RED_NETHER_BRICK_STAIRS());
$result->registerBlock("red_sandstone", fn() => VanillaBlocks::RED_SANDSTONE());
$result->registerBlock("red_sandstone_slab", fn() => VanillaBlocks::RED_SANDSTONE_SLAB());
$result->registerBlock("red_sandstone_stairs", fn() => VanillaBlocks::RED_SANDSTONE_STAIRS());
$result->registerBlock("redstone_block", fn() => VanillaBlocks::REDSTONE());
$result->registerBlock("redstone_lamp", fn() => VanillaBlocks::REDSTONE_LAMP());
$result->registerBlock("redstone_ore", fn() => VanillaBlocks::REDSTONE_ORE());
$result->registerBlock("redstone_torch", fn() => VanillaBlocks::REDSTONE_TORCH());
$result->registerBlock("redstone_wire", fn() => VanillaBlocks::REDSTONE_WIRE());
$result->registerBlock("reeds", fn() => VanillaBlocks::SUGARCANE());
$result->registerBlock("reeds_block", fn() => VanillaBlocks::SUGARCANE());
$result->registerBlock("repeater", fn() => VanillaBlocks::REDSTONE_REPEATER());
$result->registerBlock("repeater_block", fn() => VanillaBlocks::REDSTONE_REPEATER());
$result->registerBlock("reserved6", fn() => VanillaBlocks::RESERVED6());
$result->registerBlock("rose", fn() => VanillaBlocks::POPPY());
$result->registerBlock("sand", fn() => VanillaBlocks::SAND());
$result->registerBlock("sandstone", fn() => VanillaBlocks::SANDSTONE());
$result->registerBlock("sandstone_stairs", fn() => VanillaBlocks::SANDSTONE_STAIRS());
$result->registerBlock("sapling", fn() => VanillaBlocks::OAK_SAPLING());
$result->registerBlock("sea_lantern", fn() => VanillaBlocks::SEA_LANTERN());
$result->registerBlock("sea_pickle", fn() => VanillaBlocks::SEA_PICKLE());
$result->registerBlock("sealantern", fn() => VanillaBlocks::SEA_LANTERN());
$result->registerBlock("shulker_box", fn() => VanillaBlocks::DYED_SHULKER_BOX());
$result->registerBlock("sign", fn() => VanillaBlocks::OAK_SIGN());
$result->registerBlock("sign_post", fn() => VanillaBlocks::OAK_SIGN());
$result->registerBlock("silver_glazed_terracotta", fn() => VanillaBlocks::LIGHT_GRAY_GLAZED_TERRACOTTA());
$result->registerBlock("skull_block", fn() => VanillaBlocks::MOB_HEAD());
$result->registerBlock("slab", fn() => VanillaBlocks::SMOOTH_STONE_SLAB());
$result->registerBlock("slabs", fn() => VanillaBlocks::SMOOTH_STONE_SLAB());
$result->registerBlock("smoker", fn() => VanillaBlocks::SMOKER());
$result->registerBlock("smooth_quartz_stairs", fn() => VanillaBlocks::SMOOTH_QUARTZ_STAIRS());
$result->registerBlock("smooth_red_sandstone_stairs", fn() => VanillaBlocks::SMOOTH_RED_SANDSTONE_STAIRS());
$result->registerBlock("smooth_sandstone_stairs", fn() => VanillaBlocks::SMOOTH_SANDSTONE_STAIRS());
$result->registerBlock("smooth_stone", fn() => VanillaBlocks::SMOOTH_STONE());
$result->registerBlock("snow", fn() => VanillaBlocks::SNOW());
$result->registerBlock("snow_block", fn() => VanillaBlocks::SNOW());
$result->registerBlock("snow_layer", fn() => VanillaBlocks::SNOW_LAYER());
$result->registerBlock("soul_sand", fn() => VanillaBlocks::SOUL_SAND());
$result->registerBlock("sponge", fn() => VanillaBlocks::SPONGE());
$result->registerBlock("spruce_button", fn() => VanillaBlocks::SPRUCE_BUTTON());
$result->registerBlock("spruce_door", fn() => VanillaBlocks::SPRUCE_DOOR());
$result->registerBlock("spruce_door_block", fn() => VanillaBlocks::SPRUCE_DOOR());
$result->registerBlock("spruce_fence_gate", fn() => VanillaBlocks::SPRUCE_FENCE_GATE());
$result->registerBlock("spruce_pressure_plate", fn() => VanillaBlocks::SPRUCE_PRESSURE_PLATE());
$result->registerBlock("spruce_sign", fn() => VanillaBlocks::SPRUCE_SIGN());
$result->registerBlock("spruce_stairs", fn() => VanillaBlocks::SPRUCE_STAIRS());
$result->registerBlock("spruce_standing_sign", fn() => VanillaBlocks::SPRUCE_SIGN());
$result->registerBlock("spruce_trapdoor", fn() => VanillaBlocks::SPRUCE_TRAPDOOR());
$result->registerBlock("spruce_wall_sign", fn() => VanillaBlocks::SPRUCE_WALL_SIGN());
$result->registerBlock("spruce_wood_stairs", fn() => VanillaBlocks::SPRUCE_STAIRS());
$result->registerBlock("spruce_wooden_stairs", fn() => VanillaBlocks::SPRUCE_STAIRS());
$result->registerBlock("stained_clay", fn() => VanillaBlocks::STAINED_CLAY());
$result->registerBlock("stained_glass", fn() => VanillaBlocks::STAINED_GLASS());
$result->registerBlock("stained_glass_pane", fn() => VanillaBlocks::STAINED_GLASS_PANE());
$result->registerBlock("stained_hardened_clay", fn() => VanillaBlocks::STAINED_CLAY());
$result->registerBlock("standing_banner", fn() => VanillaBlocks::BANNER());
$result->registerBlock("standing_sign", fn() => VanillaBlocks::OAK_SIGN());
$result->registerBlock("still_lava", fn() => VanillaBlocks::LAVA()->setStill(true));
$result->registerBlock("still_water", fn() => VanillaBlocks::WATER()->setStill(true));
$result->registerBlock("stone", fn() => VanillaBlocks::STONE());
$result->registerBlock("stone_brick", fn() => VanillaBlocks::STONE_BRICKS());
$result->registerBlock("stone_brick_stairs", fn() => VanillaBlocks::STONE_BRICK_STAIRS());
$result->registerBlock("stone_bricks", fn() => VanillaBlocks::STONE_BRICKS());
$result->registerBlock("stone_button", fn() => VanillaBlocks::STONE_BUTTON());
$result->registerBlock("stone_pressure_plate", fn() => VanillaBlocks::STONE_PRESSURE_PLATE());
$result->registerBlock("stone_slab", fn() => VanillaBlocks::SMOOTH_STONE_SLAB());
$result->registerBlock("stone_slab2", fn() => VanillaBlocks::RED_SANDSTONE_SLAB());
$result->registerBlock("stone_slab3", fn() => VanillaBlocks::END_STONE_BRICK_SLAB());
$result->registerBlock("stone_slab4", fn() => VanillaBlocks::MOSSY_STONE_BRICK_SLAB());
$result->registerBlock("stone_stairs", fn() => VanillaBlocks::COBBLESTONE_STAIRS());
$result->registerBlock("stone_wall", fn() => VanillaBlocks::COBBLESTONE_WALL());
$result->registerBlock("stonebrick", fn() => VanillaBlocks::STONE_BRICKS());
$result->registerBlock("stonecutter", fn() => VanillaBlocks::LEGACY_STONECUTTER());
$result->registerBlock("stripped_acacia_log", fn() => VanillaBlocks::STRIPPED_ACACIA_LOG());
$result->registerBlock("stripped_birch_log", fn() => VanillaBlocks::STRIPPED_BIRCH_LOG());
$result->registerBlock("stripped_dark_oak_log", fn() => VanillaBlocks::STRIPPED_DARK_OAK_LOG());
$result->registerBlock("stripped_jungle_log", fn() => VanillaBlocks::STRIPPED_JUNGLE_LOG());
$result->registerBlock("stripped_oak_log", fn() => VanillaBlocks::STRIPPED_OAK_LOG());
$result->registerBlock("stripped_spruce_log", fn() => VanillaBlocks::STRIPPED_SPRUCE_LOG());
$result->registerBlock("sugar_cane", fn() => VanillaBlocks::SUGARCANE());
$result->registerBlock("sugar_canes", fn() => VanillaBlocks::SUGARCANE());
$result->registerBlock("sugarcane", fn() => VanillaBlocks::SUGARCANE());
$result->registerBlock("sugarcane_block", fn() => VanillaBlocks::SUGARCANE());
$result->registerBlock("sweet_berry_bush", fn() => VanillaBlocks::SWEET_BERRY_BUSH());
$result->registerBlock("tall_grass", fn() => VanillaBlocks::FERN());
$result->registerBlock("tallgrass", fn() => VanillaBlocks::FERN());
$result->registerBlock("terracotta", fn() => VanillaBlocks::STAINED_CLAY());
$result->registerBlock("tnt", fn() => VanillaBlocks::TNT());
$result->registerBlock("torch", fn() => VanillaBlocks::TORCH());
$result->registerBlock("trapdoor", fn() => VanillaBlocks::OAK_TRAPDOOR());
$result->registerBlock("trapped_chest", fn() => VanillaBlocks::TRAPPED_CHEST());
$result->registerBlock("trip_wire", fn() => VanillaBlocks::TRIPWIRE());
$result->registerBlock("tripwire", fn() => VanillaBlocks::TRIPWIRE());
$result->registerBlock("tripwire_hook", fn() => VanillaBlocks::TRIPWIRE_HOOK());
$result->registerBlock("trunk", fn() => VanillaBlocks::OAK_PLANKS());
$result->registerBlock("trunk2", fn() => VanillaBlocks::ACACIA_LOG());
$result->registerBlock("underwater_torch", fn() => VanillaBlocks::UNDERWATER_TORCH());
$result->registerBlock("undyed_shulker_box", fn() => VanillaBlocks::SHULKER_BOX());
$result->registerBlock("unlit_redstone_torch", fn() => VanillaBlocks::REDSTONE_TORCH());
$result->registerBlock("unpowered_comparator", fn() => VanillaBlocks::REDSTONE_COMPARATOR());
$result->registerBlock("unpowered_comparator_block", fn() => VanillaBlocks::REDSTONE_COMPARATOR());
$result->registerBlock("unpowered_repeater", fn() => VanillaBlocks::REDSTONE_REPEATER());
$result->registerBlock("unpowered_repeater_block", fn() => VanillaBlocks::REDSTONE_REPEATER());
$result->registerBlock("update_block", fn() => VanillaBlocks::INFO_UPDATE());
$result->registerBlock("vine", fn() => VanillaBlocks::VINES());
$result->registerBlock("vines", fn() => VanillaBlocks::VINES());
$result->registerBlock("wall_banner", fn() => VanillaBlocks::WALL_BANNER());
$result->registerBlock("wall_sign", fn() => VanillaBlocks::OAK_WALL_SIGN());
$result->registerBlock("water", fn() => VanillaBlocks::WATER());
$result->registerBlock("water_lily", fn() => VanillaBlocks::LILY_PAD());
$result->registerBlock("waterlily", fn() => VanillaBlocks::LILY_PAD());
$result->registerBlock("web", fn() => VanillaBlocks::COBWEB());
$result->registerBlock("weighted_pressure_plate_heavy", fn() => VanillaBlocks::WEIGHTED_PRESSURE_PLATE_HEAVY());
$result->registerBlock("weighted_pressure_plate_light", fn() => VanillaBlocks::WEIGHTED_PRESSURE_PLATE_LIGHT());
$result->registerBlock("wheat_block", fn() => VanillaBlocks::WHEAT());
$result->registerBlock("white_glazed_terracotta", fn() => VanillaBlocks::WHITE_GLAZED_TERRACOTTA());
$result->registerBlock("wood", fn() => VanillaBlocks::OAK_LOG());
$result->registerBlock("wood2", fn() => VanillaBlocks::ACACIA_LOG());
$result->registerBlock("wood_door_block", fn() => VanillaBlocks::OAK_DOOR());
$result->registerBlock("wood_slab", fn() => VanillaBlocks::OAK_SLAB());
$result->registerBlock("wood_slabs", fn() => VanillaBlocks::OAK_SLAB());
$result->registerBlock("wood_stairs", fn() => VanillaBlocks::OAK_STAIRS());
$result->registerBlock("wooden_button", fn() => VanillaBlocks::OAK_BUTTON());
$result->registerBlock("wooden_door", fn() => VanillaBlocks::OAK_DOOR());
$result->registerBlock("wooden_door_block", fn() => VanillaBlocks::OAK_DOOR());
$result->registerBlock("wooden_plank", fn() => VanillaBlocks::OAK_PLANKS());
$result->registerBlock("wooden_planks", fn() => VanillaBlocks::OAK_PLANKS());
$result->registerBlock("wooden_pressure_plate", fn() => VanillaBlocks::OAK_PRESSURE_PLATE());
$result->registerBlock("wooden_slab", fn() => VanillaBlocks::OAK_SLAB());
$result->registerBlock("wooden_slabs", fn() => VanillaBlocks::OAK_SLAB());
$result->registerBlock("wooden_stairs", fn() => VanillaBlocks::OAK_STAIRS());
$result->registerBlock("wooden_trapdoor", fn() => VanillaBlocks::OAK_TRAPDOOR());
$result->registerBlock("wool", fn() => VanillaBlocks::WOOL());
$result->registerBlock("workbench", fn() => VanillaBlocks::CRAFTING_TABLE());
$result->registerBlock("yellow_flower", fn() => VanillaBlocks::DANDELION());
$result->registerBlock("yellow_glazed_terracotta", fn() => VanillaBlocks::YELLOW_GLAZED_TERRACOTTA());
$result->register("apple", fn() => VanillaItems::APPLE());
$result->register("apple_enchanted", fn() => VanillaItems::ENCHANTED_GOLDEN_APPLE());
$result->register("appleenchanted", fn() => VanillaItems::ENCHANTED_GOLDEN_APPLE());
$result->register("arrow", fn() => VanillaItems::ARROW());
$result->register("baked_potato", fn() => VanillaItems::BAKED_POTATO());
$result->register("baked_potatoes", fn() => VanillaItems::BAKED_POTATO());
$result->register("bed", fn() => VanillaItems::WHITE_BED());
$result->register("beef", fn() => VanillaItems::RAW_BEEF());
$result->register("beetroot", fn() => VanillaItems::BEETROOT());
$result->register("beetroot_seed", fn() => VanillaItems::BEETROOT_SEEDS());
$result->register("beetroot_seeds", fn() => VanillaItems::BEETROOT_SEEDS());
$result->register("beetroot_soup", fn() => VanillaItems::BEETROOT_SOUP());
$result->register("blaze_powder", fn() => VanillaItems::BLAZE_POWDER());
$result->register("blaze_rod", fn() => VanillaItems::BLAZE_ROD());
$result->register("bleach", fn() => VanillaItems::BLEACH());
$result->register("boat", fn() => VanillaItems::OAK_BOAT());
$result->register("bone", fn() => VanillaItems::BONE());
$result->register("book", fn() => VanillaItems::BOOK());
$result->register("bottle_o_enchanting", fn() => VanillaItems::EXPERIENCE_BOTTLE());
$result->register("bow", fn() => VanillaItems::BOW());
$result->register("bowl", fn() => VanillaItems::BOWL());
$result->register("bread", fn() => VanillaItems::BREAD());
$result->register("brick", fn() => VanillaItems::BRICK());
$result->register("bucket", fn() => VanillaItems::BUCKET());
$result->register("carrot", fn() => VanillaItems::CARROT());
$result->register("chain_boots", fn() => VanillaItems::CHAINMAIL_BOOTS());
$result->register("chain_chestplate", fn() => VanillaItems::CHAINMAIL_CHESTPLATE());
$result->register("chain_helmet", fn() => VanillaItems::CHAINMAIL_HELMET());
$result->register("chain_leggings", fn() => VanillaItems::CHAINMAIL_LEGGINGS());
$result->register("chainmail_boots", fn() => VanillaItems::CHAINMAIL_BOOTS());
$result->register("chainmail_chestplate", fn() => VanillaItems::CHAINMAIL_CHESTPLATE());
$result->register("chainmail_helmet", fn() => VanillaItems::CHAINMAIL_HELMET());
$result->register("chainmail_leggings", fn() => VanillaItems::CHAINMAIL_LEGGINGS());
$result->register("chicken", fn() => VanillaItems::RAW_CHICKEN());
$result->register("chorus_fruit", fn() => VanillaItems::CHORUS_FRUIT());
$result->register("chorus_fruit_popped", fn() => VanillaItems::POPPED_CHORUS_FRUIT());
$result->register("clay", fn() => VanillaItems::CLAY());
$result->register("clay_ball", fn() => VanillaItems::CLAY());
$result->register("clock", fn() => VanillaItems::CLOCK());
$result->register("clown_fish", fn() => VanillaItems::CLOWNFISH());
$result->register("clownfish", fn() => VanillaItems::CLOWNFISH());
$result->register("coal", fn() => VanillaItems::COAL());
$result->register("compass", fn() => VanillaItems::COMPASS());
$result->register("compound", fn() => VanillaItems::CHEMICAL_SALT());
$result->register("cooked_beef", fn() => VanillaItems::STEAK());
$result->register("cooked_chicken", fn() => VanillaItems::COOKED_CHICKEN());
$result->register("cooked_fish", fn() => VanillaItems::COOKED_FISH());
$result->register("cooked_mutton", fn() => VanillaItems::COOKED_MUTTON());
$result->register("cooked_porkchop", fn() => VanillaItems::COOKED_PORKCHOP());
$result->register("cooked_rabbit", fn() => VanillaItems::COOKED_RABBIT());
$result->register("cooked_salmon", fn() => VanillaItems::COOKED_SALMON());
$result->register("cookie", fn() => VanillaItems::COOKIE());
$result->register("diamond", fn() => VanillaItems::DIAMOND());
$result->register("diamond_axe", fn() => VanillaItems::DIAMOND_AXE());
$result->register("diamond_boots", fn() => VanillaItems::DIAMOND_BOOTS());
$result->register("diamond_chestplate", fn() => VanillaItems::DIAMOND_CHESTPLATE());
$result->register("diamond_helmet", fn() => VanillaItems::DIAMOND_HELMET());
$result->register("diamond_hoe", fn() => VanillaItems::DIAMOND_HOE());
$result->register("diamond_leggings", fn() => VanillaItems::DIAMOND_LEGGINGS());
$result->register("diamond_pickaxe", fn() => VanillaItems::DIAMOND_PICKAXE());
$result->register("diamond_shovel", fn() => VanillaItems::DIAMOND_SHOVEL());
$result->register("diamond_sword", fn() => VanillaItems::DIAMOND_SWORD());
$result->register("dragon_breath", fn() => VanillaItems::DRAGON_BREATH());
$result->register("dried_kelp", fn() => VanillaItems::DRIED_KELP());
$result->register("dye", fn() => VanillaItems::INK_SAC());
$result->register("egg", fn() => VanillaItems::EGG());
$result->register("emerald", fn() => VanillaItems::EMERALD());
$result->register("enchanted_golden_apple", fn() => VanillaItems::ENCHANTED_GOLDEN_APPLE());
$result->register("enchanting_bottle", fn() => VanillaItems::EXPERIENCE_BOTTLE());
$result->register("ender_pearl", fn() => VanillaItems::ENDER_PEARL());
$result->register("experience_bottle", fn() => VanillaItems::EXPERIENCE_BOTTLE());
$result->register("feather", fn() => VanillaItems::FEATHER());
$result->register("fermented_spider_eye", fn() => VanillaItems::FERMENTED_SPIDER_EYE());
$result->register("fish", fn() => VanillaItems::RAW_FISH());
$result->register("fishing_rod", fn() => VanillaItems::FISHING_ROD());
$result->register("flint", fn() => VanillaItems::FLINT());
$result->register("flint_and_steel", fn() => VanillaItems::FLINT_AND_STEEL());
$result->register("flint_steel", fn() => VanillaItems::FLINT_AND_STEEL());
$result->register("ghast_tear", fn() => VanillaItems::GHAST_TEAR());
$result->register("glass_bottle", fn() => VanillaItems::GLASS_BOTTLE());
$result->register("glistering_melon", fn() => VanillaItems::GLISTERING_MELON());
$result->register("glowstone_dust", fn() => VanillaItems::GLOWSTONE_DUST());
$result->register("gold_axe", fn() => VanillaItems::GOLDEN_AXE());
$result->register("gold_boots", fn() => VanillaItems::GOLDEN_BOOTS());
$result->register("gold_chestplate", fn() => VanillaItems::GOLDEN_CHESTPLATE());
$result->register("gold_helmet", fn() => VanillaItems::GOLDEN_HELMET());
$result->register("gold_hoe", fn() => VanillaItems::GOLDEN_HOE());
$result->register("gold_ingot", fn() => VanillaItems::GOLD_INGOT());
$result->register("gold_leggings", fn() => VanillaItems::GOLDEN_LEGGINGS());
$result->register("gold_nugget", fn() => VanillaItems::GOLD_NUGGET());
$result->register("gold_pickaxe", fn() => VanillaItems::GOLDEN_PICKAXE());
$result->register("gold_shovel", fn() => VanillaItems::GOLDEN_SHOVEL());
$result->register("gold_sword", fn() => VanillaItems::GOLDEN_SWORD());
$result->register("golden_apple", fn() => VanillaItems::GOLDEN_APPLE());
$result->register("golden_axe", fn() => VanillaItems::GOLDEN_AXE());
$result->register("golden_boots", fn() => VanillaItems::GOLDEN_BOOTS());
$result->register("golden_carrot", fn() => VanillaItems::GOLDEN_CARROT());
$result->register("golden_chestplate", fn() => VanillaItems::GOLDEN_CHESTPLATE());
$result->register("golden_helmet", fn() => VanillaItems::GOLDEN_HELMET());
$result->register("golden_hoe", fn() => VanillaItems::GOLDEN_HOE());
$result->register("golden_leggings", fn() => VanillaItems::GOLDEN_LEGGINGS());
$result->register("golden_nugget", fn() => VanillaItems::GOLD_NUGGET());
$result->register("golden_pickaxe", fn() => VanillaItems::GOLDEN_PICKAXE());
$result->register("golden_shovel", fn() => VanillaItems::GOLDEN_SHOVEL());
$result->register("golden_sword", fn() => VanillaItems::GOLDEN_SWORD());
$result->register("gunpowder", fn() => VanillaItems::GUNPOWDER());
$result->register("heart_of_the_sea", fn() => VanillaItems::HEART_OF_THE_SEA());
$result->register("iron_axe", fn() => VanillaItems::IRON_AXE());
$result->register("iron_boots", fn() => VanillaItems::IRON_BOOTS());
$result->register("iron_chestplate", fn() => VanillaItems::IRON_CHESTPLATE());
$result->register("iron_helmet", fn() => VanillaItems::IRON_HELMET());
$result->register("iron_hoe", fn() => VanillaItems::IRON_HOE());
$result->register("iron_ingot", fn() => VanillaItems::IRON_INGOT());
$result->register("iron_leggings", fn() => VanillaItems::IRON_LEGGINGS());
$result->register("iron_nugget", fn() => VanillaItems::IRON_NUGGET());
$result->register("iron_pickaxe", fn() => VanillaItems::IRON_PICKAXE());
$result->register("iron_shovel", fn() => VanillaItems::IRON_SHOVEL());
$result->register("iron_sword", fn() => VanillaItems::IRON_SWORD());
$result->register("leather", fn() => VanillaItems::LEATHER());
$result->register("leather_boots", fn() => VanillaItems::LEATHER_BOOTS());
$result->register("leather_cap", fn() => VanillaItems::LEATHER_CAP());
$result->register("leather_chestplate", fn() => VanillaItems::LEATHER_TUNIC());
$result->register("leather_helmet", fn() => VanillaItems::LEATHER_CAP());
$result->register("leather_leggings", fn() => VanillaItems::LEATHER_PANTS());
$result->register("leather_pants", fn() => VanillaItems::LEATHER_PANTS());
$result->register("leather_tunic", fn() => VanillaItems::LEATHER_TUNIC());
$result->register("magma_cream", fn() => VanillaItems::MAGMA_CREAM());
$result->register("melon", fn() => VanillaItems::MELON());
$result->register("melon_seeds", fn() => VanillaItems::MELON_SEEDS());
$result->register("melon_slice", fn() => VanillaItems::MELON());
$result->register("minecart", fn() => VanillaItems::MINECART());
$result->register("mob_head", fn() => VanillaItems::SKELETON_SKULL());
$result->register("mushroom_stew", fn() => VanillaItems::MUSHROOM_STEW());
$result->register("mutton", fn() => VanillaItems::RAW_MUTTON());
$result->register("mutton_cooked", fn() => VanillaItems::COOKED_MUTTON());
$result->register("mutton_raw", fn() => VanillaItems::RAW_MUTTON());
$result->register("muttoncooked", fn() => VanillaItems::COOKED_MUTTON());
$result->register("muttonraw", fn() => VanillaItems::RAW_MUTTON());
$result->register("nautilus_shell", fn() => VanillaItems::NAUTILUS_SHELL());
$result->register("nether_brick", fn() => VanillaItems::NETHER_BRICK());
$result->register("nether_quartz", fn() => VanillaItems::NETHER_QUARTZ());
$result->register("nether_star", fn() => VanillaItems::NETHER_STAR());
$result->register("netherbrick", fn() => VanillaItems::NETHER_BRICK());
$result->register("netherstar", fn() => VanillaItems::NETHER_STAR());
$result->register("painting", fn() => VanillaItems::PAINTING());
$result->register("paper", fn() => VanillaItems::PAPER());
$result->register("poisonous_potato", fn() => VanillaItems::POISONOUS_POTATO());
$result->register("porkchop", fn() => VanillaItems::RAW_PORKCHOP());
$result->register("potato", fn() => VanillaItems::POTATO());
$result->register("potion", fn() => VanillaItems::WATER_POTION());
$result->register("prismarine_crystals", fn() => VanillaItems::PRISMARINE_CRYSTALS());
$result->register("prismarine_shard", fn() => VanillaItems::PRISMARINE_SHARD());
$result->register("puffer_fish", fn() => VanillaItems::PUFFERFISH());
$result->register("pufferfish", fn() => VanillaItems::PUFFERFISH());
$result->register("pumpkin_pie", fn() => VanillaItems::PUMPKIN_PIE());
$result->register("pumpkin_seeds", fn() => VanillaItems::PUMPKIN_SEEDS());
$result->register("quartz", fn() => VanillaItems::NETHER_QUARTZ());
$result->register("rabbit", fn() => VanillaItems::RAW_RABBIT());
$result->register("rabbit_foot", fn() => VanillaItems::RABBIT_FOOT());
$result->register("rabbit_hide", fn() => VanillaItems::RABBIT_HIDE());
$result->register("rabbit_stew", fn() => VanillaItems::RABBIT_STEW());
$result->register("raw_beef", fn() => VanillaItems::RAW_BEEF());
$result->register("raw_chicken", fn() => VanillaItems::RAW_CHICKEN());
$result->register("raw_fish", fn() => VanillaItems::RAW_FISH());
$result->register("raw_mutton", fn() => VanillaItems::RAW_MUTTON());
$result->register("raw_porkchop", fn() => VanillaItems::RAW_PORKCHOP());
$result->register("raw_rabbit", fn() => VanillaItems::RAW_RABBIT());
$result->register("raw_salmon", fn() => VanillaItems::RAW_SALMON());
$result->register("record_11", fn() => VanillaItems::RECORD_11());
$result->register("record_13", fn() => VanillaItems::RECORD_13());
$result->register("record_blocks", fn() => VanillaItems::RECORD_BLOCKS());
$result->register("record_cat", fn() => VanillaItems::RECORD_CAT());
$result->register("record_chirp", fn() => VanillaItems::RECORD_CHIRP());
$result->register("record_far", fn() => VanillaItems::RECORD_FAR());
$result->register("record_mall", fn() => VanillaItems::RECORD_MALL());
$result->register("record_mellohi", fn() => VanillaItems::RECORD_MELLOHI());
$result->register("record_stal", fn() => VanillaItems::RECORD_STAL());
$result->register("record_strad", fn() => VanillaItems::RECORD_STRAD());
$result->register("record_wait", fn() => VanillaItems::RECORD_WAIT());
$result->register("record_ward", fn() => VanillaItems::RECORD_WARD());
$result->register("redstone", fn() => VanillaItems::REDSTONE_DUST());
$result->register("redstone_dust", fn() => VanillaItems::REDSTONE_DUST());
$result->register("rotten_flesh", fn() => VanillaItems::ROTTEN_FLESH());
$result->register("salmon", fn() => VanillaItems::RAW_SALMON());
$result->register("seeds", fn() => VanillaItems::WHEAT_SEEDS());
$result->register("shears", fn() => VanillaItems::SHEARS());
$result->register("shulker_shell", fn() => VanillaItems::SHULKER_SHELL());
$result->register("skull", fn() => VanillaItems::SKELETON_SKULL());
$result->register("slime_ball", fn() => VanillaItems::SLIMEBALL());
$result->register("slimeball", fn() => VanillaItems::SLIMEBALL());
$result->register("snowball", fn() => VanillaItems::SNOWBALL());
$result->register("speckled_melon", fn() => VanillaItems::GLISTERING_MELON());
$result->register("spider_eye", fn() => VanillaItems::SPIDER_EYE());
$result->register("splash_potion", fn() => VanillaItems::WATER_SPLASH_POTION());
$result->register("steak", fn() => VanillaItems::STEAK());
$result->register("stick", fn() => VanillaItems::STICK());
$result->register("sticks", fn() => VanillaItems::STICK());
$result->register("stone_axe", fn() => VanillaItems::STONE_AXE());
$result->register("stone_hoe", fn() => VanillaItems::STONE_HOE());
$result->register("stone_pickaxe", fn() => VanillaItems::STONE_PICKAXE());
$result->register("stone_shovel", fn() => VanillaItems::STONE_SHOVEL());
$result->register("stone_sword", fn() => VanillaItems::STONE_SWORD());
$result->register("string", fn() => VanillaItems::STRING());
$result->register("sugar", fn() => VanillaItems::SUGAR());
$result->register("sweet_berries", fn() => VanillaItems::SWEET_BERRIES());
$result->register("totem", fn() => VanillaItems::TOTEM());
$result->register("turtle_shell_piece", fn() => VanillaItems::SCUTE());
$result->register("wheat", fn() => VanillaItems::WHEAT());
$result->register("wheat_seeds", fn() => VanillaItems::WHEAT_SEEDS());
$result->register("wooden_axe", fn() => VanillaItems::WOODEN_AXE());
$result->register("wooden_hoe", fn() => VanillaItems::WOODEN_HOE());
$result->register("wooden_pickaxe", fn() => VanillaItems::WOODEN_PICKAXE());
$result->register("wooden_shovel", fn() => VanillaItems::WOODEN_SHOVEL());
$result->register("wooden_sword", fn() => VanillaItems::WOODEN_SWORD());
$result->register("writable_book", fn() => VanillaItems::WRITABLE_BOOK());
$result->register("written_book", fn() => VanillaItems::WRITTEN_BOOK());
return $result;
}
/** @phpstan-param \Closure(string $input) : Item $callback */
public function register(string $alias, \Closure $callback) : void{
$key = $this->reprocess($alias);
if(isset($this->callbackMap[$key])){
throw new \InvalidArgumentException("Alias \"$key\" is already registered");
}
$this->callbackMap[$key] = $callback;
}
/** @phpstan-param \Closure(string $input) : Block $callback */
public function registerBlock(string $alias, \Closure $callback) : void{
$this->register($alias, fn(string $input) => $callback($input)->asItem());
}
/** @phpstan-param \Closure(string $input) : Item $callback */
public function override(string $alias, \Closure $callback) : void{
$this->callbackMap[$this->reprocess($alias)] = $callback;
}
/** Tries to parse the specified string into an item. */
public function parse(string $input) : ?Item{
$key = $this->reprocess($input);
if(isset($this->callbackMap[$key])){
return ($this->callbackMap[$key])($input);
}
return null;
}
protected function reprocess(string $input) : string{
return strtolower(str_replace([" ", "minecraft:"], ["_", ""], trim($input)));
}
/** @return string[] */
public function getKnownAliases() : array{
return array_keys($this->callbackMap);
}
}