More Radius Claiming Changes
This commit is contained in:
parent
17e2a86717
commit
75faaa4bb5
@ -69,9 +69,9 @@ public class CmdAutoClaim extends FCommand {
|
|||||||
context.msg(TL.COMMAND_AUTOCLAIM_ENABLED, forFaction.describeTo(context.fPlayer));
|
context.msg(TL.COMMAND_AUTOCLAIM_ENABLED, forFaction.describeTo(context.fPlayer));
|
||||||
if (FactionsPlugin.cachedRadiusClaim && context.fPlayer.attemptClaim(forFaction, context.player.getLocation(), true)) {
|
if (FactionsPlugin.cachedRadiusClaim && context.fPlayer.attemptClaim(forFaction, context.player.getLocation(), true)) {
|
||||||
context.fPlayer.getFaction().getFPlayersWhereOnline(true).forEach(f -> f.msg(TL.CLAIM_CLAIMED, context.fPlayer.describeTo(f, true), context.fPlayer.getFaction().describeTo(f), at.describeTo(f)));
|
context.fPlayer.getFaction().getFPlayersWhereOnline(true).forEach(f -> f.msg(TL.CLAIM_CLAIMED, context.fPlayer.describeTo(f, true), context.fPlayer.getFaction().describeTo(f), at.describeTo(f)));
|
||||||
return;
|
} else {
|
||||||
|
context.fPlayer.attemptClaim(forFaction, context.fPlayer.getPlayer().getLocation(), true);
|
||||||
}
|
}
|
||||||
context.fPlayer.attemptClaim(forFaction, context.fPlayer.getPlayer().getLocation(), true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -85,7 +85,7 @@ public class CmdClaimLine extends FCommand {
|
|||||||
int claims = 0;
|
int claims = 0;
|
||||||
|
|
||||||
for (int i = 0; i < amount; i++) {
|
for (int i = 0; i < amount; i++) {
|
||||||
if (FactionsPlugin.cachedRadiusClaim && context.fPlayer.attemptClaim(forFaction, context.player.getLocation(), true)) {
|
if (FactionsPlugin.cachedRadiusClaim && context.fPlayer.attemptClaim(forFaction, context.player.getLocation(), false)) {
|
||||||
claims++;
|
claims++;
|
||||||
} else {
|
} else {
|
||||||
context.fPlayer.attemptClaim(forFaction, location, true);
|
context.fPlayer.attemptClaim(forFaction, location, true);
|
||||||
|
@ -113,7 +113,10 @@ public class Econ {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean transferMoney(EconomyParticipator invoker, EconomyParticipator from, EconomyParticipator to, double amount, boolean notify) {
|
public static boolean transferMoney(EconomyParticipator invoker, EconomyParticipator from, EconomyParticipator to, double amount, boolean notify) {
|
||||||
if (!shouldBeUsed()) return false;
|
if (!shouldBeUsed()) {
|
||||||
|
invoker.msg(TL.ECON_DISABLED);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// The amount must be positive.
|
// The amount must be positive.
|
||||||
// If the amount is negative we must flip and multiply amount with -1.
|
// If the amount is negative we must flip and multiply amount with -1.
|
||||||
|
@ -1277,9 +1277,10 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
|
|||||||
if (Conf.logFactionDisband)
|
if (Conf.logFactionDisband)
|
||||||
FactionsPlugin.getInstance().log("The faction " + this.getTag() + " (" + this.getId() + ") has been disbanded since it has no members left" + (autoLeave ? " and by inactivity" : "") + ".");
|
FactionsPlugin.getInstance().log("The faction " + this.getTag() + " (" + this.getId() + ") has been disbanded since it has no members left" + (autoLeave ? " and by inactivity" : "") + ".");
|
||||||
|
|
||||||
|
if(FactionsPlugin.getInstance().getConfig().getBoolean("faction-disband-broadcast")) {
|
||||||
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers())
|
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers())
|
||||||
fplayer.msg(TL.COMMAND_DISBAND_BROADCAST_GENERIC, this.getTag(fplayer));
|
fplayer.msg(TL.COMMAND_DISBAND_BROADCAST_GENERIC, this.getTag(fplayer));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
FactionDisbandEvent disbandEvent = new FactionDisbandEvent(null, getId(), autoLeave ? PlayerDisbandReason.INACTIVITY : PlayerDisbandReason.LEAVE);
|
FactionDisbandEvent disbandEvent = new FactionDisbandEvent(null, getId(), autoLeave ? PlayerDisbandReason.INACTIVITY : PlayerDisbandReason.LEAVE);
|
||||||
|
@ -148,7 +148,7 @@ public enum TL {
|
|||||||
|
|
||||||
COMMAND_AHOME_DESCRIPTION("Send a player to their f home no matter what."),
|
COMMAND_AHOME_DESCRIPTION("Send a player to their f home no matter what."),
|
||||||
COMMAND_AHOME_NOHOME("%1$s doesn't have an f home."),
|
COMMAND_AHOME_NOHOME("%1$s doesn't have an f home."),
|
||||||
COMMAND_AHOME_SUCCESS("$1%s was sent to their f home."),
|
COMMAND_AHOME_SUCCESS("%1%s was sent to their f home."),
|
||||||
COMMAND_AHOME_OFFLINE("%1$s is offline."),
|
COMMAND_AHOME_OFFLINE("%1$s is offline."),
|
||||||
COMMAND_AHOME_TARGET("You were sent to your f home."),
|
COMMAND_AHOME_TARGET("You were sent to your f home."),
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
import static com.massivecraft.factions.zcore.util.TagReplacer.TagType;
|
import static com.massivecraft.factions.zcore.util.TagReplacer.TagType;
|
||||||
|
|
||||||
@ -106,8 +105,7 @@ public class TagUtil {
|
|||||||
if (FactionsPlugin.getInstance().isMVdWPlaceholderAPIHooked() && player.isOnline()) {
|
if (FactionsPlugin.getInstance().isMVdWPlaceholderAPIHooked() && player.isOnline()) {
|
||||||
line = be.maximvdw.placeholderapi.PlaceholderAPI.replacePlaceholders(player, line);
|
line = be.maximvdw.placeholderapi.PlaceholderAPI.replacePlaceholders(player, line);
|
||||||
}
|
}
|
||||||
|
return line;
|
||||||
return Objects.requireNonNull(line);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user