Merge branch 'master' of ssh://184.154.0.242:7999/min/mineplex

This commit is contained in:
Chiss 2014-06-11 12:14:45 +10:00
commit 0be4df4531
5 changed files with 24 additions and 20 deletions

View File

@ -23,8 +23,12 @@ public class SimpleStats extends MiniPlugin
_repository.initialize();
}
public NautHashMap<String, String> get_entries() {
return _entries;
public NautHashMap<String, String> getEntries()
{
synchronized (_transferLock)
{
return _entries;
}
}
@EventHandler
@ -33,16 +37,16 @@ public class SimpleStats extends MiniPlugin
if (updateEvent.getType() != UpdateType.SLOW)
return;
synchronized (_transferLock)
Bukkit.getScheduler().runTaskAsynchronously(GetPlugin(), new Runnable()
{
Bukkit.getScheduler().runTaskAsynchronously(GetPlugin(), new Runnable()
{
public void run()
{
public void run()
{
synchronized (_transferLock)
{
_entries = (_repository.retrieveStatRecords());
}
});
}
}
});
}
public void store(String statName, String statValue)
@ -50,15 +54,15 @@ public class SimpleStats extends MiniPlugin
final String statNameFinal = statName;
final String statValueFinal = statValue;
synchronized (_transferLock)
Bukkit.getScheduler().runTaskAsynchronously(GetPlugin(), new Runnable()
{
Bukkit.getScheduler().runTaskAsynchronously(GetPlugin(), new Runnable()
public void run()
{
public void run()
synchronized (_transferLock)
{
_repository.storeStatValue(statNameFinal, statValueFinal);
}
});
}
}
});
}
}

View File

@ -8,9 +8,6 @@ import java.sql.SQLException;
import mineplex.core.common.util.NautHashMap;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
public class SimpleStatsRepository
{
private static Object _connectionLock = new Object();

View File

@ -34,6 +34,7 @@ public abstract class ItemGadget extends Gadget
_recharge = recharge;
_gemsPerUse = gemsPerUse;
_nearParkour = canUseNearParkour;
Free = true;
}
public HashSet<Player> GetActive()

View File

@ -169,7 +169,7 @@ public class GadgetPage extends ShopPageBase<GadgetManager, GadgetShop>
itemLore.add(C.cBlack);
itemLore.addAll(Arrays.asList(gadget.GetDescription()));
if (gadget.GetCost(CurrencyType.Gems) == -1 || DonationManager.Get(Player.getName()).OwnsUnknownPackage(gadget.GetName()))
if (gadget.IsFree() || DonationManager.Get(Player.getName()).OwnsUnknownPackage(gadget.GetName()))
{
if (gadget.GetActive().contains(Player))
{

View File

@ -105,7 +105,7 @@ public class ServerManager extends MiniPlugin
new ServerManagerUpdater(this);
_quickShop = new QuickShop(this, clientManager, donationManager, "Quick Menu");
_lobbyShop = new LobbyShop(this, clientManager, donationManager, "Lobby Menu");
_domShop = new QueueShop(_queueManager, clientManager, donationManager, "Dominate");
//_domShop = new new QueueShop(_queueManager, clientManager, donationManager, "Dominate");
}
@EventHandler(priority = EventPriority.LOW)
@ -182,6 +182,7 @@ public class ServerManager extends MiniPlugin
if (event.getType() != UpdateType.SEC)
return;
/*
for (final Player player : _queueManager.findPlayersNeedingPrompt())
{
player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 5f, 1f);
@ -197,6 +198,7 @@ public class ServerManager extends MiniPlugin
}
}, 20);
}
*/
}
@EventHandler(priority = EventPriority.LOW)
@ -643,7 +645,7 @@ public class ServerManager extends MiniPlugin
@SuppressWarnings("rawtypes")
public ShopBase getDominateShop()
{
return _domShop;
return _serverNpcShopMap.get("Dominate");
}
public ServerNpcShop getBridgesShop()