private void render() {
//        System.out.println("rendering...");
        if (first) {
            c = new Chat();
            first = false;
        }
        BufferStrategy bs = this.getBufferStrategy();
        if (bs == null) {
            createBufferStrategy(3);
            return;
        }
        Graphics g = bs.getDrawGraphics();
        s.render(game);
        System.arraycopy(s.pixels, 0, pixels, 0, getGamewidth() * getGameheight());
        g.drawImage(img, 0, 0, getGamewidth() + 10, getGameheight() + 10, null);
        sine++;
        g.setFont(new Font("Lucida Console", 0, 50));
        g.setColor(Color.WHITE);
        g.drawString(fps + " fps", 20, 50);
        g.drawString("X: " + Render3D.me.getX(), 100, 100);
        g.drawString("Z: " + Render3D.me.getZ(), 150, 150);
        for (int i = 0; i < Render3D.me.getHearts(); i++) {
            try {
                g.drawImage(ImageIO.read(Texture.class.getResource("/res/heart_b.png")), i * 55, 0, 55, 50, this);
            } catch (Exception e) {
            }
        }
        if (chat) {
            c.setGraphics(g);
            c.drawChat();
        } else {
            c.reset();
        }
        if (run.multiplayer) {
            sendLoc();
        }
        g.dispose();
        bs.show();
    }