Skip to content

Commit

Permalink
block/block.go: Allow more blocks to support gravity affected blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
DaPigGuy committed Jan 13, 2025
1 parent 389cab2 commit a321f03
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions server/block/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package block
import (
"github.com/df-mc/dragonfly/server/block/cube"
"github.com/df-mc/dragonfly/server/block/customblock"
"github.com/df-mc/dragonfly/server/block/model"
"github.com/df-mc/dragonfly/server/item"
"github.com/df-mc/dragonfly/server/world"
"github.com/df-mc/dragonfly/server/world/sound"
Expand Down Expand Up @@ -224,9 +223,7 @@ func (g gravityAffected) Solidifies(cube.Pos, *world.Tx) bool {

// fall spawns a falling block entity at the given position.
func (g gravityAffected) fall(b world.Block, pos cube.Pos, tx *world.Tx) {
_, air := tx.Block(pos.Side(cube.FaceDown)).Model().(model.Empty)
_, liquid := tx.Liquid(pos.Side(cube.FaceDown))
if air || liquid {
if replaceableWith(tx, pos.Side(cube.FaceDown), b) {
tx.SetBlock(pos, nil, nil)
opts := world.EntitySpawnOpts{Position: pos.Vec3Centre()}
tx.AddEntity(tx.World().EntityRegistry().Config().FallingBlock(opts, b))
Expand Down

0 comments on commit a321f03

Please sign in to comment.