github.com/df-mc/dragonfly@v0.9.13/server/block/emerald.go (about) 1 package block 2 3 import ( 4 "github.com/df-mc/dragonfly/server/item" 5 "github.com/df-mc/dragonfly/server/world/sound" 6 ) 7 8 // Emerald is a precious mineral block crafted using 9 emeralds. 9 type Emerald struct { 10 solid 11 } 12 13 // Instrument ... 14 func (e Emerald) Instrument() sound.Instrument { 15 return sound.Bit() 16 } 17 18 // BreakInfo ... 19 func (e Emerald) BreakInfo() BreakInfo { 20 return newBreakInfo(5, func(t item.Tool) bool { 21 return t.ToolType() == item.TypePickaxe && t.HarvestLevel() >= item.ToolTierIron.HarvestLevel 22 }, pickaxeEffective, oneOf(e)).withBlastResistance(30) 23 } 24 25 // PowersBeacon ... 26 func (Emerald) PowersBeacon() bool { 27 return true 28 } 29 30 // EncodeItem ... 31 func (Emerald) EncodeItem() (name string, meta int16) { 32 return "minecraft:emerald_block", 0 33 } 34 35 // EncodeBlock ... 36 func (Emerald) EncodeBlock() (string, map[string]any) { 37 return "minecraft:emerald_block", nil 38 }