Files
mc/server/block/prismarine.go
T
TarnaWijaya 26ed99fda6
Build and deploy / Build (push) Has been cancelled
Build and deploy / Update Contributors (push) Has been cancelled
Build and deploy / Deploy (push) Has been cancelled
up3
2026-07-09 08:33:57 +08:00

38 lines
896 B
Go

package block
import (
"github.com/df-mc/dragonfly/server/world"
)
// Prismarine is a type of stone that appears underwater in ruins and ocean monuments.
type Prismarine struct {
solid
bassDrum
// Type is the type of prismarine of the block.
Type PrismarineType
}
// BreakInfo ...
func (p Prismarine) BreakInfo() BreakInfo {
return newBreakInfo(1.5, pickaxeHarvestable, pickaxeEffective, oneOf(p)).withBlastResistance(30)
}
// EncodeItem ...
func (p Prismarine) EncodeItem() (id string, meta int16) {
return "minecraft:" + p.Type.String(), 0
}
// EncodeBlock ...
func (p Prismarine) EncodeBlock() (name string, properties map[string]any) {
return "minecraft:" + p.Type.String(), nil
}
// allPrismarine returns a list of all prismarine block variants.
func allPrismarine() (c []world.Block) {
for _, t := range PrismarineTypes() {
c = append(c, Prismarine{Type: t})
}
return
}