Skip to content

[Branding Patch] API V2 #37

@SpaceWalkerRS

Description

@SpaceWalkerRS

This issue serves as a discussion post for coming up with a new spec for the Branding Patch API, its scope, what features it should have, and implementing it into a V2 for the API.

API V1

The current API allows modifying branding information in two branding contexts: the title screen and the debug overlay. These are the contexts in which Minecraft itself modifies branding information in 16w05b and above.

What is considered branding information is the string that displays the Minecraft name and version, e.g. "Minecraft 16w05a". What is considered modifying branding information is either replacing (part(s) of) the existing string, or adding (a) new part(s) before or after the existing string.

Mods can register modifier components to one or multiple contexts. All components that are registered to a context are sorted and combined into one branding modifier that is applied to the branding information in that context. Applying a branding modifier means applying each of its constituent components in order, passing the result of each component to the next.

A modifier component exists of five parts:

  • a key - a string that uniquely identifies the component
  • a operation - this defines the way in which the component modifies the branding information
  • a value - any string this component adds to the branding information
  • a priority - priority with which this component is sorted into the branding modifier
  • whether it is required - some operations must be unique within a branding modifier, and if multiple required components use one of those operations, an exception is thrown since the branding modifier cannot be constructed

There are four operations to choose from:

  • prepend - insert a string at the start of the branding information
  • append - insert a string at the end of the branding information
  • replace - replace the original branding information (i.e. the branding information before any components have been applied with a new string
  • set - set the entire branding information to a new string

Issues

  • No support for localized information.
  • No support for conditional components, like components that can be toggled through a setting, components that only apply on a Tuesday, or components that behave differently if the player is a half a heart of health, etc.
  • No support for adding new lines.
  • No support for components that depend on other components.
  • No support for targeting specific components as opposed to the entire string.

API V2

this section will be updated once an initial draft is made, and then tweaked further until a final spec is agreed upon

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions