FabricMC / yarn

Libre Minecraft mappings, free to use for everyone. No exceptions.
Creative Commons Zero v1.0 Universal
908 stars 375 forks source link

Entity packages mess #1678

Open i509VCB opened 4 years ago

i509VCB commented 4 years ago

The entity package is quite messy as some classes are vaguely related to some categories. The package coukd use some organization. I will have a proposal written up in an hour on what I think could work.

liach commented 4 years ago

concern Just don't make super tiny packages with very long paths like your last pr. Too deep path is a problem

i509VCB commented 4 years ago

Not planning on branching out too far, mainly a clarification of certain categories of entities like mobs, animals, hostile mobs, etc.

i509VCB commented 4 years ago

So I've been thinking up a concept for new package standard:

entity.mob for all Mobs. These are entities which can control their own movement.

entity.mob.passive for all passive mobs. Such as cows, sheep, villagers.

entity.mob.hostile for all hostile entities. Such as zombies, piglins, creepers. Raiders also go in this package.

Neutral entities go in the regular mob package.

Item frames and armor stands keep their current package as decorations

The player package would stay the same as now.

Client and server player implementations would stay in their corresponding side.network packages.

Abstract classes which may be implemented by multiple types of entities should go in the most common package.

For example Angerable would go in mob since Piglins are hostile and wolves are passive. LivingEntity would stay in the root entity package since living entities are not exclusively mobs (such as the player).

liach commented 3 years ago

what's the status of this now?

i509VCB commented 3 years ago

Nothing so far has changed in my idea, we have gotten some new mobs but some are yet to be added yet.

liach commented 3 years ago

feel free to do one pr if you are willing to, or list the refactors and let someone else maintain a pr.

i509VCB commented 3 years ago

I pretty much have just proposed the idea here, someone else can take on the contributions if they wish.

liach commented 3 years ago

Imo this current package setup is fine. I will close this for now and reopen if someone comment here and point out some actual examples of what classes are badly placed.

Juuxel commented 3 years ago

The current package setup is confusing and i5's proposal is better IMO. For example, why are hostile mobs in entity.mob but passive ones in entity.passive? Changing hostile mobs into their own subpackage would help with clarity. Also, this issue hasn't been resolved or heavily downvoted so reopening.