@Override
    public void onServerUpdate(Server handle) {
        if (HP<=0)
        {
            handle.sendMessage(Server.DESTROY, ByteBuffer.allocate(30).putInt(MYID));
            this.setAlive(false);
            if (Server.gameMode==Server.DEFENDER)
            {
                PlayerOnline P = handle.getPlayer(lastHit);
                if (P!=null)
                {
                    if (handle.team1.contains(P.ID))
                    {
                        P.score=-10000;
                    }
                    else
                    {
                        P.score = 10000;
                    }
                    String yes = P.username+" has killed the earthbender's guardian!";
                    handle.sendMessage(Server.MESSAGE, Server.putString(ByteBuffer.allocate(yes.length()*4+4).putInt(0xFF00FF),yes));
                    handle.expander.interrupt();
                }
                else
                {
                    for (int p:handle.team1)
                    {
                        (handle.getPlayer(p)).score = -10000;
                    }
                    String yes = "The earthbenders have failed to protect their guardian!";
                    handle.sendMessage(Server.MESSAGE, Server.putString(ByteBuffer.allocate(yes.length()*4+4).putInt(0xFF00FF),yes));
                    handle.expander.interrupt();
                }
            }
            
        }
            if (!handle.earth.isType((int)X, (int)Y,World.AIR))
            {
                if (air--<0)
                {
                    HP-=2;
                }
            }
            else
            {
                air = 100;
            }
            if (handle.earth.isType((int)X, (int)Y,World.LAVA))
            {
                HP-=2;
            }
        if (timer++>90)
        {
            //System.out.println(X);
            handle.sendMessage(Server.AI,ByteBuffer.allocate(28).putInt((int)X).putInt((int)Y).putInt((int)move).putInt((int)yspeed).putInt((int)HP).putInt(MYID).putInt(target));
            timer = 0;
        }
    }