From 5af75243cb5ab3acced960c0a31a93ec61b73ada Mon Sep 17 00:00:00 2001 From: pandaaabe <135014092+pandaa-be@users.noreply.github.com> Date: Sun, 24 Mar 2024 23:19:46 +0100 Subject: [PATCH 1/3] basic impl for carrot/warped fungus on a stick --- src/item/CarrotOnAStick.php | 37 +++++++++++++++++++++++++++++++ src/item/ItemTypeIds.php | 4 +++- src/item/StringToItemParser.php | 2 ++ src/item/VanillaItems.php | 6 +++++ src/item/WarpedFungusOnAStick.php | 37 +++++++++++++++++++++++++++++++ 5 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 src/item/CarrotOnAStick.php create mode 100644 src/item/WarpedFungusOnAStick.php diff --git a/src/item/CarrotOnAStick.php b/src/item/CarrotOnAStick.php new file mode 100644 index 00000000000..06d021ce91f --- /dev/null +++ b/src/item/CarrotOnAStick.php @@ -0,0 +1,37 @@ +register("brick", fn() => Items::BRICK()); $result->register("bucket", fn() => Items::BUCKET()); $result->register("carrot", fn() => Items::CARROT()); + $result->register("carrot_on_a_stick", fn() => Items::CARROT_ON_A_STICK()); $result->register("chain_boots", fn() => Items::CHAINMAIL_BOOTS()); $result->register("chain_chestplate", fn() => Items::CHAINMAIL_CHESTPLATE()); $result->register("chain_helmet", fn() => Items::CHAINMAIL_HELMET()); @@ -1495,6 +1496,7 @@ private static function registerItems(self $result) : void{ $result->register("turtle_shell_piece", fn() => Items::SCUTE()); $result->register("villager_spawn_egg", fn() => Items::VILLAGER_SPAWN_EGG()); $result->register("ward_armor_trim_smithing_template", fn() => Items::WARD_ARMOR_TRIM_SMITHING_TEMPLATE()); + $result->register("warped_fungus_on_a_stick", fn() => Items::WARPED_FUNGUS_ON_A_STICK()); $result->register("water_bucket", fn() => Items::WATER_BUCKET()); $result->register("wayfinder_armor_trim_smithing_template", fn() => Items::WAYFINDER_ARMOR_TRIM_SMITHING_TEMPLATE()); $result->register("wheat", fn() => Items::WHEAT()); diff --git a/src/item/VanillaItems.php b/src/item/VanillaItems.php index bbd0dfc01b3..5458e1f3af4 100644 --- a/src/item/VanillaItems.php +++ b/src/item/VanillaItems.php @@ -72,6 +72,7 @@ * @method static Item BRICK() * @method static Bucket BUCKET() * @method static Carrot CARROT() + * @method static CarrotOnAStick CARROT_ON_A_STICK() * @method static Armor CHAINMAIL_BOOTS() * @method static Armor CHAINMAIL_CHESTPLATE() * @method static Armor CHAINMAIL_HELMET() @@ -320,6 +321,7 @@ * @method static ItemBlockWallOrFloor WARPED_SIGN() * @method static LiquidBucket WATER_BUCKET() * @method static Item WAYFINDER_ARMOR_TRIM_SMITHING_TEMPLATE() + * @method static WarpedFungusOnAStick WARPED_FUNGUS_ON_A_STICK() * @method static Item WHEAT() * @method static WheatSeeds WHEAT_SEEDS() * @method static Item WILD_ARMOR_TRIM_SMITHING_TEMPLATE() @@ -459,7 +461,11 @@ protected static function setup() : void{ self::register("feather", new Item(new IID(Ids::FEATHER), "Feather")); self::register("fermented_spider_eye", new Item(new IID(Ids::FERMENTED_SPIDER_EYE), "Fermented Spider Eye")); self::register("fire_charge", new FireCharge(new IID(Ids::FIRE_CHARGE), "Fire Charge")); + self::register("fishing_rod", new FishingRod(new IID(Ids::FISHING_ROD), "Fishing Rod", [EnchantmentTags::FISHING_ROD])); + self::register("carrot_on_a_stick", new CarrotOnAStick(new IID(Ids::CARROT_ON_A_STICK), "Carrot on a Stick")); + self::register("warped_fungus_on_a_stick", new WarpedFungusOnAStick(new IID(Ids::WARPED_FUNGUS_ON_A_STICK), "Warped Fungus on a Stick")); + self::register("flint", new Item(new IID(Ids::FLINT), "Flint")); self::register("flint_and_steel", new FlintSteel(new IID(Ids::FLINT_AND_STEEL), "Flint and Steel", [EnchantmentTags::FLINT_AND_STEEL])); self::register("ghast_tear", new Item(new IID(Ids::GHAST_TEAR), "Ghast Tear")); diff --git a/src/item/WarpedFungusOnAStick.php b/src/item/WarpedFungusOnAStick.php new file mode 100644 index 00000000000..2920284c2af --- /dev/null +++ b/src/item/WarpedFungusOnAStick.php @@ -0,0 +1,37 @@ + Date: Sun, 24 Mar 2024 23:20:39 +0100 Subject: [PATCH 2/3] ups add to ItemSerializerDeserializerRegistrar --- src/data/bedrock/item/ItemSerializerDeserializerRegistrar.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/data/bedrock/item/ItemSerializerDeserializerRegistrar.php b/src/data/bedrock/item/ItemSerializerDeserializerRegistrar.php index 7a720559eaa..cb6132f90ed 100644 --- a/src/data/bedrock/item/ItemSerializerDeserializerRegistrar.php +++ b/src/data/bedrock/item/ItemSerializerDeserializerRegistrar.php @@ -181,6 +181,7 @@ private function register1to1ItemMappings() : void{ $this->map1to1Item(Ids::BRICK, Items::BRICK()); $this->map1to1Item(Ids::BUCKET, Items::BUCKET()); $this->map1to1Item(Ids::CARROT, Items::CARROT()); + $this->map1to1Item(Ids::CARROT_ON_A_STICK, Items::CARROT_ON_A_STICK()); $this->map1to1Item(Ids::CHAINMAIL_BOOTS, Items::CHAINMAIL_BOOTS()); $this->map1to1Item(Ids::CHAINMAIL_CHESTPLATE, Items::CHAINMAIL_CHESTPLATE()); $this->map1to1Item(Ids::CHAINMAIL_HELMET, Items::CHAINMAIL_HELMET()); @@ -381,6 +382,7 @@ private function register1to1ItemMappings() : void{ $this->map1to1Item(Ids::VEX_ARMOR_TRIM_SMITHING_TEMPLATE, Items::VEX_ARMOR_TRIM_SMITHING_TEMPLATE()); $this->map1to1Item(Ids::VILLAGER_SPAWN_EGG, Items::VILLAGER_SPAWN_EGG()); $this->map1to1Item(Ids::WARD_ARMOR_TRIM_SMITHING_TEMPLATE, Items::WARD_ARMOR_TRIM_SMITHING_TEMPLATE()); + $this->map1to1Item(Ids::WARPED_FUNGUS_ON_A_STICK, Items::WARPED_FUNGUS_ON_A_STICK()); $this->map1to1Item(Ids::WARPED_SIGN, Items::WARPED_SIGN()); $this->map1to1Item(Ids::WATER_BUCKET, Items::WATER_BUCKET()); $this->map1to1Item(Ids::WAYFINDER_ARMOR_TRIM_SMITHING_TEMPLATE, Items::WAYFINDER_ARMOR_TRIM_SMITHING_TEMPLATE()); From a6e5b5354c0c6c65b30aafb298052a321918b869 Mon Sep 17 00:00:00 2001 From: pandaaabe <135014092+pandaa-be@users.noreply.github.com> Date: Sun, 24 Mar 2024 23:28:24 +0100 Subject: [PATCH 3/3] cc --- src/item/VanillaItems.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/item/VanillaItems.php b/src/item/VanillaItems.php index 5458e1f3af4..e2ce831a3ab 100644 --- a/src/item/VanillaItems.php +++ b/src/item/VanillaItems.php @@ -318,10 +318,10 @@ * @method static Item VEX_ARMOR_TRIM_SMITHING_TEMPLATE() * @method static SpawnEgg VILLAGER_SPAWN_EGG() * @method static Item WARD_ARMOR_TRIM_SMITHING_TEMPLATE() + * @method static WarpedFungusOnAStick WARPED_FUNGUS_ON_A_STICK() * @method static ItemBlockWallOrFloor WARPED_SIGN() * @method static LiquidBucket WATER_BUCKET() * @method static Item WAYFINDER_ARMOR_TRIM_SMITHING_TEMPLATE() - * @method static WarpedFungusOnAStick WARPED_FUNGUS_ON_A_STICK() * @method static Item WHEAT() * @method static WheatSeeds WHEAT_SEEDS() * @method static Item WILD_ARMOR_TRIM_SMITHING_TEMPLATE()