Merge remote-tracking branch 'origin/master'

This commit is contained in:
Shaun Bennett 2015-11-06 21:15:45 -05:00
commit 4add7449eb
4 changed files with 56 additions and 41 deletions

View File

@ -56,31 +56,32 @@ public class TaskManager extends MiniDbClientPlugin<TaskClient>
{
public void run()
{
boolean taskExists = false;
synchronized (_taskLock)
{
if (!_tasks.containsKey(task))
{
_repository.addTask(task);
System.out.println("TaskManager Adding Task : " + task);
}
taskExists = _tasks.containsKey(task);
}
updateTasks();
synchronized (_taskLock)
if (!taskExists)
{
final boolean success = _repository.addAccountTask(PlayerCache.getInstance().getPlayer(uuid).getAccountId(), _tasks.get(task));
_repository.addTask(task);
System.out.println("TaskManager Adding Task : " + task);
if (callback != null)
updateTasks();
}
final boolean success = _repository.addAccountTask(PlayerCache.getInstance().getPlayer(uuid).getAccountId(), getTaskId(task));
if (callback != null)
{
Bukkit.getServer().getScheduler().runTask(getPlugin(), new Runnable()
{
Bukkit.getServer().getScheduler().runTask(getPlugin(), new Runnable()
public void run()
{
public void run()
{
callback.run(success);
}
});
}
callback.run(success);
}
});
}
}
});

View File

@ -115,19 +115,26 @@ public class TrickDialogue
final int amount = Math.max(new Random().nextInt(100) + 100, (int) Math.floor(new Random().nextDouble() * 600));
_plugin.getDonationManager().RewardCoins(new Callback<Boolean>()
{
public void run(Boolean completed)
public void run(final Boolean completed)
{
if (completed)
_plugin.runSync(new Runnable()
{
UtilPlayer.message(_player, F.main("Treat", "You received " + F.elem(C.cYellow + amount + " Coins") + " from " + F.name(_villagerName) + "."));
//Sound
_player.playSound(_player.getLocation(), Sound.LEVEL_UP, 2f, 1.5f);
}
else
{
UtilPlayer.message(_player, F.main("Treat", "There was an error giving " + F.elem(C.cYellow + amount + " Coins") + " to you. Please visit that villager again.") + ".");
}
@Override
public void run()
{
if (completed)
{
UtilPlayer.message(_player, F.main("Treat", "You received " + F.elem(C.cYellow + amount + " Coins") + " from " + F.name(_villagerName) + "."));
//Sound
_player.playSound(_player.getLocation(), Sound.LEVEL_UP, 2f, 1.5f);
}
else
{
UtilPlayer.message(_player, F.main("Treat", "There was an error giving " + F.elem(C.cYellow + amount + " Coins") + " to you. Please visit that villager again.") + ".");
}
}
});
}
}, "Treat " + _villagerName, _player.getName(), _plugin.getClientManager().getAccountId(_player), amount);
}
@ -136,19 +143,26 @@ public class TrickDialogue
final int amount = Math.max(new Random().nextInt(100) + 100, (int) Math.floor(new Random().nextDouble() * 600));
_plugin.getDonationManager().RewardGems(new Callback<Boolean>()
{
public void run(Boolean completed)
public void run(final Boolean completed)
{
if (completed)
_plugin.runSync(new Runnable()
{
UtilPlayer.message(_player, F.main("Treat", "You received " + F.elem(C.cGreen + amount + " Gems") + " from " + F.name(_villagerName) + "."));
//Sound
_player.playSound(_player.getLocation(), Sound.LEVEL_UP, 2f, 1.5f);
}
else
{
UtilPlayer.message(_player, F.main("Treat", "There was an error giving " + F.elem(C.cGreen + amount + " Gems") + " to you. Please visit that villager again.") + ".");
}
@Override
public void run()
{
if (completed)
{
UtilPlayer.message(_player, F.main("Treat", "You received " + F.elem(C.cGreen + amount + " Gems") + " from " + F.name(_villagerName) + "."));
//Sound
_player.playSound(_player.getLocation(), Sound.LEVEL_UP, 2f, 1.5f);
}
else
{
UtilPlayer.message(_player, F.main("Treat", "There was an error giving " + F.elem(C.cGreen + amount + " Gems") + " to you. Please visit that villager again.") + ".");
}
}
});
}
}, "Treat " + _villagerName, _player.getName(), _player.getUniqueId(), amount);
}

View File

@ -11,6 +11,6 @@
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/httpclient-4.2.jar"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/commons-codec-1.6.jar"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/gson-2.2.1.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre1.8.0_65"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -208,7 +208,7 @@ public class GameHostManager implements Listener
{
Player p = event.getPlayer();
if (Manager.GetServerConfig().PlayerServerWhitelist){
if (!getWhitelist().contains(p.getName())){
if (!getWhitelist().contains(p.getName().toLowerCase())){
if ((Manager.GetHost() != null) && (Manager.GetHost().equalsIgnoreCase(p.getName())))
{
return;