forked from df-mc/dragonfly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
smithing_table.go
38 lines (32 loc) · 1.03 KB
/
smithing_table.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
package block
import (
"github.com/Adrian8115/dragonfly-Amethyst-Protocol/server/block/cube"
"github.com/Adrian8115/dragonfly-Amethyst-Protocol/server/item"
"github.com/Adrian8115/dragonfly-Amethyst-Protocol/server/world"
)
// SmithingTable is a toolsmith's job site block that generates in villages. It can be used to upgrade diamond gear into
// netherite gear.
type SmithingTable struct {
bass
solid
}
// EncodeItem ...
func (SmithingTable) EncodeItem() (name string, meta int16) {
return "minecraft:smithing_table", 0
}
// EncodeBlock ...
func (SmithingTable) EncodeBlock() (name string, properties map[string]interface{}) {
return "minecraft:smithing_table", nil
}
// BreakInfo ...
func (s SmithingTable) BreakInfo() BreakInfo {
return newBreakInfo(2.5, alwaysHarvestable, axeEffective, oneOf(s))
}
// Activate ...
func (SmithingTable) Activate(pos cube.Pos, _ cube.Face, _ *world.World, u item.User, _ *item.UseContext) bool {
if opener, ok := u.(ContainerOpener); ok {
opener.OpenBlockContainer(pos)
return true
}
return false
}