Jump to content

model no loading


xelatercero

Recommended Posts

hello i am trying different ways to create items. With this way i dont get any error but the texture dont load:

 

ModiItems:

 

public class ModItems {

public static Item orbeMedio;

public static void init() {
	orbeMedio = new OrbeMedio();
}

public static void register() {
	GameRegistry.register(orbeMedio);
}

public static void registerRenders() {
	registerRender(orbeMedio);
}

private static void registerRender(Item item) {
	ModelResourceLocation itemResourceLocation = new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory");
	ModelLoader.setCustomModelResourceLocation(item, 0, itemResourceLocation);
}

}

 

 

Item:

 

public class OrbeMedio extends Item {
public OrbeMedio() {
	this.setUnlocalizedName("orbeMedio");
	this.setRegistryName("OrbeMedio");
	this.setMaxStackSize(1);
	this.setCreativeTab(CreativeTabs.MISC);
}



}

 

ClientProxy

 

public class ClientProxy extends CommonProxy{

public void preInit() {
	super.preInit();
	ModItems.registerRenders();
}

public void Init() {
	super.Init();


}

public void postInit() {
	super.postInit();
}

@Override
public boolean isDedicatedServer() {

	return false;
}

}

 

 

CommonProxy

 

public abstract class CommonProxy {

public void preInit() {
	ModItems.init();

}

public void Init() {

}

public void postInit() {


}

 public abstract boolean isDedicatedServer();

}

Link to comment
Share on other sites

ModelResourceLocation itemResourceLocation = new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory");

 

Step 1: use getRegistryName() instead of this unlocalized name substring bullshit.

Step 2: your unlocalized name does not contain your modID and should.

Step 3: this code will crash a dedicated server because you are using client side code in a common location. It does not matter that you only call this method from your client proxy, it's mere existence will crash the server.

Step 4: post your item model json.

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

Step 2: your unlocalized name does not contain your modID and should.

i never added modid in my ulocalized name.

 

this code will crash a dedicated server because you are using client side code in a common location. It does not matter that you only call this method from your client proxy, it's mere existence will crash the server.

 

what is the correct way to do it?

 

 

and my item.json is no needed , because works i mean i am using objects from another mod that i have maded and works fine, you helped me with my item json so it cant be  wrong, right?

Link to comment
Share on other sites

Step 2: your unlocalized name does not contain your modID and should.

i never added modid in my ulocalized name.

 

it should

 

If another mod adds an item that has the same unlocalized name, then the two language entries will conflict and whichever mod loads last will win.

 

this code will crash a dedicated server because you are using client side code in a common location. It does not matter that you only call this method from your client proxy, it's mere existence will crash the server.

 

what is the correct way to do it?

 

Put client side only code in the client proxy.

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

Step 3: this code will crash a dedicated server because you are using client side code in a common location. It does not matter that you only call this method from your client proxy, it's mere existence will crash the server.

 

I disagree with this. I have set up my mod also more or less like this and it doesn't crash. It doesn't crash because it is never called on the server side. How i know this for sure? Because i tested this myself on a server (yes i rent a server) and it does not crash. The server runs smooth without any problems.

Link to comment
Share on other sites

he is searching in wrong place why?

 

private static void registerRender(Item item) {
	ModelResourceLocation itemResourceLocation = new ModelResourceLocation("xelamod:" + item.getRegistryName(), "inventory");
	ModelLoader.setCustomModelResourceLocation(item, 0, itemResourceLocation);
}

 

error:

 

Caused by: java.io.FileNotFoundException: xelamod:models/item/xelamod:OrbeMedio.json

 

why he search in models/item/xelamod:Orbemedio.json

 

Link to comment
Share on other sites

Ok now io dont get any error but texture dont load:

 

{
    "parent":"item/generated",
    "textures": {
        "layer0":"xelamod:items/orbeMedio"
    },
    "display": {
        "thirdperson": {
            "rotation": [ -90, 0, 0 ],
            "translation": [ 0, 1, -3 ],
            "scale": [ 0.55, 0.55, 0.55 ]
        },
        "firstperson": {
            "rotation": [ 0, -135, 25 ],
            "translation": [ 0, 4, 2 ],
            "scale": [ 1.7, 1.7, 1.7 ]
        }
    }
}

 

 

OrbeMedio.json

{
    "parent":"xelamod:item/standartOrbeMedio",
    "textures": {
        "layer0":"xelamod:items/orbeMedio"
    }
}

Link to comment
Share on other sites

