Jump to content

Recommended Posts

Posted

I'm having a problem I can't figure. My blocks always show with the missing texture texture, and the basic cube model when placed, ignoring the associated json file located at: "src/main/resources/assets/gsr_yatm/models/block/large_copper_heat_sink.json". But, if I copy the file exactly into: "src/main/resources/assets/gsr_yatm/models/item/", it'll render the model and textures correctly for the BlockItem form, oversized in hand and so, but still correctly.

 

For example the declaration and registration of a block I'm using.

public static final String MODID = "gsr_yatm";

public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, MODID);
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MODID);
	
public static final RegistryObject<Block> LARGE_COPPER_HEAT_SINK = BLOCKS.register("large_copper_heat_sink", () -> new Block(BlockBehaviour.Properties.of(Material.STONE)));
public static final RegistryObject<Item> LARGE_COPPER_HEAT_SINK_ITEM = queueForGeneralCreativeTab(ITEMS.register("large_copper_heat_sink", () -> new BlockItem(LARGE_COPPER_HEAT_SINK.get(), new Item.Properties())));

And then in my main class's constructor this's everything.

IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();

BLOCKS.register(modEventBus);
ITEMS.register(modEventBus);

//MinecraftForge.EVENT_BUS.register(this);

modEventBus.addListener(this::addCreative);
modEventBus.addListener(this::buildContents);

And for reference the aforementioned large_copper_heat_sink.json file:

{
	"parent": "gsr_yatm:block/large_heat_sink",
	"textures": {
		"1": "gsr_yatm:block/large_copper_heat_sink_one",
		"2": "gsr_yatm:block/large_copper_heat_sink_two"
	}
}

And then finally the parent it references:

