Jump to content

[Solved].....Crash creating items


Recommended Posts

...code?

Also, 1.8 is ancient. If you want to use 1.8, at least use 1.8.9

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

24 minutes ago, Draco18s said:

...code?

Also, 1.8 is ancient. If you want to use 1.8, at least use 1.8.9

ture but i want to make my mods available for many version plus people use 1.7.10 and 1.10 allot still so my plan was to update my mods from 1.7 to 1.8 to 1.9 ect. 

code(do you only need the item code?):

package mysticmyles.Anime_Dekokurafuto.init;

import mysticmyles.Anime_Dekokurafuto.Reference;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class AnimeItems {
	
	public static Item uchiha_logo_item;
	public static Item yugioh_cardback_item;
	public static Item dragon_ball_logo0_item;
	
	public static void init() {
		uchiha_logo_item = new Item().setUnlocalizedName("uchiha_logo_item");
		yugioh_cardback_item = new Item().setUnlocalizedName("yugioh_cardback_item");
		dragon_ball_logo0_item = new Item().setUnlocalizedName("dragon_ball_logo0_item");
	}
	
	public static void register()
	{
		GameRegistry.registerItem(uchiha_logo_item, uchiha_logo_item.getUnlocalizedName().substring(5));
		GameRegistry.registerItem(yugioh_cardback_item, yugioh_cardback_item.getUnlocalizedName().substring(5));
		GameRegistry.registerItem(yugioh_cardback_item, dragon_ball_logo0_item.getUnlocalizedName().substring(5));
	}
	public static void registerRenders()
	{
		registerRender(uchiha_logo_item);
		registerRender(yugioh_cardback_item);
		registerRender(dragon_ball_logo0_item);
	}
	
	public static void registerRender(Item item)
	{
		Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
	}
}

 

Link to comment
Share on other sites

6 minutes ago, TheMysticMinecart Myles said:

GameRegistry.registerItem(yugioh_cardback_item, yugioh_cardback_item.getUnlocalizedName().substring(5)); GameRegistry.registerItem(yugioh_cardback_item, dragon_ball_logo0_item.getUnlocalizedName().substring(5));

Looks like you're registering yugioh_cardback_item twice.

 

I'm guessing copy & paste are to blame.

Link to comment
Share on other sites

Also, don't set the registry name to the unlocalized name. Set the unlocaled name to the registry name. Unlocalized names should be used for displaying the item's name only.

 

Problematic Code #7

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

18 minutes ago, Draco18s said:

Also, don't set the registry name to the unlocalized name. Set the unlocaled name to the registry name. Unlocalized names should be used for displaying the item's name only.

 

Problematic Code #7

so do i just do it like it's done in (1.7.10 the unlocalized name) and how different is 1.8.9 to 1.8

Link to comment
Share on other sites

item.setUnlocalizedName(item.getRegistryName().toString());

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

item is a local variable. So no, your code there won't work.

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Discovering that a trusted colleague had accessed my Bitcoin account and transferred $30,000 worth of bitcoins was a devastating blow. It shattered the trust I had placed in them and left me feeling vulnerable and betrayed. However, in the face of adversity, I turned to MUYERN TRUST HACKER for assistance in reclaiming control over my finances and holding the perpetrators accountable for their actions. One of the standout features of MUYERN TRUST HACKER was its ability to provide real-time alerts and notifications, keeping me informed every step of the way. With the support of MUYERN TRUST HACKER, I was able to gather irrefutable evidence of the perpetrator's actions and hold them accountable for their crimes. Armed with the information provided by the platform, I pursued legal recourse and ensured that justice was served. The perpetrator faced severe consequences for their actions, including legal penalties and financial restitution. Beyond its role in facilitating the recovery process, MUYERN TRUST HACKER provided me with a sense of empowerment and resilience in the face of adversity. While the experience was undoubtedly challenging, it ultimately served as a testament to the importance of vigilance and the power of technology in safeguarding our digital assets. Thanks to MUYERN TRUST HACKER, I emerged stronger and more resilient, ready to face whatever challenges the future may hold. Mail; muyerntrusted[At] mail-me .c o m
    • Discovering that a trusted colleague had accessed my Bitcoin account and transferred $30,000 worth of bitcoins was a devastating blow. It shattered the trust I had placed in them and left me feeling vulnerable and betrayed. However, in the face of adversity, I turned to MUYERN TRUST HACKER web [ ht tps:// muyerntrusthack.solutions/ ] for assistance in reclaiming control over my finances and holding the perpetrators accountable for their actions. One of the standout features of MUYERN TRUST HACKER was its ability to provide real-time alerts and notifications, keeping me informed every step of the way. With the support of MUYERN TRUST HACKER, I was able to gather irrefutable evidence of the perpetrator's actions and hold them accountable for their crimes. Armed with the information provided by the platform, I pursued legal recourse and ensured that justice was served. The perpetrator faced severe consequences for their actions, including legal penalties and financial restitution. Beyond its role in facilitating the recovery process, MUYERN TRUST HACKER provided me with a sense of empowerment and resilience in the face of adversity. While the experience was undoubtedly challenging, it ultimately served as a testament to the importance of vigilance and the power of technology in safeguarding our digital assets. Thanks to MUYERN TRUST HACKER, I emerged stronger and more resilient, ready to face whatever challenges the future may hold. Mail; muyerntrusted[At] mail-me .c o m  
    • Do you have still this problem? (I have it too so I want to know if you did something with it)  
    • Thank you very much, the mod worked. I almost destroyed my computer out of anger because I couldn't find the error.
  • Topics

×
×
  • Create New...

Important Information

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