scarpet icon indicating copy to clipboard operation
scarpet copied to clipboard

Add Dynamic Render Distance Display app to utilities

Open SulpherStaer opened this issue 3 years ago • 2 comments

image

An app that displays the current server render distance in the footer of the player list. This way the players always know the 'current' render distance. (some time delay)

This is intended to work together with a dynamic render distance mod, like the one made by Henkelmax.

The script has commands to configure the min and max render distance. The min/max is used in the color coded calculations, which use the same colors & calculation that carpet does for tps. The colors however are inverted. Where with tps 0 is green, and 50 is magenta, the render distance display has min as magenta, and max as green.

The amount of time it takes before the script checks the render distance again is customizable.

The script also saves the configuration on exit, to use it when the script is loaded again. Commands are locked behind op permissions.

A list of all commands with this script:

  • /renderdistance display maximumRenderDistance <max> - sets the maximum value.
  • /renderdistance display minimumRenderDistance <min> - sets the minimum value.
  • /renderdistance display limit <min> <max> - allows setting the minimum and maximum with a single command.
  • /renderdistance refreshTimer <seconds> - sets the time delay between refreshes of the display.
  • /renderdistance display update - Instantly updates the display for every player online.
  • /renderdistance display settings - shows the current min & max, and refresh time delay.

nb. the reason for the command being renderdistance display and not just renderdistance is because the mod from henkelmax also uses renderdistance as its root command.

SulpherStaer avatar Apr 07 '22 18:04 SulpherStaer

There appears to be a bug with either this script, or with carpet itself, but the config rule 'command_permission' -> 'ops', does not work at all. Tried setting it to 2 as well. Did /reload's, did /script unload/loads - did server restarts. It does not limit command permission at all.

SulpherStaer avatar Apr 07 '22 19:04 SulpherStaer

Note that adding to existing commands is not currently supported, it working is a bug IINW, it shouldn't let you load the app (the check is currently only in the legacy path, was forgotten for the new one). Should be allowed? Good question, has pros and cons.

altrisi avatar Apr 20 '22 13:04 altrisi