Add PunishShop and get PunishCommand to use it
This commit is contained in:
parent
f52af3f87f
commit
da5d58fcbd
|
@ -15,12 +15,18 @@ import mineplex.core.common.util.F;
|
|||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.punish.Punish;
|
||||
import mineplex.core.punish.UI.PunishPage;
|
||||
import mineplex.core.punish.UI.PunishPageOld;
|
||||
import mineplex.core.punish.UI.PunishShop;
|
||||
|
||||
public class PunishCommand extends CommandBase<Punish>
|
||||
{
|
||||
private PunishShop _punishShop;
|
||||
|
||||
public PunishCommand(Punish plugin)
|
||||
{
|
||||
super(plugin, Punish.Perm.PUNISHMENT_COMMAND, "punish", "p");
|
||||
|
||||
_punishShop = new PunishShop(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -71,7 +77,7 @@ public class PunishCommand extends CommandBase<Punish>
|
|||
Plugin.GetRepository().LoadPunishClient(originalName.get(), clientToken ->
|
||||
{
|
||||
Plugin.LoadClient(clientToken);
|
||||
new PunishPage(Plugin, caller, originalName.get(), finalReason, wasDisguised.get(), originalName.get(), disguisedName.get());
|
||||
_punishShop.openPageForPlayer(caller, new PunishPage(Plugin, _punishShop, caller, originalName.get(), finalReason, wasDisguised.get(), originalName.get(), disguisedName.get()));
|
||||
});
|
||||
|
||||
return;
|
||||
|
@ -113,7 +119,7 @@ public class PunishCommand extends CommandBase<Punish>
|
|||
Plugin.GetRepository().LoadPunishClient(t, clientToken ->
|
||||
{
|
||||
Plugin.LoadClient(clientToken);
|
||||
new PunishPage(Plugin, caller, t, finalReason, false, null, null);
|
||||
_punishShop.openPageForPlayer(caller, new PunishPage(Plugin, _punishShop, caller, t, finalReason, false, null, null));
|
||||
});
|
||||
}, caller, finalPlayerName, true);
|
||||
}, playerName);
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
package mineplex.core.punish.UI;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import mineplex.core.Managers;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.punish.Punish;
|
||||
import mineplex.core.shop.ShopBase;
|
||||
import mineplex.core.shop.page.ShopPageBase;
|
||||
|
||||
public class PunishShop extends ShopBase<Punish>
|
||||
{
|
||||
public PunishShop(Punish plugin)
|
||||
{
|
||||
super(plugin, plugin.GetClients(), Managers.require(DonationManager.class), "Punish");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ShopPageBase<Punish, ? extends ShopBase<Punish>> buildPagesFor(Player player)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue