Item: Removed now-obsolete Cake class

>> As of 1.2, cake has a max stack size of 64, making this class redundant as its only purpose was to declare a stack size of 1.
This commit is contained in:
Dylan K. Taylor 2018-01-25 10:09:09 +00:00
parent 6c71b443e8
commit 3842ee15cf
3 changed files with 2 additions and 40 deletions

View File

@ -45,7 +45,7 @@ class Cake extends Transparent implements FoodSource{
}
public function getName() : string{
return "Cake Block";
return "Cake";
}
protected function recalculateBoundingBox() : ?AxisAlignedBB{

View File

@ -1,38 +0,0 @@
<?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\BlockFactory;
class Cake extends Item{
public function __construct(int $meta = 0){
$this->block = BlockFactory::get(Block::CAKE_BLOCK);
parent::__construct(self::CAKE, $meta, "Cake");
}
public function getMaxStackSize() : int{
return 1;
}
}

View File

@ -136,7 +136,7 @@ class ItemFactory{
self::registerItem(new Dye());
self::registerItem(new Item(Item::BONE, 0, "Bone"));
self::registerItem(new Item(Item::SUGAR, 0, "Sugar"));
self::registerItem(new Cake());
self::registerItem(new ItemBlock(Block::CAKE_BLOCK, 0, Item::CAKE));
self::registerItem(new Bed());
self::registerItem(new ItemBlock(Block::REPEATER_BLOCK, 0, Item::REPEATER));
self::registerItem(new Cookie());