mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-06 01:51:51 +00:00
Correct slab placement
This commit is contained in:
parent
c3eec804f0
commit
f2868f386e
1
TODO.md
1
TODO.md
@ -8,7 +8,6 @@ __Check Milestones [here](https://github.com/shoghicp/PocketMine-MP/issues/miles
|
|||||||
## Alpha (full Creative)
|
## Alpha (full Creative)
|
||||||
- Block Updates
|
- Block Updates
|
||||||
- Random Chunk Updates
|
- Random Chunk Updates
|
||||||
- Placing Half Slabs
|
|
||||||
- Water/lava spread
|
- Water/lava spread
|
||||||
- Opening/closing doors, fence gates, trapdoors (reflect it to all players)
|
- Opening/closing doors, fence gates, trapdoors (reflect it to all players)
|
||||||
- Fix spawn position resetting
|
- Fix spawn position resetting
|
||||||
|
@ -119,7 +119,21 @@ class BlockAPI{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if(!isset(Material::$replaceable[$target[0]])){
|
$replace = false;
|
||||||
|
switch($target[0]){
|
||||||
|
case 44: //Slabs
|
||||||
|
if($data["face"] !== 1){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(($target[1] & 0x07) === ($data["meta"] & 0x07)){
|
||||||
|
$replace = true;
|
||||||
|
$data["block"] = 43;
|
||||||
|
$data["meta"] = $data["meta"] & 0x07;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($replace === false){
|
||||||
switch($data["face"]){
|
switch($data["face"]){
|
||||||
case 0:
|
case 0:
|
||||||
--$data["y"];
|
--$data["y"];
|
||||||
@ -140,14 +154,15 @@ class BlockAPI{
|
|||||||
++$data["x"];
|
++$data["x"];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//}
|
}
|
||||||
|
|
||||||
if($data["y"] >= 127){
|
if($data["y"] >= 127){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$block = $this->server->api->level->getBlock($data["x"], $data["y"], $data["z"]);
|
$block = $this->server->api->level->getBlock($data["x"], $data["y"], $data["z"]);
|
||||||
|
|
||||||
if(!isset(Material::$replaceable[$block[0]])){
|
if($replace === false and !isset(Material::$replaceable[$block[0]])){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -297,7 +297,7 @@ class Player{
|
|||||||
break;
|
break;
|
||||||
case MC_REQUEST_CHUNK:
|
case MC_REQUEST_CHUNK:
|
||||||
$this->actionQueue('
|
$this->actionQueue('
|
||||||
$max = floor(($this->MTU - 16 - 255) / 192);
|
$max = max(1, floor(($this->MTU - 16 - 255) / 192) - 1);
|
||||||
$chunk = $this->server->api->level->getOrderedChunk('.$data["x"].', '.$data["z"].', $max);
|
$chunk = $this->server->api->level->getOrderedChunk('.$data["x"].', '.$data["z"].', $max);
|
||||||
foreach($chunk as $d){
|
foreach($chunk as $d){
|
||||||
$this->dataPacket(MC_CHUNK_DATA, array(
|
$this->dataPacket(MC_CHUNK_DATA, array(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user