jmc2obj / j-mc-2-obj

Java-based Minecraft-to-OBJ exporter.
http://www.jmc2obj.net
359 stars 59 forks source link

Reading blockstates outside of properties #184

Closed PixusPanic closed 2 years ago

PixusPanic commented 2 years ago

Hello! I've got a question on modded block configurations, that being if it's possible to read any blockstates that are set outside of the properties section. For context, I'm trying to see if I can make the program recognize the different states of Supplementaries' wall lanterns, which, if one uses an IBE editor, shows that the "name" tag is set outside of properties. {IsRedstone:0b,Lantern:{Name:"minecraft:lantern",Properties:{hanging:"false",waterlogged:"false"}}}

Is it possible for the program, either in its current state or for a future update, to read these "external" blockstates through editing the block configuration, and/or for it to maybe "pass" it to the program by letting it read whatever's put into it and then getting the block from it (like for example, if a framed block has one of its properties set to "minecraft:oak_planks", it would then give a then give that block the texture of Oak Planks)? If it's not, it's okay; it's definitely a pretty niche thing for people since not a lot of players are going to try to export modded structures and the like.

mmdanggg2 commented 2 years ago

I had a look into this and what that IBE editor is showing is the tile(block) entity on the block. Usually they're used to store more complex state information of a block like the inventory of a chest, furnace items and burn time etc. jmc can read from these, it does for banners to get patterns and player skull textures. So you could try and write your own model in java to read that info but then you're going to be making your own fork of jmc at that point to support just those mods. It might be possible to try and do some kind of matching of the nbt data in the tile entity but having a good way to specify that in the config is not so easy because unlike blockstates, the data in there could be complex and multilayered.

PixusPanic commented 2 years ago

Thanks for your response, and yeah, that makes sense. I might consider making a fork at some point but I'm definitely going to need more practice for that.