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

Yuki_Official

【Lv:2】

正式会员
注册
2023/08/18
消息
4
金粒
1,552.00金粒
我刚开始接触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

烦请各位大佬解答!
 

在线会员

  • anan233
  • xiliehuo
  • 一个不知名的网友
  • 阿帕兹阿帕兹
  • LaoZhaog123
  • 刘氏影视传媒
  • 憨羊驼
  • creeper
  • beiyuan
  • LRP_DragonHua
  • 卖饼翁
  • MortalNutria111
  • kulouA1r
  • 小小花生
  • 大法庭の死神
  • 何壯
  • 欲野
  • LoveiOvo
  • Ruomoe
  • MM93
...和 12 更多。
后退
顶部 底部