{
	"credit": "Made with Blockbench",
	"textures": {
		"particle": "#1"
	},
	"elements": [
		{
			"from": [0, 0, 0],
			"to": [16, 4, 16],
			"faces": {
				"north": {"uv": [0, 0, 16, 4], "texture": "#2"},
				"east": {"uv": [0, 0, 16, 4], "texture": "#2"},
				"south": {"uv": [0, 0, 16, 4], "texture": "#2"},
				"west": {"uv": [0, 0, 16, 4], "texture": "#2"},
				"up": {"uv": [0, 0, 16, 16], "texture": "#1"},
				"down": {"uv": [0, 0, 16, 16], "texture": "#1"}
			}
		},
		{
			"from": [4, 4, 4],
			"to": [12, 5, 12],
			"faces": {
				"north": {"uv": [4, 9, 12, 10], "texture": "#1"},
				"east": {"uv": [4, 9, 12, 10], "texture": "#1"},
				"south": {"uv": [4, 9, 12, 10], "texture": "#1"},
				"west": {"uv": [4, 9, 12, 10], "texture": "#1"},
				"up": {"uv": [0, 0, 8, 8], "texture": "#1"},
				"down": {"uv": [0, 0, 8, 8], "texture": "#1"}
			}
		},
		{
			"from": [0, 5, 0],
			"to": [16, 6, 16],
			"faces": {
				"north": {"uv": [0, 6, 16, 7], "texture": "#1"},
				"east": {"uv": [0, 6, 16, 7], "texture": "#1"},
				"south": {"uv": [0, 6, 16, 7], "texture": "#1"},
				"west": {"uv": [0, 6, 16, 7], "texture": "#1"},
				"up": {"uv": [0, 0, 16, 16], "texture": "#1"},
				"down": {"uv": [0, 0, 16, 16], "texture": "#1"}
			}
		},
		{
			"from": [4, 6, 4],
			"to": [12, 7, 12],
			"faces": {
				"north": {"uv": [4, 8, 12, 9], "texture": "#1"},
				"east": {"uv": [4, 8, 12, 9], "texture": "#1"},
				"south": {"uv": [4, 8, 12, 9], "texture": "#1"},
				"west": {"uv": [4, 8, 12, 9], "texture": "#1"},
				"up": {"uv": [0, 0, 8, 8], "texture": "#1"},
				"down": {"uv": [0, 0, 8, 8], "texture": "#1"}
			}
		},
		{
			"from": [0, 7, 0],
			"to": [16, 8, 16],
			"faces": {
				"north": {"uv": [0, 4, 16, 5], "texture": "#1"},
				"east": {"uv": [0, 4, 16, 5], "texture": "#1"},
				"south": {"uv": [0, 4, 16, 5], "texture": "#1"},
				"west": {"uv": [0, 4, 16, 5], "texture": "#1"},
				"up": {"uv": [0, 0, 16, 16], "texture": "#1"},
				"down": {"uv": [0, 0, 16, 16], "texture": "#1"}
			}
		},
		{
			"from": [4, 8, 4],
			"to": [12, 9, 12],
			"faces": {
				"north": {"uv": [4, 7, 12, 8], "texture": "#1"},
				"east": {"uv": [4, 7, 12, 8], "texture": "#1"},
				"south": {"uv": [4, 7, 12, 8], "texture": "#1"},
				"west": {"uv": [4, 7, 12, 8], "texture": "#1"},
				"up": {"uv": [0, 0, 8, 8], "texture": "#1"},
				"down": {"uv": [0, 0, 8, 8], "texture": "#1"}
			}
		},
		{
			"from": [0, 9, 0],
			"to": [16, 10, 16],
			"faces": {
				"north": {"uv": [0, 3, 16, 4], "texture": "#1"},
				"east": {"uv": [0, 3, 16, 4], "texture": "#1"},
				"south": {"uv": [0, 3, 16, 4], "texture": "#1"},
				"west": {"uv": [0, 3, 16, 4], "texture": "#1"},
				"up": {"uv": [0, 0, 16, 16], "rotation": 180, "texture": "#1"},
				"down": {"uv": [0, 0, 16, 16], "rotation": 90, "texture": "#1"}
			}
		},
		{
			"from": [4, 10, 4],
			"to": [12, 11, 12],
			"faces": {
				"north": {"uv": [4, 6, 12, 7], "texture": "#1"},
				"east": {"uv": [4, 6, 12, 7], "texture": "#1"},
				"south": {"uv": [4, 6, 12, 7], "texture": "#1"},
				"west": {"uv": [4, 6, 12, 7], "texture": "#1"},
				"up": {"uv": [0, 0, 8, 8], "texture": "#1"},
				"down": {"uv": [0, 0, 8, 8], "texture": "#1"}
			}
		},
		{
			"from": [0, 11, 0],
			"to": [16, 12, 16],
			"faces": {
				"north": {"uv": [0, 0, 16, 1], "texture": "#1"},
				"east": {"uv": [0, 1, 16, 0], "texture": "#1"},
				"south": {"uv": [0, 0, 16, 1], "texture": "#1"},
				"west": {"uv": [0, 0, 16, 1], "texture": "#1"},
				"up": {"uv": [0, 0, 16, 16], "texture": "#1"},
				"down": {"uv": [0, 0, 16, 16], "texture": "#1"}
			}
		},
		{
			"from": [4, 12, 4],
			"to": [12, 13, 12],
			"faces": {
				"north": {"uv": [4, 5, 12, 6], "texture": "#1"},
				"east": {"uv": [4, 5, 12, 6], "texture": "#1"},
				"south": {"uv": [4, 5, 12, 6], "texture": "#1"},
				"west": {"uv": [4, 5, 12, 6], "texture": "#1"},
				"up": {"uv": [0, 0, 8, 8], "texture": "#1"},
				"down": {"uv": [0, 0, 8, 8], "texture": "#1"}
			}
		},
		{
			"from": [0, 13, 0],
			"to": [16, 14, 16],
			"faces": {
				"north": {"uv": [0, 1, 16, 2], "texture": "#1"},
				"east": {"uv": [0, 1, 16, 2], "texture": "#1"},
				"south": {"uv": [0, 1, 16, 2], "texture": "#1"},
				"west": {"uv": [0, 1, 16, 2], "texture": "#1"},
				"up": {"uv": [0, 0, 16, 16], "rotation": 270, "texture": "#1"},
				"down": {"uv": [0, 0, 16, 16], "rotation": 180, "texture": "#1"}
			}
		},
		{
			"from": [4, 14, 4],
			"to": [12, 15, 12],
			"faces": {
				"north": {"uv": [4, 4, 12, 5], "texture": "#1"},
				"east": {"uv": [4, 4, 12, 5], "texture": "#1"},
				"south": {"uv": [4, 4, 12, 5], "texture": "#1"},
				"west": {"uv": [4, 4, 12, 5], "texture": "#1"},
				"up": {"uv": [0, 0, 8, 8], "texture": "#1"},
				"down": {"uv": [0, 0, 8, 8], "texture": "#1"}
			}
		},
		{
			"from": [0, 15, 0],
			"to": [16, 16, 16],
			"faces": {
				"north": {"uv": [0, 0, 16, 1], "texture": "#1"},
				"east": {"uv": [0, 0, 16, 1], "texture": "#1"},
				"south": {"uv": [0, 0, 16, 1], "texture": "#1"},
				"west": {"uv": [0, 0, 16, 1], "texture": "#1"},
				"up": {"uv": [0, 0, 16, 16], "texture": "#1"},
				"down": {"uv": [0, 0, 16, 16], "texture": "#1"}
			}
		}
	]
}

