File tree Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -1058,6 +1058,13 @@ protected function doFirstSpawn(){
1058
1058
$ this ->spawned = true ;
1059
1059
$ this ->setImmobile (false );
1060
1060
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
+
1061
1068
$ this ->sendPotionEffects ($ this );
1062
1069
1063
1070
$ this ->sendData ($ this );
@@ -2193,20 +2200,19 @@ protected function processLogin(){
2193
2200
return ;
2194
2201
}
2195
2202
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
-
2203
2203
foreach ($ this ->server ->getOnlinePlayers () as $ p ){
2204
2204
if ($ p !== $ this and ($ p ->iusername === $ this ->iusername or $ this ->getUniqueId ()->equals ($ p ->getUniqueId ()))){
2205
2205
$ this ->close ($ this ->getLeaveMessage (), "Игрок с данным ником уже играет, смените ник! " );
2206
2206
return ;
2207
2207
}
2208
2208
}
2209
2209
2210
+ if ($ this ->loggedIn ) {
2211
+ $ this ->server ->getNetwork ()->blockAddress ($ this ->getAddress (), 1203 );
2212
+
2213
+ return ;
2214
+ }
2215
+
2210
2216
$ this ->setNameTag ($ this ->getDisplayName ());
2211
2217
2212
2218
$ nbt = $ this ->server ->getOfflinePlayerData ($ this ->username );
Original file line number Diff line number Diff line change 28
28
29
29
use pocketmine \block \Block ;
30
30
use pocketmine \entity \Entity ;
31
+ use pocketmine \entity \XPOrb ;
31
32
use pocketmine \level \format \io \ChunkException ;
32
33
use pocketmine \level \Level ;
33
34
use pocketmine \nbt \NBT ;
@@ -624,7 +625,7 @@ public function setGenerated(bool $value = true){
624
625
* @param Entity $entity
625
626
*/
626
627
public function addEntity (Entity $ entity ){
627
- if ($ entity ->isClosed ()){
628
+ if ($ entity ->isClosed () and !( $ entity instanceof XPOrb)){ //TODO: очень тупой костыль
628
629
throw new \InvalidArgumentException ("Attempted to add a garbage closed Entity to a chunk " );
629
630
}
630
631
$ this ->entities [$ entity ->getId ()] = $ entity ;
You can’t perform that action at this time.
0 commit comments