github.com/df-mc/dragonfly@v0.9.13/server/entity/effect/invisibility.go (about)

     1  package effect
     2  
     3  import (
     4  	"github.com/df-mc/dragonfly/server/world"
     5  	"image/color"
     6  )
     7  
     8  // Invisibility is a lasting effect that causes the affected entity to turn invisible. While invisible, the
     9  // entity's armour is still visible and effect particles will still be displayed.
    10  type Invisibility struct {
    11  	nopLasting
    12  }
    13  
    14  // Start ...
    15  func (Invisibility) Start(e world.Entity, _ int) {
    16  	if i, ok := e.(interface {
    17  		SetInvisible()
    18  		SetVisible()
    19  	}); ok {
    20  		i.SetInvisible()
    21  	}
    22  }
    23  
    24  // End ...
    25  func (Invisibility) End(e world.Entity, _ int) {
    26  	if i, ok := e.(interface {
    27  		SetInvisible()
    28  		SetVisible()
    29  	}); ok {
    30  		i.SetVisible()
    31  	}
    32  }
    33  
    34  // RGBA ...
    35  func (Invisibility) RGBA() color.RGBA {
    36  	return color.RGBA{R: 0x7f, G: 0x83, B: 0x92, A: 0xff}
    37  }