control.setDirty(true);
} else {
((Slider) control).setSliderPosition(event.getNewPosition());
}
} else if (control instanceof TextField) {
TextFieldChangeEvent event = new TextFieldChangeEvent(player, screen, (TextField) control, data);
((TextField) control).onTextFieldChange(event);
Bukkit.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
((TextField) control).setText(event.getOldText());
control.setDirty(true);
} else if (!event.getNewText().equals(data)) {
((TextField) control).setText(event.getNewText());
control.setDirty(true);
} else {
((TextField) control).setText(event.getNewText());
((TextField) control).setCursorPosition((int) state);
control.setDirty(false);
}
} else if (control instanceof Scrollable) {
if (data.equals("HORIZONTAL") || data.equals("VERTICAL")) {