Zarius / Bukkit-OtherBlocks

OtherBlocks (now known as OtherDrops) plugin for Bukkit (dev build: https://www.mediafire.com/?i6ows1g6kus2o0l)
http://dev.bukkit.org/server-mods/otherdrops/
GNU General Public License v3.0
17 stars 17 forks source link

Error adding a permission #292

Closed cancabron closed 9 years ago

cancabron commented 10 years ago

I want to add a permission from Modifyworld but it haves a colon... This is my config:

ANY:
    - trigger: RIGHT_CLICK
      tool: ENCHANTED_BOOK~&4&lFormula
      command: [/$pex user %p add modifyworld.items.craft.267:?*, /$pex user %p add -otherdrops.custom.esphierro, /$pex user %p add otherdrops.custom.1esphierro]
      permission: esphierro
      consumetool: 1
    - trigger: RIGHT_CLICK
      tool: ENCHANTED_BOOK~&4&lFormula
      message: "&4[!] &cYa aprendiste esa formula."
      permission: 1esphierro

The config is OK, and if i dont insert the [] for multiple commands it works, but if i add the [] this appears:

2013-10-17 18:41:26 [INFO] [OtherDrops:2.8b.573] Loading file: otherdrops-drops.yml
2013-10-17 18:41:26 [INFO] Config is invalid!
2013-10-17 18:41:26 [INFO] The error was:
org.bukkit.configuration.InvalidConfigurationException: while scanning a plain scalar
 in 'string', line 64, column 21:
              command: [/$pex user %p add modifyworld.it ... 
                        ^
found unexpected ':'
 in 'string', line 64, column 66:
     ...  add modifyworld.items.craft.267:?*, /$pex user %p add -otherdro ... 
                                         ^
Please check http://pyyaml.org/wiki/YAMLColonInFlowContext for details.

2013-10-17 18:41:26 [INFO] You can fix the error and reload with /odr.
2013-10-17 18:41:26 [INFO] [OtherDrops:2.8b.573] Config is invalid!
2013-10-17 18:41:26 [INFO] [OtherDrops:2.8b.573] The error was:
org.bukkit.configuration.InvalidConfigurationException: while scanning a plain scalar
 in 'string', line 64, column 21:
              command: [/$pex user %p add modifyworld.it ... 
                        ^
found unexpected ':'
 in 'string', line 64, column 66:
     ...  add modifyworld.items.craft.267:?*, /$pex user %p add -otherdro ... 
                                         ^
Please check http://pyyaml.org/wiki/YAMLColonInFlowContext for details.

Greetings!

Zarius commented 9 years ago

Sorry I didn't see this one when it was posted but you just need to surround each option in quote marks so that YAML doesn't try to process the colon differently. e.g.:

      command: ["/$pex user %p add modifyworld.items.craft.267:?*", "/$pex user %p add -otherdrops.custom.esphierro", "/$pex user %p add otherdrops.custom.1esphierro"]