Jump to content

Recommended Posts

Posted

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.

Posted

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.

Posted

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.

Posted

Post all your .json files for this thing (with directories).

 

EDIT

Read my "EDIT 2" in previous post if you didn't.

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

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I tried do download the essential mod to my mod pack but i didnt work. I paly on 1.21 and it should work. I use neoforge for my modding. The weird things is my friend somehow added the mod to his modpack and many others that I somehow can´t. Is there anything i can do? 
    • Thanks, I've now installed a slightly newer version and the server is at least starting up now.
    • i have the same issue. Found 1 Create mod class dependency(ies) in createdeco-1.3.3-1.19.2.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Found 11 Create mod class dependency(ies) in createaddition-fabric+1.19.2-20230723a.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Detailed walkthrough of mods which rely on missing Create mod classes: Mod: createaddition-fabric+1.19.2-20230723a.jar Missing classes of create: com/simibubi/create/compat/jei/category/sequencedAssembly/JeiSequencedAssemblySubCategory com/simibubi/create/compat/recipeViewerCommon/SequencedAssemblySubCategoryType com/simibubi/create/compat/rei/CreateREI com/simibubi/create/compat/rei/EmptyBackground com/simibubi/create/compat/rei/ItemIcon com/simibubi/create/compat/rei/category/CreateRecipeCategory com/simibubi/create/compat/rei/category/WidgetUtil com/simibubi/create/compat/rei/category/animations/AnimatedBlazeBurner com/simibubi/create/compat/rei/category/animations/AnimatedKinetics com/simibubi/create/compat/rei/category/sequencedAssembly/ReiSequencedAssemblySubCategory com/simibubi/create/compat/rei/display/CreateDisplay Mod: createdeco-1.3.3-1.19.2.jar Missing classes of create: com/simibubi/create/content/kinetics/fan/SplashingRecipe
    • The crash points to moonlight lib - try other builds or make a test without this mod and the mods requiring it
    • Do you have shaders enabled? There is an issue with the mod simpleclouds - remove this mod or disable shaders, if enabled  
  • Topics

×
×
  • Create New...

Important Information

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