• 「7周年限定勋章」正式上线!4/5/6周年的纪念勋章也限时返场了噢~【点我去看看】

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

烦请各位大佬解答!
 

在线会员

  • wrongx2
  • youshallpass3
  • q212181
  • bangxi
  • hua_ji
  • yibai171081
  • Proees
  • sidasa
  • luckiest
  • Atmsphr
  • J-CKy
  • all3842
  • Suxiaoxiang
  • 陈 祥安
  • 花城梦语
  • Moyuair
  • Highrii
  • 酱牛肉水月
  • 饼干0
  • 2801326928
  • PuddingKC
...和 52 更多。
后退
顶部 底部