mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-05 19:37:17 +00:00
Avoid unnecessary TypeConverter::getInstance() calls
we already have it available within these contexts
This commit is contained in:
parent
fbcf4649eb
commit
a1748a92ca
@ -1131,12 +1131,12 @@ class NetworkSession{
|
|||||||
*/
|
*/
|
||||||
public function syncPlayerList(array $players) : void{
|
public function syncPlayerList(array $players) : void{
|
||||||
$this->sendDataPacket(PlayerListPacket::add(array_map(function(Player $player) : PlayerListEntry{
|
$this->sendDataPacket(PlayerListPacket::add(array_map(function(Player $player) : PlayerListEntry{
|
||||||
return PlayerListEntry::createAdditionEntry($player->getUniqueId(), $player->getId(), $player->getDisplayName(), TypeConverter::getInstance()->getSkinAdapter()->toSkinData($player->getSkin()), $player->getXuid());
|
return PlayerListEntry::createAdditionEntry($player->getUniqueId(), $player->getId(), $player->getDisplayName(), $this->typeConverter->getSkinAdapter()->toSkinData($player->getSkin()), $player->getXuid());
|
||||||
}, $players)));
|
}, $players)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onPlayerAdded(Player $p) : void{
|
public function onPlayerAdded(Player $p) : void{
|
||||||
$this->sendDataPacket(PlayerListPacket::add([PlayerListEntry::createAdditionEntry($p->getUniqueId(), $p->getId(), $p->getDisplayName(), TypeConverter::getInstance()->getSkinAdapter()->toSkinData($p->getSkin()), $p->getXuid())]));
|
$this->sendDataPacket(PlayerListPacket::add([PlayerListEntry::createAdditionEntry($p->getUniqueId(), $p->getId(), $p->getDisplayName(), $this->typeConverter->getSkinAdapter()->toSkinData($p->getSkin()), $p->getXuid())]));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onPlayerRemoved(Player $p) : void{
|
public function onPlayerRemoved(Player $p) : void{
|
||||||
|
2
src/network/mcpe/cache/CraftingDataCache.php
vendored
2
src/network/mcpe/cache/CraftingDataCache.php
vendored
@ -160,7 +160,7 @@ final class CraftingDataCache{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$potionContainerChangeRecipes = [];
|
$potionContainerChangeRecipes = [];
|
||||||
$itemTypeDictionary = TypeConverter::getInstance()->getItemTypeDictionary();
|
$itemTypeDictionary = $converter->getItemTypeDictionary();
|
||||||
foreach($manager->getPotionContainerChangeRecipes() as $recipe){
|
foreach($manager->getPotionContainerChangeRecipes() as $recipe){
|
||||||
$input = $itemTypeDictionary->fromStringId($recipe->getInputItemId());
|
$input = $itemTypeDictionary->fromStringId($recipe->getInputItemId());
|
||||||
$ingredient = $converter->coreRecipeIngredientToNet($recipe->getIngredient())->getDescriptor();
|
$ingredient = $converter->coreRecipeIngredientToNet($recipe->getIngredient())->getDescriptor();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user