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

This commit is contained in:
Jonathan Williams 2015-02-10 02:22:57 -08:00
commit ff10d0cb06
3 changed files with 59 additions and 1 deletions

View File

@ -84,6 +84,7 @@ import mineplex.minecraft.game.core.fire.Fire;
import nautilus.game.arcade.addons.CompassAddon; import nautilus.game.arcade.addons.CompassAddon;
import nautilus.game.arcade.addons.SoupAddon; import nautilus.game.arcade.addons.SoupAddon;
import nautilus.game.arcade.addons.TeamArmorAddon; import nautilus.game.arcade.addons.TeamArmorAddon;
import nautilus.game.arcade.command.DisguiseCommand;
import nautilus.game.arcade.command.GameCommand; import nautilus.game.arcade.command.GameCommand;
import nautilus.game.arcade.command.WriteCommand; import nautilus.game.arcade.command.WriteCommand;
import nautilus.game.arcade.command.YoutubeCommand; import nautilus.game.arcade.command.YoutubeCommand;
@ -306,6 +307,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
addCommand(new GameCommand(this)); addCommand(new GameCommand(this));
addCommand(new WriteCommand(this)); addCommand(new WriteCommand(this));
addCommand(new YoutubeCommand(this)); addCommand(new YoutubeCommand(this));
addCommand(new DisguiseCommand(this));
} }
public GameServerConfig GetServerConfig() public GameServerConfig GetServerConfig()

View File

@ -0,0 +1,56 @@
package nautilus.game.arcade.command;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import nautilus.game.arcade.ArcadeManager;
import net.minecraft.util.com.mojang.authlib.GameProfile;
import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.ProfileLoader;
import mineplex.core.common.util.UUIDFetcher;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.disguise.disguises.DisguisePlayer;
public class DisguiseCommand extends CommandBase<ArcadeManager>
{
public DisguiseCommand(ArcadeManager plugin)
{
super(plugin, Rank.OWNER, new Rank[] {Rank.OWNER}, "disguise");
}
@Override
public void Execute(final Player caller, final String[] args)
{
if (args.length == 0)
{
UtilPlayer.message(caller, C.cRed + C.Bold + "/disguise <name>");
return;
}
Bukkit.getServer().getScheduler().runTaskAsynchronously(Plugin.GetPlugin(), new Runnable()
{
@Override
public void run()
{
try
{
GameProfile profile = new ProfileLoader(UUIDFetcher.getUUIDOf(args[0]).toString(), args[0]).loadProfile();
DisguisePlayer playerDisguise = new DisguisePlayer(caller, profile);
Plugin.GetDisguise().disguise(playerDisguise);
UtilPlayer.message(caller, C.cGreen + C.Bold + "Disguise Active: " + ChatColor.RESET + args[0]);
}
catch (Exception e)
{
UtilPlayer.message(caller, C.cRed + C.Bold + "Invalid Disguise Name: " + ChatColor.RESET + args[0]);
return;
}
}}
);
}
}

View File

@ -162,7 +162,7 @@ public class GameLootManager implements Listener
return false; return false;
} }
Reward reward = _rewardManager.nextReward(player, null, false, RewardType.GameLoot); Reward reward = _rewardManager.nextReward(player, null, false, RewardType.GameLoot, true);
RewardData rewardData = reward.giveReward("GameLoot", player); RewardData rewardData = reward.giveReward("GameLoot", player);