• 【MineBBS社区发展意见征集】

    欢迎参与MineBBS社区调查,助力打造更好Minecraft社区!完成问卷可获赠200金粒,优质回答可额外获得200金粒(限5名),快来参与吧!【点击参与】

已解决 Forge开发1.21.4模组时遇到的纹理/模型问题

Yuki_Official

【Lv:2】

正式会员
注册
2023/08/18
消息
4
金粒
1,552金粒
我刚开始接触Forge开发,金粒不多希望各位大佬解答:
我注册了一个Block并给它附上了纹理,然后我注册了一个BlockItem,Block的纹理正常显示,但它在背包里依然是无纹理的状态
源代码如下:
private static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, MODID);
public static final RegistryObject<Block> build_walla = BLOCKS.register(
"build_walla", () -> new Block(
BlockBehaviour.Properties.of()
.sound(SoundType.STONE)
.strength(-1.0f)
.setId(ResourceKey.create(
ForgeRegistries.BLOCKS.getRegistryKey(),
ResourceLocation.parse(
String.format("%s:%s", SCPRP.MODID, "build_walla")
)
)
)
)
);
private static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS,MODID);
public static final RegistryObject<Item> build_wallaitem = ITEMS.register(
"build_walla",
() -> new BlockItem(
build_walla.get(),
new Item.Properties()
.setId(ResourceKey.create(
ForgeRegistries.ITEMS.getRegistryKey(),
ResourceLocation.parse(
String.format(
"%s:%s", SCPRP.MODID, "build_walla"
)
)
)
)
)
);
这是我存放纹理/模型的目录:
QQ20250128-203242.png

烦请各位大佬解答!
 

在线会员

  • with
  • 牧沐
  • Roy123ty
  • 彭鱼燕
  • waterpullerrrr
  • LUOMIAOCHU
  • 魔王llx
  • commandf1
  • 界限
  • icechen
  • 璀星海
  • 白蓝王
  • IR25
  • 食客
  • TerrySanxian
  • LSJX2003
  • 海贝壳
  • 二白
  • GrandOtaku
  • D66623
...和 50 更多。
后退
顶部 底部