forked from df-mc/dragonfly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
coal_ore.go
37 lines (29 loc) · 867 Bytes
/
coal_ore.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
package block
import "github.com/Adrian8115/dragonfly-Amethyst-Protocol/server/item"
// CoalOre is a common ore.
type CoalOre struct {
solid
bassDrum
// Type is the type of coal ore.
Type OreType
}
// BreakInfo ...
func (c CoalOre) BreakInfo() BreakInfo {
i := newBreakInfo(c.Type.Hardness(), pickaxeHarvestable, pickaxeEffective, silkTouchOneOf(item.Coal{}, c)).withXPDropRange(0, 2)
if c.Type == DeepslateOre() {
i = i.withBlastResistance(9)
}
return i
}
// SmeltInfo ...
func (CoalOre) SmeltInfo() item.SmeltInfo {
return newOreSmeltInfo(item.NewStack(item.Coal{}, 1), 0.1)
}
// EncodeItem ...
func (c CoalOre) EncodeItem() (name string, meta int16) {
return "minecraft:" + c.Type.Prefix() + "coal_ore", 0
}
// EncodeBlock ...
func (c CoalOre) EncodeBlock() (string, map[string]any) {
return "minecraft:" + c.Type.Prefix() + "coal_ore", nil
}