github.com/df-mc/dragonfly@v0.9.13/server/block/iron.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  // Iron is a precious metal block made from 9 iron ingots.
     9  type Iron struct {
    10  	solid
    11  }
    12  
    13  // Instrument ...
    14  func (i Iron) Instrument() sound.Instrument {
    15  	return sound.IronXylophone()
    16  }
    17  
    18  // BreakInfo ...
    19  func (i Iron) BreakInfo() BreakInfo {
    20  	return newBreakInfo(5, func(t item.Tool) bool {
    21  		return t.ToolType() == item.TypePickaxe && t.HarvestLevel() >= item.ToolTierStone.HarvestLevel
    22  	}, pickaxeEffective, oneOf(i)).withBlastResistance(30)
    23  }
    24  
    25  // PowersBeacon ...
    26  func (Iron) PowersBeacon() bool {
    27  	return true
    28  }
    29  
    30  // EncodeItem ...
    31  func (Iron) EncodeItem() (name string, meta int16) {
    32  	return "minecraft:iron_block", 0
    33  }
    34  
    35  // EncodeBlock ...
    36  func (Iron) EncodeBlock() (string, map[string]any) {
    37  	return "minecraft:iron_block", nil
    38  }