mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-19 04:15:04 +00:00
Convert BlockFactory to singleton
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -54,7 +54,7 @@ class ConcretePowder extends Opaque implements Fallable{
|
||||
continue;
|
||||
}
|
||||
if($this->getSide($i) instanceof Water){
|
||||
return BlockFactory::get(BlockLegacyIds::CONCRETE, $this->idInfo->getVariant());
|
||||
return BlockFactory::getInstance()->get(BlockLegacyIds::CONCRETE, $this->idInfo->getVariant());
|
||||
}
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -44,7 +44,7 @@ class FlowerPot extends Spawnable{
|
||||
public function readSaveData(CompoundTag $nbt) : void{
|
||||
if($nbt->hasTag(self::TAG_ITEM, ShortTag::class) and $nbt->hasTag(self::TAG_ITEM_DATA, IntTag::class)){
|
||||
try{
|
||||
$this->setPlant(BlockFactory::get($nbt->getShort(self::TAG_ITEM), $nbt->getInt(self::TAG_ITEM_DATA)));
|
||||
$this->setPlant(BlockFactory::getInstance()->get($nbt->getShort(self::TAG_ITEM), $nbt->getInt(self::TAG_ITEM_DATA)));
|
||||
}catch(\InvalidArgumentException $e){
|
||||
//noop
|
||||
}
|
||||
|
Reference in New Issue
Block a user