/
manifest.go
78 lines (71 loc) · 3.89 KB
/
manifest.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package resource
// Documentation on this may be found here:
// https://minecraft.gamepedia.com/Bedrock_Edition_add-on_documentation
// Manifest contains all the basic information about the pack that Minecraft needs to identify it.
type Manifest struct {
// FormatVersion defines the current version of the manifest. This is currently always 1.
FormatVersion int `json:"format_version"`
// Header is the header of a resource pack. It contains information that applies to the entire resource
// pack, such as the name of the resource pack.
Header Header `json:"header"`
// Modules describes the modules that comprise the pack. Each entry here defines one of the kinds of
// contents of the pack.
Modules []Module `json:"modules"`
// Dependencies describes the packs that this pack depends on in order to work.
Dependencies []Dependency `json:"dependencies,omitempty"`
// Capabilities are the different features that the pack makes use of that aren't necessarily enabled by
// default. For a list of options, see below.
Capabilities []Capability `json:"capabilities,omitempty"`
}
// Header is the header of a resource pack. It contains information that applies to the entire resource pack,
// such as the name of the resource pack.
type Header struct {
// Name is the name of the pack as it appears within Minecraft.
Name string `json:"name"`
// Description is a short description of the pack. It will appear in the game below the name of the pack.
Description string `json:"description"`
// UUID is a unique identifier identifier this pack from any other pack.
UUID string `json:"uuid"`
// Version is the version of the pack, which can be used to identify changes in the pack.
Version [3]int `json:"version"`
// MinimumGameVersion is the minimum version of the game that this resource pack was written for.
MinimumGameVersion [3]int `json:"min_engine_version"`
}
// Module describes a module that comprises the pack. Each module defines one of the kinds of contents of the
// pack.
type Module struct {
// UUID is a unique identifier for the module in the same format as the pack's UUID in the header. This
// should be different from the pack's UUID, and different for every module.
UUID string `json:"uuid"`
// Description is a short description of the module. This is not user-facing at the moment.
Description string `json:"description"`
// Type is the type of the module. Can be any of the following: resources, data, client_data, interface or
// world_template.
Type string `json:"type"`
// Version is the version of the module in the same format as the pack's version in the header. This can
// be used to further identify changes in the pack.
Version [3]int `json:"version"`
}
// Dependency describes a pack that this pack depends on in order to work.
type Dependency struct {
// UUID is the unique identifier of the pack that this pack depends on. It needs to be the exact same UUID
// that the pack has defined in the header section of it's manifest file.
UUID string `json:"uuid"`
// Version is the specific version of the pack that the pack depends on. Should match the version the
// other pack has in its manifest file.
Version [3]int `json:"version"`
}
// Capability is a different features that the pack makes use of that isn't necessarily enabled by default.
// experimental_custom_ui: Allows HTML files in the pack to be used for custom UI, and scripts in the pack to
// call and manipulate custom UI.
// chemistry: Allows the pack to add, change or replace Chemistry functionality.
type Capability string
// Metadata contains additional data about the pack and is otherwise optional.
type Metadata struct {
// Author is the name of the author(s) of the pack.
Author string `json:"authors,omitempty"`
// License is the license applied to the pack.
License string `json:"license,omitempty"`
// URL is the home website of the creator of the pack.
URL string `json:"url,omitempty"`
}