Jump to content

[1.12.2]Problem with .json and textures


MrPablo2000

Recommended Posts

1 minute ago, MrPablo2000 said:

That's my eclipse log:

This says your BlockState file is missing the normal variant. Please post your code and your jsons.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

@MrPablo2000 All of your assets except for your lang file which has some legacy code needs to be in all lower case.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Caused by: java.io.FileNotFoundException: lanterns:blockstates/orz1_off.json

Is your blockstates file named orz1_off.json? Make sure it is lowercase - all asset names must be entirely lowercase(I see that your blockstates file references the model with upper-case letters in it's name - that won't work)

Edited by V0idWa1k3r
Link to comment
Share on other sites

Just now, MrPablo2000 said:

Thanks - now works the block texture, but in blocks still is purple-black squares...

Do you have a ModelRegistryEvent setup?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

13 minutes ago, MrPablo2000 said:

Yes, in RegistryHandler:

OK, first off

Code Style Issue #3

And I need to see where you call ModelLoader.setCustomModelResourceLocation

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Just now, MrPablo2000 said:

Oh, I forgot about this...Where I must call it ?

The proper way to do it is in your ModelRegistryEvent or in a wrapper method in your ClientProxy. All Items have a model so there is no reason to have an IHasModel or have the ModelLoader.setCustomModelResourceLocation in your Items class. Especially since most Items will have a single model registered to them.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

I wrote it to my mod, but it still doesn't work:

package com.mrpablo2000.lanterns.network;

import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.client.model.ModelLoader;

public class ClientProxy extends CommonProxy{

	public static void registerItemRenderers(Item item, int meta, String id)
	{
		ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName(), id));
	}
}

 

Link to comment
Share on other sites

3 minutes ago, MrPablo2000 said:

I wrote it to my mod, but it still doesn't work:

Are you calling that method in your ModelRegistryEvent for your item?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Are you thinking about this?

package com.mrpablo2000.lanterns.blocks;

import com.mrpablo2000.lanterns.Lanterns;
import com.mrpablo2000.lanterns.items.ModItems;
import com.mrpablo2000.lanterns.util.IHasModel;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;

public class BlockORZ1 extends Block implements IHasModel {

	public static boolean isActive;
	public BlockORZ1(String name, boolean isActive ) {
		super(Material.IRON);
		this.isActive=isActive;
		this.setUnlocalizedName(name);
		this.setRegistryName(name);
		this.setCreativeTab(CreativeTabs.REDSTONE);
		
		ModBlocks.BLOCKS.add(this);
		ModItems.ITEMS.add(new ItemBlock(this).setRegistryName(this.getRegistryName()));
	
	}
	
	public void registerModels() {
		Lanterns.proxy.registerItemRenderers(Item.getItemFromBlock(this), 0, "inventory");
	}
}

 

Link to comment
Share on other sites

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.