mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
lava movement
This commit is contained in:
parent
f200683643
commit
0ca6becc6a
5 changed files with 51 additions and 68 deletions
|
|
@ -77,7 +77,26 @@ class Level{
|
|||
}
|
||||
|
||||
//TODO mayPlace
|
||||
|
||||
public function isLavaInBB($aabb){
|
||||
$minX = floor($aabb->minX);
|
||||
$maxX = floor($aabb->maxX + 1);
|
||||
$minY = floor($aabb->minY);
|
||||
$maxY = floor($aabb->maxY + 1);
|
||||
$minZ = floor($aabb->minZ);
|
||||
$maxZ = floor($aabb->maxZ + 1);
|
||||
|
||||
for($x = $minX; $x < $maxX; ++$x){
|
||||
for($y = $minY; $y < $maxY; ++$y){
|
||||
for($z = $minZ; $z < $maxZ; ++$z){
|
||||
$blockId = $this->level->getBlockID($x, $y, $z);
|
||||
|
||||
if($blockId == LAVA || $blockId == STILL_LAVA) return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleMaterialAcceleration(AxisAlignedBB $aabb, $materialType, Entity $entity){
|
||||
$minX = floor($aabb->minX);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue