Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ZeroValue = values{false, 0, 0.0}
Functions ¶
This section is empty.
Types ¶
type IMiddlewares ¶ added in v0.0.11
type IMiddlewares interface {
Apply(*Project) error
All() []Middleware
Add(Middleware)
}
type Middleware ¶ added in v0.0.11
type Middlewares ¶ added in v0.0.11
type Middlewares []Middleware
func (*Middlewares) Add ¶ added in v0.0.11
func (m *Middlewares) Add(f Middleware)
func (Middlewares) All ¶ added in v0.0.11
func (m Middlewares) All() []Middleware
func (Middlewares) Apply ¶ added in v0.0.11
func (m Middlewares) Apply(g *Project) error
type Project ¶ added in v0.0.11
type Project struct {
// Logger
Logger *logger
// Contains Behavior Pack data.
BP *bp.GlowstoneBP
// Contains Resource Pack data.
RP *rp.GlowstoneRP
// Middlewares
//
// Contains functions that will be executed before saving the project.
//
// Example:
//
// g := glowstone.NewProjectV2()
// func entity_WriteLang(g *Project) error {
// // code
// return nil
// }
// g.Middlewares.Add(entity_WriteLang)
Middlewares IMiddlewares
}
func NewProject ¶
func NewProject() *Project
func (*Project) NewEntity ¶ added in v0.0.11
func (g *Project) NewEntity(identifier string) (*bp.EntityFile, *rp.EntityFile)
Create a new entity (BP and RP).
Returns BPFile and RPFile of the entity, which contain additional fields along with the entity.
Example:
bp, rp := g.NewEntity("glostone:diamond_sword")
type Settings ¶ added in v0.0.8
type Settings struct {
MinifyJSON bool
FormatVersion *SettingsFormatVersion
}
Click to show internal directories.
Click to hide internal directories.