RonanPlugins / BetterRTP

Official wiki of the BetterRTP plugin!
https://www.spigotmc.org/resources/36081/
MIT License
111 stars 86 forks source link

Per world cooldowns aren't applied #97

Closed ChrisTaylor201 closed 2 years ago

ChrisTaylor201 commented 2 years ago

Plugin Version: 3.4.2-1

Describe The Bug: Per world cooldowns aren't applied, players can randomly teleport as if no cooldowns have been set.

How To Reproduce:

  1. Enable the Settings.Cooldown.PerWorld option.
  2. Set a different cooldown for each custom world.
  3. Observe the mentioned issue.

Expected Behavior: Per world cooldowns should be applied.

Screenshots/Error Log: None.

Additional Context: Here's our configuration and the output of the /rtp info command. As you can see, each world has a different non-zero cooldown. However, the parts of the output containing Cooldown: 0N/A don't seem right to me; are the cooldowns loaded correctly?

SuperRonanCraft commented 2 years ago

Hey mate, so the way you executed /rtp info is viewing it with the current permissions of the player executing, so most likely you are bypassing cooldowns so they are not being applied, the N/A shows up is when the command is not executed by a player, so a permission check is not performed.

I would suggest performing /rtp info world <player you want to check> and see what info shows up, and check if players are allowed to bypass cooldowns with the betterrtp.bypass.cooldown permission

ChrisTaylor201 commented 2 years ago

I originally ran the /rtp info command from the console, but the output of the /rtp info world <player> command is the same, only the number of queued positions differs.

I also checked the given permission, and none of our players inherit it.

SuperRonanCraft commented 2 years ago

Okay, then I would recommend enabling Debugger in the config and get me a log after executing /rtp reload

ChrisTaylor201 commented 2 years ago

Here you are.

SuperRonanCraft commented 2 years ago

Just uploaded a new patch that should fix this issue! This problem was actually very hidden and required only one line of code, but worked it out with someone and we got it fixed! Grab the new version here https://www.spigotmc.org/resources/betterrtp.36081/update?update=453764

ChrisTaylor201 commented 2 years ago

Unfortunately, this only partially fixed the issue – cooldowns are now applied per world, but instead of the world-specific durations, the global one is used for all.

iUndef commented 2 years ago

I've updated to the latest release and am also seeing this issue. I have a custom world set, including the setting 'Cooldown: 900'. I also have the 'Cooldown' section setting 'PerWorld' set to true. However every world just uses the default cooldown time that's set in the 'Cooldown' section. I've attached my current config for reference. kohirtp.txt

SuperRonanCraft commented 2 years ago

Okay, Ima reopen this issue cause I've seen some other reports on this, I will continue to look at how I can get this fixed ;)

ChrisTaylor201 commented 2 years ago

After updating to the latest version, per world cooldowns work as expected. Thank you for the fix!