github.com/df-mc/dragonfly@v0.9.13/server/item/enchantment/soul_speed.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  )
     7  
     8  // SoulSpeed is an enchantment that can be applied on boots and allows the player to walk more quickly on soul sand or
     9  // soul soil.
    10  type SoulSpeed struct{}
    11  
    12  // Name ...
    13  func (SoulSpeed) Name() string {
    14  	return "Soul Speed"
    15  }
    16  
    17  // MaxLevel ...
    18  func (SoulSpeed) MaxLevel() int {
    19  	return 3
    20  }
    21  
    22  // Cost ...
    23  func (SoulSpeed) Cost(level int) (int, int) {
    24  	min := level * 10
    25  	return min, min + 15
    26  }
    27  
    28  // Rarity ...
    29  func (SoulSpeed) Rarity() item.EnchantmentRarity {
    30  	return item.EnchantmentRarityVeryRare
    31  }
    32  
    33  // Treasure ...
    34  func (SoulSpeed) Treasure() bool {
    35  	return true
    36  }
    37  
    38  // CompatibleWithEnchantment ...
    39  func (SoulSpeed) CompatibleWithEnchantment(item.EnchantmentType) bool {
    40  	return true
    41  }
    42  
    43  // CompatibleWithItem ...
    44  func (SoulSpeed) CompatibleWithItem(i world.Item) bool {
    45  	b, ok := i.(item.BootsType)
    46  	return ok && b.Boots()
    47  }