Last log

 

[10:59:05] [Client thread/INFO]: Setting user: Player294
[10:59:09] [Client thread/WARN]: Skipping bad option: lastServer:
[10:59:09] [Client thread/INFO]: LWJGL Version: 2.9.4
[10:59:13] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:xelamod
[10:59:15] [sound Library Loader/INFO]: Starting up SoundSystem...
[10:59:16] [Thread-8/INFO]: Initializing LWJGL OpenAL
[10:59:16] [Thread-8/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[10:59:16] [Thread-8/INFO]: OpenAL initialized.
[10:59:16] [sound Library Loader/INFO]: Sound engine started
[10:59:19] [Client thread/INFO]: Created: 16x16 textures-atlas
[10:59:21] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:xelamod
[10:59:23] [Client thread/INFO]: SoundSystem shutting down...
[10:59:24] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com
[10:59:24] [sound Library Loader/INFO]: Starting up SoundSystem...
[10:59:24] [Thread-10/INFO]: Initializing LWJGL OpenAL
[10:59:24] [Thread-10/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[10:59:24] [Thread-10/INFO]: OpenAL initialized.
[10:59:24] [sound Library Loader/INFO]: Sound engine started
[10:59:27] [Client thread/INFO]: Created: 1024x512 textures-atlas
[10:59:28] [Client thread/WARN]: Skipping bad option: lastServer:
[10:59:29] [Realms Notification Availability checker #1/INFO]: Could not authorize you against Realms server: Invalid session id
[10:59:42] [server thread/INFO]: Starting integrated minecraft server version 1.10.2
[10:59:42] [server thread/INFO]: Generating keypair
[10:59:43] [server thread/INFO]: Preparing start region for level 0
[10:59:43] [server thread/INFO]: Changing view distance to 12, from 10
[10:59:45] [server thread/INFO]: Player294[local:E:bbf83733] logged in with entity id 120 at (417.77802192786663, 4.0, 1731.81928791248)
[10:59:45] [server thread/INFO]: Player294 joined the game
[10:59:46] [server thread/INFO]: Saving and pausing game...
[10:59:46] [server thread/INFO]: Saving chunks for level 'New World'/Overworld
[10:59:46] [server thread/INFO]: Saving chunks for level 'New World'/Nether
[10:59:46] [server thread/INFO]: Saving chunks for level 'New World'/The End
[10:59:46] [pool-2-thread-1/WARN]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@e406aec[id=132512aa-0146-35c4-8d7a-8445da21ff87,name=Player294,properties={},legacy=false]
com.mojang.authlib.exceptions.AuthenticationException: The client has sent too many requests within a certain amount of time
at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:65) ~[YggdrasilAuthenticationService.class:?]
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:175) [YggdrasilMinecraftSessionService.class:?]
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:59) [YggdrasilMinecraftSessionService$1.class:?]
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:56) [YggdrasilMinecraftSessionService$1.class:?]
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache.get(LocalCache.java:3934) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4827) [guava-17.0.jar:?]
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:165) [YggdrasilMinecraftSessionService.class:?]
at net.minecraft.client.Minecraft.getProfileProperties(Minecraft.java:3060) [Minecraft.class:?]
at net.minecraft.client.resources.SkinManager$3.run(SkinManager.java:131) [skinManager$3.class:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_60]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_60]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_60]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_60]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_60]
[10:59:47] [server thread/INFO]: Player294 has just earned the achievement [Taking Inventory]
[10:59:47] [Client thread/INFO]: [CHAT] Player294 has just earned the achievement [Taking Inventory]
[11:01:45] [Client thread/INFO]: Stopping!
[11:01:45] [Client thread/INFO]: SoundSystem shutting down...
[11:01:45] [server thread/INFO]: Stopping server
[11:01:45] [server thread/INFO]: Saving players
[11:01:45] [server thread/INFO]: Saving worlds
[11:01:45] [server thread/INFO]: Saving chunks for level 'New World'/Overworld
[11:01:45] [server thread/INFO]: Saving chunks for level 'New World'/Nether
[11:01:45] [server thread/INFO]: Saving chunks for level 'New World'/The End
[11:01:46] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com
[11:01:46] [Client Shutdown Thread/INFO]: Stopping server
[11:01:46] [Client Shutdown Thread/INFO]: Saving players
[11:01:46] [Client Shutdown Thread/INFO]: Saving worlds

Link to comment
Share on other sites

Post again in spoilers all the things you have now. Perhaps you have changed some stuff.

