-
Notifications
You must be signed in to change notification settings - Fork 140
/
obsidian.go
45 lines (39 loc) · 1.05 KB
/
obsidian.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
41
42
43
44
45
package block
import (
"github.com/df-mc/dragonfly/server/item/tool"
)
// Obsidian is a dark purple block known for its high blast resistance and strength, most commonly found when
// water flows over lava.
type Obsidian struct {
solid
bassDrum
// Crying specifies if the block is a crying obsidian block. If true, the block is blue and emits light.
Crying bool
}
// LightEmissionLevel ...
func (o Obsidian) LightEmissionLevel() uint8 {
if o.Crying {
return 10
}
return 0
}
// EncodeItem ...
func (o Obsidian) EncodeItem() (name string, meta int16) {
if o.Crying {
return "minecraft:crying_obsidian", 0
}
return "minecraft:obsidian", 0
}
// EncodeBlock ...
func (o Obsidian) EncodeBlock() (string, map[string]interface{}) {
if o.Crying {
return "minecraft:crying_obsidian", nil
}
return "minecraft:obsidian", nil
}
// BreakInfo ...
func (o Obsidian) BreakInfo() BreakInfo {
return newBreakInfo(50, func(t tool.Tool) bool {
return t.ToolType() == tool.TypePickaxe && t.HarvestLevel() >= tool.TierDiamond.HarvestLevel
}, pickaxeEffective, oneOf(o))
}