Add more blockstate conditions
TyBraniff opened this issue ยท 17 comments
Is your feature request related to a problem? Please describe.
No problems, just a request.
Describe the solution you'd like
Add something in the lines of: hasTanks: True and hasSleepingbag: True to the blockstates.
Describe alternatives you've considered
Waiting for any java developer to make a Bluemap Addon through its API for travelersbackpack.
Additional context
I help out Bluemaps users make resource packs for mods that dont render correctly. Bluemaps is a Webbased Map viewer. Currently without a resource pack TravelerBackpacks render as such:

After the resource pack I provide they show as such:

Which is major improvement. However its not 1:1 accurate as some of the actual backpacks don't have tanks/sleeping bags in game.
I can only work with blockstates for resource packs so in order for me to accurately display those I'd need those blockstate conditions to grab the right model. The only other option people have is waiting for a java dev to code an addon to their Bluemap API that uses the NBT data to accurately place different models.
Hi, currently backpacks (I mean backpack models) are added through java models and rendered to the game, I plan opimizing this and adding backpacks as regular json models, so as soon as It happens it should be resolved. Marking as enhancement
I've already made the models so if that helps save you time you're welcome to take them from my GitHub.
https://github.com/TyBraniff/Bluemap-x-TravelersBackpack
They have been tested and work.
They were made using the same exact numbers you used in your Java model, just translated to blockbench, the only thing I couldn't figure out is they are somehow larger.
Edit: To elaborate
- Took values from https://github.com/Tiviacz1337/Travelers-Backpack/blob/1.20.1/src/main/java/com/tiviacz/travelersbackpack/client/model/BackpackModelData.java and created blocks for each addOrReplaceChild
- Filled in Texture offset, X Y Z S1 S2 S3 in their respective slots
- Backpack comes in upside down, Rotated the backpack 180 degrees on its X axis in blockbench.
- Created a parent model for most backpacks.
- Created separate models for backpacks with noses/wings
- Didn't need to change anything with the current blockstates, they already offset the model by 180 degrees.
So identical in design and shape but for some reason like 15 or 20% larger
I tried searching through as much source code as possible to see if there was some scaling that was happening when the backpack was placed but Java is lost on me so I get lost looking through the code
As I type that I find the flip and scaling here at https://github.com/Tiviacz1337/Travelers-Backpack/blob/94ba5a8356e15e605b0d28bc83e7c8f47b5f03ad/src/main/java/com/tiviacz/travelersbackpack/client/renderer/BackpackBlockEntityRenderer.java#L29C88-L30C71
So ~22% scale difference it seems. Could redo it, or if Java can handle scale differences that'd be tight.
Had some time tonight so I went ahead and did the reduction;
https://github.com/TyBraniff/Bluemap-x-TravelersBackpack/tree/main/assets/travelersbackpack/models
Inside /block directory should be the 1:1 of your placed backpacks
Inside /entity directory should be the fullsize model for the players back.
Forge & NeoForge provides ModelData to rendering system, it allows developers to use some values from block entities while rendering.
Fabric uses different mechanic but I've managed backpack model to work from json on both platforms, the implementations are completely different because loaders use different code to achieve dynamic models
I can provide test jar with both implementations for Forge & Fabric so you could check if it works properly with Bluemap
Thank you, a lot of good work, do you have also changes to the code to render models on the player?
Im working now to implement backpack model straight from json files, althrough I doubt I will add extra blockstate properties, instead I will use model data to add additional info to the model like tanks or sleeping bag
Because the biggest issue right now is we can't easily use NBT data without a plugin, while blockstates can be acted on much easier