Merge remote-tracking branch 'origin/master'

This commit is contained in:
Shaun Bennett 2014-12-23 08:08:00 -06:00
commit d83b586a3a
3 changed files with 17 additions and 3 deletions

View File

@ -18,6 +18,7 @@ import mineplex.core.common.jsonchat.HoverEvent;
import mineplex.core.common.jsonchat.JsonMessage;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.recharge.Recharge;
@ -123,7 +124,7 @@ public class PersonalServerManager extends MiniPlugin
private void createGroup(final Player host, final String serverName, int minPlayers, int maxPlayers, String games)
{
final ServerGroup serverGroup = new ServerGroup(serverName, serverName, host.getName(), 1024, 1, 1, 0, 19999, true, "arcade.zip", "Arcade.jar", "plugins/Arcade/", minPlayers, maxPlayers,
final ServerGroup serverGroup = new ServerGroup(serverName, serverName, host.getName(), 1024, 1, 1, 0, UtilMath.random.nextInt(250) + 19999, true, "arcade.zip", "Arcade.jar", "plugins/Arcade/", minPlayers, maxPlayers,
true, false, false, games, "Player", false, false, true, false, true, true, false, false, false, false, true, true, true, false, false, "", _us ? Region.US : Region.EU);
GetPlugin().getServer().getScheduler().runTaskAsynchronously(GetPlugin(), new Runnable()

View File

@ -34,6 +34,8 @@ public class ClassManager extends MiniClientPlugin<ClientClass> implements IClas
private HashMap<Integer, IPvpClass> _classSalesPackageIdMap;
private Object _clientLock = new Object();
private boolean _enabled = true;
public ClassManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager,
SkillFactory skillFactory, ItemFactory itemFactory, String webAddress)
@ -267,6 +269,9 @@ public class ClassManager extends MiniClientPlugin<ClientClass> implements IClas
@EventHandler
public void update(UpdateEvent event)
{
if (!_enabled)
return;
if (event.getType() != UpdateType.FAST)
return;
@ -295,6 +300,9 @@ public class ClassManager extends MiniClientPlugin<ClientClass> implements IClas
@EventHandler
public void SkillDisplay(PlayerCommandPreprocessEvent event)
{
if (!_enabled)
return;
if (event.getMessage().equals("/skill"))
{
ClientClass client = Get(event.getPlayer().getName());
@ -309,4 +317,9 @@ public class ClassManager extends MiniClientPlugin<ClientClass> implements IClas
event.setCancelled(true);
}
}
public void setEnabled(boolean var)
{
_enabled = var;
}
}

View File

@ -1149,7 +1149,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
if (_enabled)
{
_classManager.RegisterSelf();
_classManager.setEnabled(true);
_classShopManager.RegisterSelf();
_skillFactory.RegisterSelf();
_itemFactory.RegisterSelf();
@ -1161,7 +1161,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
}
else
{
_classManager.DeregisterSelf();
_classManager.setEnabled(false);
_classShopManager.DeregisterSelf();
_skillFactory.DeregisterSelf();
_itemFactory.DeregisterSelf();