mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Added a check above the trapdoor.
Made so that it avoids alternating use of ladders (or vines) and trapdoors.
This commit is contained in:
parent
9125d3f06d
commit
9983a74198
|
|
@ -998,10 +998,15 @@ bool LivingEntity::onLadder()
|
||||||
bool isOpen = (data & 0x4) != 0;
|
bool isOpen = (data & 0x4) != 0;
|
||||||
if (isOpen)
|
if (isOpen)
|
||||||
{
|
{
|
||||||
|
int aboveTile = level->getTile(xt, yt + 1, zt);
|
||||||
int belowTile = level->getTile(xt, yt - 1, zt);
|
int belowTile = level->getTile(xt, yt - 1, zt);
|
||||||
if (belowTile == Tile::ladder_Id)
|
switch (aboveTile)
|
||||||
{
|
{
|
||||||
return true;
|
case Tile::ladder_Id:
|
||||||
|
case Tile::vine_Id:
|
||||||
|
return false; // Opened trapdoor should only be climbable when it's only at the top.
|
||||||
|
default:
|
||||||
|
return belowTile == Tile::ladder_Id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue