Merge pull request #236 from speedxx/development

fix cage & uncage
This commit is contained in:
Telesphoreo 2020-07-21 23:20:23 -05:00 committed by GitHub
commit fc05003354
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View File

@ -47,6 +47,11 @@ public class Command_cage extends FreedomCommand
}
final FPlayer fPlayer = plugin.pl.getPlayer(player);
if (fPlayer.getCageData().isCaged())
{
sender.sendMessage(ChatColor.RED + "That player is already caged.");
return true;
}
Material outerMaterial = Material.GLASS;
Material innerMaterial = Material.AIR;

View File

@ -30,18 +30,15 @@ public class Command_uncage extends FreedomCommand
}
final FPlayer fPlayer = plugin.pl.getPlayer(player);
if (fPlayer.getCageData().isCaged())
{
FUtil.adminAction(sender.getName(), "Uncaging " + sender.getName(), true);
final FPlayer playerdata = plugin.pl.getPlayer(playerSender);
playerdata.getCageData().setCaged(false);
FUtil.adminAction(sender.getName(), "Uncaging " + player.getName(), true);
fPlayer.getCageData().setCaged(false);
}
else
{
msg("That player is not caged!", ChatColor.RED);
}
return true;
}
}