BenCodez / VotingPlugin

Plugin on SpigotMC
Other
83 stars 68 forks source link

Milestones Not Working. #893

Closed MattGodwin closed 4 years ago

MattGodwin commented 4 years ago

Versions Voting Plugin version: 5.22 Paper 1.16.1 (IDK the specific one)

Relevant information Config

Context I can't get voting milestones to work. When they hit a milestone it doesn't run the commands. As most people have passed the ranks it is hard to test.

BenCodez commented 4 years ago

https://pastebin.com/JZbx1L9U

MattGodwin commented 4 years ago

Hi, thanks for the speedy response. When I voted on an account for the first time this came up in the console.

[23:00:46 WARN]: [VotingPlugin] Error occurred while obtaining item, turn debug on to see full stacktrace: java.lang.IllegalArgumentException: ConfigurationSection can not be null! You are probably missing a section in your config. [23:00:46 WARN]: [VotingPlugin] Error occurred while obtaining item, turn debug on to see full stacktrace: java.lang.IllegalArgumentException: ConfigurationSection can not be null! You are probably missing a section in your config. [23:00:46 WARN]: [VotingPlugin] Error occurred while obtaining item, turn debug on to see full stacktrace: java.lang.IllegalArgumentException: ConfigurationSection can not be null! You are probably missing a section in your config. [23:00:46 WARN]: [VotingPlugin] Error occurred while obtaining item, turn debug on to see full stacktrace: java.lang.IllegalArgumentException: ConfigurationSection can not be null! You are probably missing a section in your config. [23:00:46 WARN]: [VotingPlugin] Error occurred while obtaining item, turn debug on to see full stacktrace: java.lang.IllegalArgumentException: ConfigurationSection can not be null! You are probably missing a section in your config. [23:00:46 WARN]: [VotingPlugin] Error occurred while obtaining item, turn debug on to see full stacktrace: java.lang.IllegalArgumentException: ConfigurationSection can not be null! You are probably missing a section in your config.

BenCodez commented 4 years ago

Is there an item section for every votesite?

MattGodwin commented 4 years ago

I'm not sure what you mean by that.

BenCodez commented 4 years ago

https://github.com/Ben12345rocks/VotingPlugin/blob/master/VotingPlugin/Resources/VoteSites.yml#L54

Just note it will need to be Item instead of DisplayItem unless you use the latest dev build.

MattGodwin commented 4 years ago

I have updated the votesites.yml file now I get this in the console: [23:14:05 ERROR]: Cannot load plugins/VotingPlugin/Config.yml org.bukkit.configuration.InvalidConfigurationException: while scanning a simple key in 'string', line 683, column 8: -'broadcast &d %player% Has Been ... ^ could not find expected ':' in 'string', line 684, column 8: -'lp user %player% promote voting' ^ at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:59) ~[patched_1.16.1.jar:git-Paper-83] at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:160) ~[patched_1.16.1.jar:git-Paper-83] at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:128) ~[patched_1.16.1.jar:git-Paper-83] at org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(YamlConfiguration.java:186) ~[patched_1.16.1.jar:git-Paper-83] at com.Ben12345rocks.VotingPlugin.AdvancedCore.YML.YMLFile.reloadData(YMLFile.java:91) ~[?:?] at com.Ben12345rocks.VotingPlugin.Main.reload(Main.java:1092) ~[?:?] at com.Ben12345rocks.VotingPlugin.Commands.CommandLoader$16.execute(CommandLoader.java:499) ~[?:?] at com.Ben12345rocks.VotingPlugin.AdvancedCore.CommandAPI.CommandHandler$1.run(CommandHandler.java:399) ~[?:?] at org.bukkit.craftbukkit.v1_16_R1.scheduler.CraftTask.run(CraftTask.java:99) ~[patched_1.16.1.jar:git-Paper-83] at org.bukkit.craftbukkit.v1_16_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) ~[patched_1.16.1.jar:git-Paper-83] at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[patched_1.16.1.jar:git-Paper-83] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_242] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_242] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242] Caused by: org.yaml.snakeyaml.scanner.ScannerException: while scanning a simple key in 'string', line 683, column 8: -'broadcast &d %player% Has Been ... ^ could not find expected ':' in 'string', line 684, column 8: -'lp user %player% promote voting' ^ at org.yaml.snakeyaml.scanner.ScannerImpl.stalePossibleSimpleKeys(ScannerImpl.java:464) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.scanner.ScannerImpl.needMoreTokens(ScannerImpl.java:278) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:226) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingValue.produce(ParserImpl.java:586) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:136) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:257) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:248) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:236) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:162) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:257) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:248) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:236) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:162) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:257) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:248) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:236) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:162) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:257) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:248) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:236) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:162) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.composer.Composer.getNode(Composer.java:95) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:119) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:150) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:472) ~[patched_1.16.1.jar:git-Paper-83] at org.yaml.snakeyaml.Yaml.load(Yaml.java:398) ~[patched_1.16.1.jar:git-Paper-83] at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:57) ~[patched_1.16.1.jar:git-Paper-83] ... 13 more [23:14:05 WARN]: [VotingPlugin] RewardInject Validator: VoteReward, Directly Defined: false Path: Money : Money can not be 0 [23:14:05 ERROR]: [VotingPlugin] Failed to load Config.yml

