Remove unnecessary while loop

This commit is contained in:
AlexTheCoder 2016-08-06 03:08:29 -04:00
parent 8eb74de2e8
commit c5d979e5dc

View File

@ -235,27 +235,24 @@ public class Outpost implements Listener
{
if (getState() == OutpostState.LIVE)
{
do
if (event.getClickedBlock() == null)
return;
if (event.getAction() != Action.RIGHT_CLICK_BLOCK)
return;
if (!UtilItem.isDoor(event.getClickedBlock().getType()))
return;
if (_ownerClan.isMember(event.getPlayer()))
return;
if (UtilAlg.inBoundingBox(event.getClickedBlock().getLocation(), _startCorner.clone().subtract(.5, 0, .5), _endCorner))
{
if (event.getClickedBlock() == null)
break;
if (event.getAction() != Action.RIGHT_CLICK_BLOCK)
break;
if (!UtilItem.isDoor(event.getClickedBlock().getType()))
break;
if (_ownerClan.isMember(event.getPlayer()))
break;
if (UtilAlg.inBoundingBox(event.getClickedBlock().getLocation(), _startCorner.clone().subtract(.5, 0, .5), _endCorner))
{
UtilPlayer.message(event.getPlayer(), F.main("Clans", "You cannot open the doors of this Outpost."));
event.setCancelled(true);
return;
}
} while(false);
UtilPlayer.message(event.getPlayer(), F.main("Clans", "You cannot open the doors of this Outpost."));
event.setCancelled(true);
return;
}
}
if (getState() != OutpostState.AWAITING)