Reverted changes to /cage. What was broken here?

This commit is contained in:
Steven Lawson 2012-12-01 14:26:08 -05:00
parent f6d8222a1a
commit e0c2869da8

View File

@ -40,26 +40,18 @@ public class Command_cage extends TFM_Command
{ {
if (TFM_Util.isStopCommand(args[1])) if (TFM_Util.isStopCommand(args[1]))
{ {
TFM_Util.adminAction(sender.getName(), "Uncaging " + p.getName(), true); TFM_Util.adminAction(sender.getName(), "Uncaging " + p.getName() + ".", true);
playerdata.setCaged(false); playerdata.setCaged(false);
playerdata.regenerateHistory(); playerdata.regenerateHistory();
playerdata.clearHistory(); playerdata.clearHistory();
sender.sendMessage(ChatColor.GREEN + p.getName() + " uncaged.");
return true; return true;
} }
else else
{ {
cage_material_outer = Material.matchMaterial(args[1]); cage_material_outer = Material.matchMaterial(args[1]);
if (cage_material_outer == null) if (cage_material_outer == null)
{
TFM_Util.adminAction(sender.getName(), "Uncaging " + p.getName(), true);
playerdata.setCaged(false);
playerdata.regenerateHistory();
playerdata.clearHistory();
sender.sendMessage(ChatColor.GREEN + p.getName() + " uncaged.");
return true;
}
else
{ {
cage_material_outer = Material.GLASS; cage_material_outer = Material.GLASS;
} }
@ -85,8 +77,11 @@ public class Command_cage extends TFM_Command
TFM_Util.buildHistory(target_pos, 2, playerdata); TFM_Util.buildHistory(target_pos, 2, playerdata);
TFM_Util.generateCube(target_pos, 2, playerdata.getCageMaterial(TFM_UserInfo.CageLayer.OUTER)); TFM_Util.generateCube(target_pos, 2, playerdata.getCageMaterial(TFM_UserInfo.CageLayer.OUTER));
TFM_Util.generateCube(target_pos, 1, playerdata.getCageMaterial(TFM_UserInfo.CageLayer.INNER)); TFM_Util.generateCube(target_pos, 1, playerdata.getCageMaterial(TFM_UserInfo.CageLayer.INNER));
p.setGameMode(GameMode.SURVIVAL); p.setGameMode(GameMode.SURVIVAL);
TFM_Util.adminAction(sender.getName(), "Caging " + p.getName(), true);
TFM_Util.adminAction(sender.getName(), "Caging " + p.getName() + ".", true);
return true; return true;
} }
} }