Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.7.2] Localization Trouble with .name


Recommended Posts

Register your blocks using the block.getUnlocalizedName() rather than predefined names. It will prepend tile. and append .name automatically for you, and you just need to have that in your language file:

Block block = new Block().setUnlocalizedName("block");

GameRegistry.registerBlock(block, block.getUnlocalizedName());

tile.block.name=Some Block

Link to post
Share on other sites
  • 1 month later...

Use

.setUnlocalizedName("canempty");

at constructor for an block/item ex.

can_empty = new itemCan(Blocks.air).setUnlocalizedName("canempty");

then go to game, check what is the name, which is showing:

https://www.dropbox.com/s/2fs1jqhx17rvun6/canempty.png

and then add in your .lang file shownname=Name of Item, so in my example that would be

item.canempty.name=Empty Can

.lang files have to go to assets.nameofyourmod.lang and default name for english is en_US.lang. In Your case package would be

assets.meca.lang

Hope I helped.

Link to post
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.

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



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Hi, I am new to modding and am having a little trouble when it comes to rgistering a custom recipe serializer to generate my recipe. It's a simple single item recipe so I tired to extend the singleItemRecipeBuilder, however I keep getting the following error when I runData. [01:46:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:648]: Caused by: java.lang.ExceptionInInitializerError [01:46:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:648]:     at com.kup.burgercraft.util.recipe.MeatGrindingRecipeBuilder.meatGrinding(MeatGrindingRecipeBuilder.java:16) [01:46:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:648]:     at com.kup.burgercraft.data.ModRecipeProvider.RegisterMeatGrinding(ModRecipeProvider.java:52) [01:46:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:648]:     at com.kup.burgercraft.data.ModRecipeProvider.buildShapelessRecipes(ModRecipeProvider.java:20) [01:46:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:648]:     at net.minecraft.data.RecipeProvider.run(RecipeProvider.java:50) [01:46:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:648]:     at net.minecraft.data.DataGenerator.run(DataGenerator.java:44) [01:46:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:648]:     at net.minecraftforge.fml.event.lifecycle.GatherDataEvent$DataGeneratorConfig.lambda$runAll$0(GatherDataEvent.java:111) [01:46:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:648]:     at cpw.mods.modlauncher.api.LamdbaExceptionUtils.lambda$rethrowConsumer$0(LamdbaExceptionUtils.java:34) [01:46:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:648]:     at java.base/java.util.HashMap$Values.forEach(HashMap.java:976) [01:46:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:648]:     at net.minecraftforge.fml.event.lifecycle.GatherDataEvent$DataGeneratorConfig.runAll(GatherDataEvent.java:107) [01:46:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:648]:     at net.minecraftforge.fml.DatagenModLoader.begin(DatagenModLoader.java:61) [01:46:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:648]:     at net.minecraft.data.Main.main(Main.java:43) [01:46:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:648]:     ... 11 more [01:46:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:671]: Caused by: java.lang.IllegalStateException: Cannot register new entries to DeferredRegister after RegistryEvent.Register has been fired. [01:46:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:671]:     at net.minecraftforge.registries.DeferredRegister.register(DeferredRegister.java:111) [01:46:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:671]:     at com.kup.burgercraft.setup.ModRecipes$Serializers.<clinit>(ModRecipes.java:26) [01:46:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:671]:     ... 22 more below is a few pastebins of hopefully the more relavant clases ModRecipeProvider MeatGrindingRecipe ModRecipes Registration   Many thanks for any assiance you might be able to lend.  
    • Hello There! The finale is FINALLY here of this really wholesome video series! In this one we switch some things up and we surprise my one friend with a MINECRAFT ACCOUNT! Then we get back to the usual stuff where we surprise the ones who have Java Minecraft with their statues and everything! Sadly this little series was cut short because of the server shutting down but it was fun nonetheless! If you are looking for a wholesome/good vibe video series this is the one for you! I hope you all enjoy this video and if you did don't forget to like and sub for more!  
    • My forge 1.12.2 shows up in launcher and the tap shows up when I launches at the bottom of my screen. The game itself doesn't pop up on my screen. When launching forge again, it will just say that a game is already there. Can someone please help me solve this problem? I have already tried searching for multiple instances of minecraft using task manager, finding nothing. 
    • After looking through a ton of functions, I found the issue was that my entity was extending MonsterEntity, which extends MobEntity, which creates a GroundPathNavigator, which has a rules for canUpdatePath that include "this.mob.isOnGround()". My entity is a flying entity. Whoops. Solution was to simply override the createNavigation function, where I simply "return new FlyingPathNavigator(this, world);". Everything works fine now.
    • do you already have a custom recipe implemented? if not, you'll a class that'l hold the recipe and check for matches, the recipe inventory and the recipe serializer   then it's up to you to write the logic in your container. you can use of the world's recipe manager to see if a recipe inventory matches any recipe
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.