Describe what is not working. How does your item look like in game in the inventory and held in your hand?

Does it look like a big black/pink square?

Post these files again plz:

-your main class

-your client proxy

-your ModItems class

 

-the item model

Link to comment
Share on other sites

Does it look like a big black/pink square?

 

Yes.

 

Main

 

 

@Mod(modid=Reference.MOD_ID , name=Reference.MOD_NAME, version=Reference.MOD_VERSION)
public class xelamod {

@SidedProxy(clientSide=Reference.CLIENT_SIDE, serverSide=Reference.SERVER_SIDE)
 public static CommonProxy proxy;
@Instance
public static xelamod instance = new xelamod();


@EventHandler
public void preInit(FMLPreInitializationEvent e) {

	proxy.preInit();
	ModItems.init();
	ModItems.register();

}

@EventHandler
public void init(FMLInitializationEvent e) {

	proxy.Init();
}

@EventHandler
public void postInit(FMLPostInitializationEvent e) {

	proxy.postInit();
}


}

 

 

 

Client

 

 

public class ClientProxy extends CommonProxy{

public void preInit() {
	super.preInit();

}

public void Init() {
	super.Init();
	ModItems.registerRenders();


}

public void postInit() {
	super.postInit();
}

@Override
public boolean isDedicatedServer() {

	return false;
}

}

 

 

 

ModItem class

 

 

public class ModItems {

public static Item orbeMedio;

public static void init() {
	orbeMedio = new OrbeMedio();
}

public static void register() {
	GameRegistry.register(orbeMedio);
}

public static void registerRenders() {
	registerRender(orbeMedio);
}

private static void registerRender(Item item) {
	ModelResourceLocation itemResourceLocation = new ModelResourceLocation(item.getRegistryName(), "inventory");
	ModelLoader.setCustomModelResourceLocation(item, 0, itemResourceLocation);
}

}

 

 

 

 

Item Model:

 

 

 

Parent:

 

{
    "parent":"item/generated",
    "textures": {
        "layer0":"xelamod:items/orbeMedio"
    },
    "display": {
        "thirdperson": {
            "rotation": [ -90, 0, 0 ],
            "translation": [ 0, 1, -3 ],
            "scale": [ 0.55, 0.55, 0.55 ]
        },
        "firstperson": {
            "rotation": [ 0, -135, 25 ],
            "translation": [ 0, 4, 2 ],
            "scale": [ 1.7, 1.7, 1.7 ]
        }
    }
}

 

Item :

 

{
    "parent":"xelamod:item/standartOrbeMedio",
    "textures": {
        "layer0":"xelamod:items/orbeMedio"
    }
}

 

 

 

 

Link to comment
Share on other sites

1 - Yes this is the last log

 

2- Yes i am 100% registering the model in the client proxy iun Init

 

3-The model doesnt work

 

number 2 is wrong, you need to do it in the preInit.

So it seems Diesieben07 was right about that:

The only possibilities:

  • That is not the correct log.
  • You are not actually registering your model.
  • Your model works just fine.

 

One of these is true.

Link to comment
Share on other sites

ok if i do it i get this:

 

 

 

Caught exception from xelamod
java.lang.NullPointerException
at com.xelatercero.xelamod.init.ModItems.registerRender(ModItems.java:26) ~[bin/:?]
at com.xelatercero.xelamod.init.ModItems.registerRenders(ModItems.java:22) ~[bin/:?]
at com.xelatercero.xelamod.ClientProxy.preInit(ClientProxy.java:9) ~[bin/:?]
at com.xelatercero.xelamod.xelamod.preInit(xelamod.java:26) ~[bin/:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_60]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_60]
at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:599) ~[forgeSrc-1.10.2-12.18.2.2099.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_60]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_60]
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:239) ~[forgeSrc-1.10.2-12.18.2.2099.jar:?]
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:217) ~[forgeSrc-1.10.2-12.18.2.2099.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_60]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_60]
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:142) [LoadController.class:?]
at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:609) [Loader.class:?]
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:257) [FMLClientHandler.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:477) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_60]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_60]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_60]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_60]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:26) [start/:?]
[17:34:34] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:649]: ---- Minecraft Crash Report ----

 

 

Link to comment
Share on other sites

You're trying to register the renderer for your item before you've created it.

 

		proxy.preInit(); <-- register rendering
	ModItems.init(); <-- create item
	ModItems.register();

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.

Announcements



×
×
  • Create New...

Important Information

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