Skip to content

Commit

Permalink
chore: improve sendBlockUpdates
Browse files Browse the repository at this point in the history
  • Loading branch information
Ingrim4 committed Sep 9, 2023
1 parent 6999695 commit 733375b
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public void sendBlockUpdates(Player player, Iterable<BlockPos> iterable) {
} else {
PacketContainer packet = new PacketContainer(PacketType.Play.Server.MULTI_BLOCK_CHANGE);
packet.getChunkCoordIntPairs().write(0, entry.getKey());
packet.getMultiBlockChangeInfoArrays().write(0, entry.getValue().toArray(MultiBlockChangeInfo[]::new));
packet.getMultiBlockChangeInfoArrays().write(0, blockStates.toArray(MultiBlockChangeInfo[]::new));
serverPlayer.playerConnection.sendPacket((Packet<?>) packet.getHandle());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public void sendBlockUpdates(Player player, Iterable<BlockPos> iterable) {
} else {
PacketContainer packet = new PacketContainer(PacketType.Play.Server.MULTI_BLOCK_CHANGE);
packet.getChunkCoordIntPairs().write(0, entry.getKey());
packet.getMultiBlockChangeInfoArrays().write(0, entry.getValue().toArray(MultiBlockChangeInfo[]::new));
packet.getMultiBlockChangeInfoArrays().write(0, blockStates.toArray(MultiBlockChangeInfo[]::new));
serverPlayer.playerConnection.sendPacket((Packet<?>) packet.getHandle());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public void sendBlockUpdates(Player player, Iterable<BlockPos> iterable) {
} else {
PacketContainer packet = new PacketContainer(PacketType.Play.Server.MULTI_BLOCK_CHANGE);
packet.getChunkCoordIntPairs().write(0, entry.getKey());
packet.getMultiBlockChangeInfoArrays().write(0, entry.getValue().toArray(MultiBlockChangeInfo[]::new));
packet.getMultiBlockChangeInfoArrays().write(0, blockStates.toArray(MultiBlockChangeInfo[]::new));
serverPlayer.playerConnection.sendPacket((Packet<?>) packet.getHandle());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public void sendBlockUpdates(Player player, Iterable<BlockPos> iterable) {
} else {
PacketContainer packet = new PacketContainer(PacketType.Play.Server.MULTI_BLOCK_CHANGE);
packet.getChunkCoordIntPairs().write(0, entry.getKey());
packet.getMultiBlockChangeInfoArrays().write(0, entry.getValue().toArray(MultiBlockChangeInfo[]::new));
packet.getMultiBlockChangeInfoArrays().write(0, blockStates.toArray(MultiBlockChangeInfo[]::new));
serverPlayer.playerConnection.sendPacket((Packet<?>) packet.getHandle());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public void sendBlockUpdates(Player player, Iterable<BlockPos> iterable) {
} else {
PacketContainer packet = new PacketContainer(PacketType.Play.Server.MULTI_BLOCK_CHANGE);
packet.getChunkCoordIntPairs().write(0, entry.getKey());
packet.getMultiBlockChangeInfoArrays().write(0, entry.getValue().toArray(MultiBlockChangeInfo[]::new));
packet.getMultiBlockChangeInfoArrays().write(0, blockStates.toArray(MultiBlockChangeInfo[]::new));
serverPlayer.playerConnection.sendPacket((Packet<?>) packet.getHandle());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public void sendBlockUpdates(Player player, Iterable<BlockPos> iterable) {
} else {
PacketContainer packet = new PacketContainer(PacketType.Play.Server.MULTI_BLOCK_CHANGE);
packet.getChunkCoordIntPairs().write(0, entry.getKey());
packet.getMultiBlockChangeInfoArrays().write(0, entry.getValue().toArray(MultiBlockChangeInfo[]::new));
packet.getMultiBlockChangeInfoArrays().write(0, blockStates.toArray(MultiBlockChangeInfo[]::new));
serverPlayer.playerConnection.sendPacket((Packet<?>) packet.getHandle());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public void sendBlockUpdates(Player player, Iterable<BlockPos> iterable) {
} else {
PacketContainer packet = new PacketContainer(PacketType.Play.Server.MULTI_BLOCK_CHANGE);
packet.getChunkCoordIntPairs().write(0, entry.getKey());
packet.getMultiBlockChangeInfoArrays().write(0, entry.getValue().toArray(MultiBlockChangeInfo[]::new));
packet.getMultiBlockChangeInfoArrays().write(0, blockStates.toArray(MultiBlockChangeInfo[]::new));
serverPlayer.playerConnection.sendPacket((Packet<?>) packet.getHandle());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public void sendBlockUpdates(Player player, Iterable<BlockPos> iterable) {
} else {
PacketContainer packet = new PacketContainer(PacketType.Play.Server.MULTI_BLOCK_CHANGE);
packet.getChunkCoordIntPairs().write(0, entry.getKey());
packet.getMultiBlockChangeInfoArrays().write(0, entry.getValue().toArray(MultiBlockChangeInfo[]::new));
packet.getMultiBlockChangeInfoArrays().write(0, blockStates.toArray(MultiBlockChangeInfo[]::new));
serverPlayer.playerConnection.sendPacket((Packet<?>) packet.getHandle());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public void sendBlockUpdates(Player player, Iterable<BlockPos> iterable) {
} else {
PacketContainer packet = new PacketContainer(PacketType.Play.Server.MULTI_BLOCK_CHANGE);
packet.getChunkCoordIntPairs().write(0, entry.getKey());
packet.getMultiBlockChangeInfoArrays().write(0, entry.getValue().toArray(MultiBlockChangeInfo[]::new));
packet.getMultiBlockChangeInfoArrays().write(0, blockStates.toArray(MultiBlockChangeInfo[]::new));
serverPlayer.playerConnection.sendPacket((Packet<?>) packet.getHandle());
}
}
Expand Down

0 comments on commit 733375b

Please sign in to comment.