JustBru00 / RenamePlugin

A Spigot/Bukkit Plugin that preforms different item modifications with easy to use commands.
https://epicrename.com
Mozilla Public License 2.0
16 stars 9 forks source link

[BUG] /removeloreline, /rename, and blacklisted words not working as intended #93

Closed SiuanSong closed 6 years ago

SiuanSong commented 6 years ago

Broken: Players are able to /removeloreline, /rename, /lore, & /setloreline from an item with a blacklisted word, thus removing any lore or name from an item they shouldn't be able to.
However, players are not able to /setloreline, /lore [blacklisted word] or /rename [blacklisted word]

JustBru00 commented 6 years ago

What are you trying to prevent? Players from using a word in the new name/lore or players from renaming something with that word in it?

SiuanSong commented 6 years ago

Both actually. "Players from using a word in the new lore" is blocked and working properly. It's "players from renaming something with that word in it" that is broken.
We have a plugin that gives potion effects if a certain lore is on the item. Some effects are negative, such as Blindness. Players are able to simply remove the lore line to get rid of the effect. However, they cannot add an effect via low, they can only remove.

JustBru00 commented 6 years ago

I will look at the code to see if there is an obvious issue. Can you send me a copy of your config?

JustBru00 commented 6 years ago

Also what version of the plugin and spigot/bukkit are you using?

SiuanSong commented 6 years ago

EpicRename v 3.4 git-Spigot-642f6d2-ca6d2cf (MC: 1.12.2)

SiuanSong commented 6 years ago

https://pastebin.com/3HWu4w0T

JustBru00 commented 6 years ago

The existinglore and existingname blacklists are what you are missing. They block players from preforming commands on items that already have the listed words in their lore or name respectively. So your config should look something like this:

#EpicRename by Justin Brubaker. https://www.spigotmc.org/resources/epicrename.4341/
#Version 3.0+

#DO NOT CHANGE THIS PLEASE
config_version: 4

#Plugin Prefix
prefix: '&8[&3Rename&8] &f'

#Economy Features
#You must restart the server after changing the economy settings.
economy:
  use: false
  costs:
    rename: 100
    lore: 100

#Blacklists    
blacklists:
  material:
    - 'WATCH'
    - 'PAPER'
    - 'COMPASS'
    - 'TRIPWIRE_HOOK'
    - 'DIAMOND'
    - 'MONSTER_EGG'
    - 'MONSTER_EGGS'
  text:
    - 'Swan Key'
    - 'Donator Key'
    - 'The Orb'
    - 'Token'
    - 'Voucher'
    - 'Mending X'
    - 'Infinity X'
    - 'I*'
    - 'II*'
    - 'III*'
    - 'IV*'
    - 'V*'
    - 'VI*'
    - 'X*'
    - 'Kolbi'
    - 'Item frames needed'
    - 'Louie216'

  #These values are checked without color and are case insensitive.  
  existingname:
    - 'Swan Key'
    - 'Donator Key'
    - 'The Orb'
    - 'Token'
    - 'Voucher'
    - 'Mending X'
    - 'Infinity X'
    - 'I*'
    - 'II*'
    - 'III*'
    - 'IV*'
    - 'V*'
    - 'VI*'
    - 'X*'
    - 'Kolbi'
    - 'Item frames needed'
    - 'Louie216'

  #These values are checked without color and are case insensitive.    
  existingloreline:
    - 'Swan Key'
    - 'Donator Key'
    - 'The Orb'
    - 'Token'
    - 'Voucher'
    - 'Mending X'
    - 'Infinity X'
    - 'I*'
    - 'II*'
    - 'III*'
    - 'IV*'
    - 'V*'
    - 'VI*'
    - 'X*'
    - 'Kolbi'
    - 'Item frames needed'
    - 'Louie216'

#Default Character Limit is 30
character_limit:
  enabled: false
  limit: 30  

#Should underscores be replaced with spaces?
replace_underscores: false

#Per world plugin enable
per_world: false

#Enabled worlds
enabled_worlds:
  - 'world'
  - 'world_nether'
  - 'world_the_end'
JustBru00 commented 6 years ago

Sorry that it is not more clear. blacklists.text was named before blacklists.existinglore and blacklists.existingname existed.

SiuanSong commented 6 years ago

Thank you! Working now

JustBru00 commented 6 years ago

Awesome! I have created an issue (#94) that should address the the clarity issue in the future.