public class WindowItemsHandler extends MessageHandler<WindowItemsMessage> {
@Override
public void handleClient(ClientSession session, WindowItemsMessage msg) {
Player player = session.getPlayer();
WindowHolder holder = player.get(WindowHolder.class);
if (holder == null) {
return;
}
Window window = holder.getActiveWindow();
ItemStack[] slots = msg.getItems();
for (int i = 0; i < slots.length; i++) {
Slot entry = window.getSlot(i);
if (entry == null) {
return;