Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper entity mapping #103

Open
juliarn opened this issue Jan 11, 2021 · 0 comments
Open

Proper entity mapping #103

juliarn opened this issue Jan 11, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@juliarn
Copy link
Member

juliarn commented Jan 11, 2021

Description
The big problem with entity mapping from Flint to Minecraft and from Minecraft to Flint currently is, that the types do not always match. For example, when wanting the map the Minecraft.getInstance().player to a Flint object, the result will never be instanceof ClientPlayer. This can lead to problems when wanting to store something in an entity, for example the potion effects. ClientPlayer#getActivePotions will never return a non-empty list because the potion effects are applied to another instance of PlayerEntity representing the player.
Another issue of the current mapping system is, that there has to be a mapping method for every single entity, which will get too much when all entities are implemented. A single method like fromMinecraftEntity(Object handle) would be good.
Furthermore, the toMinecraft mapping method is not really needed. As all entities currently are wrappers around the minecraft object, a getHandle() method should be fine.

@juliarn juliarn added the bug Something isn't working label Jan 11, 2021
@juliarn juliarn self-assigned this Jan 11, 2021
@juliarn juliarn added this to To do in Flint Development via automation Jan 11, 2021
@juliarn juliarn moved this from To do to In progress in Flint Development Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

1 participant