mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 01:09:44 +00:00
Fixed setting chunks on non-loaded regions
This commit is contained in:
parent
a5e78d775b
commit
ed5325c069
@ -183,6 +183,7 @@ class Anvil extends BaseLevelProvider{
|
||||
public function setChunk($chunkX, $chunkZ, SimpleChunk $chunk){
|
||||
if($chunk->isGenerated() === false){
|
||||
$this->unloadChunk($chunkX, $chunkZ, false);
|
||||
$this->loadRegion($chunkX >> 4, $chunkZ >> 4);
|
||||
$region = $this->getRegion($chunkX >> 4, $chunkZ >> 4);
|
||||
$region->removeChunk($chunkX - $region->getX() * 32, $chunkZ - $region->getZ() * 32);
|
||||
$this->loadChunk($chunkX, $chunkZ);
|
||||
|
@ -63,8 +63,12 @@ class GenerationThread extends \Thread{
|
||||
|
||||
$this->internalSocket = $sockets[0];
|
||||
socket_set_block($this->internalSocket); //IMPORTANT!
|
||||
@socket_set_option($this->internalSocket, SOL_SOCKET, SO_SNDBUF, 1024 * 1024 * 2);
|
||||
@socket_set_option($this->internalSocket, SOL_SOCKET, SO_RCVBUF, 1024 * 1024 * 2);
|
||||
$this->externalSocket = $sockets[1];
|
||||
socket_set_nonblock($this->externalSocket);
|
||||
@socket_set_option($this->externalSocket, SOL_SOCKET, SO_SNDBUF, 1024 * 1024 * 2);
|
||||
@socket_set_option($this->externalSocket, SOL_SOCKET, SO_RCVBUF, 1024 * 1024 * 2);
|
||||
|
||||
$this->start(PTHREADS_INHERIT_ALL & ~PTHREADS_INHERIT_CLASSES);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user