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

     1  package effect
     2  
     3  import (
     4  	"github.com/df-mc/dragonfly/server/world"
     5  	"image/color"
     6  	"time"
     7  )
     8  
     9  // Saturation is a lasting effect that causes the affected player to regain food and saturation.
    10  type Saturation struct {
    11  	nopLasting
    12  }
    13  
    14  // Apply ...
    15  func (Saturation) Apply(e world.Entity, lvl int, _ time.Duration) {
    16  	if i, ok := e.(interface {
    17  		Saturate(food int, saturation float64)
    18  	}); ok {
    19  		i.Saturate(lvl, 2*float64(lvl))
    20  	}
    21  }
    22  
    23  // RGBA ...
    24  func (Saturation) RGBA() color.RGBA {
    25  	return color.RGBA{R: 0xf8, G: 0x24, B: 0x23, A: 0xff}
    26  }