Files

34 lines
789 B
Go
Raw Permalink Normal View History

2026-07-09 08:33:57 +08:00
package block
import "github.com/df-mc/dragonfly/server/item"
// CoalOre is a common ore.
type CoalOre struct {
solid
bassDrum
// Type is the type of coal ore.
Type OreType
}
// BreakInfo ...
func (c CoalOre) BreakInfo() BreakInfo {
return newBreakInfo(c.Type.Hardness(), pickaxeHarvestable, pickaxeEffective, oreDrops(item.Coal{}, c)).withXPDropRange(0, 2).withBlastResistance(15)
}
// SmeltInfo ...
func (CoalOre) SmeltInfo() item.SmeltInfo {
return newOreSmeltInfo(item.NewStack(item.Coal{}, 1), 0.1)
}
// EncodeItem ...
func (c CoalOre) EncodeItem() (name string, meta int16) {
return "minecraft:" + c.Type.Prefix() + "coal_ore", 0
}
// EncodeBlock ...
func (c CoalOre) EncodeBlock() (string, map[string]any) {
return "minecraft:" + c.Type.Prefix() + "coal_ore", nil
}