Readd CheckOwnsPackageCommand to CustomerSupport, getter for BonusRepository

This commit is contained in:
Spencer 2018-01-07 00:10:18 -05:00 committed by Alexander Meech
parent 058c75206e
commit 675594c8bd

View File

@ -16,11 +16,11 @@ import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.weather.WeatherChangeEvent; import org.bukkit.event.weather.WeatherChangeEvent;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.Managers;
import mineplex.core.MiniPlugin; import mineplex.core.MiniPlugin;
import mineplex.core.account.CoreClientManager; import mineplex.core.account.CoreClientManager;
import mineplex.core.account.permissions.Permission; import mineplex.core.account.permissions.Permission;
import mineplex.core.account.permissions.PermissionGroup; import mineplex.core.account.permissions.PermissionGroup;
import mineplex.core.bonuses.BonusRepository;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.NautHashMap;
@ -34,6 +34,7 @@ public class CustomerSupport extends MiniPlugin
{ {
public enum Perm implements Permission public enum Perm implements Permission
{ {
CHECK_OWNS_PACKAGE_COMMAND,
CHECK_COMMAND, CHECK_COMMAND,
JOIN_SERVER, JOIN_SERVER,
} }
@ -41,6 +42,7 @@ public class CustomerSupport extends MiniPlugin
private CoreClientManager _clientManager; private CoreClientManager _clientManager;
private DonationManager _donationManager; private DonationManager _donationManager;
private InventoryManager _inventoryManager; private InventoryManager _inventoryManager;
private BonusRepository _bonusRepository;
private SupportRepository _repository; private SupportRepository _repository;
private PowerPlayClubRepository _powerPlayRepo; private PowerPlayClubRepository _powerPlayRepo;
@ -50,16 +52,17 @@ public class CustomerSupport extends MiniPlugin
private boolean _allowWeatherChange = false; private boolean _allowWeatherChange = false;
public CustomerSupport(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, PowerPlayClubRepository powerPlayRepo, InventoryManager inventoryManager) public CustomerSupport(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, PowerPlayClubRepository powerPlayRepo, InventoryManager inventoryManager, BonusRepository bonusRepository)
{ {
super("Support", plugin); super("Support", plugin);
_clientManager = clientManager; _clientManager = clientManager;
_donationManager = donationManager; _donationManager = donationManager;
_inventoryManager = inventoryManager; _inventoryManager = inventoryManager;
_repository = new SupportRepository(); _bonusRepository = bonusRepository;
_powerPlayRepo = powerPlayRepo; _powerPlayRepo = powerPlayRepo;
_inventoryManager = Managers.require(InventoryManager.class);
_repository = new SupportRepository();
_petRepository = new PetRepository(); _petRepository = new PetRepository();
_allowWeatherChange = true; _allowWeatherChange = true;
@ -67,6 +70,7 @@ public class CustomerSupport extends MiniPlugin
_allowWeatherChange = false; _allowWeatherChange = false;
addCommand(new CheckCommand(this)); addCommand(new CheckCommand(this));
addCommand(new CheckOwnsPackageCommand(this));
generatePermissions(); generatePermissions();
} }
@ -108,6 +112,11 @@ public class CustomerSupport extends MiniPlugin
return _petRepository; return _petRepository;
} }
public BonusRepository getBonusRepository()
{
return _bonusRepository;
}
@EventHandler @EventHandler
public void Join(PlayerJoinEvent event) public void Join(PlayerJoinEvent event)
{ {