mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
fixed ice collisions
This commit is contained in:
parent
80d78faecd
commit
8684e3092a
2 changed files with 8 additions and 2 deletions
|
|
@ -566,9 +566,10 @@ class Entity extends Position
|
|||
for($x = $x0; $x <= $x1; ++$x){
|
||||
for($y = $y0; $y <= $y1; ++$y){
|
||||
for($z = $z0; $z <= $z1; ++$z){
|
||||
|
||||
$b = $this->level->level->getBlockID($x, $y, $z);
|
||||
if(($b === WATER || $b === STILL_WATER)){
|
||||
$water = $y == ($y1 - 1);
|
||||
if(($b == WATER || $b == STILL_WATER)){
|
||||
$water |= $y == ($y1 - 1);
|
||||
$this->fallDistance = 0;
|
||||
}
|
||||
if($b != 0){
|
||||
|
|
|
|||
|
|
@ -6,6 +6,11 @@ class IceBlock extends TransparentBlock{
|
|||
$this->hardness = 2.5;
|
||||
$this->slipperiness = 0.98;
|
||||
}
|
||||
|
||||
public static function getCollisionBoundingBoxes(Level $level, $x, $y, $z, Entity $entity){
|
||||
return [new AxisAlignedBB($x, $y, $z, $x + 1, $y + 1, $z + 1)];
|
||||
}
|
||||
|
||||
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
$ret = $this->level->setBlock($this, $this, true, false, true);
|
||||
$this->level->scheduleBlockUpdate(new Position($this, 0, 0, $this->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue