Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item Blacklist #35

Open
ElitoGame opened this issue Sep 6, 2022 · 0 comments
Open

Item Blacklist #35

ElitoGame opened this issue Sep 6, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@ElitoGame
Copy link
Collaborator

Short Description

Some servers might have unique items, they do not want to be sold. May it be due to a story quest or just because a dupe gave some person 9 million barrier blocks. In these cases or others, you might want to stop the trade of certain items with a blacklist.

Implementation

  • Create a new config file to handle the blacklist (itemblacklist.yml). Some servers might add a ton of items to this list. In that case, storing the blacklist in the standard config, would make it quite unreadable.
  • The way items are defined will vary a lot, so there should be a bunch of options:
blacklist:
  # -------- Compact design: ---------
  # The material can be defined via material:name. This should use the same names as F3+H ingame, not the bukkit STONE names.
  - material:stone 
  # Using two ;; separates options. itemname and lore can be used to filter for these settings. \n equals a new line of lore. 
  # If a lore or name line starts with &- it means that the check should ignore colors. ChatColor.stripcolors()
  - material:diamond_pickaxe;;itemname:King's Axe!;;itemlore:Only wielded by\n&-the king during combat!
  # Enchantments can be defined with or without a associated level. /{level} and are separated by comma. 
  # A > or < sign can be use limit to values greater then or less then.
  - enchantments:depth_strider,feather_falling/4,unbreaking/>1,mending
  # potions work the same way as Enchantments. Durability can be a value or if it ends with % a percent value. 
  # Can be used with > or < too.
  - potions:slow_falling,resistance/<4;;durability:100%
  # Attributes consist of the syntax: name of the attribute/ value of the attribute/ operation of the attribute/ affected slots.
  # Slots are separated by the & symbol.
  # Hide flags targets the various flags to hide. Unbreakable is a boolean value, either true or false.
  - attributes:max_health/1/amount/mainhand&offhand;;hide_flags:modifiers,unbreakable;;unbrekable:true
  # -------- Readable/Comfy design: ---------
  # Items have a identifier name to find them easier.
  - item1:
    material: fishing_rod
    enchantments:
      - lure: >1
      # Level 0 equals not here at all. Level -1 equals enchantment is present with any level.
      - unbreaking: 0
    unbreakable: true
  • Implement a ingame blacklist editor. /ecsadmin blacklist will show a gui list of all the blacklist filters. If a filter doesn't have a material, display a replacement item here instead (paper or structure void)
  • Filters don't neccessarily need a item. When inside the blacklist gui, have a button to select a item from your inventory. Whichever item you click next in your bottom inventory will be added as a blacklisted item. You will be directed to a new window with various buttons. You can select all the item settings you want to use for the blacklist:
[Material]   [Name]     [Lore]     ...
 enabled    disabled   disabled    ...
  • A shop selling a blacklisted item should still be opened when clicked, however, the buy and sell options should be disabled. Creating a shop with a blacklisted item should throw an error.
@ElitoGame ElitoGame added the enhancement New feature or request label Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant