Jump to content

Missing textures problem


yazant123

Recommended Posts

Hi everyone, I'm beginner of minecraft modding and new in this forum.

I'm doing a new mod for more sword and tools, and forge version of this mod is 1.12.2, but I have problems with textures, everytime I Fix it I fix it I fix it it gave the same problem for textures and I don't know how to fix this huge problem, if you want to see my codes I've made it so there it is:

 

init/moditems

package toolsmod.init;

import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import net.minecraftforge.fml.common.registry.GameRegistry;
import toolsmod.Reference;
import toolsmod.items.itemBedrockingot;
import toolsmod.items.itemBedrocksword;
import toolsmod.items.itemObsidianIngot;
import toolsmod.items.itemObsidiansword;
import toolsmod.util.util;

public class Moditems {
	
	public static Item ObsidianIngot;
	public static Item BedrockIngot;
	
	public static void Init() {
		ObsidianIngot = new itemObsidianIngot("obsidian_ingot", "obsidian_ingot");
		BedrockIngot = new itemBedrockingot("bedrock_ingot","bedrock_ingot");
		
	}
	
	
	public static void register() {
		registeritem(ObsidianIngot);
		registeritem(BedrockIngot);
	}
	
	public static void registerRenders() {
		registerRenderItem(ObsidianIngot);
		registerRenderItem(BedrockIngot);
	}
	
	public static void registeritem(Item item) {
		ForgeRegistries.ITEMS.register(item);
		util.getLogger().info("Registered_item" + item.getUnlocalizedName().substring(5));
	}
	
	public static void registerRenderItem(Item item) {
		ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(new ResourceLocation(Reference.MODID, item.getUnlocalizedName().substring(5)), "inventory"));
		util.getLogger().info("Register Render for " + item.getUnlocalizedName().substring(5));
	}
}

 

init.modtools

package toolsmod.init;

import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.item.ItemSword;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import toolsmod.Reference;
import toolsmod.items.itemBedrocksword;
import toolsmod.items.itemObsidiansword;
import toolsmod.util.util;

public class Modtools {
	
	public static final ToolMaterial ObsidianMaterial = EnumHelper.addToolMaterial(Reference.MODID + ":Obsidian", 2, 300, 5.0F, 2.0f, 12);
	public static final ToolMaterial BedrockMaterial = EnumHelper.addToolMaterial(Reference.MODID + ":Bedrock", 3, 400, 7.0F, 4.0f, 14);
	
	public static ItemSword Obsidiansword;
	public static ItemSword Bedrocksword;
	
	public static void Init() {
		Obsidiansword = new itemObsidiansword(ObsidianMaterial, "obsidian_sword");
		Bedrocksword = new itemBedrocksword(BedrockMaterial, "bedrock_sword");
		
	}
	
	public static void register() {
		registeritem(Obsidiansword);
		registeritem(Bedrocksword);
	}
	
	public static void registerRenders() {
		registerRenderItem(Obsidiansword);
		registerRenderItem(Bedrocksword);
	}
	
	
	public static void registeritem(Item item) {
		ForgeRegistries.ITEMS.register(item);
		util.getLogger().info("Registered_item" + item.getUnlocalizedName().substring(5));
	}
	
	public static void registerRenderItem(Item item) {
		ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(new ResourceLocation(Reference.MODID, item.getUnlocalizedName().substring(5)), "inventory"));
		util.getLogger().info("Register Render for " + item.getUnlocalizedName().substring(5));
	}
}

 

and codes from proxy package

Commonproxy

package toolsmod.proxy;

import toolsmod.init.Moditems;

public class Commonproxy {
	public void registerRenders() {
		Moditems.registerRenders();
	}
}

 

Clientproxy

package toolsmod.proxy;

public class Clientproxy extends Commonproxy {
	
	@Override
	public void registerRenders() {
		
	}
}

 

and this is two of them from model items

{
    "parent": "item/generated",
    "textures": {
        "layer0": "toolsmod:items/obsidian_ingot"
    }
}

 

{
    "parent": "item/generated",
    "textures": {
        "layer0": "toolsmod:items/obsidian_sword"
    }
}

 

hope someone tell me the problem....

Link to comment
Share on other sites

1) Why is your "register renderers" called from common code? That shit's client only.

2) Models need to be registered in the ModelRegistryEvent

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

5 hours ago, Draco18s said:

1) Why is your "register renderers" called from common code? That shit's client only.

2) Models need to be registered in the ModelRegistryEvent

well tbh, is just because I learned minecraft modding from youtube

so this means it will fix this problem or not.

Link to comment
Share on other sites

5 hours ago, yazant123 said:

so this means it will fix this problem or not.

It will. If you'd made those changes you would have seen.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.



×
×
  • Create New...

Important Information

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