Jump to content

Using this.name = name results in mod.tile:block


Lgk

Recommended Posts

Is there any way to skip the tile part of the unlocalized name that i get from

public BlockMetadataBase(String name) {
        super(Material.IRON);
        this.name = name;

        setUnlocalizedName(name);
        setRegistryName(name);
}

 

 

I'm making my mod for 1.10.2 if that's relevant.

Edited by Lgk
Link to comment
Share on other sites

Just now, diesieben07 said:

No idea what you are talking about. You should almost never call getUnlocalizedName.

Well the problem is simply that my blockstate json will have to be called tile.blocks.json or something like that. And when I'm editing recipes in minetweaker I'll have to type extrastuff:tile.blocks:0, extrastuff:tile.blocks:1 etc.extrastuff_tile.blocks.png.3ad711f6b7406c55894980d8173c4201.png

Link to comment
Share on other sites

The problem is that I'm not sure where I passed that name. Here's my ModBlocks.java class. Maybe it's not necessary, I'm puzzled.

public class ModBlocks {

    public static BlockMetadataBase blocks;


    public static void init() {
        blocks = register(new BlockMetadataBase("blocks"));
    }

    private static <T extends Block> T register(T block, ItemBlock itemBlock) {
        GameRegistry.register(block);
        GameRegistry.register(itemBlock);

    if (block instanceof BlockMetadataBase) {
            ((BlockMetadataBase)block).registerItemModel(itemBlock);
            ((BlockMetadataBase)block).registerBakeryVariants();
        }
        return block;
    }

    private static <T extends Block> T register(T block) {
        ItemBlock itemBlock = new ItemBlockMetadataBase(block);
        itemBlock.setRegistryName(block.getUnlocalizedName());
        return register(block, itemBlock);
    }

 

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.