modmeta

package
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 26, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package modmeta provides functionality to get mod metadata from mod binaries.

Index

Constants

This section is empty.

Variables

View Source
var (
	FailedToReadMcModInfoVersion = errors.New("forge: failed to read mcmod.info with any supported format")
)

Functions

func ReadJarManifest added in v0.2.1

func ReadJarManifest(r io.Reader) (map[string]string, error)

ReadJarManifest takes a reader for a Jar file's manifest (META-INF/MANIFEST.mf), and returns a map of KEY: VALUE. If there is a format issue with the manifest, an error will be returned.

Types

type FabricModJsonMetadata

type FabricModJsonMetadata struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Version     string   `json:"version"`
	Description string   `json:"description"`
	Authors     []string `json:"authors"`
	Contact     struct {
		Homepage string `json:"homepage"`
	} `json:"contact"`
}

Represents a single mods' metadata from Fabric's fabric.mod.json standard.

func ReadFabricModJson

func ReadFabricModJson(reader io.Reader) (*FabricModJsonMetadata, error)

Reads a fabric.mod.json file.

func (*FabricModJsonMetadata) ToModMetadata

func (m *FabricModJsonMetadata) ToModMetadata() *ModMetadata

Creates a ModMetadata for the fabric.mod.json metadata. The System will be set to "fabric".

type ModMetadata

type ModMetadata struct {
	// The mod system/loader the mods uses.
	System string

	ID          string
	Name        string
	Version     string
	Description string
	URL         string
	Authors     string
}

Represents a single mod's metadata.

func FindMetadata

func FindMetadata(archive string) ([]*ModMetadata, error)

FindMetadata attempts to find mod information from a Java binary, looking for metadata from Minecraft Forge.

func ReadForgeModsToml

func ReadForgeModsToml(reader io.Reader) ([]*ModMetadata, error)

Reads a mods.toml file.

func ReadMcModInfo

func ReadMcModInfo(reader io.Reader) ([]*ModMetadata, error)

Reads a mcmod.info file that uses either the V1 or V2 format. If modmeta is unable to read in either format, FailedToReadMcModInfoVersion will be returned. The System is set to "forge", though its worth noting that other mod systems use FML's loader - for example, Sponge plugins.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL