From 71c7f66bad7435687c9797537c77aa70eaee3204 Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 6 Jan 2025 23:13:08 -0800 Subject: [PATCH] add jukebox logic --- server/block/jukebox.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/server/block/jukebox.go b/server/block/jukebox.go index 20520bebe..edfb7604e 100644 --- a/server/block/jukebox.go +++ b/server/block/jukebox.go @@ -92,6 +92,7 @@ func (j Jukebox) Activate(pos cube.Pos, _ cube.Face, tx *world.Tx, u item.User, } } } + updateAroundRedstone(pos, tx) return true } @@ -105,6 +106,24 @@ func (j Jukebox) Disc() (sound.DiscType, bool) { return sound.DiscType{}, false } +// WeakPower ... +func (j Jukebox) WeakPower(pos cube.Pos, face cube.Face, tx *world.Tx, accountForDust bool) int { + if !j.Item.Empty() { + return 15 + } + return 0 +} + +// StrongPower ... +func (j Jukebox) StrongPower(pos cube.Pos, face cube.Face, tx *world.Tx, accountForDust bool) int { + return j.WeakPower(pos, face, tx, accountForDust) +} + +// RedstoneSource ... +func (j Jukebox) RedstoneSource() bool { + return !j.Item.Empty() +} + // EncodeNBT ... func (j Jukebox) EncodeNBT() map[string]any { m := map[string]any{"id": "Jukebox"}