diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdJoin.java b/src/main/java/com/massivecraft/factions/cmd/CmdJoin.java index 93014472..cd92674b 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdJoin.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdJoin.java @@ -75,14 +75,23 @@ public class CmdJoin extends FCommand { } return; } + int limit = 0; int altLimit = Conf.factionAltMemberLimit; + limit = Conf.factionMemberLimit; + + if (limit > 0 && faction.getFPlayers().size() >= limit && !faction.altInvited(fme)) { + msg(TL.COMMAND_JOIN_ATLIMIT, faction.getTag(fme), limit, fplayer.describeTo(fme, false)); + return; + } if (altLimit > 0 && faction.getAltPlayers().size() >= altLimit && !faction.altInvited(fme)) { msg(TL.COMMAND_JOIN_ATLIMIT, faction.getTag(fme), altLimit, fplayer.describeTo(fme, false)); return; } + + // if economy is enabled, they're not on the bypass list, and this command has a cost set, make sure they can pay if (samePlayer && !canAffordCommand(Conf.econCostJoin, TL.COMMAND_JOIN_TOJOIN.toString())) { return; diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdStealth.java b/src/main/java/com/massivecraft/factions/cmd/CmdStealth.java index cd1d9438..62f03ba6 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdStealth.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdStealth.java @@ -21,6 +21,9 @@ public class CmdStealth extends FCommand { } public void perform() { + + + Faction faction = fme.getFaction(); if (faction != null && !faction.getId().equalsIgnoreCase("0") && !faction.getId().equalsIgnoreCase("none") && !faction.getId().equalsIgnoreCase("safezone") && !faction.getId().equalsIgnoreCase("warzone")) { fme.setStealth(!fme.isStealthEnabled()); diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java b/src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java index d945a696..59670237 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java @@ -483,11 +483,11 @@ public class FactionsBlockListener implements Listener { @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) public void onBlockBreak(BlockBreakEvent event) { + FPlayer fme = FPlayers.getInstance().getByPlayer(event.getPlayer()); if (!playerCanBuildDestroyBlock(event.getPlayer(), event.getBlock().getLocation(), "destroy", false)) { event.setCancelled(true); return; } - FPlayer fme = FPlayers.getInstance().getByPlayer(event.getPlayer()); if (!fme.hasFaction()) { return; } diff --git a/src/main/java/com/massivecraft/factions/zcore/util/TL.java b/src/main/java/com/massivecraft/factions/zcore/util/TL.java index c2126dc0..f4737835 100644 --- a/src/main/java/com/massivecraft/factions/zcore/util/TL.java +++ b/src/main/java/com/massivecraft/factions/zcore/util/TL.java @@ -63,6 +63,7 @@ public enum TL { /** * Messsges for /f help */ + ALT_PLACE_DENY("&c[!] &7You are a alt you may not place blocks!"), COMMAND_HELP_NEXTCREATE("Learn how to create a faction on the next page."), COMMAND_HELP_INVITATIONS("command.help.invitations", "You might want to close it and use invitations:"), COMMAND_HELP_HOME("And don't forget to set your home:"),