Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Warped Fungus/Carrot on a Stick #6306

Open
wants to merge 5 commits into
base: minor-next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/data/bedrock/item/ItemSerializerDeserializerRegistrar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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());
Expand Down
37 changes: 37 additions & 0 deletions src/item/CarrotOnAStick.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?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;

class CarrotOnAStick extends Durable{

public function getMaxStackSize() : int{
return 1;
}

public function getMaxDurability() : int{
return 26;
ShockedPlot7560 marked this conversation as resolved.
Show resolved Hide resolved
}

//TODO
}
4 changes: 3 additions & 1 deletion src/item/ItemTypeIds.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,10 @@ private function __construct(){
public const SPIRE_ARMOR_TRIM_SMITHING_TEMPLATE = 20285;
public const PITCHER_POD = 20286;
public const NAME_TAG = 20287;
public const CARROT_ON_A_STICK = 20288;
public const WARPED_FUNGUS_ON_A_STICK = 20289;

public const FIRST_UNUSED_ITEM_ID = 20288;
public const FIRST_UNUSED_ITEM_ID = 20290;

private static int $nextDynamicId = self::FIRST_UNUSED_ITEM_ID;

Expand Down
2 changes: 2 additions & 0 deletions src/item/StringToItemParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,7 @@ private static function registerItems(self $result) : void{
$result->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());
Expand Down Expand Up @@ -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());
Expand Down
6 changes: 6 additions & 0 deletions src/item/VanillaItems.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -317,6 +318,7 @@
* @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()
Expand Down Expand Up @@ -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"));
Expand Down
37 changes: 37 additions & 0 deletions src/item/WarpedFungusOnAStick.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?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;

class WarpedFungusOnAStick extends Durable{

public function getMaxStackSize() : int{
return 1;
}

public function getMaxDurability() : int{
return 100;
}

//TODO
}