Jump to content

Recommended Posts

Posted

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();

}

Posted
  Quote
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.

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

i never added modid in my ulocalized name.

 

  Quote
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?

Posted
  On 10/23/2016 at 10:05 PM, xelatercero said:

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

i never added modid in my ulocalized name.

 

  Quote
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.

 

  Quote
  Quote
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.

Posted
  On 10/23/2016 at 8:40 PM, Draco18s said:

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.

Posted

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

 

Posted

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"
    }
}

Posted

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

Posted

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

Posted
  Quote
Does it look like a big black/pink square?

 

Yes.

 

Main

 

  Reveal hidden contents

 

 

Client

 

  Reveal hidden contents

 

 

ModItem class

 

  Reveal hidden contents

 

 

 

Item Model:

 

 

  Reveal hidden contents

 

Posted
  On 10/24/2016 at 2:21 PM, xelatercero said:

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:

  Quote

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.

Posted

ok if i do it i get this:

 

 

  Reveal hidden contents

 

Posted

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.

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.