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

     1  package block
     2  
     3  import "github.com/df-mc/dragonfly/server/item"
     4  
     5  // Cobblestone is a common block, obtained from mining stone.
     6  type Cobblestone struct {
     7  	solid
     8  	bassDrum
     9  
    10  	// Mossy specifies if the cobblestone is mossy. This variant of cobblestone is typically found in
    11  	// dungeons or in small clusters in the giant tree taiga biome.
    12  	Mossy bool
    13  }
    14  
    15  // BreakInfo ...
    16  func (c Cobblestone) BreakInfo() BreakInfo {
    17  	return newBreakInfo(2, pickaxeHarvestable, pickaxeEffective, oneOf(c)).withBlastResistance(30)
    18  }
    19  
    20  // SmeltInfo ...
    21  func (Cobblestone) SmeltInfo() item.SmeltInfo {
    22  	return newSmeltInfo(item.NewStack(Stone{}, 1), 0.1)
    23  }
    24  
    25  // RepairsStoneTools ...
    26  func (c Cobblestone) RepairsStoneTools() bool {
    27  	return !c.Mossy
    28  }
    29  
    30  // EncodeItem ...
    31  func (c Cobblestone) EncodeItem() (name string, meta int16) {
    32  	if c.Mossy {
    33  		return "minecraft:mossy_cobblestone", 0
    34  	}
    35  	return "minecraft:cobblestone", 0
    36  }
    37  
    38  // EncodeBlock ...
    39  func (c Cobblestone) EncodeBlock() (string, map[string]any) {
    40  	if c.Mossy {
    41  		return "minecraft:mossy_cobblestone", nil
    42  	}
    43  	return "minecraft:cobblestone", nil
    44  }