Skip to content

Commit

Permalink
Added the Entity Metadata type
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
LiteApplication committed May 17, 2024
1 parent 1f26da5 commit 9936baf
Show file tree
Hide file tree
Showing 18 changed files with 16,785 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ checks:
return-statements:
enabled: false



exclude_patterns:
- "tests/**"
- ".github/**"
# The scripts directory is only there to provide quick scripts to generate things that are in the actual code
# They don't need testing as they are not meant to be used outside the developpment process
- "scripts/**"
10 changes: 10 additions & 0 deletions docs/api/types/entity_metadata.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Entity Metadata
======================

This is the documentation for the NBT type used in Minecraft's network protocol.




.. automodule:: mcproto.types.entity
:no-undoc-members:
12 changes: 12 additions & 0 deletions docs/api/types/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. Types Documentation
Types Documentation
==================================

This folder contains the documentation for various types used in the project.

.. toctree::
:maxdepth: 2

nbt.rst
entity_metadata.rst
12 changes: 12 additions & 0 deletions docs/api/types/nbt.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
NBT
======================

This is the documentation for the NBT type used in Minecraft's network protocol.




.. automodule:: mcproto.types.nbt
:members:
:undoc-members:
:show-inheritance:
18 changes: 18 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@
import sys
import datetime
from pathlib import Path
from typing import Any

from packaging.version import parse as parse_version
from typing_extensions import override

from mcproto.types.entity.metadata import _ProxyEntityMetadataEntry, _DefaultEntityMetadataEntry

if sys.version_info >= (3, 11):
from tomllib import load as toml_parse
else:
Expand Down Expand Up @@ -117,6 +120,21 @@
"exclude-members": "__dict__,__weakref__",
}


def autodoc_skip_member(app: Any, what: str, name: str, obj: Any, skip: bool, options: Any) -> bool:
"""Skip EntityMetadataEntry class fields as they are already documented in the docstring."""
if isinstance(obj, type) and (
issubclass(obj, _ProxyEntityMetadataEntry) or issubclass(obj, _DefaultEntityMetadataEntry)
):
return True
return skip


def setup(app: Any) -> None:
"""Set up the Sphinx app."""
app.connect("autodoc-skip-member", autodoc_skip_member)


# -- sphinx.ext.autosectionlabel ---------------

# Automatically generate section labels:
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Content
api/packets.rst
api/protocol.rst
api/internal.rst
api/types/index.rst


Indices and tables
Expand Down
300 changes: 300 additions & 0 deletions mcproto/types/entity/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,300 @@
from mcproto.types.entity.generated import (
EntityEM,
InteractionEM,
DisplayEM,
BlockDisplayEM,
ItemDisplayEM,
TextDisplayEM,
ThrownItemProjectileEM,
ThrownEggEM,
ThrownEnderPearlEM,
ThrownExperienceBottleEM,
ThrownPotionEM,
ThrownSnowballEM,
EyeOfEnderEM,
FallingBlockEM,
AreaEffectCloudEM,
FishingHookEM,
AbstractArrowEM,
ArrowEM,
SpectralArrowEM,
ThrownTridentEM,
AbstractVehicleEM,
BoatEM,
ChestBoatEM,
AbstractMinecartEM,
MinecartEM,
AbstractMinecartContainerEM,
MinecartHopperEM,
MinecartChestEM,
MinecartFurnaceEM,
MinecartTNTEM,
MinecartSpawnerEM,
MinecartCommandBlockEM,
EndCrystalEM,
DragonFireballEM,
SmallFireballEM,
FireballEM,
WitherSkullEM,
FireworkRocketEM,
ItemFrameEM,
GlowingItemFrameEM,
PaintingEM,
ItemEntityEM,
LivingEntityEM,
PlayerEM,
ArmorStandEM,
MobEM,
AmbientCreatureEM,
BatEM,
PathfinderMobEM,
WaterAnimalEM,
SquidEM,
DolphinEM,
AbstractFishEM,
CodEM,
PufferFishEM,
SalmonEM,
TropicalFishEM,
TadpoleEM,
AgeableMobEM,
AnimalEM,
SnifferEM,
AbstractHorseEM,
HorseEM,
ZombieHorseEM,
SkeletonHorseEM,
CamelEM,
ChestedHorseEM,
DonkeyEM,
LlamaEM,
TraderLlamaEM,
MuleEM,
AxolotlEM,
BeeEM,
FoxEM,
FrogEM,
OcelotEM,
PandaEM,
PigEM,
RabbitEM,
TurtleEM,
PolarBearEM,
ChickenEM,
CowEM,
MooshroomEM,
HoglinEM,
SheepEM,
StriderEM,
GoatEM,
TameableAnimalEM,
CatEM,
WolfEM,
ParrotEM,
AbstractVillagerEM,
VillagerEM,
WanderingTraderEM,
AbstractGolemEM,
IronGolemEM,
SnowGolemEM,
ShulkerEM,
MonsterEM,
BasePiglinEM,
PiglinEM,
PiglinBruteEM,
BlazeEM,
CreeperEM,
EndermiteEM,
GiantEM,
GuardianEM,
ElderGuardianEM,
SilverfishEM,
RaiderEM,
AbstractIllagerEM,
VindicatorEM,
PillagerEM,
SpellcasterIllagerEM,
EvokerEM,
IllusionerEM,
RavagerEM,
WitchEM,
EvokerFangsEM,
VexEM,
AbstractSkeletonEM,
SkeletonEM,
WitherSkeletonEM,
StrayEM,
SpiderEM,
WardenEM,
WitherEM,
ZoglinEM,
ZombieEM,
ZombieVillagerEM,
HuskEM,
DrownedEM,
ZombifiedPiglinEM,
EndermanEM,
EnderDragonEM,
FlyingEM,
GhastEM,
PhantomEM,
SlimeEM,
LlamaSpitEM,
PrimedTntEM,
)

