mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 20:19:44 +00:00
Update to API 12
This commit is contained in:
parent
731ada7b38
commit
c59b4776ae
149 changed files with 6850 additions and 1918 deletions
|
|
@ -64,17 +64,17 @@ class PineTreeObject extends TreeObject{
|
|||
$firstMaxedRadius = false;
|
||||
for($leavesY = 0; $leavesY <= $leavesBottomY; ++$leavesY) {
|
||||
$yy = $this->totalHeight - $leavesY;
|
||||
for ($xx = -$leavesRadius; $xx <= $leavesRadius; ++$xx) {
|
||||
for ($zz = -$leavesRadius; $zz <= $leavesRadius; ++$zz) {
|
||||
if (abs($xx) != $leavesRadius or abs($zz) != $leavesRadius or $leavesRadius <= 0) {
|
||||
for($xx = -$leavesRadius; $xx <= $leavesRadius; ++$xx) {
|
||||
for($zz = -$leavesRadius; $zz <= $leavesRadius; ++$zz) {
|
||||
if(abs($xx) != $leavesRadius or abs($zz) != $leavesRadius or $leavesRadius <= 0) {
|
||||
$level->setBlockRaw(new Vector3($pos->x + $xx, $pos->y + $yy, $pos->z + $zz), new LeavesBlock($this->type));
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($leavesRadius >= $leavesMaxRadius) {
|
||||
if($leavesRadius >= $leavesMaxRadius) {
|
||||
$leavesRadius = $firstMaxedRadius ? 1 : 0;
|
||||
$firstMaxedRadius = true;
|
||||
if (++$leavesMaxRadius > $this->leavesAbsoluteMaxRadius) {
|
||||
if(++$leavesMaxRadius > $this->leavesAbsoluteMaxRadius) {
|
||||
$leavesMaxRadius = $this->leavesAbsoluteMaxRadius;
|
||||
}
|
||||
}else{
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class SmallTreeObject extends TreeObject{
|
|||
public function canPlaceObject(Level $level, Vector3 $pos, Random $random){
|
||||
$radiusToCheck = 0;
|
||||
for ($yy = 0; $yy < $this->trunkHeight + 3; ++$yy) {
|
||||
if ($yy == 1 or $yy === $this->trunkHeight) {
|
||||
if($yy == 1 or $yy === $this->trunkHeight) {
|
||||
++$radiusToCheck;
|
||||
}
|
||||
for($xx = -$radiusToCheck; $xx < ($radiusToCheck + 1); ++$xx){
|
||||
|
|
@ -94,7 +94,7 @@ class SmallTreeObject extends TreeObject{
|
|||
}
|
||||
|
||||
// Place the trunk last
|
||||
if( $leaflevel > 1 )
|
||||
if($leaflevel > 1)
|
||||
{
|
||||
$trunkpos = new Vector3( $pos->x, $pos->y + $yy, $pos->z );
|
||||
$level->setBlockRaw($trunkpos, new WoodBlock( $this->type ) );
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class SpruceTreeObject extends TreeObject{
|
|||
for($yy = $this->totalHeight; $yy >= $this->leavesBottomY; --$yy){
|
||||
for($xx = -$leavesRadius; $xx <= $leavesRadius; ++$xx) {
|
||||
for($zz = -$leavesRadius; $zz <= $leavesRadius; ++$zz) {
|
||||
if (abs($xx) != $leavesRadius or abs($zz) != $leavesRadius or $leavesRadius <= 0) {
|
||||
if(abs($xx) != $leavesRadius or abs($zz) != $leavesRadius or $leavesRadius <= 0) {
|
||||
$level->setBlockRaw(new Vector3($pos->x + $xx, $pos->y + $yy, $pos->z + $zz), new LeavesBlock($this->type));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue