Skip to content

Commit c322489

Browse files
authored
Document forge response classes (#1109)
1 parent a91b29a commit c322489

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

docs/api/basic.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,32 @@ For Java Server (1.7+)
8888
:inherited-members:
8989
:exclude-members: build
9090

91+
Forge Data
92+
**********
93+
94+
Forge mod metadata is available on :attr:`status.forge_data <mcstatus.responses.JavaStatusResponse.forge_data>`.
95+
96+
.. module:: mcstatus.forge_data
97+
:no-index:
98+
99+
.. autoclass:: mcstatus.forge_data.ForgeData()
100+
:members:
101+
:undoc-members:
102+
:inherited-members:
103+
:exclude-members: build
104+
105+
.. autoclass:: mcstatus.forge_data.ForgeDataChannel()
106+
:members:
107+
:undoc-members:
108+
:inherited-members:
109+
:exclude-members: build, decode
110+
111+
.. autoclass:: mcstatus.forge_data.ForgeDataMod()
112+
:members:
113+
:undoc-members:
114+
:inherited-members:
115+
:exclude-members: build, decode
116+
91117

92118
For Java Server (1.4-1.6)
93119
*************************

mcstatus/forge_data.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ class RawForgeData(TypedDict, total=False):
5959

6060
@dataclass(frozen=True)
6161
class ForgeDataChannel:
62+
"""A single Forge data channel."""
63+
6264
name: str
6365
"""Channel name and ID (for example ``fml:handshake``)."""
6466
version: str
@@ -98,8 +100,12 @@ def decode(cls, buffer: Connection, mod_id: str | None = None) -> Self:
98100

99101
@dataclass(frozen=True)
100102
class ForgeDataMod:
103+
"""A single Forge mod."""
104+
101105
name: str
106+
"""A mod name."""
102107
marker: str
108+
"""A mod marker. Usually a version."""
103109

104110
@classmethod
105111
def build(cls, raw: RawForgeDataMod) -> Self:
@@ -193,12 +199,14 @@ def read_optimized_buffer(self) -> Connection:
193199

194200
@dataclass(frozen=True)
195201
class ForgeData:
202+
"""Class for storing information about Forge mods."""
203+
196204
fml_network_version: int
197205
"""Forge Mod Loader network version."""
198206
channels: list[ForgeDataChannel]
199207
"""List of channels, both for mods and non-mods."""
200208
mods: list[ForgeDataMod]
201-
"""List of mods"""
209+
"""List of mods."""
202210
truncated: bool
203211
"""Is the mods list and or channel list incomplete?"""
204212

0 commit comments

Comments
 (0)