MixinWorld
基本信息
| 属性 | 值 |
|---|---|
| Mixin 目标 | net.minecraft.world.World |
| Phase | EARLY |
| 角色 | World.breakBlock Metadata 位移常数 12 → 16 |
@ModifyConstant
@ModifyConstant(
method = "func_147480_a(IIIZ)Z", // 即 breakBlock(x, y, z, dropBlock)
constant = @Constant(intValue = Constants.VANILLA_BITS_PER_ID), // 12
require = 1)
private static int neid$injectedBreakBlock(int original) {
return Constants.BITS_PER_ID; // 16
}
作用
World.breakBlock 在挖方块时被调用,内部把方块 ID 和 Metadata 组合为一个整数(用于 Block.harvestBlock 等调用):vanilla 用 id << 12 \| meta,NEID 改为 id << 16 \| meta。
相关条目
- MixinItemInWorldManager - 服务端挖掘
- MixinPlayerControllerMP - 客户端挖掘
- Constants -
BITS_PER_ID = 16