######################################################################
# This file is automatically generated by the entity generator script.
# You can modify it by changing what you want in the script.
######################################################################

from mcproto.types.entity.enums import Direction, Pose, SnifferState, DragonPhase

__all__ = [
"EntityEM",
"InteractionEM",
"DisplayEM",
"BlockDisplayEM",
"ItemDisplayEM",
"TextDisplayEM",
"ThrownItemProjectileEM",
"ThrownEggEM",
"ThrownEnderPearlEM",
"ThrownExperienceBottleEM",
"ThrownPotionEM",
"ThrownSnowballEM",
"EyeOfEnderEM",
"FallingBlockEM",
"AreaEffectCloudEM",
"FishingHookEM",
"AbstractArrowEM",
"ArrowEM",
"SpectralArrowEM",
"ThrownTridentEM",
"AbstractVehicleEM",
"BoatEM",
"ChestBoatEM",
"AbstractMinecartEM",
"MinecartEM",
"AbstractMinecartContainerEM",
"MinecartHopperEM",
"MinecartChestEM",
"MinecartFurnaceEM",
"MinecartTNTEM",
"MinecartSpawnerEM",
"MinecartCommandBlockEM",
"EndCrystalEM",
"DragonFireballEM",
"SmallFireballEM",
"FireballEM",
"WitherSkullEM",
"FireworkRocketEM",
"ItemFrameEM",
"GlowingItemFrameEM",
"PaintingEM",
"ItemEntityEM",
"LivingEntityEM",
"PlayerEM",
"ArmorStandEM",
"MobEM",
"AmbientCreatureEM",
"BatEM",
"PathfinderMobEM",
"WaterAnimalEM",
"SquidEM",
"DolphinEM",
"AbstractFishEM",
"CodEM",
"PufferFishEM",
"SalmonEM",
"TropicalFishEM",
"TadpoleEM",
"AgeableMobEM",
"AnimalEM",
"SnifferEM",
"AbstractHorseEM",
"HorseEM",
"ZombieHorseEM",
"SkeletonHorseEM",
"CamelEM",
"ChestedHorseEM",
"DonkeyEM",
"LlamaEM",
"TraderLlamaEM",
"MuleEM",
"AxolotlEM",
"BeeEM",
"FoxEM",
"FrogEM",
"OcelotEM",
"PandaEM",
"PigEM",
"RabbitEM",
"TurtleEM",
"PolarBearEM",
"ChickenEM",
"CowEM",
"MooshroomEM",
"HoglinEM",
"SheepEM",
"StriderEM",
"GoatEM",
"TameableAnimalEM",
"CatEM",
"WolfEM",
"ParrotEM",
"AbstractVillagerEM",
"VillagerEM",
"WanderingTraderEM",
"AbstractGolemEM",
"IronGolemEM",
"SnowGolemEM",
"ShulkerEM",
"MonsterEM",
"BasePiglinEM",
"PiglinEM",
"PiglinBruteEM",
"BlazeEM",
"CreeperEM",
"EndermiteEM",
"GiantEM",
"GuardianEM",
"ElderGuardianEM",
"SilverfishEM",
"RaiderEM",
"AbstractIllagerEM",
"VindicatorEM",
"PillagerEM",
"SpellcasterIllagerEM",
"EvokerEM",
"IllusionerEM",
"RavagerEM",
"WitchEM",
"EvokerFangsEM",
"VexEM",
"AbstractSkeletonEM",
"SkeletonEM",
"WitherSkeletonEM",
"StrayEM",
"SpiderEM",
"WardenEM",
"WitherEM",
"ZoglinEM",
"ZombieEM",
"ZombieVillagerEM",
"HuskEM",
"DrownedEM",
"ZombifiedPiglinEM",
"EndermanEM",
"EnderDragonEM",
"FlyingEM",
"GhastEM",
"PhantomEM",
"SlimeEM",
"LlamaSpitEM",
"PrimedTntEM",
"Direction",
"Pose",
"SnifferState",
"DragonPhase",
]
Loading

0 comments on commit 9936baf

Please sign in to comment.