MixinPlayerControllerMP
基本信息
| 属性 | 值 |
|---|---|
| Mixin 目标 | net.minecraft.client.multiplayer.PlayerControllerMP |
| Phase | EARLY |
| 角色 | 客户端 onPlayerDestroyBlock Metadata 位移常数 12 → 16 |
@ModifyConstant
@ModifyConstant(
method = "onPlayerDestroyBlock",
constant = @Constant(intValue = Constants.VANILLA_BITS_PER_ID),
require = 1)
private static int neid$newBitsPerID(int i) {
return Constants.BITS_PER_ID;
}
作用
客户端预测挖掘方块时同样用 id << 12 \| meta,NEID 改为 id << 16 \| meta。与服务端 MixinItemInWorldManager 配套,保证客户端↔服务端 metadata 编码一致。
相关条目
- MixinItemInWorldManager - 服务端对应
- Constants -
BITS_PER_ID = 16