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

Adds support for modifying the tick rate #6592

Open
wants to merge 39 commits into
base: dev/feature
Choose a base branch
from

Conversation

Asleeepp
Copy link
Contributor

Description

This PR aims to add support for the tick rate to be changed, modified, etc, etc
Currently unfinished.
Plans to add a lot more to this.


Target Minecraft Versions: 1.20.3+
Requirements: none
Related Issues: none

@Asleeepp Asleeepp marked this pull request as draft April 19, 2024 17:32
@AyhamAl-Ali AyhamAl-Ali added the feature Pull request adding a new feature. label Apr 19, 2024
@sovdeeth sovdeeth changed the base branch from master to dev/feature April 19, 2024 21:14
@Asleeepp Asleeepp marked this pull request as ready for review April 21, 2024 12:35
Copy link
Member

@sovdeeth sovdeeth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also needs tests for the parts that can be tested. (probably can't test stepping, maybe with junit)

src/main/java/ch/njol/skript/expressions/ExprTick.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/expressions/ExprTick.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/expressions/ExprTick.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/expressions/ExprTick.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/expressions/ExprTick.java Outdated Show resolved Hide resolved
@Asleeepp Asleeepp requested a review from sovdeeth April 22, 2024 19:02
src/main/java/ch/njol/skript/effects/EffFreezeServer.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/expressions/ExprTick.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/expressions/ExprTick.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/expressions/ExprTick.java Outdated Show resolved Hide resolved
Copy link
Member

@sovdeeth sovdeeth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just minor stuff
will test tomorrow

src/main/java/ch/njol/skript/bukkitutil/ServerUtils.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/expressions/ExprTick.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/expressions/ExprTick.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/expressions/ExprTick.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/expressions/ExprTick.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/expressions/ExprTick.java Outdated Show resolved Hide resolved

@Override
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) {
if (!parseResult.tags.isEmpty()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should always be true (so it can be removed)

src/main/java/ch/njol/skript/effects/EffSprintServer.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffStepServer.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/effects/EffStepServer.java Outdated Show resolved Hide resolved
@sovdeeth sovdeeth added the 2.9 Targeting a 2.9.X version release label Jun 29, 2024
@APickledWalrus APickledWalrus removed the 2.9 Targeting a 2.9.X version release label Jul 2, 2024
src/main/java/ch/njol/skript/effects/EffStepServer.java Outdated Show resolved Hide resolved
})
@Since("INSERT VERSION")
@RequiredPlugins("Minecraft 1.20.4+")
public class ExprServerTickRate extends SimpleExpression<Float> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any connection between this and tps? I can see them getting mixed up.

Copy link
Contributor Author

@Asleeepp Asleeepp Sep 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing TPS expression gets the TPS over a period of time (1, 5, 15 minutes)

This one gets the current tick rate, which is most likely more precise then the existing expression, its also more specific to tick rate management, as opposed to average TPS over intervals.

though maybe this should be an option of that expression instead of something entirely new? Would love to hear other peoples thoughts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though, if it were to get added to that expression, I feel it would be tricky to come up with good syntax for it as [the] tps already exists in that expression, and returns all of the tps over the intervals.

putting this into that expression would output some dodgy syntax i feel like, I personally think it'd be best to keep them separate, but like I said before, would love to hear some other peoples thoughts

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No this doesn't get a more precise tps
It gets/sets the goal tps, which by default is 20. Your server can be having 10 tps but be targetting 20 tps, therefore lagging. It can have 5 tps and target 5 tps, therefor not lagging. TPS would return 10 and 5 respectively, but this expression would return 20 and 5.

Copy link
Contributor Author

@Asleeepp Asleeepp Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No this doesn't get a more precise tps It gets/sets the goal tps, which by default is 20. Your server can be having 10 tps but be targetting 20 tps, therefore lagging. It can have 5 tps and target 5 tps, therefor not lagging. TPS would return 10 and 5 respectively, but this expression would return 20 and 5.

whoops 😅, then yeah, this should stay its own expression

@TheAbsolutionism
Copy link

#6314

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Pull request adding a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants