Improve alignment with stairs when moving

This commit is contained in:
Tom
2020-09-28 19:33:18 -07:00
parent 2bdea5a0f9
commit 176c7a68f6
3 changed files with 44 additions and 6 deletions

View File

@ -50,6 +50,15 @@ func LadderDirection(bStateID world.BlockStatus) Direction {
return Direction(((uint32(bStateID) - block.Ladder.MinStateID) & 0xE) >> 1)
}
func ChestDirection(bStateID world.BlockStatus) Direction {
return Direction(((uint32(bStateID) - block.Chest.MinStateID) / 6) & 0x3)
}
func StairsDirection(bStateID world.BlockStatus) Direction {
b := block.StateID[uint32(bStateID)]
return Direction(((uint32(bStateID) - block.ByID[b].MinStateID) / 20) & 0x3)
}
// Movement represents a single type of movement in a path.
type Movement uint8