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

This commit is contained in:
Chiss 2014-11-23 10:36:11 +11:00
commit b3a9410e54
4 changed files with 45 additions and 15 deletions

View File

@ -145,6 +145,8 @@ public class ServerManager extends MiniPlugin
long timeUntilPortal = getMillisecondsUntilPortal(player, false);
if (!_hubManager.CanPortal(player) || timeUntilPortal > 0)
{
player.closeInventory();
if (timeUntilPortal > 0)
{
player.playSound(player.getEyeLocation(), Sound.CHICKEN_EGG_POP, 2, 2);

View File

@ -6,6 +6,7 @@ import org.bukkit.entity.Player;
import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
import mineplex.core.common.util.Callback;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UUIDFetcher;
import mineplex.staffServer.salespackage.SalesPackageManager;
@ -18,18 +19,26 @@ public class BoosterCommand extends CommandBase<SalesPackageManager>
}
@Override
public void Execute(Player caller, String[] args)
public void Execute(final Player caller, String[] args)
{
if (args == null || args.length != 2)
return;
String playerName = args[0];
int amount = Integer.parseInt(args[1]);
final String playerName = args[0];
final int amount = Integer.parseInt(args[1]);
UUID uuid = UUIDFetcher.getUUIDOf(playerName);
Plugin.getDonationManager().PurchaseUnknownSalesPackage(null, playerName, uuid, "Gem Booster " + amount, false, 0, false);
Plugin.getInventoryManager().addItemToInventoryForOffline(uuid.toString(), "Utility", "Gem Booster", amount);
caller.sendMessage(F.main(Plugin.getName(), "Added " + amount + " boosters to " + playerName + "'s account!"));
Plugin.getInventoryManager().addItemToInventoryForOffline(new Callback<Boolean>()
{
public void run(Boolean success)
{
if (success)
caller.sendMessage(F.main(Plugin.getName(), "Added " + amount + " boosters to " + playerName + "'s account!"));
else
caller.sendMessage(F.main(Plugin.getName(), "There was an error adding " + amount + " boosters to " + playerName + "'s account!"));
}
}, uuid.toString(), "Utility", "Gem Booster", amount);
}
}

View File

@ -6,6 +6,7 @@ import org.bukkit.entity.Player;
import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
import mineplex.core.common.util.Callback;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UUIDFetcher;
import mineplex.staffServer.salespackage.SalesPackageManager;
@ -18,18 +19,27 @@ public class TreasureChestCommand extends CommandBase<SalesPackageManager>
}
@Override
public void Execute(Player caller, String[] args)
public void Execute(final Player caller, String[] args)
{
if (args == null || args.length != 2)
return;
String playerName = args[0];
int amount = Integer.parseInt(args[1]);
final String playerName = args[0];
final int amount = Integer.parseInt(args[1]);
UUID uuid = UUIDFetcher.getUUIDOf(playerName);
Plugin.getDonationManager().PurchaseUnknownSalesPackage(null, playerName, uuid, "Treasure Chest " + amount, false, 0, false);
Plugin.getInventoryManager().addItemToInventoryForOffline(uuid.toString(), "Utility", "Treasure Chest", amount);
caller.sendMessage(F.main(Plugin.getName(), "Added " + amount + " treasure chests to " + playerName + "'s account!"));
Plugin.getInventoryManager().addItemToInventoryForOffline(new Callback<Boolean>()
{
public void run(Boolean success)
{
if (success)
caller.sendMessage(F.main(Plugin.getName(), "Added " + amount + " treasure chests to " + playerName + "'s account!"));
else
caller.sendMessage(F.main(Plugin.getName(), "There was an error adding " + amount + " treasure chests to " + playerName + "'s account!"));
}
}, uuid.toString(), "Utility", "Treasure Chest", amount);
}
}

View File

@ -6,6 +6,7 @@ import org.bukkit.entity.Player;
import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
import mineplex.core.common.util.Callback;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UUIDFetcher;
import mineplex.staffServer.salespackage.SalesPackageManager;
@ -18,18 +19,26 @@ public class TreasureKeyCommand extends CommandBase<SalesPackageManager>
}
@Override
public void Execute(Player caller, String[] args)
public void Execute(final Player caller, String[] args)
{
if (args == null || args.length != 2)
return;
String playerName = args[0];
int amount = Integer.parseInt(args[1]);
final String playerName = args[0];
final int amount = Integer.parseInt(args[1]);
UUID uuid = UUIDFetcher.getUUIDOf(playerName);
Plugin.getDonationManager().PurchaseUnknownSalesPackage(null, playerName, uuid, "Treasure Key " + amount, false, 0, false);
Plugin.getInventoryManager().addItemToInventoryForOffline(uuid.toString(), "Treasure", "Treasure Key", amount);
caller.sendMessage(F.main(Plugin.getName(), "Added " + amount + " treasure Keys to " + playerName + "'s account!"));
Plugin.getInventoryManager().addItemToInventoryForOffline(new Callback<Boolean>()
{
public void run(Boolean success)
{
if (success)
caller.sendMessage(F.main(Plugin.getName(), "Added " + amount + " treasure Keys to " + playerName + "'s account!"));
else
caller.sendMessage(F.main(Plugin.getName(), "There was an error adding " + amount + " treasure Keys to " + playerName + "'s account!"));
}
}, uuid.toString(), "Treasure", "Treasure Key", amount);
}
}