mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
fixed setBlock with non int coords
This commit is contained in:
parent
171390260d
commit
11737d0bda
2 changed files with 9 additions and 7 deletions
|
|
@ -24,14 +24,14 @@ class TaskEatTileGoal extends TaskBase
|
|||
|
||||
if (--$this->selfCounter == 4)
|
||||
{
|
||||
$id = $ai->entity->level->level->getBlockID($ai->entity->x, $ai->entity->y, $ai->entity->z);
|
||||
$idb = $ai->entity->level->level->getBlockID($ai->entity->x, $ai->entity->y - 1, $ai->entity->z);
|
||||
$id = $ai->entity->level->level->getBlockID((int)$ai->entity->x, (int)$ai->entity->y, (int)$ai->entity->z);
|
||||
$idb = $ai->entity->level->level->getBlockID((int)$ai->entity->x, (int)$ai->entity->y - 1, (int)$ai->entity->z);
|
||||
if($id === TALL_GRASS){
|
||||
$ai->entity->level->fastSetBlockUpdate($ai->entity->x, $ai->entity->y, $ai->entity->z, AIR, 0);
|
||||
$ai->entity->level->fastSetBlockUpdate((int)$ai->entity->x, (int)$ai->entity->y, (int)$ai->entity->z, AIR, 0);
|
||||
$ai->entity->eatGrass();
|
||||
|
||||
}elseif($idb === GRASS){
|
||||
$ai->entity->level->fastSetBlockUpdate($ai->entity->x, $ai->entity->y - 1, $ai->entity->z, DIRT, 0);
|
||||
$ai->entity->level->fastSetBlockUpdate((int)$ai->entity->x, (int)$ai->entity->y - 1, (int)$ai->entity->z, DIRT, 0);
|
||||
$ai->entity->eatGrass();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -663,9 +663,11 @@ class PMFLevel extends PMF{
|
|||
}elseif($this->chunks[$index][$Y] === false){
|
||||
$this->fillMiniChunk($X, $Z, $Y);
|
||||
}
|
||||
$aX = $x - ($X << 4);
|
||||
$aZ = $z - ($Z << 4);
|
||||
$aY = $y - ($Y << 4);
|
||||
|
||||
$aX = $x & 0xf;
|
||||
$aZ = $z & 0xf;
|
||||
$aY = $y & 0xf;
|
||||
|
||||
$bindex = (int) ($aY + ($aX << 5) + ($aZ << 9));
|
||||
$mindex = (int) (($aY >> 1) + 16 + ($aX << 5) + ($aZ << 9));
|
||||
$old_b = ord($this->chunks[$index][$Y][$bindex]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue