@@ -0,0 +1,2917 @@
+package info.tregmine.web;%0A%0Aimport static org.bukkit.ChatColor.AQUA;%0A%0Aimport java.io.PrintWriter;%0A%0Aimport org.bukkit.Server;%0Aimport org.eclipse.jetty.server.Request;%0Aimport org.json.*;%0A%0Aimport info.tregmine.*;%0Aimport info.tregmine.api.TregminePlayer;%0A%0Apublic class PlayerReloadInventoryAction implements WebHandler.Action%0A%7B%0A    public static class Factory implements WebHandler.ActionFactory%0A    %7B%0A        public Factory()%0A        %7B%0A        %7D%0A%0A        @Override%0A        public String getName()%0A        %7B%0A            return %22/reloadinventory%22;%0A        %7D%0A%0A        @Override%0A        public WebHandler.Action createAction(Request request)%0A        throws WebHandler.WebException%0A        %7B%0A            try %7B%0A                int subjectId = Integer.parseInt(request.getParameter(%22subjectId%22));%0A                int issuerId = Integer.parseInt(request.getParameter(%22issuerId%22));%0A                return new PlayerReloadInventoryAction(subjectId, issuerId);%0A            %7D%0A            catch (NullPointerException e) %7B%0A                throw new WebHandler.WebException(e);%0A            %7D%0A            catch (NumberFormatException e) %7B%0A                throw new WebHandler.WebException(e);%0A            %7D%0A        %7D%0A    %7D%0A%0A    private int subjectId;%0A    private int issuerId;%0A%0A    private boolean status;%0A    private String error;%0A%0A    public PlayerReloadInventoryAction(int subjectId, int issuerId)%0A    %7B%0A        this.subjectId = subjectId;%0A        this.issuerId = issuerId;%0A%0A        this.status = true;%0A        this.error = null;%0A    %7D%0A%0A    @Override%0A    public void queryGameState(Tregmine tregmine)%0A    %7B%0A        TregminePlayer subject = tregmine.getPlayerOffline(subjectId);%0A        if (subject == null) %7B%0A            status = false;%0A            error = %22Subject not found.%22;%0A            return;%0A        %7D%0A%0A        TregminePlayer issuer = tregmine.getPlayer(issuerId);%0A        if (issuer == null) %7B%0A            issuer = tregmine.getPlayerOffline(issuerId);%0A        %7D%0A        %0A        if (subject.isOnline()) %7B%0A            subject.loadInventory(subject.getCurrentInventory(), false);%0A        %7D%0A        %0A        Tregmine.LOGGER.info(subject.getChatName() + %22's inventory was reloaded by %22 +%0A                             issuer.getChatName() + %22 (from web)%22);%0A%0A        Server server = tregmine.getServer();%0A        server.broadcastMessage(issuer.getChatName() + AQUA + %22 reloaded %22%0A                + subject.getChatName() + AQUA + %22's inventory%22);%0A    %7D%0A%0A    @Override%0A    public void generateResponse(PrintWriter writer)%0A    throws WebHandler.WebException%0A    %7B%0A        try %7B%0A            JSONWriter json = new JSONWriter(writer);%0A            json.object()%0A                .key(%22status%22).value(status ? %22ok%22 : %22error%22)%0A                .key(%22error%22).value(error)%0A                .endObject();%0A%0A            writer.close();%0A        %7D%0A        catch (JSONException e) %7B%0A            throw new WebHandler.WebException(e);%0A        %7D%0A    %7D%0A%7D%0A

Create PlayerReloadInventoryAction.java