mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 20:14:31 +00:00
Convert BlockFactory to singleton
This commit is contained in:
@@ -50,7 +50,7 @@ class ItemBlock extends Item{
|
||||
}
|
||||
|
||||
public function getBlock() : Block{
|
||||
return BlockFactory::get($this->blockId, $this->meta === -1 ? 0 : $this->meta & 0xf);
|
||||
return BlockFactory::getInstance()->get($this->blockId, $this->meta === -1 ? 0 : $this->meta & 0xf);
|
||||
}
|
||||
|
||||
public function getFuelTime() : int{
|
||||
|
@@ -467,7 +467,7 @@ class ItemFactory{
|
||||
*/
|
||||
public static function isRegistered(int $id, int $variant = 0) : bool{
|
||||
if($id < 256){
|
||||
return BlockFactory::isRegistered($id);
|
||||
return BlockFactory::getInstance()->isRegistered($id);
|
||||
}
|
||||
|
||||
return isset(self::$list[self::getListOffset($id, $variant)]);
|
||||
|
Reference in New Issue
Block a user