tool

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TierDiamond = Tier{HarvestLevel: 4, Durability: 1561, BaseMiningEfficiency: 8, BaseAttackDamage: 4, Name: "diamond"}

TierDiamond is the tier of diamond tools.

View Source
var TierGold = Tier{HarvestLevel: 1, Durability: 32, BaseMiningEfficiency: 12, BaseAttackDamage: 1, Name: "golden"}

TierGold is the tier of gold tools.

View Source
var TierIron = Tier{HarvestLevel: 3, Durability: 250, BaseMiningEfficiency: 6, BaseAttackDamage: 3, Name: "iron"}

TierIron is the tier of iron tools.

View Source
var TierNetherite = Tier{HarvestLevel: 4, Durability: 2031, BaseMiningEfficiency: 9, BaseAttackDamage: 5, Name: "netherite"}

TierNetherite is the tier of netherite tools. This is the highest possible tier.

View Source
var TierStone = Tier{HarvestLevel: 2, Durability: 131, BaseMiningEfficiency: 4, BaseAttackDamage: 2, Name: "stone"}

TierStone is the tier of stone tools.

View Source
var TierWood = Tier{HarvestLevel: 1, Durability: 59, BaseMiningEfficiency: 2, BaseAttackDamage: 1, Name: "wooden"}

TierWood is the tier of wood tools. This is the lowest possible tier.

View Source
var TypeAxe = Type{t(1)}

TypeAxe is the type for axes.

View Source
var TypeHoe = Type{t(2)}

TypeHoe is the type for hoes.

View Source
var TypeNone = Type{t(-1)}

TypeNone is the type of items that are not tools.

View Source
var TypePickaxe = Type{t(0)}

TypePickaxe is the type for pickaxes.

View Source
var TypeShears = Type{t(4)}

TypeShears is the type for shears.

View Source
var TypeShovel = Type{t(3)}

TypeShovel is the type for shovels.

View Source
var TypeSword = Type{t(5)}

TypeSword is the type for swords.

Functions

This section is empty.

Types

type None

type None struct{}

None is a tool type typically used in functions for items that do not function as tools.

func (None) BaseMiningEfficiency

func (n None) BaseMiningEfficiency(world.Block) float64

BaseMiningEfficiency ...

func (None) HarvestLevel

func (n None) HarvestLevel() int

HarvestLevel ...

func (None) ToolType

func (n None) ToolType() Type

ToolType ...

type Tier

type Tier struct {
	// HarvestLevel is the level that this tier of tools is able to harvest. If a block has a harvest level
	// above this one, a tool with this tier won't be able to harvest it.
	HarvestLevel int
	// BaseMiningEfficiency is the base efficiency of the tier, when it comes to mining blocks. This is
	// specifically used for tools such as pickaxes.
	BaseMiningEfficiency float64
	// BaseAttackDamage is the base attack damage of tools with this tiers. All tools have a constant value
	// that is added on top of this.
	BaseAttackDamage float64
	// BaseDurability returns the maximum durability that a tool with this tier has.
	Durability int
	// Name is the name of the tier.
	Name string
}

Tier represents the tier, or material, that a tool is made of.

func Tiers

func Tiers() []Tier

Tiers returns a list of all tool tiers.

type Tool

type Tool interface {
	// ToolType returns the type of the tool. The blocks that can be mined with this tool depend on this
	// tool type.
	ToolType() Type
	// HarvestLevel returns the level that this tool is able to harvest. If a block has a harvest level above
	// this one, this tool won't be able to harvest it.
	HarvestLevel() int
	// BaseMiningEfficiency is the base efficiency of the tool, when it comes to mining blocks. This decides
	// the speed with which blocks can be mined.
	// Some tools have a mining efficiency that depends on the block (swords, shears). The block mined is
	// passed for this behaviour.
	BaseMiningEfficiency(b world.Block) float64
}

Tool represents an item that may be used as a tool.

type Type

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

Type represents the type of a tool. This decides the type of blocks that the tool is used for.

Jump to

Keyboard shortcuts

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