
package com.whippy.sponge.auction.main;

import java.io.IOException;

import org.json.simple.parser.ParseException;
import org.slf4j.Logger;
import org.spongepowered.api.Game;
import org.spongepowered.api.event.Subscribe;
import org.spongepowered.api.event.state.ServerStartingEvent;
import org.spongepowered.api.plugin.Plugin;
import org.spongepowered.api.service.command.CommandService;

import com.google.inject.Inject;
import com.whippy.sponge.auction.beans.StaticsHandler;
import com.whippy.sponge.auction.commands.AucCommand;
import com.whippy.sponge.auction.orchestrator.Auctioneer;


@Plugin(id = "WhipAuction", name = "WhipAuction")
public class WhipAuction {

    //~ ----------------------------------------------------------------------------------------------------------------
    //~ Instance fields 
    //~ ----------------------------------------------------------------------------------------------------------------

    @Inject
    Game game;

    @Inject
    Logger logger;

    //~ ----------------------------------------------------------------------------------------------------------------
    //~ Methods 
    //~ ----------------------------------------------------------------------------------------------------------------

    @Subscribe
    public void onServerStarting(ServerStartingEvent event) throws IOException, ParseException {
    	StaticsHandler.setLogger(logger);
    	StaticsHandler.setAuctioneer(new Auctioneer());
    }

    @Subscribe
    public void onPreInitializationEvent(ServerStartingEvent event) {
        CommandService cmdService = game.getCommandDispatcher();
        cmdService.register(this, new AucCommand(), "auc");

    }

}

@@ -526,16 +526,70 @@
 ommand;%0A
+import com.whippy.sponge.auction.commands.BidCommand;%0A
 import c
@@ -1726,16 +1726,76 @@
  %22auc%22);
+%0A        cmdService.register(this, new BidCommand(), %22bid%22);
 %0A%0A    %7D%0A

Add bid command