mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-25 01:49:30 +00:00
perf(bukkit): 优化方块状态映射逻辑
This commit is contained in:
@@ -61,6 +61,11 @@ public class PacketConsumers {
|
||||
mappingsMOD[entry.getKey()] = entry.getValue();
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < mappingsMOD.length; i++) {
|
||||
if (BlockStateUtils.isVanillaBlock(i)) {
|
||||
mappingsMOD[i] = remap(i);
|
||||
}
|
||||
}
|
||||
BLOCK_LIST = new IntIdentityList(registrySize);
|
||||
BIOME_LIST = new IntIdentityList(RegistryUtils.currentBiomeRegistrySize());
|
||||
}
|
||||
@@ -70,8 +75,7 @@ public class PacketConsumers {
|
||||
}
|
||||
|
||||
public static int remapMOD(int stateId) {
|
||||
int modStateId = mappingsMOD[stateId];
|
||||
return BlockStateUtils.isVanillaBlock(modStateId) ? remap(modStateId) : modStateId;
|
||||
return mappingsMOD[stateId];
|
||||
}
|
||||
|
||||
public static final TriConsumer<NetWorkUser, NMSPacketEvent, Object> LEVEL_CHUNK_WITH_LIGHT = (user, event, packet) -> {
|
||||
|
||||
Reference in New Issue
Block a user