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

OD doesn't accept multiple levels of the same enchanted tool in the TOOL condition. #186

Open ZephORSC opened 11 years ago

ZephORSC commented 11 years ago

The TOOL condition in Otherdrops won't properly accept defining an enchanted tool multiple times with multiple enchantments and varying levels of those enchantments. It only accepts the first defined version of the item.

Given the following example:

STEP:
    - action: RIGHT_CLICK
      tool: [ DIAMOND_SWORD@!LOOT_BONUS_MOBS, DIAMOND_SWORD@!LOOT_BONUS_MOBS#2, DIAMOND_SWORD@!LOOT_BONUS_MOBS#3, DIAMOND_SWORD@!DAMAGE_UNDEAD, IRON_SWORD@!LOOT_BONUS_MOBS#2, IRON_SWORD@!LOOT_BONUS_MOBS#3 ]
      message: "Debug."
      flags: UNIQUE

Here we tell OD that on right clicking a single step, it should print the message "Debug." if using any of the defined tools. However, it only prints the debug message when using a [ DIAMOND_SWORD with Looting 1 ], and [ IRON_SWORD with Looting 2 ], because those are the first instances defined of Diamond sword and Iron sword. Diamond sword with Looting 2, Looting 3, and Smite 1 fail to be recognized, and Iron sword with Looting 3 fails to be recognized.

The alternative solution for now is to do many individual entries of each tool, with each enchantment. For example:

STEP:
    - action: RIGHT_CLICK
      tool: [ DIAMOND_SWORD@!LOOT_BONUS_MOBS ]
      message: "Debug."
      flags: UNIQUE
    - action: RIGHT_CLICK
      tool: [ DIAMOND_SWORD@!LOOT_BONUS_MOBS#2 ]
      message: "Debug."
      flags: UNIQUE
    - action: RIGHT_CLICK
      tool: [ DIAMOND_SWORD@!LOOT_BONUS_MOBS#3 ]
      message: "Debug."
      flags: UNIQUE
    - action: RIGHT_CLICK
      tool: [ DIAMOND_SWORD@!DAMAGE_UNDEAD ]
      message: "Debug."
      flags: UNIQUE
    - action: RIGHT_CLICK
      tool: [ IRON_SWORD@!LOOT_BONUS_MOBS#2 ]
      message: "Debug."
      flags: UNIQUE
    - action: RIGHT_CLICK
      tool: [ IRON_SWORD@!LOOT_BONUS_MOBS#3 ]
      message: "Debug."
      flags: UNIQUE
CelticMinstrel commented 11 years ago

I'm guessing it would be easier to accept ranges for the enchantment level than to accept multiples of a tool... though, that would add another layer of complexity on top of your already overcomplex syntax...

Zarius commented 11 years ago

Actually, I believe it does already support a range :-) I'll have to test that out later. Although both ways should be working, for consistency.