B1n-ry / Youre-in-grave-danger

A minecraft mod which adds one single block. The grave, which will generate when you die, and store your items
https://www.curseforge.com/minecraft/mc-mods/youre-in-grave-danger
MIT License
65 stars 18 forks source link

How to customize graves? #148

Closed VincentQZX closed 8 months ago

VincentQZX commented 8 months ago

mod version : You're in Grave Danger 2.0.0-beta.7 game version : Minecraft 1.20.1 mod loader : fabric 0.15.0 issuse description : I can change the texture of the graves easily, but I find it hard to change the model of it by using an resourcepack. I put my model into this file : resourcepacks\Graves\assets\yigd\models\block ("Graves" is my resourespack's name), but it can't work. I wonder if there is a course or an example resourcepack for me to learn how to change the graves' model properly. Thanks for answering my question. Hope you can make the wonderful mod better and better!!!

B1n-ry commented 8 months ago

There's this on the mod wiki, but it's slightly outdated. I believe not too much should have changed though. By looking through really quickly, the only apparent difference I can find is that Base_Layer (cuboid that adapted rendering, based on the block below, if enabled, uses) is renamed to just base.

Also what exactly do you mean by "it can't work"? Does it crash? Or are just the faces of the textures wrong? Here's an explanation to why the texture faces would be wrong anyway: The graves uses a "blockentity renderer". Just like chests, this would cause the model to be static, not possible to modify with resource packs. However I've coded the mod to respect the model .json file anyway. This is done by dynamically rendering cubes/cuboids. This is different from other blocks, as you can only really decide where the entirety of the texture for a specific cuboid is located in a texture file. This means that for each cube shape, or element in the model .json file, all the faces must be connected in a proper order (there's an explanation of how on the wiki). I've also made the hitbox of the grave change based on what the model .json file is set to, which is different from all other blocks as they would retain their hitbox from how the model looks like from the start (defined by mojang). This is why there's also a model .json file you can add to a datapack, if the size would change for the clients, so modpacks or whatever can sync the shape of the block over client and server, instead of kicking people for flying when standing on top of the grave.

Let me know if there's anything you want further clarified or if there's anything else I can help you with. Also let me know if it still won't work for you

B1n-ry commented 8 months ago

Given you did not ask any follow-up questions, I'll assume you found out how to do it. I'll close this issue, but if you did have further questions, I'd still be happy to answer them!