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
Add Point of interest #5379
base: master
Are you sure you want to change the base?
Add Point of interest #5379
Conversation
Villages went through a rework in 1.14 and seems to have been simplified, i.e. much less state storage. The village.dat format got replaced with Point of Interest and it seems village mechanics are much more driven by villager/iron golem entities instead of a village object. So if we upgrade cVillage into something more generic, PointOfInterest maybe, it'll handle not only village stuff but all the other points of interest like portals and beehives. |
I was trying to implement the old village mechanics (pre 1.14) to have a coherence with the targeted version of Cuberite. |
Somewhere in the doddering old 1.12 Cuberite there's a fresh young 1.18 compatible Cuberite struggling to emerge. Let's help it on it's way! |
yes, it would not hurt to make support for 1.18, but I think it will be difficult |
If we implement POI, we would also have to change the villagers since their jobs will also depend of POI. |
Implementing poies was simplier than i thought. I just added the poi object to see if it's fine and then i will implement them in the world. |
Now, the poies are created when a poi block is placed (or removed when it has been replaced). The only thing remaining is the storage. And then, i will be able to start working on villages if everything is good. |
Poies are stored in the poi folder instead of the region one with the official server. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your work. Sorry for the long wait.
Maybe the title of the PR is misleading :D
In total I Thing this is ready to merge beside some comments I made.
It has been a very long time. I almost forgot this PR. Right now, i don't have time to continue working on it because of my studies. I will probably work on this PR during computer classes if I'm too bored xD |
While we were learning how to use char arrays, I applied your suggestions, it should be good. For now, this PR is kind of useless because the poies are not stored in disk. I didn't do that because i didn't know which file to edit to make this work. |
The wiki is quite straightforward https://minecraft.fandom.com/wiki/Java_Edition_level_format#poi_format |
I meant in Cuberite because poies are not stored in region files but in other files. |
Any writing to disk is done in src/WorldStorage. The actual call is done in a async way. I suggest looking in cWorld or check where the code from src/WorldStorage is called. I think the POIs should be stored at the same point in time the world is stored Edit: the thread that stores stuff is in src/WorldStorage/WorldStorage.h |
Thank your for the effort. The goal is to be like vanilla Minecraft is. So loading and saving POIs should be done in the same way Mojang does |
I see. I did some poking around in the storage code, and it's not very friendly for this kind of modification. Next PR here I come |
I started to implement villages. Since it's a big thing, you can already tell me if i should change some things so i don't waste too much time doing it again. It can then allow iron golems to spawn and villager to breed.