Merge branch 'master' of ssh://184.154.0.242:7999/min/mineplex
This commit is contained in:
commit
b3a9410e54
@ -145,6 +145,8 @@ public class ServerManager extends MiniPlugin
|
|||||||
long timeUntilPortal = getMillisecondsUntilPortal(player, false);
|
long timeUntilPortal = getMillisecondsUntilPortal(player, false);
|
||||||
if (!_hubManager.CanPortal(player) || timeUntilPortal > 0)
|
if (!_hubManager.CanPortal(player) || timeUntilPortal > 0)
|
||||||
{
|
{
|
||||||
|
player.closeInventory();
|
||||||
|
|
||||||
if (timeUntilPortal > 0)
|
if (timeUntilPortal > 0)
|
||||||
{
|
{
|
||||||
player.playSound(player.getEyeLocation(), Sound.CHICKEN_EGG_POP, 2, 2);
|
player.playSound(player.getEyeLocation(), Sound.CHICKEN_EGG_POP, 2, 2);
|
||||||
|
@ -6,6 +6,7 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
import mineplex.core.command.CommandBase;
|
import mineplex.core.command.CommandBase;
|
||||||
import mineplex.core.common.Rank;
|
import mineplex.core.common.Rank;
|
||||||
|
import mineplex.core.common.util.Callback;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UUIDFetcher;
|
import mineplex.core.common.util.UUIDFetcher;
|
||||||
import mineplex.staffServer.salespackage.SalesPackageManager;
|
import mineplex.staffServer.salespackage.SalesPackageManager;
|
||||||
@ -18,18 +19,26 @@ public class BoosterCommand extends CommandBase<SalesPackageManager>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Execute(Player caller, String[] args)
|
public void Execute(final Player caller, String[] args)
|
||||||
{
|
{
|
||||||
if (args == null || args.length != 2)
|
if (args == null || args.length != 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
String playerName = args[0];
|
final String playerName = args[0];
|
||||||
int amount = Integer.parseInt(args[1]);
|
final int amount = Integer.parseInt(args[1]);
|
||||||
|
|
||||||
UUID uuid = UUIDFetcher.getUUIDOf(playerName);
|
UUID uuid = UUIDFetcher.getUUIDOf(playerName);
|
||||||
|
|
||||||
Plugin.getDonationManager().PurchaseUnknownSalesPackage(null, playerName, uuid, "Gem Booster " + amount, false, 0, false);
|
Plugin.getDonationManager().PurchaseUnknownSalesPackage(null, playerName, uuid, "Gem Booster " + amount, false, 0, false);
|
||||||
Plugin.getInventoryManager().addItemToInventoryForOffline(uuid.toString(), "Utility", "Gem Booster", amount);
|
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!"));
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
import mineplex.core.command.CommandBase;
|
import mineplex.core.command.CommandBase;
|
||||||
import mineplex.core.common.Rank;
|
import mineplex.core.common.Rank;
|
||||||
|
import mineplex.core.common.util.Callback;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UUIDFetcher;
|
import mineplex.core.common.util.UUIDFetcher;
|
||||||
import mineplex.staffServer.salespackage.SalesPackageManager;
|
import mineplex.staffServer.salespackage.SalesPackageManager;
|
||||||
@ -18,18 +19,27 @@ public class TreasureChestCommand extends CommandBase<SalesPackageManager>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Execute(Player caller, String[] args)
|
public void Execute(final Player caller, String[] args)
|
||||||
{
|
{
|
||||||
if (args == null || args.length != 2)
|
if (args == null || args.length != 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
String playerName = args[0];
|
final String playerName = args[0];
|
||||||
int amount = Integer.parseInt(args[1]);
|
final int amount = Integer.parseInt(args[1]);
|
||||||
|
|
||||||
UUID uuid = UUIDFetcher.getUUIDOf(playerName);
|
UUID uuid = UUIDFetcher.getUUIDOf(playerName);
|
||||||
|
|
||||||
Plugin.getDonationManager().PurchaseUnknownSalesPackage(null, playerName, uuid, "Treasure Chest " + amount, false, 0, false);
|
Plugin.getDonationManager().PurchaseUnknownSalesPackage(null, playerName, uuid, "Treasure Chest " + amount, false, 0, false);
|
||||||
Plugin.getInventoryManager().addItemToInventoryForOffline(uuid.toString(), "Utility", "Treasure Chest", amount);
|
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!"));
|
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);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
import mineplex.core.command.CommandBase;
|
import mineplex.core.command.CommandBase;
|
||||||
import mineplex.core.common.Rank;
|
import mineplex.core.common.Rank;
|
||||||
|
import mineplex.core.common.util.Callback;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UUIDFetcher;
|
import mineplex.core.common.util.UUIDFetcher;
|
||||||
import mineplex.staffServer.salespackage.SalesPackageManager;
|
import mineplex.staffServer.salespackage.SalesPackageManager;
|
||||||
@ -18,18 +19,26 @@ public class TreasureKeyCommand extends CommandBase<SalesPackageManager>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Execute(Player caller, String[] args)
|
public void Execute(final Player caller, String[] args)
|
||||||
{
|
{
|
||||||
if (args == null || args.length != 2)
|
if (args == null || args.length != 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
String playerName = args[0];
|
final String playerName = args[0];
|
||||||
int amount = Integer.parseInt(args[1]);
|
final int amount = Integer.parseInt(args[1]);
|
||||||
|
|
||||||
UUID uuid = UUIDFetcher.getUUIDOf(playerName);
|
UUID uuid = UUIDFetcher.getUUIDOf(playerName);
|
||||||
|
|
||||||
Plugin.getDonationManager().PurchaseUnknownSalesPackage(null, playerName, uuid, "Treasure Key " + amount, false, 0, false);
|
Plugin.getDonationManager().PurchaseUnknownSalesPackage(null, playerName, uuid, "Treasure Key " + amount, false, 0, false);
|
||||||
Plugin.getInventoryManager().addItemToInventoryForOffline(uuid.toString(), "Treasure", "Treasure Key", amount);
|
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!"));
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user