Fix Slime Soccer, Add /unlockcosmetics and /lockcosmetics for other players (#232)
* Added option to run /unlockcosmetics and /lockcosmetics for other players * Fixed Slimeball Soccer field location
This commit is contained in:
parent
bd90c465dd
commit
c0754a23c8
@ -11,6 +11,8 @@ import mineplex.core.gadget.types.Gadget;
|
||||
import mineplex.core.gadget.types.GadgetType;
|
||||
import mineplex.core.mount.Mount;
|
||||
import mineplex.core.pet.Pet;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class LockCosmeticsCommand extends CommandBase<GadgetManager>
|
||||
@ -32,36 +34,15 @@ public class LockCosmeticsCommand extends CommandBase<GadgetManager>
|
||||
{
|
||||
removeCosmetics(null, caller);
|
||||
}
|
||||
// Adds specific type
|
||||
else
|
||||
else if (args.length == 1)
|
||||
{
|
||||
String type = args[0];
|
||||
if (type.equalsIgnoreCase("all"))
|
||||
Player player = Bukkit.getPlayer(args[0]);
|
||||
if (player != null)
|
||||
{
|
||||
removeCosmetics(null, caller);
|
||||
}
|
||||
else if (type.equalsIgnoreCase("pet"))
|
||||
{
|
||||
removePets(caller);
|
||||
}
|
||||
else if (type.equalsIgnoreCase("mount"))
|
||||
{
|
||||
removeMounts(caller);
|
||||
}
|
||||
else
|
||||
{
|
||||
GadgetType gadgetType = GadgetType.valueOf(type);
|
||||
if (gadgetType == null)
|
||||
{
|
||||
UtilPlayer.message(caller, F.main("Cosmetics", "Invalid cosmetic type!"));
|
||||
}
|
||||
else
|
||||
{
|
||||
removeCosmetics(gadgetType, caller);
|
||||
}
|
||||
removeCosmetics(null, player);
|
||||
UtilPlayer.message(caller, F.main("Unlock Cosmetics", "Removed all the cosmetics to " + F.name(player.getName()) + "!"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void removeCosmetics(GadgetType gadgetType, Player caller)
|
||||
|
@ -11,6 +11,8 @@ import mineplex.core.gadget.types.Gadget;
|
||||
import mineplex.core.gadget.types.GadgetType;
|
||||
import mineplex.core.mount.Mount;
|
||||
import mineplex.core.pet.Pet;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class UnlockCosmeticsCommand extends CommandBase<GadgetManager>
|
||||
@ -32,37 +34,16 @@ public class UnlockCosmeticsCommand extends CommandBase<GadgetManager>
|
||||
{
|
||||
addCosmetics(null, caller);
|
||||
}
|
||||
// Adds specific type
|
||||
else
|
||||
{
|
||||
String type = args[0];
|
||||
if (type.equalsIgnoreCase("all"))
|
||||
{
|
||||
addCosmetics(null, caller);
|
||||
}
|
||||
else if (type.equalsIgnoreCase("pet"))
|
||||
else if (args.length == 1)
|
||||
{
|
||||
Player player = Bukkit.getPlayer(args[0]);
|
||||
if (player != null)
|
||||
{
|
||||
addPets(caller);
|
||||
addCosmetics(null, player);
|
||||
UtilPlayer.message(caller, F.main("Unlock Cosmetics", "Added all the cosmetics to " + F.name(player.getName()) + "!"));
|
||||
}
|
||||
else if (type.equalsIgnoreCase("mount"))
|
||||
{
|
||||
addMounts(caller);
|
||||
}
|
||||
else
|
||||
{
|
||||
GadgetType gadgetType = GadgetType.valueOf(type);
|
||||
if (gadgetType == null)
|
||||
{
|
||||
UtilPlayer.message(caller, F.main("Cosmetics", "Invalid cosmetic type!"));
|
||||
}
|
||||
else
|
||||
{
|
||||
addCosmetics(gadgetType, caller);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addCosmetics(GadgetType gadgetType, Player caller)
|
||||
{
|
||||
|
@ -98,7 +98,7 @@ public class SoccerManager extends MiniPlugin
|
||||
_hubManager = hubManager;
|
||||
|
||||
_cornerFieldPlayerA = new Location(hubManager.GetSpawn().getWorld(), -13.5, 67, -65.5);
|
||||
_cornerFieldPlayerB = new Location(hubManager.GetSpawn().getWorld(), 25.5, 100, -87.5);
|
||||
_cornerFieldPlayerB = new Location(hubManager.GetSpawn().getWorld(), 25.5, 100, -86.5);
|
||||
|
||||
_cornerGoalPlayerA = new Location(hubManager.GetSpawn().getWorld(), -17.5, 67, -71.5);
|
||||
_cornerGoalPlayerB = new Location(hubManager.GetSpawn().getWorld(), 29.5, 100, -80.5);
|
||||
|
Loading…
Reference in New Issue
Block a user