forked from df-mc/dragonfly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cobblestone.go
44 lines (36 loc) · 1.08 KB
/
cobblestone.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
package block
import "github.com/Adrian8115/dragonfly-Amethyst-Protocol/server/item"
// Cobblestone is a common block, obtained from mining stone.
type Cobblestone struct {
solid
bassDrum
// Mossy specifies if the cobblestone is mossy. This variant of cobblestone is typically found in
// dungeons or in small clusters in the giant tree taiga biome.
Mossy bool
}
// BreakInfo ...
func (c Cobblestone) BreakInfo() BreakInfo {
return newBreakInfo(2, pickaxeHarvestable, pickaxeEffective, oneOf(c)).withBlastResistance(30)
}
// SmeltInfo ...
func (Cobblestone) SmeltInfo() item.SmeltInfo {
return newSmeltInfo(item.NewStack(Stone{}, 1), 0.1)
}
// RepairsStoneTools ...
func (c Cobblestone) RepairsStoneTools() bool {
return !c.Mossy
}
// EncodeItem ...
func (c Cobblestone) EncodeItem() (name string, meta int16) {
if c.Mossy {
return "minecraft:mossy_cobblestone", 0
}
return "minecraft:cobblestone", 0
}
// EncodeBlock ...
func (c Cobblestone) EncodeBlock() (string, map[string]any) {
if c.Mossy {
return "minecraft:mossy_cobblestone", nil
}
return "minecraft:cobblestone", nil
}