26ed99fda6
Build and deploy / Build (push) Has been cancelled
Build and deploy / Update Contributors (push) Has been cancelled
Build and deploy / Deploy (push) Has been cancelled
28 lines
727 B
Go
28 lines
727 B
Go
package item
|
|
|
|
// FireworkStar is an item used to determine the color, effect, and shape of firework rockets.
|
|
type FireworkStar struct {
|
|
FireworkExplosion
|
|
}
|
|
|
|
// EncodeNBT ...
|
|
func (f FireworkStar) EncodeNBT() map[string]any {
|
|
return map[string]any{
|
|
"FireworksItem": f.FireworkExplosion.EncodeNBT(),
|
|
"customColor": int32FromRGBA(f.Colour.RGBA()),
|
|
}
|
|
}
|
|
|
|
// DecodeNBT ...
|
|
func (f FireworkStar) DecodeNBT(data map[string]any) any {
|
|
if i, ok := data["FireworksItem"].(map[string]any); ok {
|
|
f.FireworkExplosion = f.FireworkExplosion.DecodeNBT(i).(FireworkExplosion)
|
|
}
|
|
return f
|
|
}
|
|
|
|
// EncodeItem ...
|
|
func (f FireworkStar) EncodeItem() (name string, meta int16) {
|
|
return "minecraft:firework_star", invertColour(f.Colour)
|
|
}
|