forked from df-mc/dragonfly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gold_ore.go
40 lines (33 loc) · 986 Bytes
/
gold_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
38
39
40
package block
import (
"github.com/Adrian8115/dragonfly-Amethyst-Protocol/server/item"
)
// GoldOre is a rare mineral block found underground.
type GoldOre struct {
solid
bassDrum
// Type is the type of gold ore.
Type OreType
}
// BreakInfo ...
func (g GoldOre) BreakInfo() BreakInfo {
i := newBreakInfo(g.Type.Hardness(), func(t item.Tool) bool {
return t.ToolType() == item.TypePickaxe && t.HarvestLevel() >= item.ToolTierIron.HarvestLevel
}, pickaxeEffective, silkTouchOneOf(item.RawGold{}, g))
if g.Type == DeepslateOre() {
i = i.withBlastResistance(9)
}
return i
}
// SmeltInfo ...
func (GoldOre) SmeltInfo() item.SmeltInfo {
return newOreSmeltInfo(item.NewStack(item.GoldIngot{}, 1), 1)
}
// EncodeItem ...
func (g GoldOre) EncodeItem() (name string, meta int16) {
return "minecraft:" + g.Type.Prefix() + "gold_ore", 0
}
// EncodeBlock ...
func (g GoldOre) EncodeBlock() (string, map[string]any) {
return "minecraft:" + g.Type.Prefix() + "gold_ore", nil
}