stanhebben / MineTweaker3

Tweak your minecraft experience
68 stars 32 forks source link

[feature] Make /mt names dump out all valid sub-items (metadata/damage/tags) for item IDs #305

Open fluffle opened 8 years ago

fluffle commented 8 years ago

Hi,

I'm working on some dirty Lua scripts for ComputerCraft (http://github.com/fluffle/deliabot) and it would be really useful if I could use MineTweaker to dump not just item IDs but all valid sub-items. I realise this is a pretty long list! I started looking at sending a PR instead but the learning curve is pretty steep so it may take me a bit of time. I figured filing a feature request first couldn't hurt.

Cheers, --fluffle

fluffle commented 8 years ago

Ugh, of course I mean /mt names. Sorry.

Blue64 commented 8 years ago

and preferably also print their localized name (not currently standard) along with their unlocalized name (currently standard) :+1: because it's a real pain in the butt to keep the game open and constantly switch back & forth to ensure I didn't mess up the Item's Name in my comment in the Script so I can later Identify it (or locate it via "Ctrl"+"F")

this would be an amazing feature (and really put a dent in the overuse of "/mt hand" for script creation, as this would be much faster in most cases)

jaredlll08 commented 8 years ago

We are unable to print out the nbt tags, metadata and damage is the same, it will also create a new entry for EVERY damage, so iron_pick:0, iron_pick:1, iron_pick:2, ..., iron_pick:n

So that will make the list extremely large as some items have huge damage values.

Blue64 commented 8 years ago

You'd need to remove any duplicates from the Tool/Armor list obviously, and any new tools (Mining Dimension, Ex Nihilo, etc.) It'd be a large list, this is true, but expected.

Perhaps a upper limit of (configurable) 75 Meta per Item registered? AE2 loves to re-use Meta, all 4 types of Cable, 17 colors each, are all various Meta of the same Item, which makes sorting them a royal pain lol

jaredlll08 commented 8 years ago

It would still be a problem, and iirc AE2 uses nbt, which is impossible for me to loop through

fluffle commented 8 years ago

Asking for NBT is a bit much, I agree.

I think this is the code in NEI that searches the damage space for valid items. It looks like their strategy is to check for models that differ in damage slots 0-15. They only do this if (1) there are no item overrides, and (2) item.getSubItems() does not provide any sub items.

I can try porting the logic to MT if you're interested? I'll make sure to check my semicolons this time!

Blue64 commented 7 years ago

AE2 v2 R10 I'm pretty sure uses Meta, as the cables are somewhere in the hundred Meta Range, and the Seeds reach into the :1200 Meta Range for Pure Fluix Seed at 0.0% I believe. so this would help. (I know, super mega late comment, but was really good idea, and if not currently implemented, totally should be lol)

@fluffle was this your attempt of this?