Implement physics + pathfinding over slabs

This commit is contained in:
Tom
2020-10-12 22:13:02 -07:00
parent 5120b2dd9a
commit 1240aefc38
4 changed files with 102 additions and 21 deletions

View File

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