mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 02:38:54 +00:00
Fixed trees not generating trunk
This commit is contained in:
parent
e09ebb0623
commit
79adbdeafe
@ -51,10 +51,10 @@ class SpruceTree extends Tree{
|
||||
$yyy = $y + $this->treeHeight - $yy;
|
||||
|
||||
for($xx = $x - $radius; $xx <= $x + $radius; ++$xx){
|
||||
$xOff = $xx - $x;
|
||||
$xOff = abs($xx - $x);
|
||||
for($zz = $z - $radius; $zz <= $z + $radius; ++$zz){
|
||||
$zOff = $zz - $z;
|
||||
if(abs($xOff) === $radius and abs($zOff) === $radius and $radius > 0){
|
||||
$zOff = abs($zz - $z);
|
||||
if(($xOff === 0 and $zOff === 0) or ($xOff === $radius and $zOff === $radius and $radius > 0)){
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -99,10 +99,10 @@ abstract class Tree{
|
||||
$yOff = $yy - ($y + $this->treeHeight);
|
||||
$mid = (int) (1 - $yOff / 2);
|
||||
for($xx = $x - $mid; $xx <= $x + $mid; ++$xx){
|
||||
$xOff = $xx - $x;
|
||||
$xOff = abs($xx - $x);
|
||||
for($zz = $z - $mid; $zz <= $z + $mid; ++$zz){
|
||||
$zOff = $zz - $z;
|
||||
if(abs($xOff) === $mid and abs($zOff) === $mid and ($yOff === 0 or $random->nextBoundedInt(2) === 0)){
|
||||
$zOff = abs($zz - $z);
|
||||
if(($xOff === 0 and $zOff === 0) or ($xOff === $mid and $zOff === $mid and ($yOff === 0 or $random->nextBoundedInt(2) === 0))){
|
||||
continue;
|
||||
}
|
||||
$level->setBlockIdAt($xx, $yy, $zz, $this->leafBlock);
|
||||
|
Loading…
x
Reference in New Issue
Block a user