[Dev Tool] NamedBlocks
#1
This function returns block names from ids and metavals.

There is a explanatory README in the zip.


Attached Files
.zip   NamedBlocks.zip (Size: 3.95 KB / Downloads: 331)
Reply
Thanks given by:
#2
Why would you need a plugin, when there's a set of API functions doing exactly the same? ItemToString(), ItemTypeToString() also accept cItem objects that represent blocks:
Code:
local TypeDesc = ItemTypeToString(BlockType);  -- returns e.g. "wood" or "torch"; no meta processing

local BlockItem = cItem(BlockType, 1, Meta);
local MetaDesc = ItemToString(BlockItem);  -- returns e.g. "birch wood" or "torch"
local FullDesc = ItemToFullString(BlockItem);  -- returns e.g. "birch wood:1 * 1" or "torch:4 * 1"

Sorry for the multiple edits, I had to look the functions up in the end, couldn't make it from the top of my head.

Also of note: these API calls actually use the items.ini file, so they are kept up-to-date easily with the rest of MCServer.
Reply
Thanks given by:
#3
I didn't know about those functions, and I want formatted names with caps - I'm going to be giving these things to users.
Reply
Thanks given by:
#4
You can format the names in the ini file, then. Only I think it doesn't handle spaces, so you must not use a space in the block name.
Reply
Thanks given by:
#5
Doesn't matter, this works fine for meTongue

I want spaces and caps, and for the users not to have to edit the items.ini file.
Reply
Thanks given by:
#6
You should provide a reverse lookup too, then, so that the names that you give out can be traced back into blocktypes and blockmetas.
Reply
Thanks given by:
#7
Yeah I guess so. That would require loads more work. But it would work Smile

Just to check - there are no functions for it already are there?
Reply
Thanks given by:
#8
There are functions that translate strings returned by ItemToString() et al into blocktypes / cItem: BlockStringToType() and StringToItem()
Reply
Thanks given by:
#9
ok i guess i could do it for users... synonyms for blocks etc.]

But are people going to use it. I would but it would be inly a minor feature for BlockLogger and i doubt masses of people will use that feature.
Reply
Thanks given by:
#10
Quote:But are people going to use it. I would but it would be inly a minor feature for BlockLogger and i doubt masses of people will use that feature.
I tend to believe similar function exist inside Handy... Doubt if it exist in released version though...
Anyway, I'll add them to handy if they are missing and if you don't mind. Let's make a better dev plugin together!
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)