mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 20:07:09 +00:00
Fixed chunk rotation on McRegion-based worlds
This commit is contained in:
parent
171de939cd
commit
7c68e42a86
@ -78,15 +78,15 @@ class Chunk extends BaseFullChunk{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getBlockId($x, $y, $z){
|
public function getBlockId($x, $y, $z){
|
||||||
return ord($this->blocks{($z << 11) + ($x << 7) + $y});
|
return ord($this->blocks{($x << 11) + ($z << 7) + $y});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setBlockId($x, $y, $z, $id){
|
public function setBlockId($x, $y, $z, $id){
|
||||||
$this->blocks{($z << 11) + ($x << 7) + $y} = chr($id);
|
$this->blocks{($x << 11) + ($z << 7) + $y} = chr($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBlockData($x, $y, $z){
|
public function getBlockData($x, $y, $z){
|
||||||
$m = ord($this->data{($z << 10) + ($x << 6) + ($y >> 1)});
|
$m = ord($this->data{($x << 10) + ($z << 6) + ($y >> 1)});
|
||||||
if(($y & 1) === 0){
|
if(($y & 1) === 0){
|
||||||
return $m >> 4;
|
return $m >> 4;
|
||||||
}else{
|
}else{
|
||||||
@ -95,7 +95,7 @@ class Chunk extends BaseFullChunk{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function setBlockData($x, $y, $z, $data){
|
public function setBlockData($x, $y, $z, $data){
|
||||||
$i = ($z << 10) + ($x << 6) + ($y >> 1);
|
$i = ($x << 10) + ($z << 6) + ($y >> 1);
|
||||||
$old_m = ord($this->data{$i});
|
$old_m = ord($this->data{$i});
|
||||||
if(($y & 1) === 0){
|
if(($y & 1) === 0){
|
||||||
$this->data{$i} = chr((($data & 0x0f) << 4) | ($old_m & 0x0f));
|
$this->data{$i} = chr((($data & 0x0f) << 4) | ($old_m & 0x0f));
|
||||||
@ -105,7 +105,7 @@ class Chunk extends BaseFullChunk{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getBlock($x, $y, $z, &$blockId, &$meta = null){
|
public function getBlock($x, $y, $z, &$blockId, &$meta = null){
|
||||||
$i = ($z << 11) + ($x << 7) + $y;
|
$i = ($x << 11) + ($z << 7) + $y;
|
||||||
$blockId = ord($this->blocks{$i});
|
$blockId = ord($this->blocks{$i});
|
||||||
$m = ord($this->data{$i >> 1});
|
$m = ord($this->data{$i >> 1});
|
||||||
if(($y & 1) === 0){
|
if(($y & 1) === 0){
|
||||||
@ -116,7 +116,7 @@ class Chunk extends BaseFullChunk{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function setBlock($x, $y, $z, $blockId = null, $meta = null){
|
public function setBlock($x, $y, $z, $blockId = null, $meta = null){
|
||||||
$i = ($z << 11) + ($x << 7) + $y;
|
$i = ($x << 11) + ($z << 7) + $y;
|
||||||
|
|
||||||
$changed = false;
|
$changed = false;
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ class Chunk extends BaseFullChunk{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getBlockSkyLight($x, $y, $z){
|
public function getBlockSkyLight($x, $y, $z){
|
||||||
$sl = ord($this->skyLight{($z << 10) + ($x << 6) + ($y >> 1)});
|
$sl = ord($this->skyLight{($x << 10) + ($z << 6) + ($y >> 1)});
|
||||||
if(($y & 1) === 0){
|
if(($y & 1) === 0){
|
||||||
return $sl >> 4;
|
return $sl >> 4;
|
||||||
}else{
|
}else{
|
||||||
@ -157,7 +157,7 @@ class Chunk extends BaseFullChunk{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function setBlockSkyLight($x, $y, $z, $level){
|
public function setBlockSkyLight($x, $y, $z, $level){
|
||||||
$i = ($z << 10) + ($x << 6) + ($y >> 1);
|
$i = ($x << 10) + ($z << 6) + ($y >> 1);
|
||||||
$old_sl = ord($this->skyLight{$i});
|
$old_sl = ord($this->skyLight{$i});
|
||||||
if(($y & 1) === 0){
|
if(($y & 1) === 0){
|
||||||
$this->skyLight{$i} = chr((($level & 0x0f) << 4) | ($old_sl & 0x0f));
|
$this->skyLight{$i} = chr((($level & 0x0f) << 4) | ($old_sl & 0x0f));
|
||||||
@ -167,7 +167,7 @@ class Chunk extends BaseFullChunk{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getBlockLight($x, $y, $z){
|
public function getBlockLight($x, $y, $z){
|
||||||
$l = ord($this->blockLight{($z << 10) + ($x << 6) + ($y >> 1)});
|
$l = ord($this->blockLight{($x << 10) + ($z << 6) + ($y >> 1)});
|
||||||
if(($y & 1) === 0){
|
if(($y & 1) === 0){
|
||||||
return $l >> 4;
|
return $l >> 4;
|
||||||
}else{
|
}else{
|
||||||
@ -176,7 +176,7 @@ class Chunk extends BaseFullChunk{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function setBlockLight($x, $y, $z, $level){
|
public function setBlockLight($x, $y, $z, $level){
|
||||||
$i = ($z << 10) + ($x << 6) + ($y >> 1);
|
$i = ($x << 10) + ($z << 6) + ($y >> 1);
|
||||||
$old_l = ord($this->blockLight{$i});
|
$old_l = ord($this->blockLight{$i});
|
||||||
if(($y & 1) === 0){
|
if(($y & 1) === 0){
|
||||||
$this->blockLight{$i} = chr((($level & 0x0f) << 4) | ($old_l & 0x0f));
|
$this->blockLight{$i} = chr((($level & 0x0f) << 4) | ($old_l & 0x0f));
|
||||||
@ -186,19 +186,19 @@ class Chunk extends BaseFullChunk{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getBlockIdColumn($x, $z){
|
public function getBlockIdColumn($x, $z){
|
||||||
return substr($this->blocks, ($z << 11) + ($x << 7), 128);
|
return substr($this->blocks, ($x << 11) + ($z << 7), 128);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBlockDataColumn($x, $z){
|
public function getBlockDataColumn($x, $z){
|
||||||
return substr($this->data, ($z << 10) + ($x << 6), 64);
|
return substr($this->data, ($x << 10) + ($z << 6), 64);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBlockSkyLightColumn($x, $z){
|
public function getBlockSkyLightColumn($x, $z){
|
||||||
return substr($this->skyLight, ($z << 10) + ($x << 6), 64);
|
return substr($this->skyLight, ($x << 10) + ($z << 6), 64);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBlockLightColumn($x, $z){
|
public function getBlockLightColumn($x, $z){
|
||||||
return substr($this->blockLight, ($z << 10) + ($x << 6), 64);
|
return substr($this->blockLight, ($x << 10) + ($z << 6), 64);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4,12 +4,17 @@
|
|||||||
|
|
||||||
settings:
|
settings:
|
||||||
shutdown-message: "Server closed"
|
shutdown-message: "Server closed"
|
||||||
|
#Allow listing plugins via Query
|
||||||
query-plugins: true
|
query-plugins: true
|
||||||
|
#Show a console message when a plugin uses deprecated API methods
|
||||||
deprecated-verbose: true
|
deprecated-verbose: true
|
||||||
|
#Enable plugin and core profiling by default
|
||||||
enable-profiling: false
|
enable-profiling: false
|
||||||
advanced-cache: false
|
advanced-cache: false
|
||||||
upnp-forwarding: false
|
upnp-forwarding: false
|
||||||
|
#Sends anonymous statistics to create usage reports
|
||||||
send-usage: true
|
send-usage: true
|
||||||
|
#Number of AsyncTask workers
|
||||||
async-workers: 4
|
async-workers: 4
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
@ -19,15 +24,21 @@ debug:
|
|||||||
commands: false
|
commands: false
|
||||||
|
|
||||||
level-settings:
|
level-settings:
|
||||||
default-format: mcregion #The default format that levels will use when created
|
#The default format that levels will use when created
|
||||||
convert-format: false #If true, converts from a format that is not the default to the default format on load
|
default-format: mcregion
|
||||||
|
#If true, converts from a format that is not the default to the default format on load
|
||||||
|
convert-format: false
|
||||||
|
|
||||||
chunk-sending:
|
chunk-sending:
|
||||||
|
#Amount of chunks sent to players per tick
|
||||||
per-tick: 4
|
per-tick: 4
|
||||||
compression-level: 9
|
#Compression level used when sending chunks. Higher = more CPU, less bandwidth usage
|
||||||
|
compression-level: 7
|
||||||
|
|
||||||
chunk-ticking:
|
chunk-ticking:
|
||||||
|
#Max amount of chunks processed each tick
|
||||||
per-tick: 80
|
per-tick: 80
|
||||||
|
#Radius of chunks around a player to tick
|
||||||
tick-radius: 2
|
tick-radius: 2
|
||||||
light-updates: false
|
light-updates: false
|
||||||
clear-tick-list: false
|
clear-tick-list: false
|
||||||
@ -47,7 +58,8 @@ spawn-limits:
|
|||||||
water-animals: 5
|
water-animals: 5
|
||||||
ambient: 15
|
ambient: 15
|
||||||
|
|
||||||
auto-report: #Send crash reports for processing
|
auto-report:
|
||||||
|
#Send crash reports for processing
|
||||||
enabled: true
|
enabled: true
|
||||||
send-code: true
|
send-code: true
|
||||||
send-settings: true
|
send-settings: true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user