mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-22 08:29:21 +00:00
perf(network): 优化数据包的处理逻辑
This commit is contained in:
@@ -45,19 +45,12 @@ public class PacketConsumers {
|
||||
|
||||
public static void init(Map<Integer, Integer> map, int registrySize) {
|
||||
mappings = new int[registrySize];
|
||||
Arrays.fill(mappings, -1);
|
||||
for (int i = 0; i < registrySize; i++) {
|
||||
mappings[i] = i;
|
||||
}
|
||||
mappingsMOD = Arrays.copyOf(mappings, registrySize);
|
||||
for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
|
||||
mappings[entry.getKey()] = entry.getValue();
|
||||
}
|
||||
mappingsMOD = new int[registrySize];
|
||||
Arrays.fill(mappingsMOD, -1);
|
||||
for (int i = 0; i < registrySize; i++) {
|
||||
mappingsMOD[i] = i;
|
||||
}
|
||||
for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
|
||||
if (BlockStateUtils.isVanillaBlock(entry.getKey())) {
|
||||
mappingsMOD[entry.getKey()] = entry.getValue();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user