块纹理和块名称未加载Minecraft Forge [英] Block textures and block names not loading minecraft forge

查看:109
本文介绍了块纹理和块名称未加载Minecraft Forge的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的世界制作一个mod,但无法加载纹理:

I am making a mod for minecraft but I can't get the textures to load:

此外,名称也无法正确显示(瓷砖.亚里特矿石(Yarrite Ore).

Also the names dont show up correctly (tile.Yarrite Ore.Name instead of Yarrite Ore):

这是我用来创建块的代码(YarriteOre.java):

here is the code I used to Create the block(YarriteOre.java):

package com.NoNameYetMod.common;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;

public class YarriteOre extends Block{
    public YarriteOre(int id,Material mat) {
        super(mat);
        this.setCreativeTab(CreativeTabs.tabBlock);
    }

    @Override
    public void registerBlockIcons(IIconRegister p_149651_1_){
        this.blockIcon = p_149651_1_.registerIcon("NoNameYetMod:Yarrite Ore");
    }
}

这是我在游戏中注册块的mod.java文件:

and here is the mod.java file in which I register the block in the game:

package com.NoNameYetMod.common;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Metadata;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;

@Mod(modid = "NoNameYetMod", name = "The \"No Name\" Yet Mod", version = "1.0.0 (Warning: Alpha!)")

public class NoNameYetMod{

    @Metadata
    public static ModMetadata meta;
    //Yarrite
    public static Block YarriteOre;
    int YarriteOreID = 1001;

    @EventHandler
    public void init(FMLPreInitializationEvent event){
        //Yarrit
        YarriteOre = new YarriteOre(YarriteOreID, Material.rock).setHardness(1.5F).setBlockName("Yarrite Ore");

}

我尝试将图标重命名为Yarrite OreYarriteYarritOre,但是它们都不起作用!有人知道我在做什么错吗?

I tried renaming the icon to Yarrite Ore, Yarrite and YarritOre but none of them work! does anybody know what I'm doing wrong?

我也尝试了.Png和.JPeg文件,但是它们都不起作用...

I also tried .Png and .JPeg files but non of them worked...

我在src/main/resources/assets/NoNameYetMod/Textures/blocks文件夹中拥有项目.

I have the items in the src/main/resources/assets/NoNameYetMod/Textures/blocks folder.

推荐答案

要修复名称,只需在\ main \ resources \ assets \ MOD_ID \ lang中创建一个名为en_US.lang的文件即可.该文件是一个基本的文本文件,记事本可以对其进行编辑,您应该输入看到的疯狂名称,其技术名称,然后输入您想要的游戏内名称.这是一个示例:

To fix the name all you have to do in create a file called en_US.lang in \main\resources\assets\MOD_ID\lang. The file is a basic text file, notepad can edit it, and you should put in the crazy name you see, its technical name, and then what you want it to be called in-game name. Here is an example:

tile.Yarrite Ore.Name = Yarrite Ore

对项目执行相同操作,只需使用item.X而不是tile.X.

Do the same for items, just use item.X instead of tile.X.

您是否在1.7或1.8中使用伪造,所以1.8中的纹理加载方式发生了很大变化?对于1.7,您需要做的就是将其添加到super(mat);之后.

Are you using forge for 1.7 or 1.8, the way textures are loaded was changed by a great deal in 1.8? For 1.7 all you need to do is add this just after the line with super(mat);

this.setBlockTextureName("MODID" + ":" + "yarriteOre");

用图像名称替换yarriteOre.无需在行尾添加.png,Minecraft在查找图像时会这样做.对于基本的块纹理,您不需要registerBlockIcons()方法.

Replace yarriteOre with the image name. There's no need to add .png at the end of the line, Minecraft does that when looking for the image. For basic blocks texturing, you don't need the registerBlockIcons() method.

这里是一些很棒的Minecraft改装教程1.3-1.8的链接.我以前用过它们,对您有很大帮助.

Here's a link to some great Minecraft modding tutorials, 1.3-1.8. I've used them before and the're great help.

链接

这篇关于块纹理和块名称未加载Minecraft Forge的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