-
Notifications
You must be signed in to change notification settings - Fork 140
/
stained_terracotta.go
39 lines (32 loc) · 1.15 KB
/
stained_terracotta.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package block
import (
"github.com/df-mc/dragonfly/server/world"
)
// StainedTerracotta is a block formed from clay, with a hardness and blast resistance comparable to stone. In contrast
// to Terracotta, t can be coloured in the same 16 colours that wool can be dyed, but more dulled and earthen.
type StainedTerracotta struct {
solid
bassDrum
// Colour specifies the colour of the block.
Colour Colour
}
// BreakInfo ...
func (t StainedTerracotta) BreakInfo() BreakInfo {
return newBreakInfo(1.25, pickaxeHarvestable, pickaxeEffective, oneOf(t))
}
// EncodeItem ...
func (t StainedTerracotta) EncodeItem() (name string, meta int16) {
return "minecraft:stained_hardened_clay", int16(t.Colour.Uint8())
}
// EncodeBlock ...
func (t StainedTerracotta) EncodeBlock() (name string, properties map[string]interface{}) {
return "minecraft:stained_hardened_clay", map[string]interface{}{"color": t.Colour.String()}
}
// allStainedTerracotta returns stained terracotta blocks with all possible colours.
func allStainedTerracotta() []world.Block {
b := make([]world.Block, 0, 16)
for _, c := range Colours() {
b = append(b, StainedTerracotta{Colour: c})
}
return b
}