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
39 lines
851 B
Go
39 lines
851 B
Go
package block
|
|
|
|
import (
|
|
"github.com/df-mc/dragonfly/server/item"
|
|
"github.com/df-mc/dragonfly/server/world/sound"
|
|
)
|
|
|
|
// Iron is a precious metal block made from 9 iron ingots.
|
|
type Iron struct {
|
|
solid
|
|
}
|
|
|
|
// Instrument ...
|
|
func (i Iron) Instrument() sound.Instrument {
|
|
return sound.IronXylophone()
|
|
}
|
|
|
|
// BreakInfo ...
|
|
func (i Iron) BreakInfo() BreakInfo {
|
|
return newBreakInfo(5, func(t item.Tool) bool {
|
|
return t.ToolType() == item.TypePickaxe && t.HarvestLevel() >= item.ToolTierStone.HarvestLevel
|
|
}, pickaxeEffective, oneOf(i)).withBlastResistance(30)
|
|
}
|
|
|
|
// PowersBeacon ...
|
|
func (Iron) PowersBeacon() bool {
|
|
return true
|
|
}
|
|
|
|
// EncodeItem ...
|
|
func (Iron) EncodeItem() (name string, meta int16) {
|
|
return "minecraft:iron_block", 0
|
|
}
|
|
|
|
// EncodeBlock ...
|
|
func (Iron) EncodeBlock() (string, map[string]any) {
|
|
return "minecraft:iron_block", nil
|
|
}
|