github.com/df-mc/dragonfly@v0.9.13/server/item/enchantment/flame.go (about)

     1  package enchantment
     2  
     3  import (
     4  	"github.com/df-mc/dragonfly/server/item"
     5  	"github.com/df-mc/dragonfly/server/world"
     6  	"time"
     7  )
     8  
     9  // Flame turns your arrows into flaming arrows allowing you to set your targets on fire.
    10  type Flame struct{}
    11  
    12  // Name ...
    13  func (Flame) Name() string {
    14  	return "Flame"
    15  }
    16  
    17  // MaxLevel ...
    18  func (Flame) MaxLevel() int {
    19  	return 1
    20  }
    21  
    22  // Cost ...
    23  func (Flame) Cost(int) (int, int) {
    24  	return 20, 50
    25  }
    26  
    27  // Rarity ...
    28  func (Flame) Rarity() item.EnchantmentRarity {
    29  	return item.EnchantmentRarityRare
    30  }
    31  
    32  // BurnDuration always returns a hundred seconds, no matter the level.
    33  func (Flame) BurnDuration() time.Duration {
    34  	return time.Second * 100
    35  }
    36  
    37  // CompatibleWithEnchantment ...
    38  func (Flame) CompatibleWithEnchantment(item.EnchantmentType) bool {
    39  	return true
    40  }
    41  
    42  // CompatibleWithItem ...
    43  func (Flame) CompatibleWithItem(i world.Item) bool {
    44  	_, ok := i.(item.Bow)
    45  	return ok
    46  }