How to block worldedit commands based on the blocks changed

Discussion in 'Spigot Plugin Development' started by Pangamma, Jun 1, 2017.

  1. We've been having a string of griefers come through setting entire plots to chests. If we disallow griefers from using chests in worldedit, that prevents users from copying their houses around. Not cool. We need a weird, custom solution for this.To prevent this from continuing, I want to make a plugin that does the following:

    1. Let user perform their command.
    2. Check the blocks changed. Check out ratios of laggy blocks to non laggy block, or just if anything should be considered malicious or dangerous.
    3. If ratio is off, notify all staff members. Prevent the worldedit command from completing. Deny any changes to the world. Warn the user about the actions taken. Perhaps also temporarily remove their worldedit permissions.


    I need help with part 2. Any ideas on which part of the API to use? Any example code? Thank you in advance.
     
  2. Choco

    Moderator

    Why don't you just use WorldEdit's blacklist?
    Config Option: limits.disallowed-blocks
     
  3. If you are using a WorldEditAPI(I don't know if one exists), just multiply the first and second selection and if the answer is over your desired amount, cancel it.

    Edit: Sorry, your title question is nothing like your body question. Just divide the answer from above by like 3 and if sand or whatever is over 3(the divided Integer), cancel it as well.
     
  4. Maybe have a command listener and check for the arguments?