Files
mc/server/entity/effect/invisibility.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

41 lines
773 B
Go

package effect
import (
"github.com/df-mc/dragonfly/server/world"
"image/color"
)
// Invisibility is a lasting effect that causes the affected entity to turn
// invisible. While invisible, the entity's armour is still visible and effect
// particles will still be displayed.
var Invisibility invisibility
type invisibility struct {
nopLasting
}
// Start ...
func (invisibility) Start(e world.Entity, _ int) {
if i, ok := e.(interface {
SetInvisible()
SetVisible()
}); ok {
i.SetInvisible()
}
}
// End ...
func (invisibility) End(e world.Entity, _ int) {
if i, ok := e.(interface {
SetInvisible()
SetVisible()
}); ok {
i.SetVisible()
}
}
// RGBA ...
func (invisibility) RGBA() color.RGBA {
return color.RGBA{R: 0xf6, G: 0xf6, B: 0xf6, A: 0xff}
}