Class BackendDescriptor
java.lang.Object
dev.xichil.mvui.BackendDescriptor
What one backend serves (TODO.md 0.6, 5.3): per platform, the DataVersion range it was checked
against, plus the runtime names it is remapped to. Read from the
<id>.properties file each
backend's build writes into BackendRegistry.DESCRIPTORS. Immutable; equal by id(). Part of the
backend contract; mods don't need it.
A descriptor file looks like this (other keys are ignored):
id=e8-fabric names=official fabric=4786-Here backend
e8-fabric serves Fabric from DataVersion 4786 on, with no upper bound, and its classes are in
package dev.xichil.mvui.backend.e8_fabric.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intlast(UiPlatform)of an open-ended range (newest backend of a platform, future versions). -
Constructor Summary
ConstructorsConstructorDescriptionBackendDescriptor(String id, String runtimeNames, Map<UiPlatform, int[]> ranges) A descriptor; usually made byparse(Properties). -
Method Summary
Modifier and TypeMethodDescriptionThe backend'sUiBackendimplementation.booleanintfirst(UiPlatform platform) First DataVersion the backend was checked against onplatform; selection starts here.inthashCode()id()The backend id, e.g.intlast(UiPlatform platform) Last DataVersion the backend was checked against onplatform, orOPEN.Package of the backend's mixins (Fabric and Legacy Fabric backends).dev.xichil.mvui.backend.<id with _ for ->: the backend's own package.static BackendDescriptorparse(Properties p) Parses a descriptor file:id,namesand one<platform>=first-lastper served platform (empty last: open-ended).The runtime-name family (TODO.md §3.2), e.g.booleanserves(UiPlatform platform) Whether the backend servesplatform.toString()
-
Field Details
-
OPEN
public static final int OPENlast(UiPlatform)of an open-ended range (newest backend of a platform, future versions).- See Also:
-
-
Constructor Details
-
BackendDescriptor
A descriptor; usually made byparse(Properties).- Parameters:
id- the backend id: lower case, digits and single dashes, e.g.e5-7-fabricruntimeNames- the runtime-name family, e.g.intermediary,mcp-srg,mojmap,officialranges- per platform {first, last} DataVersion, lastOPENfor no upper bound; copied- Throws:
IllegalArgumentException- if the id is malformed, the names are empty, no platform is served, or a range isn't two ascending numbers
-
-
Method Details
-
parse
Parses a descriptor file:id,namesand one<platform>=first-lastper served platform (empty last: open-ended). Other keys (minecraft,java…) are ignored.- Parameters:
p- the loaded properties- Returns:
- the descriptor
- Throws:
IllegalArgumentException- if a range or another value is malformed
-
id
The backend id, e.g.e8-fabric; also names its package (packageName()).- Returns:
- the backend's id
-
runtimeNames
The runtime-name family (TODO.md §3.2), e.g.intermediary; for logs and checks.- Returns:
- the backend's runtime-name family, e.g.
mojmap
-
serves
Whether the backend servesplatform.- Parameters:
platform- a loader- Returns:
trueif the descriptor has a range for it
-
first
First DataVersion the backend was checked against onplatform; selection starts here.- Parameters:
platform- the loader whose range to read- Returns:
- the first DataVersion of the range
- Throws:
IllegalArgumentException- if the backend doesn't serveplatform
-
last
Last DataVersion the backend was checked against onplatform, orOPEN. Doesn't limit selection (BackendRegistry); the build's coverage check uses it.- Parameters:
platform- the loader whose range to read- Returns:
- the last DataVersion of the range, or
OPEN - Throws:
IllegalArgumentException- if the backend doesn't serveplatform
-
packageName
dev.xichil.mvui.backend.<id with _ for ->: the backend's own package.- Returns:
- the backend's package, e.g.
dev.xichil.mvui.backend.e8_fabric
-
entryClassName
-
mixinPackage
Package of the backend's mixins (Fabric and Legacy Fabric backends).- Returns:
- the mixin package, e.g.
dev.xichil.mvui.backend.e8_fabric.mixin
-
equals
-
hashCode
-
toString
-