mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-20 15:41:33 +00:00
Move potion types to enum
This commit is contained in:
@@ -33,6 +33,7 @@ use pocketmine\block\utils\TreeType;
|
||||
use pocketmine\block\VanillaBlocks;
|
||||
use pocketmine\data\bedrock\DyeColorIdMap;
|
||||
use pocketmine\data\bedrock\EntityLegacyIds;
|
||||
use pocketmine\data\bedrock\PotionTypeIdMap;
|
||||
use pocketmine\entity\Entity;
|
||||
use pocketmine\entity\Location;
|
||||
use pocketmine\entity\Squid;
|
||||
@@ -278,9 +279,10 @@ class ItemFactory{
|
||||
))->setColor($color));
|
||||
}
|
||||
|
||||
foreach(Potion::ALL as $type){
|
||||
$this->register(new Potion(new ItemIdentifier(ItemIds::POTION, $type), "Potion", $type));
|
||||
$this->register(new SplashPotion(new ItemIdentifier(ItemIds::SPLASH_POTION, $type), "Splash Potion", $type));
|
||||
foreach(PotionType::getAll() as $type){
|
||||
$typeId = PotionTypeIdMap::getInstance()->toId($type);
|
||||
$this->register(new Potion(new ItemIdentifier(ItemIds::POTION, $typeId), "Potion", $type));
|
||||
$this->register(new SplashPotion(new ItemIdentifier(ItemIds::SPLASH_POTION, $typeId), "Splash Potion", $type));
|
||||
}
|
||||
|
||||
foreach(TreeType::getAll() as $type){
|
||||
|
Reference in New Issue
Block a user