Jump to content

[1.8] [SOLVED] Certain items loading, certain not?


TheDogePwner

Recommended Posts

Hi,

This is the most bewildering thing that has ever happened to me during programming. Most of my items load, but some don't. The ones that do have working names (from my .lang file), working texture, etc. They all have pretty much identical code. Here is my main class:

 

 

package uc.mainmod;

 

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.item.Item;

import net.minecraft.item.Item.ToolMaterial;

import net.minecraftforge.common.util.EnumHelper;

import net.minecraftforge.fml.common.Mod;

import net.minecraftforge.fml.common.Mod.EventHandler;

import net.minecraftforge.fml.common.event.FMLInitializationEvent;

import net.minecraftforge.fml.common.registry.GameRegistry;

import uc.crafting.EmeraldArmorRecipes;

import uc.crafting.EmeraldToolsRecipes;

import uc.crafting.MachineCasingRecipe;

import uc.crafting.SteelDustRecipe;

import uc.items.EmeraldBoots;

import uc.items.EmeraldChestplate;

import uc.items.EmeraldHelmet;

import uc.items.EmeraldLeggings;

import uc.items.EmeraldPickaxe;

import uc.items.MachineCasing;

import uc.items.SteelDust;

import uc.items.SteelIngot;

import uc.smelting.SteelIngotSmeltingRecipe;

import uc.tabs.MechanicalItemsTab;

import uc.textures.EmeraldArmorTexturer;

import uc.textures.EmeraldToolTexturer;

import uc.textures.MachineCasingTexturer;

import uc.textures.SteelItemTexturer;

 

@Mod(modid = UltraCraft.MODID, version = UltraCraft.VERSION, name = UltraCraft.NAME)

public class UltraCraft {

public static final String MODID = "ultracraft";

public static final String VERSION = "1.0.0";

public static final String NAME = "UltraCraft";

 

public static Item steelIngot;

public static Item steelDust;

 

public static Item emeraldHelmet;

public static Item emeraldChestplate;

public static Item emeraldLeggings;

public static Item emeraldBoots;

 

public static Item machineCasing;

 

public static Item emeraldPickaxe;

 

ToolMaterial emeraldToolMaterial = EnumHelper.addToolMaterial("emeraldToolMaterial", 4, 2420, 14.0F, 7.0F, 16);

 

public static CreativeTabs mechanicalItemsTab;

 

@EventHandler

public void init(FMLInitializationEvent event) {

System.out.println("Creating creative tabs...");

mechanicalItemsTab = new MechanicalItemsTab("mechanicalItems");

 

System.out.println("Creating items...");

steelIngot = new SteelIngot();

steelDust = new SteelDust();

 

emeraldHelmet = new EmeraldHelmet();

emeraldChestplate = new EmeraldChestplate();

emeraldLeggings = new EmeraldLeggings();

emeraldBoots = new EmeraldBoots();

 

machineCasing = new MachineCasing();

 

emeraldPickaxe = new EmeraldPickaxe(emeraldToolMaterial);

 

System.out.println("Adding crafting recipes...");

SteelDustRecipe.addSteelDustRecipe();

EmeraldArmorRecipes.addEmeraldArmorRecipes();

EmeraldToolsRecipes.createEmeraldToolsRecipes();

MachineCasingRecipe.addMachineCasingRecipe();

 

System.out.println("Adding smelting recipes...");

SteelIngotSmeltingRecipe.addSteelIngotSmeltingRecipe();

 

System.out.println("Texturing items...");

SteelItemTexturer.texture();

EmeraldArmorTexturer.texture();

EmeraldToolTexturer.texture();

MachineCasingTexturer.texture();

 

System.out.println("Registering items...");

GameRegistry.registerItem(steelDust, "SteelDust", UltraCraft.MODID);

GameRegistry.registerItem(steelIngot, "SteelIngot", UltraCraft.MODID);

GameRegistry.registerItem(emeraldHelmet, "EmeraldHelmet", UltraCraft.MODID);

GameRegistry.registerItem(emeraldChestplate, "EmeraldChestplate", UltraCraft.MODID);

GameRegistry.registerItem(emeraldLeggings, "EmeraldLeggings", UltraCraft.MODID);

GameRegistry.registerItem(emeraldBoots, "EmeraldBoots", UltraCraft.MODID);

GameRegistry.registerItem(machineCasing, "MachineCasing", UltraCraft.MODID);

GameRegistry.registerItem(emeraldPickaxe, "EmeraldPickaxe", UltraCraft.MODID);

}

}

 

 

Here is the class of an item that has no texture, and it's name is item.MachineCasing.name:

 

package uc.items;

 

import uc.mainmod.UltraCraft;

import net.minecraft.item.Item;

 

public class MachineCasing extends Item {

public MachineCasing() {

setMaxStackSize(4);

setCreativeTab(UltraCraft.mechanicalItemsTab);

setUnlocalizedName("MachineCasing");

}

}

 

 

Here is the texturer for the MachineCasing:

 

package uc.textures;

 

import net.minecraft.client.Minecraft;

import net.minecraft.client.renderer.ItemModelMesher;

import net.minecraft.client.resources.model.ModelResourceLocation;

import uc.mainmod.UltraCraft;

 

public class MachineCasingTexturer {

public static void texture() {

ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem()

.getItemModelMesher();

mesher.register(

UltraCraft.machineCasing,

0,

new ModelResourceLocation(UltraCraft.MODID

+ ":"

+ UltraCraft.machineCasing.getUnlocalizedName().substring(

5), "inventory"));

}

}

 

What on earth is the problem???

Sup bruh.

Link to comment
Share on other sites

Nothing in logs? Texture not found maybe?

 

"TheDogePwner"

 

WHY? WHYYYYYYYYYYYYY?!?!??! (Hint: Look at my avatar)

 

EDIT

Also, your code will crash on dedic. You can't use Minecraft.class in dedic. Start using proxies for rendering/texturing.

 

EDIT 2

I see nothing out of ordinary (I am not really looking well to be honest) <lol that "sounded" like I'd be some creep-face>, BUT - initialize and register everything in PreInit. Do renderers and textures in Init (load). Might do the trick, idk, just common experience with those problems.

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

1. Sir, I apologize for pwning you (lol).

2. HEY LOOK! YAY!

[15:51:26] [Client thread/ERROR] [FML]: Model definition for location ultracraft:MachineCasing#inventory not found

 

Strange, considering I have MachineCasing.json in ultracraft/models/item/MachineCasing.json... and a texture in ultracraft/textures/items/MachineCasing.png...

Also remember the name isn't loading from en_US.lang.

Sup bruh.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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