for (int i = 0; i < MAX_LINES; i++) {
if (text[i].length() > CHARS_PER_LINE) {
text[i] = text[i].substring(0, CHARS_PER_LINE);
}
}
SignUpdateEvent event = new SignUpdateEvent(this, text, cause);
//Call event to plugins, allow them to alter it
VanillaPlugin.getInstance().getEngine().getEventManager().callEvent(event);
//Send event to protocol
if (!event.isCancelled()) {
for (Player p : this.getOwner().getBlock().getChunk().getObservingPlayers()) {
p.getNetwork().callProtocolEvent(event);
}
getData().put(VanillaData.SIGN_TEXT, event.getLines());
}
}