enchantments

package
v0.0.0-...-b9cfb1f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2019 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Protection byte = iota
	FireProtection
	FeatherFalling
	BlastProtection
	ProjectileProtection
	Thorns
	Respiration
	DepthStrider
	AquaAffinity
	Sharpness
	Smite
	BaneOfArthropods
	Knockback
	FireAspect
	Looting
	Efficiency
	SilkTouch
	Unbreaking
	Fortune
	Power
	Punch
	Flame
	Infinity
	LuckOfTheSea
	Lure
	FrostWalker
	Mending
)

Variables

View Source
var DefaultManager = NewManager()

DefaultManager is the default enchantment manager. The init function registers the default enchantments.

Functions

This section is empty.

Types

type Enchantable

type Enchantable struct {
}

type Instance

type Instance struct {
	Type
	// Level is the enchantment level.
	// This value indicates the strength of the
	// enchantment.
	Level byte
}

Instance is an enchantment instance. It holds an enchantment type, and contains the leftover duration of an enchantment, and the value of it.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager provides helper functions for managing enchantments, such as registering, deregistering and checks for those.

func NewManager

func NewManager() *Manager

NewManager returns a new enchantment manager. Maps are allocated, but no default enchantments are registered yet.

func (*Manager) RegisterDefaults

func (manager *Manager) RegisterDefaults()

RegisterDefaults registers all default enchantments. This function should be called whenever a new manager is made, in order to have all default enchantments registered.

type Type

type Type struct {
	// contains filtered or unexported fields
}

Type holds the data of the enchantment. It is an immutable type, which is used to identify an enchantment.

func (Type) GetId

func (t Type) GetId() int16

GetId returns the enchantment ID of a type. It is used mainly to identify an enchantment.

func (Type) GetStringId

func (t Type) GetStringId() string

GetStringId returns the string ID of a type. This string ID may be used to identify enchantments by user output.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL