mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
reworked mob spawn, added mob despawn if far away, mobs will not die if their pos is >255 or <0, getBlockID/getBlock return INVISIBLE_BEDROCK if pos >255 or <0 (xz)
This commit is contained in:
parent
271f82f5ed
commit
9ee4b08657
6 changed files with 98 additions and 25 deletions
|
|
@ -332,7 +332,11 @@ class PMFLevel extends PMF{
|
|||
}
|
||||
|
||||
public function getBlockID($x, $y, $z){
|
||||
if($x < 0 || $x > 255 || $z < 0 || $z > 255 || $y < 0 || $y > 127){
|
||||
if($x < 0 || $x > 255 || $z < 0 || $z > 255){
|
||||
return INVISIBLE_BEDROCK;
|
||||
}
|
||||
|
||||
if($y > 127 || $y < 0){
|
||||
return 0;
|
||||
}
|
||||
$X = $x >> 4;
|
||||
|
|
@ -428,7 +432,10 @@ class PMFLevel extends PMF{
|
|||
}
|
||||
|
||||
public function getBlock($x, $y, $z){
|
||||
if($x < 0 || $x > 255 || $z < 0 || $z > 255 || $y < 0 || $y > 127){
|
||||
if($x < 0 || $x > 255 || $z < 0 || $z > 255){
|
||||
return [INVISIBLE_BEDROCK, 0];
|
||||
}
|
||||
if($y < 0 || $y > 127){
|
||||
return [AIR, 0];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue