• 周年纪念勋章活动已圆满结束,如有已购买但仍未申请的用户,可以通过对应勋章的下载链接申请~

已解决 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

烦请各位大佬解答!
 

在线会员

  • TATyKeFei
  • 面具人
  • 阿茶余
  • Buku
  • JR_Jerry
  • JSKJ
  • zxxxxxxx
  • endevouc4
  • lvyitian
  • awa
  • 马上
  • Reiyans
  • 星芝芒
  • XiaoDou_
  • mclishang
  • k kkljlk
  • 新霁
  • Deja5
  • GF
  • 小智i
  • polang
...和 50 更多。
后退
顶部 底部