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

Make Pets out of the real entity object #106

Open
Arnuh opened this issue Sep 24, 2021 · 4 comments
Open

Make Pets out of the real entity object #106

Arnuh opened this issue Sep 24, 2021 · 4 comments
Assignees

Comments

@Arnuh
Copy link
Owner

Arnuh commented Sep 24, 2021

Issues have shown that trying to extend Pets off just the "Mob" class will no longer fully hold. Solution is to do what dsh105 originally planned, make Pets only 1 layer above the actual Entity we are making a Pet of. This will make the server think its a 100% authentic entity while we still have full control of the entity and how it interacts.

This will likely introduce new scenarios which certain server owners might not like and I will have to manage those in the future. Example is Zombies seeing a Villager pet as a hostile and attempting to attacking it.

Currently only Villager 100% needs this fix due to #105 while the Axolotl sensor is the only other issue which is easily(and already) fixable. Not entirely sure if all Pets should be moved to this new setup.

@Arnuh
Copy link
Owner Author

Arnuh commented Nov 30, 2021

Goat also now extends "Goat" NMS entity class 2f3ba3e

@Arnuh
Copy link
Owner Author

Arnuh commented Dec 5, 2021

With this change any interfaces we use like "Ageable" would require every pet to handle its own setBaby.

d169736 has started the first movement of fixing that by moving away from using classes that extend EntityPet like EntityAgeablePet and instead handle setBaby in a "PetBase". Same general idea but it properly supports the future of extending the real entity class over EntityPet

@Arnuh
Copy link
Owner Author

Arnuh commented Feb 1, 2022

Axolotl is now changed. This ends the list of entities as of 1.18 that required this change(or workarounds). 364668f

Any future entities will be using the new system from the start, where as old entities will slowly get changed.

@Arnuh
Copy link
Owner Author

Arnuh commented Apr 29, 2023

Can technically see what is left on the todo for this by checking the provided folder.

https://github.com/Arnuh/EchoPet/tree/development/api/src/main/java/com/dsh105/echopet/compat/api/entity/type/nms

All of these should be moved to handles or not actually exist(no data setters) based on the current setup of this change.

I don't think it's important for an nms entity interface to exist for every pet type since I'd suggest just checking via the actual pet type if you needed that information and have access to the echopet api anyway. Only reason the interface would exist is if in the future I needed to add setters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant