Jump to content

1.11.2 Eclipse Method getRegistryName and getUnlocalizedName are undefined


Recommended Posts

Posted

I'm new with modding and I wanted to create a Item. Now,  this is my Item Class

ItemObsidianingot

package items;

import com.FlinnX.MoreMaterials.Reference;
import net.minecraft.item.Item;

public class ItemObsidianingot extends Item {

	public ItemObsidianingot() {
		setUnlocalizedName(Reference.MoreMaterialsItems.OBSIDIANINGOT.getUnlocalizedName());
		setRegistryName(Reference.MoreMaterialsItems.OBSIDIANINGOT.getRegistryName());
	}
}

 

And this is my References Class

package com.FlinnX.MoreMaterials;

public class Reference {

	//Fundemental Mod Variables
	public static final String MOD_ID = "fmm"; //ID of the Mod: FlinnxMOreMAterials
	public static final String NAME = "More Materials Mod"; //The Name
	public static final String VERSION = "0.1-alpha"; //The Version of the Mod
	public static final String ACCEPTED_VERSIONS = "[1.11.2]"; //The Version it will be playable on
	
	public static final String CLIENT_PROXY_CLASS = "com.FlinnX.MoreMaterials.proxy.ClientProxy"; //Client Proxy Location
	public static final String SERVER_PROXY_CLASS = "com.FlinnX.MoreMaterials.proxy.ServerProxy"; //Server Proxy Location
	
	
	public static enum MoreMaterialsItems {
		OBSIDIANINGOT("obsidianingot", "ItemObsidianingot");
		
		private String unlocalizedName;
		private String registryName;
		
		MoreMaterialsItems(String unlocalizedName, String registryName) {
			this.unlocalizedName = unlocalizedName;
			this.registryName = registryName;
		}
	}
}

 

This is my Error:

 

The method getRegistryName() is undefined for the type Reference.MoreMaterialsItems

The method getUnlocalizedName() is undefined for the type Reference.MoreMaterilasItems

 

I saw that another user had this error and someone suggested that he should rename the enum. I tried this out too but it didn't worked.

Posted (edited)
22 hours ago, FlinnX said:

MoreMaterialsItems(String unlocalizedName, String registryName) { this.unlocalizedName = unlocalizedName; this.registryName = registryName; }

you don't put that in your reference, obviously the two methods are going to be underfined...

Edited by Differentiation
Posted

You're missing definitions for unlocalizedName and registryName. I would add them here:

 

public String getUnlocalizedName() {
  			return unlocalizedName;
}
public String getRegistryName() {
  			return registryName;
}

Just throw those underneath your MoreMaterialsItems in your Reference class, and it should solve your problem.

 

2 hours ago, Differentiation said:

you don't put that in your reference, obviously the two methods are going to be underfined...

Putting them in your reference class fine, the OP just blatantly decided not to define them.

Follow these rules when talking to me, and we'll get along fine.

1).I know Java fairly well. I don't know as much about modding. They are not the same, don't compare them.

2). I consider myself to always be learning. I make mistakes, you make mistakes. Who doesn't?

3). Insult me, and I will leave the thread. I have a real life, I don't have time to throw petty insults in a Minecraft Modding forum.

 

ModMCdl - Co-Founder and Director of Design for Artemis Game Studios

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.