SpongePowered / SpongeAPI

A Minecraft plugin API
http://www.spongepowered.org/
MIT License
1.14k stars 342 forks source link

Request to support per-player view distance #1682

Open phyne opened 7 years ago

phyne commented 7 years ago

Referencing this sponge thread

Would it be possible to support per-player view distance? A method to send a certain amount of chunks based on a player's individual setting (either specified by them or the server) would be unbelievable. I stumbled upon paperspigot, and apparently they support this feature.

In any case, thanks for the great work you guys do on Sponge!

ryantheleach commented 7 years ago

Would this prevent the chunks from even loading? or is this just a move to save on serialization / sending to the player?

parlough commented 7 years ago

The related Paper patch can be found here - https://github.com/PaperMC/Paper/blob/master/Spigot-Server-Patches/0036-Add-player-view-distance-API.patch

parlough commented 6 years ago

@dags- I saw you were working on a plugin like this. If you wanted to make PRs to Sponge or at least provide some feedback on how you'd like to see this done in the API that would be fantastic!

ryantheleach commented 6 years ago

https://github.com/SpongePowered/SpongeAPI/pull/1659 has merged per world view distances FYI.

dags- commented 6 years ago

World and Player both have methods 'getViewDistance' which refer to different things:

To me, 'get/setChunkRadius' (or similar) makes sense for the server-side notion of chunks around a player (the server setting doesn't change the client's view-distance setting), but even in the server.properties file it's called 'view-distance'. Alternatively the method currently in Player could just be renamed to something like 'getClientViewDistance' or 'getRenderDistance'?

I'm a little out of touch with the latest Sponge developments in all honestly so not sure what the preferred plan of attack would be.

Other than getter/setters, a reset method as added to the per-World PR would be a good idea.