Skip to content

Commit 02bfd1b

Browse files
committed
block/vine.go: Do not allow overwriting existing vine blocks
1 parent cf60e08 commit 02bfd1b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

server/block/vine.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ func (v Vines) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.
118118
if !used {
119119
return false
120120
}
121+
if _, ok := tx.Block(pos).(Vines); ok {
122+
// Do not overwrite existing vine block.
123+
return false
124+
}
121125
//noinspection GoAssignmentToReceiver
122126
v = v.SetAttachment(face.Direction().Opposite(), true)
123127

0 commit comments

Comments
 (0)