forked from df-mc/dragonfly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iron_ore.go
40 lines (33 loc) · 984 Bytes
/
iron_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"
)
// IronOre is a mineral block found underground.
type IronOre struct {
solid
bassDrum
// Type is the type of iron ore.
Type OreType
}
// BreakInfo ...
func (i IronOre) BreakInfo() BreakInfo {
b := newBreakInfo(i.Type.Hardness(), func(t item.Tool) bool {
return t.ToolType() == item.TypePickaxe && t.HarvestLevel() >= item.ToolTierStone.HarvestLevel
}, pickaxeEffective, silkTouchOneOf(item.RawIron{}, i))
if i.Type == DeepslateOre() {
b = b.withBlastResistance(9)
}
return b
}
// SmeltInfo ...
func (IronOre) SmeltInfo() item.SmeltInfo {
return newOreSmeltInfo(item.NewStack(item.IronIngot{}, 1), 0.7)
}
// EncodeItem ...
func (i IronOre) EncodeItem() (name string, meta int16) {
return "minecraft:" + i.Type.Prefix() + "iron_ore", 0
}
// EncodeBlock ...
func (i IronOre) EncodeBlock() (string, map[string]any) {
return "minecraft:" + i.Type.Prefix() + "iron_ore", nil
}