mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Removed not needed network steps, corrected slot methods
This commit is contained in:
@ -61,9 +61,9 @@ class NoiseGeneratorPerlin extends NoiseGenerator{
|
||||
$y += $this->offsetY;
|
||||
$z += $this->offsetZ;
|
||||
|
||||
$floorX = self::floor($x);
|
||||
$floorY = self::floor($y);
|
||||
$floorZ = self::floor($z);
|
||||
$floorX = (int) floor($x);
|
||||
$floorY = (int) floor($y);
|
||||
$floorZ = (int) floor($z);
|
||||
|
||||
$X = $floorX & 0xFF;
|
||||
$Y = $floorY & 0xFF;
|
||||
|
@ -81,9 +81,9 @@ class NoiseGeneratorSimplex extends NoiseGeneratorPerlin{
|
||||
|
||||
// Skew the input space to determine which simplex cell we're in
|
||||
$s = ($x + $y + $z) * self::$F3; // Very nice and simple skew factor for 3D
|
||||
$i = self::floor($x + $s);
|
||||
$j = self::floor($y + $s);
|
||||
$k = self::floor($z + $s);
|
||||
$i = (int) floor($x + $s);
|
||||
$j = (int) floor($y + $s);
|
||||
$k = (int) floor($z + $s);
|
||||
$t = ($i + $j + $k) * self::$G3;
|
||||
$X0 = $i - $t; // Unskew the cell origin back to (x,y,z) space
|
||||
$Y0 = $j - $t;
|
||||
@ -214,8 +214,8 @@ class NoiseGeneratorSimplex extends NoiseGeneratorPerlin{
|
||||
|
||||
// Skew the input space to determine which simplex cell we're in
|
||||
$s = ($x + $y) * self::$F2; // Hairy factor for 2D
|
||||
$i = self::floor($x + $s);
|
||||
$j = self::floor($y + $s);
|
||||
$i = (int) floor($x + $s);
|
||||
$j = (int) floor($y + $s);
|
||||
$t = ($i + $j) * self::$G2;
|
||||
$X0 = $i - $t; // Unskew the cell origin back to (x,y) space
|
||||
$Y0 = $j - $t;
|
||||
|
@ -60,13 +60,19 @@ class OreObject{
|
||||
$endZ = (int) ($seedZ + $size);
|
||||
|
||||
for($x = $startX; $x <= $endX; ++$x){
|
||||
$sizeX = pow(($x + 0.5 - $seedX) / $size, 2);
|
||||
$sizeX = ($x + 0.5 - $seedX) / $size;
|
||||
$sizeX *= $sizeX;
|
||||
|
||||
if($sizeX < 1){
|
||||
for($y = $startY; $y <= $endY; ++$y){
|
||||
$sizeY = pow(($y + 0.5 - $seedY) / $size, 2);
|
||||
$sizeY = ($y + 0.5 - $seedY) / $size;
|
||||
$sizeY *= $sizeY;
|
||||
|
||||
if($y > 0 and ($sizeX + $sizeY) < 1){
|
||||
for($z = $startZ; $z <= $endZ; ++$z){
|
||||
$sizeZ = pow(($z + 0.5 - $seedZ) / $size, 2);
|
||||
$sizeZ = ($z + 0.5 - $seedZ) / $size;
|
||||
$sizeZ *= $sizeZ;
|
||||
|
||||
if(($sizeX + $sizeY + $sizeZ) < 1 and $level->level->getBlockID($x, $y, $z) === STONE){
|
||||
$level->setBlockRaw(new Vector3($x, $y, $z), $this->type->material);
|
||||
}
|
||||
|
Reference in New Issue
Block a user