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

[Feature Request and/or Issue] Block Lorename Check #280

Open Blacklands opened 11 years ago

Blacklands commented 11 years ago

I'm not sure how to label this, it might be a feature request, but it's also kind of an issue, and also a question... so here you go: Before I come to the actual problem, I'd need to have something clarified:

Can blocks (not items) have a lore name while they are placed? It doesn't matter if that name gets lost when mining them and picking them up (as seems to be the case, just tested it), I just need to know if they can have a lore name while placed. I know the Chest can, but I think that's a feature.

The reason why I need to know that is the following:

I was going to add different kinds of functionality to the Cauldron block (for example, I wanted to make it so that one can put dyes into them and then color up to five wool blocks in them), when I realized that it seems the Cauldron can only have a data value up to 14. After 3, which is a full Cauldron, the values up to 14 can be freely used, but anything higher than 14 will just revert to 14. 12 usable data values (from 3 to 14) are not even remotely enough to even add the wool coloring to Cauldrons, let alone other features, too.

So I thought I'd try it not via data values, but by replacing the Cauldron with another Cauldron that has a unique lore name (with "replacementblock"), and then check for that lore name. Then I realized that it seems you can't check a block for its lore name, only the tool you are using. I'm not sure if that's because that feature just is not implemented yet, or because a block doesn't retain its name when being "in the world" (placed down), so it isn't possible at all to do that.

Basically, I would need -something-, some sort of data, that I can assign to blocks (mainly the Cauldron, that's the main issue) when I can't use the normal data values (like it's the case with the Cauldron, which only supports data values up to 14).

If blocks can in fact have a lore name in the world, then I could just check for that (provided you add the functionality to OtherDrops to do that), if not, would there be anything else that I could assign to the Cauldron?

I'll give you an example why this would be VERY useful:

Cauldron Wool Coloring

cauldron@3:
- trigger: right_click
  tool: dye@0
  consumetool: 1
  message: "The Cauldron is now filled with a mixture of water and black dye."
  replacementblock: cauldron@4
- trigger: right_click
  tool: dye@1
  consumetool: 1
  message: "The Cauldron is now filled with a mixture of water and red dye."
  replacementblock: cauldron@5

cauldron@4:
- trigger: right_click
  tool: [wool@0, wool@1, wool@2, etc]
  consumetool: 1
  drop: wool@15

cauldron@5:
- trigger: right_click
  tool: [wool@0, wool@1, wool@2, etc]
  consumetool: 1
  drop: wool@14

This is not even the full functionality for wool coloring that I'd like to add, and you can already see that, with only 12 usable data values for the Cauldron, it is not possible to do for all the dye colors.

Now, if blocks can in fact have a lore name in the world, and you would add a way to check for them, I could just do something like:

cauldron@3:
- trigger: right_click
  tool: dye@0
  consumetool: 1
  message: "The Cauldron is now filled with a mixture of water and black dye."
  replacementblock: cauldron@!~black
- trigger: right_click
  tool: dye@1
  consumetool: 1
  message: "The Cauldron is now filled with a mixture of water and red dye."
  replacementblock: cauldron@!~red

cauldron@!~black:
- trigger: right_click
  tool: [wool@0, wool@1, wool@2, etc]
  consumetool: 1
  drop: wool@15

cauldron@!~red:
- trigger: right_click
  tool: [wool@0, wool@1, wool@2, etc]
  consumetool: 1
  drop: wool@14

That this lore name would be lost upon mining the Cauldron wouldn't be bad, I would make it so that they'd drop a normal Cauldron anyways (anything else wouldn't make much sense).

So, is that possible? If so, could you add a lorename check please? And if not, would you happen to know any other possible solution for it?

Blacklands commented 11 years ago

Okay, Faldonboy has already answered my first question: Blocks do not retain their name. Would there be any other way to do the things I've shown in my example above? Maybe a workaround to do it with this limited amount of (12) data values?

Zarius commented 11 years ago

Faldonboy's correct - blocks on the ground don't have the ability to have lorenames. Can't think of a workaround with the limited data values. Technically the chest doesn't have a lorename either, it's the inventory it holds that has the name.

I have considered added an ability to add names to blocks on the ground though. I'd have to track block placements and save the location of the block in a separate file. Couple of issues are making sure the entry is removed when the block is removed & whether the file would get too big (then I'd need to look into a database solution perhaps).

I'll mark it for consideration after I release 2.8 properly.

Blacklands commented 11 years ago

Thank you for the fast response. I guess I will just do it somehow else or skip it for now. Nice to hear that you're thinking about adding that functionality, even if it might still be a good deal in the future. :) EDIT: Uh, not sure if I should close this ticket now or not...

CelticMinstrel commented 11 years ago

I thought container blocks could have names though?