Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9936baf

Browse files
committedMay 17, 2024··
Added the Entity Metadata type
* Modified the conf.py sphinx configuration file to ignore the custom fields used in the Entity Metadata type * Added the Entity Metadata type to the documentation * Added `scripts` to the .codeclimate.yml ignore list
1 parent 1f26da5 commit 9936baf

18 files changed

+16785
-3
lines changed
 

‎.codeclimate.yml

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ checks:
3131
return-statements:
3232
enabled: false
3333

34+
35+
3436
exclude_patterns:
3537
- "tests/**"
3638
- ".github/**"
39+
# The scripts directory is only there to provide quick scripts to generate things that are in the actual code
40+
# They don't need testing as they are not meant to be used outside the developpment process
41+
- "scripts/**"

‎docs/api/types/entity_metadata.rst

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Entity Metadata
2+
======================
3+
4+
This is the documentation for the NBT type used in Minecraft's network protocol.
5+
6+
7+
8+
9+
.. automodule:: mcproto.types.entity
10+
:no-undoc-members:

‎docs/api/types/index.rst

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.. Types Documentation
2+
3+
Types Documentation
4+
==================================
5+
6+
This folder contains the documentation for various types used in the project.
7+
8+
.. toctree::
9+
:maxdepth: 2
10+
11+
nbt.rst
12+
entity_metadata.rst

‎docs/api/types/nbt.rst

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
NBT
2+
======================
3+
4+
This is the documentation for the NBT type used in Minecraft's network protocol.
5+
6+
7+
8+
9+
.. automodule:: mcproto.types.nbt
10+
:members:
11+
:undoc-members:
12+
:show-inheritance:

‎docs/conf.py

+18
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@
1212
import sys
1313
import datetime
1414
from pathlib import Path
15+
from typing import Any
1516

1617
from packaging.version import parse as parse_version
1718
from typing_extensions import override
1819

20+
from mcproto.types.entity.metadata import _ProxyEntityMetadataEntry, _DefaultEntityMetadataEntry
21+
1922
if sys.version_info >= (3, 11):
2023
from tomllib import load as toml_parse
2124
else:
@@ -117,6 +120,21 @@
117120
"exclude-members": "__dict__,__weakref__",
118121
}
119122

123+
124+
def autodoc_skip_member(app: Any, what: str, name: str, obj: Any, skip: bool, options: Any) -> bool:
125+
"""Skip EntityMetadataEntry class fields as they are already documented in the docstring."""
126+
if isinstance(obj, type) and (
127+
issubclass(obj, _ProxyEntityMetadataEntry) or issubclass(obj, _DefaultEntityMetadataEntry)
128+
):
129+
return True
130+
return skip
131+
132+
133+
def setup(app: Any) -> None:
134+
"""Set up the Sphinx app."""
135+
app.connect("autodoc-skip-member", autodoc_skip_member)
136+
137+
120138
# -- sphinx.ext.autosectionlabel ---------------
121139

122140
# Automatically generate section labels:

‎docs/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Content
2424
api/packets.rst
2525
api/protocol.rst
2626
api/internal.rst
27+
api/types/index.rst
2728

2829

2930
Indices and tables

‎mcproto/types/entity/__init__.py

