Open ryantheleach opened 4 years ago
+1 I installed it on my server today and it shows undiscovered places where people begin to rush! It is however a very good plugin.
The major issue with this is how to define and detect if/when a player discovers a structure. What does "discover" mean? Seeing it, being within a certain distance of it, entering it, opening a chest within it? Is it different for different types of structures? Each of these also presents varying levels of difficulty regarding implementation.
I understand why this feature is desirable and I'm interested in working on it, but I would greatly appreciate any thoughts on what "discovery" means to you.
I'm not sure exactly how structures are tracked and listed.
I think "discovering" structures, you could just look at defining a basic radius around the center of the structure. So a Which Hut and a Woodland mansion would have different radii that would trigger a "discover".
For hidden structures like Strong Holds though, you probably could just a smaller radius if it could possible be centered on the End Portal. You run the small chance that a player can possible run/boat/fly right over top of it randomly, but arguably when you are that close, you would hear the sounds anyway.
Even for the surface structures, you could even use a slightly smaller radius as well then the physical foot print to only trigger the discovery once they've been inside of it.
Each type of structure would like have a defined default block radius, this could be part of config as well for servers that want full control.
The discovery-offset-percent could be a variable that just adjusts the radius as a percent:
So either could shrink the defined radius by 15% to only "discover" it once a player has gotten pretty much inside the structure or increase it by 75% to discover it as a player just gets within a couple chunks of it.
Adding extra layers like "is it raided" or "has it been explored" or "has the end portal been activated" would create more complication then the majority of users of this are probably looking for.
Discovery to me, means triggering the advancement for entering a place. To use much else is pretty nebulous.
Mimicing vanilla behavior (for lack of an advancement trigger hook without creating a datapack), would probably be to run locateNearestStructure on the player with radius 1, every 20 ticks
reference: https://www.spigotmc.org/threads/how-to-know-when-a-player-enters-a-structure.449789/#post-3868018
It could only show where the render has been generated or only structures around the player...
Is your feature request related to a problem? Please describe. I installed this and went to bed, expecting it to highlight farm locations for witches huts and ocean monuments and stuff, and couldn't get it working, when I woke up, it had started working and had revealed way way more then I was expecting, and anything that had been generated, not just discovered.
Describe the solution you'd like I'd like the plugin to (be configured) to only show structures that had been entered or raided by players.
Describe alternatives you've considered Turning problematic structures off in the config.