繁体   English   中英

Minecraft 1.7.2有效设置纹理

[英]Minecraft 1.7.2 setting textures efficiently

我在每个文件中设置纹理,这是设置纹理的无效方法

this.setUnlocalizedName("ItemName");
this.setTextureName("MyModName:ItemName");

这种方式对我来说很有意义,但是没有用:

this.setUnlocalizedName("ItemName");
this.setTextureName(OtherClassName.MODID + ":" + this.getUnlocalizedName());

“ OtherClassName.MODID”引用另一个包含“ MyModName”的类中的变量。this.getUnlocalizedName()获取已声明的UnlocalizedName,“ ItemName”

有什么帮助吗? 我不确定为什么它不起作用。

getUnlocalizedName -它返回传递给setUnlocalizedName的字符串,但带有“ item”。 在开始时。 使用混淆代码的乐趣...

这将工作:

String name = "ItemName";
this.setUnlocalizedName(name);
this.setTextureName(OtherClassName.MODID + ":" + name);

请注意,它的效率不如运行速度更快,但是如果您对项目名称进行大量更改,编写起来可能会更快。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM