Set the correct max stack size for spyglass (#5133)

This commit is contained in:
Alexey 2022-07-05 22:43:46 +03:00 committed by GitHub
parent 5536672e4b
commit a005cd6e33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 2 deletions

View File

@ -185,7 +185,6 @@ class ItemFactory{
$this->register(new Item(new IID(Ids::RAW_IRON), "Raw Iron"));
$this->register(new Item(new IID(Ids::RAW_GOLD), "Raw Gold"));
$this->register(new Item(new IID(Ids::PHANTOM_MEMBRANE), "Phantom Membrane"));
$this->register(new Item(new IID(Ids::SPYGLASS), "Spyglass"));
//the meta values for buckets are intentionally hardcoded because block IDs will change in the future
$this->register(new LiquidBucket(new IID(Ids::WATER_BUCKET), "Water Bucket", Blocks::WATER()));
@ -235,6 +234,7 @@ class ItemFactory{
$this->register(new ItemBlockWallOrFloor(new IID(Ids::WARPED_SIGN), Blocks::WARPED_SIGN(), Blocks::WARPED_WALL_SIGN()));
$this->register(new Snowball(new IID(Ids::SNOWBALL), "Snowball"));
$this->register(new SpiderEye(new IID(Ids::SPIDER_EYE), "Spider Eye"));
$this->register(new Spyglass(new IID(Ids::SPYGLASS), "Spyglass"));
$this->register(new Steak(new IID(Ids::STEAK), "Steak"));
$this->register(new Stick(new IID(Ids::STICK), "Stick"));
$this->register(new StringItem(new IID(Ids::STRING), "String"));

31
src/item/Spyglass.php Normal file
View File

@ -0,0 +1,31 @@
<?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 Spyglass extends Item{
public function getMaxStackSize() : int{
return 1;
}
}

View File

@ -249,7 +249,7 @@ use pocketmine\utils\CloningRegistryTrait;
* @method static SplashPotion SPLASH_POTION()
* @method static Boat SPRUCE_BOAT()
* @method static ItemBlockWallOrFloor SPRUCE_SIGN()
* @method static Item SPYGLASS()
* @method static Spyglass SPYGLASS()
* @method static SpawnEgg SQUID_SPAWN_EGG()
* @method static Steak STEAK()
* @method static Stick STICK()