MattGodwin commented 4 years ago

I added spaces in front of the '-lp user promote...' and that got rid of the error but It still doesn't run the command or show an error in console.

BenCodez commented 4 years ago

Pastebin what you have.

MattGodwin commented 4 years ago

https://pastebin.com/AqDLephb

BenCodez commented 4 years ago

https://pastebin.com/jKj2iR0p

MattGodwin commented 4 years ago

I don't get any errors but it still doesn't run the commands.

BenCodez commented 4 years ago

Are the milestones running?

MattGodwin commented 4 years ago

No, it just goes through the same as any other vote: [21:23:03 INFO]: Enmatt issued server command: /fakevote KailhBoxJades MCSL [21:23:03 INFO]: [Broadcast] Thanks KailhBoxJades for voting on MCSL [21:23:03 INFO]: [GriefPrevention] Adjusted KailhBoxJades's bonus claim blocks by 500. New total bonus blocks: 14500. [21:23:03 INFO]: CONSOLE issued server command: /give KailhBoxJades diamond 1 [21:23:03 INFO]: Giving 1 of diamond to [Default] KailhBoxJades.

I am resetting the vote total on the account so that it definitely should trigger a milestone.

BenCodez commented 4 years ago

Milestones only execute once, probably already been given.

/av User (player) ForceMilestone (Number)

MattGodwin commented 4 years ago

When I do that, it works as it should. It's just when they actually reach the milestone.

BenCodez commented 4 years ago

It can only be given once, even while it wasn't working before it probably still counted it.

MattGodwin commented 4 years ago

So what should I do?

BenCodez commented 4 years ago

See if it works when started with a new player?

MattGodwin commented 4 years ago

Nah, it still didn't work...

BenCodez commented 4 years ago

Set debuglevel to EXTRA, send the log.

MattGodwin commented 4 years ago

I think i have found the error, although I don't know how to fix it: https://pastebin.com/HWtJLpi7

In the rewards, it has a /give command which involves the ' character. I believe that it is closing the string early and then detecting a yml error. Is there anything that I can do to get around this?

BenCodez commented 4 years ago

Use " to start and end it

On Fri, Aug 7, 2020, 5:13 AM Matt notifications@github.com wrote:

I think i have found the error, although I don't know how to fix it: https://pastebin.com/HWtJLpi7

In the rewards, it has a /give command which involves the ' character. I believe that it is closing the string early and then detecting a yml error. Is there anything that I can do to get around this?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Ben12345rocks/VotingPlugin/issues/893#issuecomment-670418648, or unsubscribe https://github.com/notifications/unsubscribe-auth/AECIQNZYYTOOGS6EVBRCDQDR7PATNANCNFSM4PVVXG3A .

MattGodwin commented 4 years ago

The command also has " in it so it throws the same error.

BenCodez commented 4 years ago

You can escape the characters then. I thinks just a \ in front (if not google it) Or just use the plugin builtin item reward

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.