public void run(int playerId) {
SpoutPlayer p = SpoutManager.getPlayerFromId(playerId);
InGameHUD mainScreen = p.getMainScreen();
PopupScreen popup = mainScreen.getActivePopup();
Screen current = p.getCurrentScreen();
Screen in = null;
if (mainScreen != null && screen.equals(mainScreen.getId())) {
in = mainScreen;
}
if (popup != null && screen.equals(popup.getId())) {
in = popup;
}
if (current != null && screen.equals(current.getId())) {
in = current;
}
if (in == null) {
return;
}
if (!in.containsWidget(slot)) {
return;
}
// Slot handling code goes here.
Slot slot = (Slot) in.getWidget(this.slot);
try {
ItemStack stackOnCursor = p.getItemOnCursor();
if (stackOnCursor == null) {
stackOnCursor = new ItemStack(0);
}