Skip to content

Commit

Permalink
model
Browse files Browse the repository at this point in the history
  • Loading branch information
RestartFU committed May 29, 2024
1 parent c8d6a24 commit 87a894f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
3 changes: 1 addition & 2 deletions server/block/hopper.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ func NewHopper() Hopper {

// Model ...
func (Hopper) Model() world.BlockModel {
// TODO: Implement me.
return model.Solid{}
return model.Hopper{}
}

// SideClosed ...
Expand Down
18 changes: 18 additions & 0 deletions server/block/model/hopper.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package model

import (
"github.com/df-mc/dragonfly/server/block/cube"
"github.com/df-mc/dragonfly/server/world"
)

type Hopper struct{}

// BBox returns a physics.BBox that spans a full block.
func (Hopper) BBox(cube.Pos, *world.World) []cube.BBox {
return []cube.BBox{full}
}

// FaceSolid only returns true for the top face of the hopper.
func (Hopper) FaceSolid(_ cube.Pos, face cube.Face, _ *world.World) bool {
return face == cube.FaceUp
}

0 comments on commit 87a894f

Please sign in to comment.