github.com/df-mc/dragonfly@v0.9.13/server/block/model/skull.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  // Skull is a model used by skull blocks.
     9  type Skull struct {
    10  	// Direction is the direction the skull is facing.
    11  	Direction cube.Face
    12  	// Hanging specifies if the Skull is hanging on a wall.
    13  	Hanging bool
    14  }
    15  
    16  // BBox ...
    17  func (s Skull) BBox(cube.Pos, *world.World) []cube.BBox {
    18  	box := cube.Box(0.25, 0, 0.25, 0.75, 0.5, 0.75)
    19  	if !s.Hanging {
    20  		return []cube.BBox{box}
    21  	}
    22  	return []cube.BBox{box.TranslateTowards(s.Direction.Opposite(), 0.25).TranslateTowards(cube.FaceUp, 0.25)}
    23  }
    24  
    25  // FaceSolid ...
    26  func (Skull) FaceSolid(cube.Pos, cube.Face, *world.World) bool {
    27  	return false
    28  }