github.com/df-mc/dragonfly@v0.9.13/server/entity/effect/haste.go (about) 1 package effect 2 3 import ( 4 "image/color" 5 ) 6 7 // Haste is a lasting effect that increases the mining speed of a player by 20% for each level of the effect. 8 type Haste struct { 9 nopLasting 10 } 11 12 // Multiplier returns the mining speed multiplier from this effect. 13 func (Haste) Multiplier(lvl int) float64 { 14 v := 1 - float64(lvl)*0.1 15 if v < 0 { 16 v = 0 17 } 18 return v 19 } 20 21 // RGBA ... 22 func (Haste) RGBA() color.RGBA { 23 return color.RGBA{R: 0xd9, G: 0xc0, B: 0x43, A: 0xff} 24 }