Any help'd be sincerely appreciated,

GSR

Posted

Don't post code in the forum. Upload enough code to github to reproduce your issue.

 

If the problem isn't obvious from the little information you post in the forums, your question will likely just be ignored.

But if the problem isn't obvious from reading the code on github, we can at least download it and run/debug it for ourselves.

 

e.g. In this case we have no way to validate you have done things correctly if we can't see the real file structure, rather than what you think/say it is.

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Posted

That isn't what I meant by reproducable. Where's the build.gradle, etc?

If you don't make your problem easily accessible, people will eventually just ignore it instead of wasting time keeping having to ask for more information.

 

Anyway, I've never seen a model done that like that.

https://github.com/GSR-Os76/YATM/blob/main/src/main/resources/assets/gsr_yatm/models/block/large_heat_sink.json

Your root model has none of the item transformation stuff, e.g. this is the vanilla root model for most blocks

https://github.com/misode/mcmeta/blob/assets/assets/minecraft/models/block/block.json

 

To be honest, I don't know what it uses if you don't specify that information?

I would guess if you add "minecraft:block/block" as the parent of that large_heat_sink model it would fix things?

I would also bet your run/logs/debug.log has a lot of warnings. Especially since the block has no blockstates file.

 

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Posted

Adding the "minecraft:block/block" as the parent to the large_heat_sink.json model fixes how it renders in the players hand and inventory slots to be more so consistent with other blocks, but it still doesn't render in the world to any extent. Still good to know though, still helpful improvement.

In fact cutting out the middle person all together doesn't fix anything either, nor does copying a working block that's from minecraft's block json file as the large_copper_heat_sink block model, they'll only work for the BlockItem. I tried both among many other things throughout yesterday, along with reading all the documentation I could find, yet I have no clue. And I can't find other people reporting it happening for forge 1.19.3 - 44.1.0 either, so I'd suspect it's something to do with my set up.

 

I've uploaded the build.gradle file, as well as several others. To be entirely honest I don't know what they actually mean/represent/do, I've been doing this for roughly five days and haven't researched them yet.

Your patience and contribution of your time is very much appreciated.

Posted
38 minutes ago, warjort said:

I would also bet your run/logs/debug.log has a lot of warnings. Especially since the block has no blockstates file.

 

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Posted
Quote

[17May2023 17:35:06.737] [Worker-Main-2/WARN] [net.minecraft.client.resources.model.ModelBakery/]: Exception loading blockstate definition: 'gsr_yatm:blockstates/large_copper_heat_sink.json' missing model for variant: 'gsr_yatm:large_copper_heat_sink#'

 

  • Like 1

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.