IEdibleBlock

基本信息

属性 值
类名 squeek.applecore.api.food.IEdibleBlock
类型 interface,1 个方法
启用版本 Minecraft 1.7.10

功能

供方块实现,使其能作为食物被吃掉(如原版蛋糕)。

方法 说明
getFoodValues(EntityPlayer player, World world, Block block, int meta, int x, int y, int z) 返回该方块的食物数值

实现要点

  • 签名比 IEdible 丰富:额外传入 World、坐标与 meta, 允许按位置和状态返回不同数值。
  • 搭配 IAppleCoreRegistry 使用:方块与物品的对应关系 通常无法由原版 getBlockFromItem 推出,需要在注册表中登记。
  • 全仓源码中没有内置实现类;原版蛋糕是通过 BlockCakeMixin 走注册表路径处理的。

相关条目