LootrMinecraft / Lootr

friendly loot
MIT License
41 stars 37 forks source link

Ability to load Lootr chest/barrel blocks in Bluemap #409

Open Laephis opened 2 weeks ago

Laephis commented 2 weeks ago

Hello,

This might fall under a (long-shot) enhancement request, but I’m trying to get the block models from lootr to load successfully in Bluemap. There are instructions found here that explain how to make this work, but either lootr isn’t set up in a way for this to work automatically or I’m not smart enough to figure out what needs to be changed. I attempted to create a resource pack to fix the issue, but was told that the lootr block-model jsons don't seem to be in the correct format/have the correct data inside them. Is there anything that can be done to allow the lootr mod to work correctly with Bluemap? Many thanks for any help/suggestions.

Here’s an example of how the lootr chests currently show up:

cachedImage

noobanidus commented 2 weeks ago

This seems like an unfortunately quite complex issue.

With regard to chests, they use a BlockEntityRenderer similar to Vanilla chests, meaning that they don't actually have a specific model file that could be found in the resources or added to a resource pack. I didn't see anything on the website that specified how to deal with "entity" models like this.

Barrels use custom loader logic from Fabric and Forge to determine, based on the state of the block as it's synchronzied to the client, whether they should use the "opened" or "unopened" variants of textures (or the old textures, or just Vanilla textures).

However, it should be possible to just pick one set of models and create a blockstate file for them that bypasses the model loader completely and include that in a resource pack.

EDIT: Actually, following on from that, you could most likely recreate the block model for the chests (without the moveable parts) in Block Bench as a .json model, set the UVs correctly, etc, and then add that to a resource pack as well.

EDIT 2: So, in theory, what you'd need to do is:

  1. Make a model for the chest that's the size/shape of the Vanilla chest, but use the texture that you want from Lootr (current, previous, etc).
  2. Cull down the blockstate for the barrel and change the model references to which model you want (opened, unopened, and with the relevant correct texture).

That should make it work, hopefully!