github.com/df-mc/dragonfly@v0.9.13/server/block/coal_ore.go (about)

     1  package block
     2  
     3  import "github.com/df-mc/dragonfly/server/item"
     4  
     5  // CoalOre is a common ore.
     6  type CoalOre struct {
     7  	solid
     8  	bassDrum
     9  
    10  	// Type is the type of coal ore.
    11  	Type OreType
    12  }
    13  
    14  // BreakInfo ...
    15  func (c CoalOre) BreakInfo() BreakInfo {
    16  	i := newBreakInfo(c.Type.Hardness(), pickaxeHarvestable, pickaxeEffective, silkTouchOneOf(item.Coal{}, c)).withXPDropRange(0, 2)
    17  	if c.Type == DeepslateOre() {
    18  		i = i.withBlastResistance(9)
    19  	}
    20  	return i
    21  }
    22  
    23  // SmeltInfo ...
    24  func (CoalOre) SmeltInfo() item.SmeltInfo {
    25  	return newOreSmeltInfo(item.NewStack(item.Coal{}, 1), 0.1)
    26  }
    27  
    28  // EncodeItem ...
    29  func (c CoalOre) EncodeItem() (name string, meta int16) {
    30  	return "minecraft:" + c.Type.Prefix() + "coal_ore", 0
    31  }
    32  
    33  // EncodeBlock ...
    34  func (c CoalOre) EncodeBlock() (string, map[string]any) {
    35  	return "minecraft:" + c.Type.Prefix() + "coal_ore", nil
    36  
    37  }