Skip to content

Commit 3e18e74

Browse files
committed
Fixed resource pack and..
1 parent 7e9a962 commit 3e18e74

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

src/pocketmine/Player.php

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,13 @@ protected function doFirstSpawn(){
10581058
$this->spawned = true;
10591059
$this->setImmobile(false);
10601060

1061+
if($this->hasPermission(Server::BROADCAST_CHANNEL_USERS)){
1062+
$this->server->getPluginManager()->subscribeToPermission(Server::BROADCAST_CHANNEL_USERS, $this);
1063+
}
1064+
if($this->hasPermission(Server::BROADCAST_CHANNEL_ADMINISTRATIVE)){
1065+
$this->server->getPluginManager()->subscribeToPermission(Server::BROADCAST_CHANNEL_ADMINISTRATIVE, $this);
1066+
}
1067+
10611068
$this->sendPotionEffects($this);
10621069

10631070
$this->sendData($this);
@@ -2193,20 +2200,19 @@ protected function processLogin(){
21932200
return;
21942201
}
21952202

2196-
if($this->hasPermission(Server::BROADCAST_CHANNEL_USERS)){
2197-
$this->server->getPluginManager()->subscribeToPermission(Server::BROADCAST_CHANNEL_USERS, $this);
2198-
}
2199-
if($this->hasPermission(Server::BROADCAST_CHANNEL_ADMINISTRATIVE)){
2200-
$this->server->getPluginManager()->subscribeToPermission(Server::BROADCAST_CHANNEL_ADMINISTRATIVE, $this);
2201-
}
2202-
22032203
foreach($this->server->getOnlinePlayers() as $p){
22042204
if($p !== $this and ($p->iusername === $this->iusername or $this->getUniqueId()->equals($p->getUniqueId()))){
22052205
$this->close($this->getLeaveMessage(), "Игрок с данным ником уже играет, смените ник!");
22062206
return;
22072207
}
22082208
}
22092209

2210+
if ($this->loggedIn) {
2211+
$this->server->getNetwork()->blockAddress($this->getAddress(), 1203);
2212+
2213+
return;
2214+
}
2215+
22102216
$this->setNameTag($this->getDisplayName());
22112217

22122218
$nbt = $this->server->getOfflinePlayerData($this->username);

src/pocketmine/level/format/Chunk.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
use pocketmine\block\Block;
3030
use pocketmine\entity\Entity;
31+
use pocketmine\entity\XPOrb;
3132
use pocketmine\level\format\io\ChunkException;
3233
use pocketmine\level\Level;
3334
use pocketmine\nbt\NBT;
@@ -624,7 +625,7 @@ public function setGenerated(bool $value = true){
624625
* @param Entity $entity
625626
*/
626627
public function addEntity(Entity $entity){
627-
if($entity->isClosed()){
628+
if($entity->isClosed() and !($entity instanceof XPOrb)){ //TODO: очень тупой костыль
628629
throw new \InvalidArgumentException("Attempted to add a garbage closed Entity to a chunk");
629630
}
630631
$this->entities[$entity->getId()] = $entity;

0 commit comments

Comments
 (0)