Files
mc/server/block/smithing_table.go
TarnaWijaya 26ed99fda6
Build and deploy / Build (push) Has been cancelled
Build and deploy / Update Contributors (push) Has been cancelled
Build and deploy / Deploy (push) Has been cancelled
up3
2026-07-09 08:33:57 +08:00

39 lines
990 B
Go

package block
import (
"github.com/df-mc/dragonfly/server/block/cube"
"github.com/df-mc/dragonfly/server/item"
"github.com/df-mc/dragonfly/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, tx *world.Tx, u item.User, _ *item.UseContext) bool {
if opener, ok := u.(ContainerOpener); ok {
opener.OpenBlockContainer(pos, tx)
return true
}
return false
}