github.com/df-mc/dragonfly@v0.9.13/server/block/model/ladder.go (about)

     1  package model
     2  
     3  import (
     4  	"github.com/df-mc/dragonfly/server/block/cube"
     5  	"github.com/df-mc/dragonfly/server/world"
     6  )
     7  
     8  // Ladder is the model for a ladder block.
     9  type Ladder struct {
    10  	// Facing is the side opposite to the block the Ladder is currently attached to.
    11  	Facing cube.Direction
    12  }
    13  
    14  // BBox returns one physics.BBox that depends on the facing direction of the Ladder.
    15  func (l Ladder) BBox(cube.Pos, *world.World) []cube.BBox {
    16  	return []cube.BBox{full.ExtendTowards(l.Facing.Face(), -0.8125)}
    17  }
    18  
    19  // FaceSolid always returns false.
    20  func (l Ladder) FaceSolid(cube.Pos, cube.Face, *world.World) bool {
    21  	return false
    22  }