Traveler's Backpack [Fabric]

Traveler's Backpack [Fabric]

15M Downloads

Add more blockstate conditions

TyBraniff opened this issue ยท 17 comments

commented

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:
Image
After the resource pack I provide they show as such:
Image
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.

commented

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

commented

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.

commented

Or I can push if you want. Whatever helps.

commented

Are they 1:1 like java models?

commented

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

So identical in design and shape but for some reason like 15 or 20% larger

commented

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

commented

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.

commented

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.

commented

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

commented

I can provide test jar with both implementations for Forge & Fabric so you could check if it works properly with Bluemap

commented

Sorry sir, modelling is the extent of my knowledge.

commented

Thank you, a lot of good work, do you have also changes to the code to render models on the player?

commented

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

commented

What do you mean by "add additional info"

commented

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

commented

I'll take the fabric jar and test

commented

ping me on my discord server