mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +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)
|
||||
- Block Updates
|
||||
- Random Chunk Updates
|
||||
- Placing Half Slabs
|
||||
- Water/lava spread
|
||||
- Opening/closing doors, fence gates, trapdoors (reflect it to all players)
|
||||
- Fix spawn position resetting
|
||||
|
@ -119,7 +119,21 @@ class BlockAPI{
|
||||
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"]){
|
||||
case 0:
|
||||
--$data["y"];
|
||||
@ -140,14 +154,15 @@ class BlockAPI{
|
||||
++$data["x"];
|
||||
break;
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
if($data["y"] >= 127){
|
||||
return;
|
||||
}
|
||||
|
||||
$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;
|
||||
}
|
||||
|
||||
|
@ -297,7 +297,7 @@ class Player{
|
||||
break;
|
||||
case MC_REQUEST_CHUNK:
|
||||
$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);
|
||||
foreach($chunk as $d){
|
||||
$this->dataPacket(MC_CHUNK_DATA, array(
|
||||
|
Loading…
x
Reference in New Issue
Block a user