public class CommandBlockHandler extends MessageHandler<CommandBlockMessage> {
@Override
public void handleServer(ServerSession session, CommandBlockMessage msg) {
int x = msg.getX(), y = msg.getY(), z = msg.getZ();
String text = msg.getCommand();
CommandBlock c = VanillaPlugin.getInstance().getEngine().getDefaultWorld().getBlock(x, y, z).get(CommandBlock.class);
Player player = session.getPlayer();
String prefix = VanillaPlugin.getInstance().getPrefix();
if (c == null || !(c instanceof CommandBlock)) {
player.getEngine().getLogger().warning("CommandBlock information received, but there is no CommandBlock at {" + x + "," + y + "," + z + "}.");
return;
}
c.setCommand(text, new PlayerCause(player));
}