Skip to content
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

View Distance #2010

Closed
Misio12320 opened this issue Apr 18, 2019 · 16 comments
Closed

View Distance #2010

Misio12320 opened this issue Apr 18, 2019 · 16 comments
Labels
completed The issue has been fully resolved and the change will be in the next Skript update. enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: lowest "Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements).

Comments

@Misio12320
Copy link

Hello. Could you might add view distance option?
Its useful option to reduce the lags on server.
Might could also work with on join e.g: 'set players render distance to 3' to let player join succesfull without lagging others and ownself

@ShaneBeee
Copy link
Contributor

  1. I do like this idea. Someone a while back asked me to add it to Skript-Paper (Since its only available on Paper and not Spigot) and it works like a charm. It would be cool to see Skript add it

  2. For the time being you can just do this with skript-mirror

  3. In all honesty, I just recommend setting your server view distance to whatever you need it to be. Do players really need to have different view distances from each other? Should really just be a global setting.

@Pikachu920
Copy link
Member

Pikachu920 commented Apr 18, 2019

@ShaneBeee personally I see a great opportunity to make people donate $100 per chunk of view distance

@ShaneBeee
Copy link
Contributor

@ShaneBeee personally I see a great opportunity to make people donate $100 per chunk of view distance

Im not sure if you're being sarcastic or serious ;) haha, but yeah I guess that would totally make sense, I didn't think of it that way!

@Beaness
Copy link

Beaness commented Apr 18, 2019

I would still be cool to have this in skript but people could make Pay To See (P2S).
But however a java dev could make this too without skript.

@Misio12320
Copy link
Author

Misio12320 commented Apr 18, 2019

Just for less lags ( for me less lags, not P2S lol). Plugin 'BestViewDistance' is not too fast like Skript. The 'set view distance for player' or 'set players view distance to 4' "to be reminiscent" with Skript. I cannot even join my server because the chunks are too large but might Skript could do something with events like on join... With Skript view distance could be easier than doing with skript-mirror. Searched here and found that #1655 so...
3. But when I change e.g to render-distance 3 the chunks are too short and can join but not playable. My world is corrupted so it can cause lags too... While joining with render distance more than e.g 8 its not possible to play cause lags or crash/kick. (...)

@ShaneBeee
Copy link
Contributor

if you have Skript-mirror its very simple (you will need to be using Paper not Spigot)

on join:
    player.setViewDistance(4)

At least this is something you can do for the time being

@Misio12320
Copy link
Author

Wow really? I was thinking if that would need something like on the skUnity (import: java.lang.System java.lang.String as JavaString java.lang.Math org.bukkit.Location) Hmm. But the 'set players view distance to 4' also too useful, easy to write and nice to read...

@ShaneBeee
Copy link
Contributor

You don't need any imports because the player object is already there.

I do agree with this
"But the 'set players view distance to 4' also too useful, easy to write and nice to read..."
Here is how I did it in Skript-Paper

Im just saying for the time being

@FranKusmiruk
Copy link
Member

I'll add it later. Meanwhile, you can use the alternatives suggested here.

@FranKusmiruk FranKusmiruk added enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: lowest "Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements). labels Apr 18, 2019
@Misio12320
Copy link
Author

  • may add "add +1 to player's view distance" to let decrease the lag because the player.setViewDistance(3)
    wait 3 real seconds
    player.setViewDistance(4)
    wait 3 real seconds. laggs too much and might "add +1 to player's view distance" might could change something... I think if the player.setViewDistance(4) and (3) is very different and it restarting the chunks and generating new + adding this 1

@ShaneBeee
Copy link
Contributor

They will most likely do a whole set/get/add/remove thing, as with many other expression, but just a heads up, the way it would be written would be exactly what you are doing.

Internally it would most likely be something like

player.setViewDistance(player.getViewDistance() + value)

so at the end of the day, internally it would the same thing as if doing it with skript-mirror

@Misio12320
Copy link
Author

[13:18:51 ERROR]: [Skript] 14 log handlers were not stopped properly! (at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1496)) [if you're a server admin and you see this message please file a bug report at https://github.com/bensku/skript/issues if there is not already one]

[13:18:52 ERROR]: [Skript] 14 log handlers were not stopped properly! (at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1602)) [if you're a server admin and you see this message please file a bug report at https://github.com/bensku/skript/issues if there is not already one]
[13:18:52 INFO]: [PlaceholderAPI] 124 placeholder expansions are available on the cloud.
[13:18:56 ERROR]: [Skript] 5 log handlers were not stopped properly! (at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1596)) [if you're a server admin and you see this message please file a bug report at https://github.com/bensku/skript/issues if there is not already one]
[13:18:56 ERROR]: [Skript] 1 log handler was not stopped properly! (at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1602)) [if you're a server admin and you see this message please file a bug report at https://github.com/bensku/skript/issues if there is not already one]
[13:18:56 ERROR]: [Skript] 522 log handlers were not stopped properly! (at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1523)) [if you're a server admin and you see this message please file a bug report at https://github.com/bensku/skript/issues if there is not already one]
[13:19:05 ERROR]: [Skript] 2829 log handlers were not stopped properly! (at ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:253)) [if you're a server admin and you see this message please file a bug report at https://github.com/bensku/skript/issues if there is not already one]
what is it? I have force loaded 2k or more chunks in 1.13.2 by command /forceload

@FranKusmiruk
Copy link
Member

That has nothing to do with this issue nor is something caused by Skript, ask for support in the forums/discord server.

@Beaness
Copy link

Beaness commented Apr 23, 2019

Not sure but you might need update skript mirror to 2.0.0 because these errors are like the same that happens on 1.0.0

@Misio12320
Copy link
Author

Sorry. Just reinstall needed. And how to do this.. I'm getting lag when I try join and getting t...: 21:54:04 WARN]: [Skript] No matching method: CraftPlayer#getViewDistance called with (3 (Long))

@ShaneBeee
Copy link
Contributor

Getters don’t take parameters.

@Whimsyturtle Whimsyturtle added the completed The issue has been fully resolved and the change will be in the next Skript update. label Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed The issue has been fully resolved and the change will be in the next Skript update. enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: lowest "Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements).
Projects
None yet
Development

No branches or pull requests

6 participants