-
Notifications
You must be signed in to change notification settings - Fork 140
/
glass_pane.go
40 lines (33 loc) · 904 Bytes
/
glass_pane.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package block
import (
"github.com/df-mc/dragonfly/server/block/cube"
"github.com/df-mc/dragonfly/server/world"
)
// GlassPane is a transparent block that can be used as a more efficient alternative to glass blocks.
type GlassPane struct {
transparent
thin
clicksAndSticks
}
// CanDisplace ...
func (p GlassPane) CanDisplace(b world.Liquid) bool {
_, water := b.(Water)
return water
}
// SideClosed ...
func (p GlassPane) SideClosed(cube.Pos, cube.Pos, *world.World) bool {
return false
}
// BreakInfo ...
func (p GlassPane) BreakInfo() BreakInfo {
// TODO: Silk touch.
return newBreakInfo(0.3, alwaysHarvestable, nothingEffective, simpleDrops())
}
// EncodeItem ...
func (GlassPane) EncodeItem() (name string, meta int16) {
return "minecraft:glass_pane", meta
}
// EncodeBlock ...
func (GlassPane) EncodeBlock() (string, map[string]interface{}) {
return "minecraft:glass_pane", nil
}