forked from df-mc/dragonfly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
polished_blackstone_brick.go
43 lines (36 loc) · 1.14 KB
/
polished_blackstone_brick.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
40
41
42
43
package block
import "github.com/Adrian8115/dragonfly-Amethyst-Protocol/server/item"
// PolishedBlackstoneBrick are a brick variant of polished blackstone and can spawn in bastion remnants and ruined portals.
type PolishedBlackstoneBrick struct {
solid
bassDrum
// Cracked specifies if the polished blackstone bricks is its cracked variant.
Cracked bool
}
// BreakInfo ...
func (b PolishedBlackstoneBrick) BreakInfo() BreakInfo {
return newBreakInfo(1.5, pickaxeHarvestable, pickaxeEffective, oneOf(b)).withBlastResistance(30)
}
// SmeltInfo ...
func (b PolishedBlackstoneBrick) SmeltInfo() item.SmeltInfo {
if b.Cracked {
return item.SmeltInfo{}
}
return newSmeltInfo(item.NewStack(PolishedBlackstoneBrick{Cracked: true}, 1), 0.1)
}
// EncodeItem ...
func (b PolishedBlackstoneBrick) EncodeItem() (name string, meta int16) {
name = "polished_blackstone_bricks"
if b.Cracked {
name = "cracked_" + name
}
return "minecraft:" + name, 0
}
// EncodeBlock ...
func (b PolishedBlackstoneBrick) EncodeBlock() (string, map[string]any) {
name := "polished_blackstone_bricks"
if b.Cracked {
name = "cracked_" + name
}
return "minecraft:" + name, nil
}