Inject ShopFactory
This commit is contained in:
@@ -26,15 +26,16 @@ package client.command.commands.gm2;
|
||||
import client.Client;
|
||||
import client.command.Command;
|
||||
import client.command.CommandContext;
|
||||
import server.ShopFactory;
|
||||
|
||||
public class GmShopCommand extends Command {
|
||||
{
|
||||
setDescription("Open the GM shop.");
|
||||
}
|
||||
|
||||
private static final int GM_SHOP_ID = 1337;
|
||||
|
||||
@Override
|
||||
public void execute(Client c, String[] params, CommandContext ctx) {
|
||||
ShopFactory.getInstance().getShop(1337).sendShop(c);
|
||||
ctx.shopFactory().getShop(GM_SHOP_ID).sendShop(c);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ package client.command.commands.gm3;
|
||||
import client.Client;
|
||||
import client.command.Command;
|
||||
import client.command.CommandContext;
|
||||
import server.ShopFactory;
|
||||
|
||||
|
||||
public class ReloadShopsCommand extends Command {
|
||||
@@ -36,6 +35,6 @@ public class ReloadShopsCommand extends Command {
|
||||
|
||||
@Override
|
||||
public void execute(Client c, String[] params, CommandContext ctx) {
|
||||
ShopFactory.getInstance().reloadShops();
|
||||
ctx.shopFactory().reloadShops();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user