30 seconds recharge on ability to host locally.

This commit is contained in:
Jonathan Williams 2014-12-23 05:56:17 -05:00
parent 21d255fcd1
commit bb8b1d60f9
2 changed files with 9 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import org.bukkit.entity.Player;
import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
import mineplex.core.recharge.Recharge;
public class HostServerCommand extends CommandBase<PersonalServerManager>
{
@ -15,6 +16,9 @@ public class HostServerCommand extends CommandBase<PersonalServerManager>
@Override
public void Execute(Player caller, String[] args)
{
if (!Recharge.Instance.use(caller, "Host Server", 30000, true, true))
return;
Plugin.hostServer(caller, caller.getName());
}
}

View File

@ -14,6 +14,7 @@ import mineplex.core.account.CoreClientManager;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.recharge.Recharge;
import mineplex.serverdata.Region;
import mineplex.serverdata.ServerGroup;
import mineplex.serverdata.ServerManager;
@ -57,6 +58,9 @@ public class PersonalServerManager extends MiniPlugin
{
if (_interfaceItem.equals(event.getPlayer().getItemInHand()))
{
if (!Recharge.Instance.use(event.getPlayer(), "Host Server", 30000, true, true))
return;
hostServer(event.getPlayer(), event.getPlayer().getName());
}
}
@ -84,7 +88,7 @@ public class PersonalServerManager extends MiniPlugin
public void hostServer(Player player, String serverName)
{
createGroup(player, serverName, 24, 24, "Smash");
createGroup(player, serverName, 12, 24, "Smash");
}
private void createGroup(final Player host, final String serverName, int minPlayers, int maxPlayers, String games)