TechnicJelle / BlueMapMCMapSync

Allow your players to discover your BlueMap more immersively, by syncing with in-game maps!
2 stars 1 forks source link

Automatically discover map when it's created #3

Open TechnicJelle opened 6 months ago

TechnicJelle commented 6 months ago

Inspired by @ryanalexmartin's great PR #2.

(This PR can still use some extra cleaning up, though, so it's marked as a draft until that's done)

Closes #1

TechnicJelle commented 5 months ago

Hey @ryanalexmartin, I think I've about finished this now. Would you be willing to test it? As far as I can see, it works fine in my own tests, but it's always nice to get a second opinion, before I officially release it.

Jaymus3 commented 2 months ago

Tested the artifact you linked with Spigot and the map restriction works correctly, but the automatic discovery doesn't appear to be working. If I run /bmdiscover then force an update with /bluemap update world, all of the new mapdata appears, but otherwise nothing new comes through. I will test with Paper when it gets 1.21 support and report back.

TechnicJelle commented 2 months ago

Any errors in your server console?

Jaymus3 commented 2 months ago

No, I don't have any errors in my log. Here's all of the log entries from BlueMapMCMapSync on my most recent log.

[16:10:32] [Craft Scheduler Thread - 1/WARN]: [BlueMapMCMapSync] New version available: v0.1 (current: v0.2-SNAPSHOT)
[16:10:32] [Craft Scheduler Thread - 1/WARN]: [BlueMapMCMapSync] Download it at https://github.com/TechnicJelle/BlueMapMCMapSync/releases/latest
[16:10:32] [Craft Scheduler Thread - 1/INFO]: [BlueMapMCMapSync] Loading existing configs
[16:10:32] [Craft Scheduler Thread - 1/INFO]: [BlueMapMCMapSync] Loading config for map: world_nether
[16:10:33] [Craft Scheduler Thread - 1/INFO]: [BlueMapMCMapSync] Loaded 0 squares for map: world_nether (Debug Mode: false)
[16:10:33] [Craft Scheduler Thread - 1/INFO]: [BlueMapMCMapSync] Loading config for map: world
[16:10:33] [Craft Scheduler Thread - 1/INFO]: [BlueMapMCMapSync] Loaded 2 squares for map: world (Debug Mode: false)
[16:10:33] [Craft Scheduler Thread - 1/INFO]: [BlueMapMCMapSync] Loading config for map: world_the_end
[16:10:33] [Craft Scheduler Thread - 1/INFO]: [BlueMapMCMapSync] Loaded 0 squares for map: world_the_end (Debug Mode: false)
[16:10:33] [Craft Scheduler Thread - 1/INFO]: [BlueMap] Loaded!

I also restarted the server to make sure all of the current chunk data was flushed to disk, as I've had oddities with BlueMap rendering chunks correctly when they're in use by players. EDIT: Here's the log after running /bmdiscover and reloading the server again, which shows the map squares count increased:

[16:55:14] [Craft Scheduler Thread - 1/WARN]: [BlueMapMCMapSync] New version available: v0.1 (current: v0.2-SNAPSHOT)
[16:55:14] [Craft Scheduler Thread - 1/WARN]: [BlueMapMCMapSync] Download it at https://github.com/TechnicJelle/BlueMapMCMapSync/releases/latest
[16:55:14] [Craft Scheduler Thread - 1/INFO]: [BlueMapMCMapSync] Loading existing configs
[16:55:14] [Craft Scheduler Thread - 1/INFO]: [BlueMapMCMapSync] Loading config for map: world_nether
[16:55:14] [Craft Scheduler Thread - 1/INFO]: [BlueMapMCMapSync] Loaded 0 squares for map: world_nether (Debug Mode: false)
[16:55:14] [Craft Scheduler Thread - 1/INFO]: [BlueMapMCMapSync] Loading config for map: world
[16:55:14] [Craft Scheduler Thread - 1/INFO]: [BlueMapMCMapSync] Loaded 3 squares for map: world (Debug Mode: false)
[16:55:14] [Craft Scheduler Thread - 1/INFO]: [BlueMapMCMapSync] Loading config for map: world_the_end
[16:55:14] [Craft Scheduler Thread - 1/INFO]: [BlueMapMCMapSync] Loaded 0 squares for map: world_the_end (Debug Mode: false)
[16:55:14] [Craft Scheduler Thread - 1/INFO]: [BlueMap] Loaded!
TechnicJelle commented 2 months ago

Thank you! Could you enable debug mode, explore some more stuff, and send the log again? If I recall correctly, debug mode should log some stuff when a new square is discovered. Both when discovered by command, and automatically, when a new map is created.

Jaymus3 commented 2 months ago

Hello again. We've done some testing. There is a config option that needs to be enabled first of all, and I did not have that enabled which is why it wasn't working initially. The map finding works fine for freshly created maps and for found maps like buried treasure, but does not work if a map has been scaled with the cartographer's table. Those maps require the command /bmdiscover to actually sync. I'd also like the ability to turn this map syncing off per world so players don't need to make maps for the nether for example.