+300
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,300 @@
1+
from mcproto.types.entity.generated import (
2+
EntityEM,
3+
InteractionEM,
4+
DisplayEM,
5+
BlockDisplayEM,
6+
ItemDisplayEM,
7+
TextDisplayEM,
8+
ThrownItemProjectileEM,
9+
ThrownEggEM,
10+
ThrownEnderPearlEM,
11+
ThrownExperienceBottleEM,
12+
ThrownPotionEM,
13+
ThrownSnowballEM,
14+
EyeOfEnderEM,
15+
FallingBlockEM,
16+
AreaEffectCloudEM,
17+
FishingHookEM,
18+
AbstractArrowEM,
19+
ArrowEM,
20+
SpectralArrowEM,
21+
ThrownTridentEM,
22+
AbstractVehicleEM,
23+
BoatEM,
24+
ChestBoatEM,
25+
AbstractMinecartEM,
26+
MinecartEM,
27+
AbstractMinecartContainerEM,
28+
MinecartHopperEM,
29+
MinecartChestEM,
30+
MinecartFurnaceEM,
31+
MinecartTNTEM,
32+
MinecartSpawnerEM,
33+
MinecartCommandBlockEM,
34+
EndCrystalEM,
35+
DragonFireballEM,
36+
SmallFireballEM,
37+
FireballEM,
38+
WitherSkullEM,
39+
FireworkRocketEM,
40+
ItemFrameEM,
41+
GlowingItemFrameEM,
42+
PaintingEM,
43+
ItemEntityEM,
44+
LivingEntityEM,
45+
PlayerEM,
46+
ArmorStandEM,
47+
MobEM,
48+
AmbientCreatureEM,
49+
BatEM,
50+
PathfinderMobEM,
51+
WaterAnimalEM,
52+
SquidEM,
53+
DolphinEM,
54+
AbstractFishEM,
55+
CodEM,
56+
PufferFishEM,
57+
SalmonEM,
58+
TropicalFishEM,
59+
TadpoleEM,
60+
AgeableMobEM,
61+
AnimalEM,
62+
SnifferEM,
63+
AbstractHorseEM,
64+
HorseEM,
65+
ZombieHorseEM,
66+
SkeletonHorseEM,
67+
CamelEM,
68+
ChestedHorseEM,
69+
DonkeyEM,
70+
LlamaEM,
71+
TraderLlamaEM,
72+
MuleEM,
73+
AxolotlEM,
74+
BeeEM,
75+
FoxEM,
76+
FrogEM,
77+
OcelotEM,
78+
PandaEM,
79+
PigEM,
80+
RabbitEM,
81+
TurtleEM,
82+
PolarBearEM,
83+
ChickenEM,
84+
CowEM,
85+
MooshroomEM,
86+
HoglinEM,
87+
SheepEM,
88+
StriderEM,
89+
GoatEM,
90+
TameableAnimalEM,
91+
CatEM,
92+
WolfEM,
93+
ParrotEM,
94+
AbstractVillagerEM,
95+
VillagerEM,
96+
WanderingTraderEM,
97+
AbstractGolemEM,
98+
IronGolemEM,
99+
SnowGolemEM,
100+
ShulkerEM,
101+
MonsterEM,
102+
BasePiglinEM,
103+
PiglinEM,
104+
PiglinBruteEM,
105+
BlazeEM,
106+
CreeperEM,
107+
EndermiteEM,
108+
GiantEM,
109+
GuardianEM,
110+
ElderGuardianEM,
111+
SilverfishEM,
112+
RaiderEM,
113+
AbstractIllagerEM,
114+
VindicatorEM,
115+
PillagerEM,
116+
SpellcasterIllagerEM,
117+
EvokerEM,
118+
IllusionerEM,
119+
RavagerEM,
120+
WitchEM,
121+
EvokerFangsEM,
122+
VexEM,
123+
AbstractSkeletonEM,
124+
SkeletonEM,
125+
WitherSkeletonEM,
126+
StrayEM,
127+
SpiderEM,
128+
WardenEM,
129+
WitherEM,
130+
ZoglinEM,
131+
ZombieEM,
132+
ZombieVillagerEM,
133+
HuskEM,
134+
DrownedEM,
135+
ZombifiedPiglinEM,
136+
EndermanEM,
137+
EnderDragonEM,
138+
FlyingEM,
139+
GhastEM,
140+
PhantomEM,
141+
SlimeEM,
142+
LlamaSpitEM,
143+
PrimedTntEM,
144+
)
145+
146+
######################################################################
147+
# This file is automatically generated by the entity generator script.
148+
# You can modify it by changing what you want in the script.
149+
######################################################################
150+
151+
from mcproto.types.entity.enums import Direction, Pose, SnifferState, DragonPhase
152+
153+
__all__ = [
154+
"EntityEM",
155+
"InteractionEM",
156+
"DisplayEM",
157+
"BlockDisplayEM",
158+
"ItemDisplayEM",
159+
"TextDisplayEM",
160+
"ThrownItemProjectileEM",
161+
"ThrownEggEM",
162+
"ThrownEnderPearlEM",
163+
"ThrownExperienceBottleEM",
164+
"ThrownPotionEM",
165+
"ThrownSnowballEM",
166+
"EyeOfEnderEM",
167+
"FallingBlockEM",
168+
"AreaEffectCloudEM",
169+
"FishingHookEM",
170+
"AbstractArrowEM",
171+
"ArrowEM",
172+
"SpectralArrowEM",
173+
"ThrownTridentEM",
174+
"AbstractVehicleEM",
175+
"BoatEM",
176+
"ChestBoatEM",
177+
"AbstractMinecartEM",
178+
"MinecartEM",
179+
"AbstractMinecartContainerEM",
180+
"MinecartHopperEM",
181+
"MinecartChestEM",
182+
"MinecartFurnaceEM",
183+
"MinecartTNTEM",
184+
"MinecartSpawnerEM",
185+
"MinecartCommandBlockEM",
186+
"EndCrystalEM",
187+
"DragonFireballEM",
188+
"SmallFireballEM",
189+
"FireballEM",
190+
"WitherSkullEM",
191+
"FireworkRocketEM",
192+
"ItemFrameEM",
193+
"GlowingItemFrameEM",
194+
"PaintingEM",
195+
"ItemEntityEM",
196+
"LivingEntityEM",
197+
"PlayerEM",
198+
"ArmorStandEM",
199+
"MobEM",
200+
"AmbientCreatureEM",
201+
"BatEM",
202+
"PathfinderMobEM",
203+
"WaterAnimalEM",
204+
"SquidEM",
205+
"DolphinEM",
206+
"AbstractFishEM",
207+
"CodEM",
208+
"PufferFishEM",
209+
"SalmonEM",
210+
"TropicalFishEM",
211+
"TadpoleEM",
212+
"AgeableMobEM",
213+
"AnimalEM",
214+
"SnifferEM",
215+
"AbstractHorseEM",
216+
"HorseEM",
217+
"ZombieHorseEM",
218+
"SkeletonHorseEM",
219+
"CamelEM",
220+
"ChestedHorseEM",
221+
"DonkeyEM",
222+
"LlamaEM",
223+
"TraderLlamaEM",
224+
"MuleEM",
225+
"AxolotlEM",
226+
"BeeEM",
227+
"FoxEM",
228+
"FrogEM",
229+
"OcelotEM",
230+
"PandaEM",
231+
"PigEM",
232+
"RabbitEM",
233+
"TurtleEM",
234+
"PolarBearEM",
235+
"ChickenEM",
236+
"CowEM",
237+
"MooshroomEM",
238+
"HoglinEM",
239+
"SheepEM",
240+
"StriderEM",
241+
"GoatEM",
242+
"TameableAnimalEM",
243+
"CatEM",
244+
"WolfEM",
245+
"ParrotEM",
246+
"AbstractVillagerEM",
247+
"VillagerEM",
248+
"WanderingTraderEM",
249+
"AbstractGolemEM",
250+
"IronGolemEM",
251+
"SnowGolemEM",
252+
"ShulkerEM",
253+
"MonsterEM",
254+
"BasePiglinEM",
255+
"PiglinEM",
256+
"PiglinBruteEM",
257+
"BlazeEM",
258+
"CreeperEM",
259+
"EndermiteEM",
260+
"GiantEM",
261+
"GuardianEM",
262+
"ElderGuardianEM",
263+
"SilverfishEM",
264+
"RaiderEM",
265+
"AbstractIllagerEM",
266+
"VindicatorEM",
267+
"PillagerEM",
268+
"SpellcasterIllagerEM",
269+
"EvokerEM",
270+
"IllusionerEM",
271+
"RavagerEM",
272+
"WitchEM",
273+
"EvokerFangsEM",
274+
"VexEM",
275+
"AbstractSkeletonEM",
276+
"SkeletonEM",
277+
"WitherSkeletonEM",
278+
"StrayEM",
279+
"SpiderEM",
280+
"WardenEM",
281+
"WitherEM",
282+
"ZoglinEM",
283+
"ZombieEM",
284+
"ZombieVillagerEM",
285+
"HuskEM",
286+
"DrownedEM",
287+
"ZombifiedPiglinEM",
288+
"EndermanEM",
289+
"EnderDragonEM",
290+
"FlyingEM",
291+
"GhastEM",
292+
"PhantomEM",
293+
"SlimeEM",
294+
"LlamaSpitEM",
295+
"PrimedTntEM",
296+
"Direction",
297+
"Pose",
298+
"SnifferState",
299+
"DragonPhase",
300+
]

0 commit comments

Comments
 (0)
Please sign in to comment.