Compare commits
41 Commits
2.3.7-STAB
...
2.4.0-RC
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dd94b45347 | ||
|
|
28b07fc6a4 | ||
|
|
11ea9bc1aa | ||
|
|
7f922fef28 | ||
|
|
81ef43768d | ||
|
|
1a19ee77ba | ||
|
|
0444517eec | ||
|
|
03077b62ba | ||
|
|
d98c647397 | ||
|
|
e9923344a2 | ||
|
|
cdc07ed5eb | ||
|
|
7b94367eb4 | ||
|
|
b7d991c0dd | ||
|
|
6372245fcd | ||
|
|
f2c0f725b7 | ||
|
|
0b677cb4de | ||
|
|
e8642a3108 | ||
|
|
a355b1d0c8 | ||
|
|
929c34d850 | ||
|
|
903129e462 | ||
|
|
e84c69f2b0 | ||
|
|
3e530487d7 | ||
|
|
14776b8877 | ||
|
|
7f927189ea | ||
|
|
6f293dce17 | ||
|
|
2676f048d6 | ||
|
|
24aaa0ed6f | ||
|
|
2a01682fbe | ||
|
|
ba59310548 | ||
|
|
bec09168b6 | ||
|
|
4fe6484db9 | ||
|
|
71a099beeb | ||
|
|
ddd3150732 | ||
|
|
ec1501bf4f | ||
|
|
8ad2fdf848 | ||
|
|
1ee62c2267 | ||
|
|
7e6646b4df | ||
|
|
0d08ff4cec | ||
|
|
cf3ce62023 | ||
|
|
30d6b3c248 | ||
|
|
c22e3a5227 |
4
pom.xml
4
pom.xml
@@ -4,7 +4,7 @@
|
||||
|
||||
<groupId>com.massivecraft</groupId>
|
||||
<artifactId>Factions</artifactId>
|
||||
<version>1.6.9.5-2.3.7-RC</version>
|
||||
<version>1.6.9.5-2.3.9-RC</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>SaberFactions</name>
|
||||
@@ -108,7 +108,7 @@
|
||||
<dependency>
|
||||
<groupId>com.github.stefvanschie.inventoryframework</groupId>
|
||||
<artifactId>IF</artifactId>
|
||||
<version>0.5.8</version>
|
||||
<version>0.5.19</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
|
||||
@@ -180,6 +180,7 @@ public class FactionsPlugin extends MPlugin {
|
||||
}
|
||||
|
||||
saveDefaultConfig();
|
||||
this.reloadConfig();
|
||||
//Start wait task executor
|
||||
WaitExecutor.startTask();
|
||||
// Load Conf from disk
|
||||
|
||||
@@ -57,6 +57,10 @@ public class CmdAdmin extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (fyou.isAlt()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// only perform a FPlayerJoinEvent when newLeader isn't actually in the faction
|
||||
if (fyou.getFaction() != targetFaction) {
|
||||
FPlayerJoinEvent event = new FPlayerJoinEvent(FPlayers.getInstance().getByPlayer(context.player), targetFaction, FPlayerJoinEvent.PlayerJoinReason.LEADER);
|
||||
@@ -86,7 +90,7 @@ public class CmdAdmin extends FCommand {
|
||||
FactionsPlugin.instance.getFlogManager().log(targetFaction, FLogType.RANK_EDIT, context.fPlayer.getName(), fyou.getName(), ChatColor.RED + "Admin");
|
||||
|
||||
// Inform all players
|
||||
if(FactionsPlugin.instance.getConfig().getBoolean("faction-leader-broadcast")) {
|
||||
if (FactionsPlugin.instance.getConfig().getBoolean("faction-leader-broadcast")) {
|
||||
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
|
||||
fplayer.msg(TL.COMMAND_ADMIN_PROMOTED, context.player == null ? TL.GENERIC_SERVERADMIN.toString() : context.fPlayer.describeTo(fplayer, true), fyou.describeTo(fplayer), targetFaction.describeTo(fplayer));
|
||||
}
|
||||
|
||||
@@ -2,7 +2,10 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.*;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Role;
|
||||
import com.massivecraft.factions.util.WarmUpUtil;
|
||||
import com.massivecraft.factions.zcore.fperms.Access;
|
||||
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
public class CmdCheckpoint extends FCommand {
|
||||
@@ -17,10 +20,7 @@ public class CmdCheckpoint extends FCommand {
|
||||
|
||||
this.optionalArgs.put("set", "");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.CHECKPOINT)
|
||||
.playerOnly()
|
||||
.memberOnly()
|
||||
.build();
|
||||
this.requirements = new CommandRequirements.Builder(Permission.CHECKPOINT).playerOnly().memberOnly().build();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -29,18 +29,39 @@ public class CmdCheckpoint extends FCommand {
|
||||
context.msg(TL.COMMAND_CHECKPOINT_DISABLED);
|
||||
return;
|
||||
}
|
||||
if (context.args.size() == 1) {
|
||||
FLocation myLocation = new FLocation(context.player.getLocation());
|
||||
Faction myLocFaction = Board.getInstance().getFactionAt(myLocation);
|
||||
if (myLocFaction == Factions.getInstance().getWilderness() || myLocFaction == context.faction) {
|
||||
context.faction.setCheckpoint(context.player.getLocation());
|
||||
context.msg(TL.COMMAND_CHECKPOINT_SET);
|
||||
return;
|
||||
if (context.args.size() == 1 && context.args.get(0).equalsIgnoreCase("set")) {
|
||||
if (context.fPlayer.getRole() == Role.LEADER) {
|
||||
FLocation myLocation = new FLocation(context.player.getLocation());
|
||||
Faction myLocFaction = Board.getInstance().getFactionAt(myLocation);
|
||||
if (myLocFaction == Factions.getInstance().getWilderness() || myLocFaction == context.faction) {
|
||||
context.faction.setCheckpoint(context.player.getLocation());
|
||||
context.msg(TL.COMMAND_CHECKPOINT_SET);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
context.msg(TL.COMMAND_CHECKPOINT_INVALIDLOCATION);
|
||||
return;
|
||||
}
|
||||
|
||||
PermissableAction action = PermissableAction.SETWARP;
|
||||
Access access = context.faction.getAccess(context.fPlayer, action);
|
||||
if (access == Access.DENY) {
|
||||
context.msg(TL.GENERIC_FPERM_NOPERMISSION, action.getName());
|
||||
return;
|
||||
} else {
|
||||
FLocation myLocation = new FLocation(context.player.getLocation());
|
||||
Faction myLocFaction = Board.getInstance().getFactionAt(myLocation);
|
||||
if (myLocFaction == Factions.getInstance().getWilderness() || myLocFaction == context.faction) {
|
||||
context.faction.setCheckpoint(context.player.getLocation());
|
||||
context.msg(TL.COMMAND_CHECKPOINT_SET);
|
||||
return;
|
||||
} else {
|
||||
context.msg(TL.COMMAND_CHECKPOINT_INVALIDLOCATION);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (context.faction.getCheckpoint() == null) {
|
||||
context.msg(TL.COMMAND_CHECKPOINT_NOT_SET);
|
||||
return;
|
||||
@@ -57,8 +78,6 @@ public class CmdCheckpoint extends FCommand {
|
||||
} else {
|
||||
context.msg(TL.COMMAND_CHECKPOINT_CLAIMED);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -55,6 +55,10 @@ public class CmdColeader extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (you.isAlt()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (context.fPlayer != null && context.fPlayer.getRole() != Role.LEADER && !permAny) {
|
||||
context.msg(TL.COMMAND_COLEADER_NOTADMIN);
|
||||
return;
|
||||
|
||||
@@ -54,7 +54,7 @@ public class CmdCreate extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if(Cooldown.isOnCooldown(context.fPlayer.getPlayer(), "createCooldown") && !context.fPlayer.isAdminBypassing()){
|
||||
if (Cooldown.isOnCooldown(context.fPlayer.getPlayer(), "createCooldown") && !context.fPlayer.isAdminBypassing()) {
|
||||
context.msg(TL.COMMAND_COOLDOWN);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3,10 +3,7 @@ package com.massivecraft.factions.cmd;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Role;
|
||||
import com.massivecraft.factions.zcore.fperms.Access;
|
||||
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import mkremins.fanciful.FancyMessage;
|
||||
@@ -56,6 +53,7 @@ public class CmdDeinvite extends FCommand {
|
||||
|
||||
context.faction.msg(TL.COMMAND_DEINVITE_REVOKES, context.fPlayer.describeTo(context.faction), you.describeTo(context.faction));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_DEINVITE_DESCRIPTION;
|
||||
|
||||
@@ -70,7 +70,7 @@ public class CmdDisband extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if(Cooldown.isOnCooldown(context.fPlayer.getPlayer(), "disbandCooldown") && !context.fPlayer.isAdminBypassing()){
|
||||
if (Cooldown.isOnCooldown(context.fPlayer.getPlayer(), "disbandCooldown") && !context.fPlayer.isAdminBypassing()) {
|
||||
context.msg(TL.COMMAND_COOLDOWN);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class CmdFly extends FCommand {
|
||||
|
||||
public static final boolean fly = FactionsPlugin.getInstance().getConfig().getBoolean("enable-faction-flight");
|
||||
/**
|
||||
* @author FactionsUUID Team
|
||||
*/
|
||||
@@ -27,8 +28,6 @@ public class CmdFly extends FCommand {
|
||||
public static ConcurrentHashMap<String, Boolean> flyMap = new ConcurrentHashMap<>();
|
||||
public static BukkitTask particleTask = null;
|
||||
|
||||
public static final boolean fly = FactionsPlugin.getInstance().getConfig().getBoolean("enable-faction-flight");
|
||||
|
||||
|
||||
public CmdFly() {
|
||||
super();
|
||||
@@ -65,25 +64,25 @@ public class CmdFly extends FCommand {
|
||||
|
||||
if (toFac != fme.getFaction()) {
|
||||
if (!me.hasPermission(Permission.FLY_WILDERNESS.node) && toFac.isWilderness() || !me.hasPermission(Permission.FLY_SAFEZONE.node) && toFac.isSafeZone() || !me.hasPermission(Permission.FLY_WARZONE.node) && toFac.isWarZone()) {
|
||||
if(sendMessage) fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme));
|
||||
if (sendMessage) fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme));
|
||||
return false;
|
||||
}
|
||||
Access access = toFac.getAccess(fme, PermissableAction.FLY);
|
||||
if ((!(me.hasPermission(Permission.FLY_ENEMY.node) || access == Access.ALLOW)) && toFac.getRelationTo(fme.getFaction()) == Relation.ENEMY) {
|
||||
if(sendMessage) fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme));
|
||||
if (sendMessage) fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme));
|
||||
return false;
|
||||
}
|
||||
if (!(me.hasPermission(Permission.FLY_ALLY.node) || access == Access.ALLOW) && toFac.getRelationTo(fme.getFaction()) == Relation.ALLY) {
|
||||
if(sendMessage) fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme));
|
||||
if (sendMessage) fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme));
|
||||
return false;
|
||||
}
|
||||
if (!(me.hasPermission(Permission.FLY_TRUCE.node) || access == Access.ALLOW) && toFac.getRelationTo(fme.getFaction()) == Relation.TRUCE) {
|
||||
if(sendMessage) fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme));
|
||||
if (sendMessage) fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(me.hasPermission(Permission.FLY_NEUTRAL.node) || access == Access.ALLOW) && toFac.getRelationTo(fme.getFaction()) == Relation.NEUTRAL && !toFac.isSystemFaction()) {
|
||||
if(sendMessage) fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme));
|
||||
if (sendMessage) fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme));
|
||||
return false;
|
||||
}
|
||||
return me.hasPermission(Permission.FLY_FLY.node) && (access != Access.DENY || toFac.isSystemFaction());
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.massivecraft.factions.zcore.util.TL;
|
||||
*/
|
||||
public class CmdFriendlyFire extends FCommand {
|
||||
|
||||
public CmdFriendlyFire(){
|
||||
public CmdFriendlyFire() {
|
||||
super();
|
||||
this.aliases.addAll(Aliases.friendlyFire);
|
||||
|
||||
@@ -23,12 +23,12 @@ public class CmdFriendlyFire extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
if(!Conf.friendlyFireFPlayersCommand){
|
||||
if (!Conf.friendlyFireFPlayersCommand) {
|
||||
context.msg(TL.GENERIC_DISABLED, "friendly fire");
|
||||
return;
|
||||
}
|
||||
|
||||
if(context.fPlayer.hasFriendlyFire()){
|
||||
if (context.fPlayer.hasFriendlyFire()) {
|
||||
context.fPlayer.setFriendlyFire(false);
|
||||
context.msg(TL.COMMAND_FRIENDLY_FIRE_TOGGLE_OFF);
|
||||
} else {
|
||||
|
||||
@@ -9,7 +9,6 @@ import com.massivecraft.factions.util.CC;
|
||||
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import mkremins.fanciful.FancyMessage;
|
||||
import org.bukkit.ChatColor;
|
||||
|
||||
public class CmdInvite extends FCommand {
|
||||
|
||||
@@ -61,9 +60,9 @@ public class CmdInvite extends FCommand {
|
||||
if (target.isOnline()) {
|
||||
// Tooltips, colors, and commands only apply to the string immediately before it.
|
||||
FancyMessage message = new FancyMessage(TL.COMMAND_INVITE_INVITEDYOU.toString()
|
||||
.replace("%1$s", context.fPlayer.describeTo(target, true))
|
||||
.replace("%2$s", context.faction.getTag())
|
||||
.replaceAll("&", "§"))
|
||||
.replace("%1$s", context.fPlayer.describeTo(target, true))
|
||||
.replace("%2$s", context.faction.getTag())
|
||||
.replaceAll("&", "§"))
|
||||
.tooltip(TL.COMMAND_INVITE_CLICKTOJOIN.toString())
|
||||
.command("/" + Conf.baseCommandAliases.get(0) + " join " + context.faction.getTag());
|
||||
message.send(target.getPlayer());
|
||||
|
||||
@@ -1,25 +1,14 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.*;
|
||||
import com.massivecraft.factions.cmd.audit.FLogType;
|
||||
import com.massivecraft.factions.discord.Discord;
|
||||
import com.massivecraft.factions.event.FPlayerJoinEvent;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.util.CC;
|
||||
import com.massivecraft.factions.zcore.frame.fupgrades.UpgradeType;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.exceptions.HierarchyException;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class CmdJoin extends FCommand {
|
||||
|
||||
/**
|
||||
* @author FactionsUUID Team
|
||||
*/
|
||||
|
||||
public CmdJoin() {
|
||||
super();
|
||||
this.aliases.addAll(Aliases.join);
|
||||
@@ -81,7 +70,7 @@ public class CmdJoin extends FCommand {
|
||||
|
||||
int altLimit = Conf.factionAltMemberLimit;
|
||||
|
||||
if (altLimit > 0 && faction.getAltPlayers().size() >= altLimit && faction.altInvited(context.fPlayer)) {
|
||||
if (altLimit > 0 && faction.getAltPlayers().size() >= altLimit && !faction.altInvited(context.fPlayer)) {
|
||||
context.msg(TL.COMMAND_JOIN_ATLIMIT, faction.getTag(context.fPlayer), altLimit, fplayer.describeTo(context.fPlayer, false));
|
||||
return;
|
||||
}
|
||||
@@ -115,6 +104,8 @@ public class CmdJoin extends FCommand {
|
||||
fplayer.msg(TL.COMMAND_JOIN_MOVED, context.fPlayer.describeTo(fplayer, true), faction.getTag(fplayer));
|
||||
}
|
||||
|
||||
faction.msg(TL.COMMAND_JOIN_JOINED, fplayer.describeTo(faction, true));
|
||||
|
||||
fplayer.resetFactionData();
|
||||
|
||||
if (faction.altInvited(fplayer)) {
|
||||
@@ -125,30 +116,13 @@ public class CmdJoin extends FCommand {
|
||||
}
|
||||
|
||||
faction.deinvite(fplayer);
|
||||
|
||||
try {
|
||||
context.fPlayer.setRole(faction.getDefaultRole());
|
||||
FactionsPlugin.instance.logFactionEvent(faction, FLogType.INVITES, context.fPlayer.getName(), CC.Green + "joined", "the faction");
|
||||
if (Discord.useDiscord && context.fPlayer.discordSetup() && Discord.isInMainGuild(context.fPlayer.discordUser()) && Discord.mainGuild != null) {
|
||||
Member m = Discord.mainGuild.getMember(context.fPlayer.discordUser());
|
||||
if (Conf.factionRoles) {
|
||||
Discord.mainGuild.getController().addSingleRoleToMember(m, Objects.requireNonNull(Discord.createFactionRole(faction.getTag()))).queue();
|
||||
}
|
||||
if (Conf.factionDiscordTags) {
|
||||
Discord.mainGuild.getController().setNickname(m, Discord.getNicknameString(context.fPlayer)).queue();
|
||||
}
|
||||
}
|
||||
} catch (HierarchyException e) {
|
||||
System.out.print(e.getMessage());
|
||||
}
|
||||
|
||||
faction.msg(TL.COMMAND_JOIN_JOINED, fplayer.describeTo(faction, true));
|
||||
context.fPlayer.setRole(faction.getDefaultRole());
|
||||
|
||||
if (Conf.logFactionJoin) {
|
||||
if (samePlayer) {
|
||||
FactionsPlugin.getInstance().log(TL.COMMAND_JOIN_JOINEDLOG.toString(), fplayer.getName(), faction.getTag());
|
||||
FactionsPlugin.instance.log(TL.COMMAND_JOIN_JOINEDLOG.toString(), fplayer.getName(), faction.getTag());
|
||||
} else {
|
||||
FactionsPlugin.getInstance().log(TL.COMMAND_JOIN_MOVEDLOG.toString(), context.fPlayer.getName(), fplayer.getName(), faction.getTag());
|
||||
FactionsPlugin.instance.log(TL.COMMAND_JOIN_MOVEDLOG.toString(), context.fPlayer.getName(), fplayer.getName(), faction.getTag());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,6 +115,7 @@ public class CmdKick extends FCommand {
|
||||
toKickFaction.msg(TL.COMMAND_KICK_FACTION, context.fPlayer.describeTo(toKickFaction, true), toKick.describeTo(toKickFaction, true));
|
||||
|
||||
toKick.msg(TL.COMMAND_KICK_KICKED, context.fPlayer.describeTo(toKick, true), toKickFaction.describeTo(toKick));
|
||||
|
||||
if (toKickFaction != context.faction) {
|
||||
context.fPlayer.msg(TL.COMMAND_KICK_KICKS, toKick.describeTo(context.fPlayer), toKickFaction.describeTo(context.fPlayer));
|
||||
}
|
||||
@@ -127,6 +128,9 @@ public class CmdKick extends FCommand {
|
||||
FactionsPlugin.instance.logFactionEvent(toKickFaction, FLogType.INVITES, context.fPlayer.getName(), CC.Red + "kicked", toKick.getName());
|
||||
toKickFaction.deinvite(toKick);
|
||||
toKick.resetFactionData();
|
||||
if (!CmdFly.checkBypassPerms(toKick, toKick.getPlayer(), toKickFaction, false)) {
|
||||
CmdFly.disableFlight(toKick);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -42,76 +42,75 @@ public class CmdList extends FCommand {
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||
if (!context.payForCommand(Conf.econCostList, "to list the factions", "for listing the factions"))
|
||||
return;
|
||||
FactionsPlugin.getInstance().getServer().getScheduler().runTaskAsynchronously(FactionsPlugin.instance, () -> {
|
||||
|
||||
ArrayList<Faction> factionList = Factions.getInstance().getAllFactions();
|
||||
factionList.remove(Factions.getInstance().getWilderness());
|
||||
factionList.remove(Factions.getInstance().getSafeZone());
|
||||
factionList.remove(Factions.getInstance().getWarZone());
|
||||
ArrayList<Faction> factionList = Factions.getInstance().getAllFactions();
|
||||
factionList.remove(Factions.getInstance().getWilderness());
|
||||
factionList.remove(Factions.getInstance().getSafeZone());
|
||||
factionList.remove(Factions.getInstance().getWarZone());
|
||||
|
||||
// remove exempt factions
|
||||
if (context.fPlayer != null && context.fPlayer.getPlayer() != null && !context.fPlayer.getPlayer().hasPermission("factions.show.bypassexempt")) {
|
||||
List<String> exemptFactions = FactionsPlugin.getInstance().getConfig().getStringList("show-exempt");
|
||||
// remove exempt factions
|
||||
if (context.fPlayer != null && context.fPlayer.getPlayer() != null && !context.fPlayer.getPlayer().hasPermission("factions.show.bypassexempt")) {
|
||||
List<String> exemptFactions = FactionsPlugin.getInstance().getConfig().getStringList("show-exempt");
|
||||
|
||||
factionList.removeIf(next -> exemptFactions.contains(next.getTag()));
|
||||
factionList.removeIf(next -> exemptFactions.contains(next.getTag()));
|
||||
}
|
||||
|
||||
// Sort by total followers first
|
||||
factionList.sort((f1, f2) -> {
|
||||
int f1Size = f1.getFPlayers().size();
|
||||
int f2Size = f2.getFPlayers().size();
|
||||
if (f1Size < f2Size) {
|
||||
return 1;
|
||||
} else if (f1Size > f2Size) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Sort by total followers first
|
||||
factionList.sort((f1, f2) -> {
|
||||
int f1Size = f1.getFPlayers().size();
|
||||
int f2Size = f2.getFPlayers().size();
|
||||
if (f1Size < f2Size) {
|
||||
return 1;
|
||||
} else if (f1Size > f2Size) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
|
||||
// Then sort by how many members are online now
|
||||
factionList.sort((f1, f2) -> {
|
||||
int f1Size = f1.getFPlayersWhereOnline(true).size();
|
||||
int f2Size = f2.getFPlayersWhereOnline(true).size();
|
||||
if (f1Size < f2Size) {
|
||||
return 1;
|
||||
} else if (f1Size > f2Size) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
|
||||
ArrayList<String> lines = new ArrayList<>();
|
||||
|
||||
factionList.add(0, Factions.getInstance().getWilderness());
|
||||
|
||||
final int pageheight = 9;
|
||||
int pagenumber = context.argAsInt(0, 1);
|
||||
int pagecount = (factionList.size() / pageheight) + 1;
|
||||
if (pagenumber > pagecount) {
|
||||
pagenumber = pagecount;
|
||||
} else if (pagenumber < 1) {
|
||||
pagenumber = 1;
|
||||
}
|
||||
int start = (pagenumber - 1) * pageheight;
|
||||
int end = start + pageheight;
|
||||
if (end > factionList.size()) {
|
||||
end = factionList.size();
|
||||
}
|
||||
|
||||
|
||||
String header = FactionsPlugin.getInstance().getConfig().getString("list.header", defaults[0]);
|
||||
header = header.replace("{pagenumber}", String.valueOf(pagenumber)).replace("{pagecount}", String.valueOf(pagecount));
|
||||
lines.add(FactionsPlugin.getInstance().txt.parse(header));
|
||||
|
||||
for (Faction faction : factionList.subList(start, end)) {
|
||||
if (faction.isWilderness()) {
|
||||
lines.add(FactionsPlugin.getInstance().txt.parse(TagUtil.parsePlain(faction, FactionsPlugin.getInstance().getConfig().getString("list.factionless", defaults[1]))));
|
||||
continue;
|
||||
}
|
||||
lines.add(FactionsPlugin.getInstance().txt.parse(TagUtil.parsePlain(faction, context.fPlayer, FactionsPlugin.getInstance().getConfig().getString("list.entry", defaults[2]))));
|
||||
}
|
||||
context.sendMessage(lines);
|
||||
return 0;
|
||||
});
|
||||
|
||||
// Then sort by how many members are online now
|
||||
factionList.sort((f1, f2) -> {
|
||||
int f1Size = f1.getFPlayersWhereOnline(true).size();
|
||||
int f2Size = f2.getFPlayersWhereOnline(true).size();
|
||||
if (f1Size < f2Size) {
|
||||
return 1;
|
||||
} else if (f1Size > f2Size) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
|
||||
ArrayList<String> lines = new ArrayList<>();
|
||||
|
||||
factionList.add(0, Factions.getInstance().getWilderness());
|
||||
|
||||
final int pageheight = 9;
|
||||
int pagenumber = context.argAsInt(0, 1);
|
||||
int pagecount = (factionList.size() / pageheight) + 1;
|
||||
if (pagenumber > pagecount) {
|
||||
pagenumber = pagecount;
|
||||
} else if (pagenumber < 1) {
|
||||
pagenumber = 1;
|
||||
}
|
||||
int start = (pagenumber - 1) * pageheight;
|
||||
int end = start + pageheight;
|
||||
if (end > factionList.size()) {
|
||||
end = factionList.size();
|
||||
}
|
||||
|
||||
|
||||
String header = FactionsPlugin.getInstance().getConfig().getString("list.header", defaults[0]);
|
||||
assert header != null;
|
||||
header = header.replace("{pagenumber}", String.valueOf(pagenumber)).replace("{pagecount}", String.valueOf(pagecount));
|
||||
lines.add(FactionsPlugin.getInstance().txt.parse(header));
|
||||
|
||||
for (Faction faction : factionList.subList(start, end)) {
|
||||
if (faction.isWilderness()) {
|
||||
lines.add(FactionsPlugin.getInstance().txt.parse(TagUtil.parsePlain(faction, FactionsPlugin.getInstance().getConfig().getString("list.factionless", defaults[1]))));
|
||||
continue;
|
||||
}
|
||||
lines.add(FactionsPlugin.getInstance().txt.parse(TagUtil.parsePlain(faction, context.fPlayer, FactionsPlugin.getInstance().getConfig().getString("list.entry", defaults[2]))));
|
||||
}
|
||||
context.sendMessage(lines);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -50,6 +50,10 @@ public class CmdMod extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (you.isAlt()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (context.fPlayer != null && context.fPlayer.getRole() != Role.LEADER && !permAny) {
|
||||
context.msg(TL.COMMAND_MOD_NOTADMIN);
|
||||
return;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class CmdOpen extends FCommand {
|
||||
|
||||
String open = context.faction.getOpen() ? TL.COMMAND_OPEN_OPEN.toString() : TL.COMMAND_OPEN_CLOSED.toString();
|
||||
|
||||
if(Cooldown.isOnCooldown(context.fPlayer.getPlayer(), "openCooldown") && !context.fPlayer.isAdminBypassing()){
|
||||
if (Cooldown.isOnCooldown(context.fPlayer.getPlayer(), "openCooldown") && !context.fPlayer.isAdminBypassing()) {
|
||||
context.msg(TL.COMMAND_COOLDOWN);
|
||||
return;
|
||||
}
|
||||
@@ -51,7 +51,7 @@ public class CmdOpen extends FCommand {
|
||||
Cooldown.setCooldown(fplayer.getPlayer(), "openCooldown", FactionsPlugin.getInstance().getConfig().getInt("fcooldowns.f-open"));
|
||||
continue;
|
||||
}
|
||||
if(FactionsPlugin.getInstance().getConfig().getBoolean("faction-open-broadcast")) return;
|
||||
if (FactionsPlugin.getInstance().getConfig().getBoolean("faction-open-broadcast")) return;
|
||||
fplayer.msg(TL.COMMAND_OPEN_CHANGED, context.faction.getTag(fplayer.getFaction()), open);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -84,37 +84,41 @@ public class CmdShow extends FCommand {
|
||||
}
|
||||
|
||||
List<FancyMessage> fancy = new ArrayList<>();
|
||||
for (String raw : show) {
|
||||
String parsed = TagUtil.parsePlain(faction, context.fPlayer, raw); // use relations
|
||||
if (parsed == null) {
|
||||
continue; // Due to minimal f show.
|
||||
}
|
||||
|
||||
if (context.fPlayer != null) {
|
||||
parsed = TagUtil.parsePlaceholders(context.fPlayer.getPlayer(), parsed);
|
||||
}
|
||||
|
||||
if (TagUtil.hasFancy(parsed)) {
|
||||
List<FancyMessage> localFancy = TagUtil.parseFancy(faction, context.fPlayer, parsed);
|
||||
if (localFancy != null)
|
||||
fancy.addAll(localFancy);
|
||||
|
||||
continue;
|
||||
}
|
||||
if (!parsed.contains("{notFrozen}") && !parsed.contains("{notPermanent}")) {
|
||||
if (parsed.contains("{ig}")) {
|
||||
// replaces all variables with no home TL
|
||||
parsed = parsed.substring(0, parsed.indexOf("{ig}")) + TL.COMMAND_SHOW_NOHOME.toString();
|
||||
List<String> finalShow = show;
|
||||
Faction finalFaction = faction;
|
||||
instance.getServer().getScheduler().runTaskAsynchronously(instance, () -> {
|
||||
for (String raw : finalShow) {
|
||||
String parsed = instance.getConfig().getBoolean("relational-show", true) ? TagUtil.parsePlain(finalFaction, context.fPlayer, raw) : TagUtil.parsePlain(finalFaction, raw); // use relations
|
||||
if (parsed == null) {
|
||||
continue; // Due to minimal f show.
|
||||
}
|
||||
if (parsed.contains("%")) {
|
||||
parsed = parsed.replaceAll("%", ""); // Just in case it got in there before we disallowed it.
|
||||
|
||||
if (context.fPlayer != null) {
|
||||
parsed = TagUtil.parsePlaceholders(context.fPlayer.getPlayer(), parsed);
|
||||
}
|
||||
|
||||
if (TagUtil.hasFancy(parsed)) {
|
||||
List<FancyMessage> localFancy = TagUtil.parseFancy(finalFaction, context.fPlayer, parsed);
|
||||
if (localFancy != null)
|
||||
fancy.addAll(localFancy);
|
||||
|
||||
continue;
|
||||
}
|
||||
if (!parsed.contains("{notFrozen}") && !parsed.contains("{notPermanent}")) {
|
||||
if (parsed.contains("{ig}")) {
|
||||
// replaces all variables with no home TL
|
||||
parsed = parsed.substring(0, parsed.indexOf("{ig}")) + TL.COMMAND_SHOW_NOHOME.toString();
|
||||
}
|
||||
if (parsed.contains("%")) {
|
||||
parsed = parsed.replaceAll("%", ""); // Just in case it got in there before we disallowed it.
|
||||
}
|
||||
parsed = FactionsPlugin.getInstance().txt.parse(parsed);
|
||||
FancyMessage localFancy = instance.txt.parseFancy(parsed);
|
||||
fancy.add(localFancy);
|
||||
}
|
||||
parsed = FactionsPlugin.getInstance().txt.parse(parsed);
|
||||
FancyMessage localFancy = instance.txt.parseFancy(parsed);
|
||||
fancy.add(localFancy);
|
||||
}
|
||||
}
|
||||
instance.getServer().getScheduler().runTask(instance, () -> context.sendFancyMessage(fancy));
|
||||
instance.getServer().getScheduler().runTask(instance, () -> context.sendFancyMessage(fancy));
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -54,7 +54,7 @@ public class CmdTag extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if(Cooldown.isOnCooldown(context.player, "tagCooldown") && !context.fPlayer.isAdminBypassing()){
|
||||
if (Cooldown.isOnCooldown(context.player, "tagCooldown") && !context.fPlayer.isAdminBypassing()) {
|
||||
context.msg(TL.COMMAND_COOLDOWN);
|
||||
return;
|
||||
}
|
||||
@@ -72,7 +72,6 @@ public class CmdTag extends FCommand {
|
||||
}
|
||||
|
||||
|
||||
|
||||
String oldtag = context.faction.getTag();
|
||||
context.faction.setTag(tag);
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.fperms.Access;
|
||||
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.Material;
|
||||
|
||||
public class CmdUnban extends FCommand {
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.massivecraft.factions.discord.CmdInviteBot;
|
||||
import com.massivecraft.factions.discord.CmdSetGuild;
|
||||
import com.massivecraft.factions.missions.CmdMissions;
|
||||
import com.massivecraft.factions.shop.CmdShop;
|
||||
import com.massivecraft.factions.shop.ShopGUIFrame;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import me.lucko.commodore.CommodoreProvider;
|
||||
import org.bukkit.Bukkit;
|
||||
@@ -377,6 +378,7 @@ public class FCmdRoot extends FCommand implements CommandExecutor {
|
||||
}
|
||||
if (FactionsPlugin.getInstance().getConfig().getBoolean("F-Shop.Enabled", false) && !fShopEnabled) {
|
||||
this.addSubCommand(this.cmdShop);
|
||||
new ShopGUIFrame(null).checkShopConfig();
|
||||
fShopEnabled = true;
|
||||
}
|
||||
if (FactionsPlugin.getInstance().getConfig().getBoolean("f-inventory-see.Enabled", false) && !invSeeEnabled) {
|
||||
|
||||
@@ -31,13 +31,16 @@ public class CmdUnclaim extends FCommand {
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.UNCLAIM)
|
||||
.playerOnly()
|
||||
.memberOnly()
|
||||
.withAction(PermissableAction.TERRITORY)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
if (!context.fPlayer.isAdminBypassing() && !context.fPlayer.hasFaction()) {
|
||||
context.fPlayer.msg(TL.GENERIC_MEMBERONLY);
|
||||
return;
|
||||
}
|
||||
|
||||
if (context.args.size() == 2) {
|
||||
Faction target = context.argAsFaction(1);
|
||||
@@ -63,6 +66,11 @@ public class CmdUnclaim extends FCommand {
|
||||
boolean didUnClaim = unClaim(new FLocation(context.player), context);
|
||||
if (didUnClaim && !context.fPlayer.canFlyAtLocation())
|
||||
context.fPlayer.setFFlying(false, false);
|
||||
|
||||
for(FPlayer fPlayer : context.faction.getFPlayersWhereOnline(true)){
|
||||
if(!fPlayer.canFlyAtLocation())
|
||||
fPlayer.setFFlying(false, false);
|
||||
}
|
||||
} else {
|
||||
// radius claim
|
||||
if (!Permission.CLAIM_RADIUS.has(context.sender, false)) {
|
||||
@@ -83,10 +91,13 @@ public class CmdUnclaim extends FCommand {
|
||||
this.stop();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
boolean didUnClaim = unClaim(new FLocation(context.player), context);
|
||||
if (didUnClaim && !context.fPlayer.canFlyAtLocation())
|
||||
context.fPlayer.setFFlying(false, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,14 +57,8 @@ public class CmdUnclaimall extends FCommand {
|
||||
}
|
||||
if (Econ.shouldBeUsed()) {
|
||||
double refund = Econ.calculateTotalLandRefund(target.getLandRounded());
|
||||
if (Conf.bankEnabled && Conf.bankFactionPaysLandCosts) {
|
||||
if (!Econ.modifyMoney(target, refund, TL.COMMAND_UNCLAIMALL_TOUNCLAIM.toString(), TL.COMMAND_UNCLAIMALL_FORUNCLAIM.toString())) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!Econ.modifyMoney(target, refund, TL.COMMAND_UNCLAIMALL_TOUNCLAIM.toString(), TL.COMMAND_UNCLAIMALL_FORUNCLAIM.toString())) {
|
||||
return;
|
||||
}
|
||||
if (!Econ.modifyMoney(target, refund, TL.COMMAND_UNCLAIMALL_TOUNCLAIM.toString(), TL.COMMAND_UNCLAIMALL_FORUNCLAIM.toString())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public class CmdGrace extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if(context.args.size() == 1) {
|
||||
if (context.args.size() == 1) {
|
||||
if (context.sender.hasPermission(String.valueOf(Permission.GRACETOGGLE))) {
|
||||
if (context.argAsString(0).equalsIgnoreCase("on") || context.argAsString(0).equalsIgnoreCase("start")) {
|
||||
FactionsPlugin.getInstance().getTimerManager().graceTimer.setPaused(false);
|
||||
@@ -61,7 +61,7 @@ public class CmdGrace extends FCommand {
|
||||
}
|
||||
}
|
||||
|
||||
if(FactionsPlugin.getInstance().getTimerManager().graceTimer.getRemaining() <= 0L) {
|
||||
if (FactionsPlugin.getInstance().getTimerManager().graceTimer.getRemaining() <= 0L) {
|
||||
context.fPlayer.msg(TL.COMMAND_GRACE_DISABLED_NO_FORMAT.toString());
|
||||
} else {
|
||||
context.fPlayer.msg(TL.COMMAND_GRACE_TIME_REMAINING, String.valueOf(TimerManager.getRemaining(FactionsPlugin.getInstance().getTimerManager().graceTimer.getRemaining(), true)));
|
||||
|
||||
@@ -39,9 +39,9 @@ public abstract class FRelationCommand extends FCommand {
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
Faction them = context.argAsFaction(0);
|
||||
if (them == null) {
|
||||
return;
|
||||
}
|
||||
if (them == null) return;
|
||||
|
||||
if (!context.faction.isNormal()) return;
|
||||
|
||||
if (!them.isNormal()) {
|
||||
context.msg(TL.COMMAND_RELATIONS_ALLTHENOPE);
|
||||
|
||||
@@ -74,6 +74,10 @@ public class FPromoteCommand extends FCommand {
|
||||
}
|
||||
}
|
||||
|
||||
if (target.isAlt()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't allow people to demote people who already have the lowest rank.
|
||||
if (current.value == 0 && relative <= 0) {
|
||||
context.msg(TL.COMMAND_PROMOTE_LOWEST_RANK, target.getName());
|
||||
|
||||
@@ -11,7 +11,6 @@ import com.massivecraft.factions.util.wait.WaitedTask;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
@@ -81,9 +80,9 @@ public class CmdWild extends FCommand implements WaitedTask {
|
||||
public void teleportPlayer(Player p, FLocation loc) {
|
||||
Location finalLoc;
|
||||
if (FactionsPlugin.getInstance().getConfig().getBoolean("Wild.Arrival.SpawnAbove")) {
|
||||
finalLoc = new Location(p.getWorld(), loc.getX(), p.getWorld().getHighestBlockYAt(Math.round(loc.getX()), Math.round(loc.getZ())) + FactionsPlugin.getInstance().getConfig().getInt("Wild.Arrival.SpawnAboveBlocks", 1), loc.getZ());
|
||||
finalLoc = new Location(loc.getWorld(), loc.getX(), loc.getWorld().getHighestBlockYAt(Math.round(loc.getX()), Math.round(loc.getZ())) + FactionsPlugin.getInstance().getConfig().getInt("Wild.Arrival.SpawnAboveBlocks", 1), loc.getZ());
|
||||
} else {
|
||||
finalLoc = new Location(p.getWorld(), loc.getX(), p.getWorld().getHighestBlockYAt(Math.round(loc.getX()), Math.round(loc.getZ())), loc.getZ());
|
||||
finalLoc = new Location(loc.getWorld(), loc.getX(), loc.getWorld().getHighestBlockYAt(Math.round(loc.getX()), Math.round(loc.getZ())), loc.getZ());
|
||||
}
|
||||
p.teleport(finalLoc, PlayerTeleportEvent.TeleportCause.PLUGIN);
|
||||
setTeleporting(p);
|
||||
@@ -116,5 +115,4 @@ public class CmdWild extends FCommand implements WaitedTask {
|
||||
player.sendMessage(TL.COMMAND_WILD_INTERUPTED.toString());
|
||||
teleportRange.remove(player);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -48,7 +48,8 @@ public class Econ {
|
||||
}
|
||||
econ = rsp.getProvider();
|
||||
FactionsPlugin.getInstance().log("Economy integration through Vault plugin successful.");
|
||||
if (!Conf.econEnabled) FactionsPlugin.getInstance().log("NOTE: Economy is disabled. You can enable it with the command: f config econEnabled true");
|
||||
if (!Conf.econEnabled)
|
||||
FactionsPlugin.getInstance().log("NOTE: Economy is disabled. You can enable it with the command: f config econEnabled true");
|
||||
//FactionsPlugin.getInstance().cmdBase.cmdHelp.updateHelp();
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ import org.dynmap.DynmapAPI;
|
||||
import org.dynmap.markers.*;
|
||||
import org.dynmap.utils.TileFlags;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
@@ -50,6 +52,8 @@ public class EngineDynmap {
|
||||
public MarkerAPI markerApi;
|
||||
public MarkerSet markerset;
|
||||
|
||||
List<List<Point>> polyLine = new ArrayList<List<Point>>();
|
||||
|
||||
private EngineDynmap() {
|
||||
}
|
||||
|
||||
@@ -80,9 +84,7 @@ public class EngineDynmap {
|
||||
for (int i = 0; i < string.length(); i++) {
|
||||
char c = string.charAt(i);
|
||||
if (c > 127 || c == '"' || c == '<' || c == '>' || c == '&') {
|
||||
out.append("&#")
|
||||
.append((int) c)
|
||||
.append(';');
|
||||
out.append("&#").append((int) c).append(';');
|
||||
} else {
|
||||
out.append(c);
|
||||
}
|
||||
@@ -121,10 +123,12 @@ public class EngineDynmap {
|
||||
}
|
||||
|
||||
// Shedule non thread safe sync at the end!
|
||||
Bukkit.getScheduler().scheduleSyncRepeatingTask(FactionsPlugin.getInstance(), () -> {
|
||||
Bukkit.getScheduler().scheduleSyncRepeatingTask(FactionsPlugin.getInstance(), () ->
|
||||
{
|
||||
|
||||
final Map<String, TempMarker> homes = createHomes();
|
||||
final Map<String, TempAreaMarker> areas = createAreas();
|
||||
final Map<String, TempPolyLineMarker> polys = createPolys(areas);
|
||||
final Map<String, Set<String>> playerSets = createPlayersets();
|
||||
|
||||
if (!updateCore()) {
|
||||
@@ -138,6 +142,7 @@ public class EngineDynmap {
|
||||
|
||||
updateHomes(homes);
|
||||
updateAreas(areas);
|
||||
updatePolys(polys);
|
||||
updatePlayersets(playerSets);
|
||||
}, 100L, 100L);
|
||||
}
|
||||
@@ -239,6 +244,7 @@ public class EngineDynmap {
|
||||
// NOTE: That way what is left at the end will be outdated markers to remove.
|
||||
Marker marker = markers.remove(markerId);
|
||||
if (marker == null) {
|
||||
marker = temp.create(this.markerApi, this.markerset, markerId);
|
||||
marker = temp.create(this.markerApi, this.markerset, markerId);
|
||||
if (marker == null) {
|
||||
EngineDynmap.severe("Could not get/create the home marker " + markerId);
|
||||
@@ -260,6 +266,29 @@ public class EngineDynmap {
|
||||
// -------------------------------------------- //
|
||||
|
||||
// Thread Safe: YES
|
||||
|
||||
public Map<String, TempPolyLineMarker> createPolys(Map<String, TempAreaMarker> areas) {
|
||||
Map<String, TempPolyLineMarker> ret = new HashMap<String, TempPolyLineMarker>();
|
||||
for (Entry<String, TempAreaMarker> entry : areas.entrySet()) {
|
||||
String markerID = entry.getKey();
|
||||
TempAreaMarker area = entry.getValue();
|
||||
|
||||
int counter = 0;
|
||||
for (List<Point> points : area.getPolyLine()) {
|
||||
markerID = markerID + "_poly_" + counter;
|
||||
TempPolyLineMarker tempPoly = new TempPolyLineMarker();
|
||||
tempPoly.polyLine = points;
|
||||
tempPoly.lineColor = area.lineColor;
|
||||
tempPoly.lineOpacity = area.lineOpacity;
|
||||
tempPoly.lineWeight = area.lineWeight;
|
||||
tempPoly.world = area.world;
|
||||
ret.put(markerID, tempPoly);
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public Map<String, TempAreaMarker> createAreas() {
|
||||
Map<String, Map<Faction, Set<FLocation>>> worldFactionChunks = createWorldFactionChunks();
|
||||
return createAreas(worldFactionChunks);
|
||||
@@ -351,12 +380,11 @@ public class EngineDynmap {
|
||||
|
||||
// Loop through until we don't find more areas
|
||||
while (allChunks != null) {
|
||||
|
||||
TileFlags ourChunkFlags = null;
|
||||
LinkedList<FLocation> ourChunks = null;
|
||||
LinkedList<FLocation> newChunks = null;
|
||||
|
||||
int minimumX = Integer.MAX_VALUE;
|
||||
int minimumZ = Integer.MAX_VALUE;
|
||||
for (FLocation chunk : allChunks) {
|
||||
int chunkX = (int) chunk.getX();
|
||||
int chunkZ = (int) chunk.getZ();
|
||||
@@ -367,18 +395,10 @@ public class EngineDynmap {
|
||||
ourChunks = new LinkedList<>();
|
||||
floodFillTarget(allChunkFlags, ourChunkFlags, chunkX, chunkZ); // Copy shape
|
||||
ourChunks.add(chunk); // Add it to our chunk list
|
||||
minimumX = chunkX;
|
||||
minimumZ = chunkZ;
|
||||
}
|
||||
// If shape found, and we're in it, add to our node list
|
||||
else if (ourChunkFlags != null && ourChunkFlags.getFlag(chunkX, chunkZ)) {
|
||||
ourChunks.add(chunk);
|
||||
if (chunkX < minimumX) {
|
||||
minimumX = chunkX;
|
||||
minimumZ = chunkZ;
|
||||
} else if (chunkX == minimumX && chunkZ < minimumZ) {
|
||||
minimumZ = chunkZ;
|
||||
}
|
||||
}
|
||||
// Else, keep it in the list for the next polygon
|
||||
else {
|
||||
@@ -391,86 +411,129 @@ public class EngineDynmap {
|
||||
|
||||
// Replace list (null if no more to process)
|
||||
allChunks = newChunks;
|
||||
|
||||
if (ourChunkFlags == null) {
|
||||
continue;
|
||||
}
|
||||
List<TempLine> outputLines = new ArrayList<TempLine>();
|
||||
Map<TempLine, Integer> lines = new HashMap<TempLine, Integer>();
|
||||
|
||||
// Trace outline of blocks - start from minx, minz going to x+
|
||||
int initialX = minimumX;
|
||||
int initialZ = minimumZ;
|
||||
int currentX = minimumX;
|
||||
int currentZ = minimumZ;
|
||||
Direction direction = Direction.XPLUS;
|
||||
ArrayList<int[]> linelist = new ArrayList<>();
|
||||
linelist.add(new int[]{initialX, initialZ}); // Add start point
|
||||
while ((currentX != initialX) || (currentZ != initialZ) || (direction != Direction.ZMINUS)) {
|
||||
switch (direction) {
|
||||
case XPLUS: // Segment in X+ direction
|
||||
if (!ourChunkFlags.getFlag(currentX + 1, currentZ)) { // Right turn?
|
||||
linelist.add(new int[]{currentX + 1, currentZ}); // Finish line
|
||||
direction = Direction.ZPLUS; // Change direction
|
||||
} else if (!ourChunkFlags.getFlag(currentX + 1, currentZ - 1)) { // Straight?
|
||||
currentX++;
|
||||
} else { // Left turn
|
||||
linelist.add(new int[]{currentX + 1, currentZ}); // Finish line
|
||||
direction = Direction.ZMINUS;
|
||||
currentX++;
|
||||
currentZ--;
|
||||
}
|
||||
break;
|
||||
case ZPLUS: // Segment in Z+ direction
|
||||
if (!ourChunkFlags.getFlag(currentX, currentZ + 1)) { // Right turn?
|
||||
linelist.add(new int[]{currentX + 1, currentZ + 1}); // Finish line
|
||||
direction = Direction.XMINUS; // Change direction
|
||||
} else if (!ourChunkFlags.getFlag(currentX + 1, currentZ + 1)) { // Straight?
|
||||
currentZ++;
|
||||
} else { // Left turn
|
||||
linelist.add(new int[]{currentX + 1, currentZ + 1}); // Finish line
|
||||
direction = Direction.XPLUS;
|
||||
currentX++;
|
||||
currentZ++;
|
||||
}
|
||||
break;
|
||||
case XMINUS: // Segment in X- direction
|
||||
if (!ourChunkFlags.getFlag(currentX - 1, currentZ)) { // Right turn?
|
||||
linelist.add(new int[]{currentX, currentZ + 1}); // Finish line
|
||||
direction = Direction.ZMINUS; // Change direction
|
||||
} else if (!ourChunkFlags.getFlag(currentX - 1, currentZ + 1)) { // Straight?
|
||||
currentX--;
|
||||
} else { // Left turn
|
||||
linelist.add(new int[]{currentX, currentZ + 1}); // Finish line
|
||||
direction = Direction.ZPLUS;
|
||||
currentX--;
|
||||
currentZ++;
|
||||
}
|
||||
break;
|
||||
case ZMINUS: // Segment in Z- direction
|
||||
if (!ourChunkFlags.getFlag(currentX, currentZ - 1)) { // Right turn?
|
||||
linelist.add(new int[]{currentX, currentZ}); // Finish line
|
||||
direction = Direction.XPLUS; // Change direction
|
||||
} else if (!ourChunkFlags.getFlag(currentX - 1, currentZ - 1)) { // Straight?
|
||||
currentZ--;
|
||||
} else { // Left turn
|
||||
linelist.add(new int[]{currentX, currentZ}); // Finish line
|
||||
direction = Direction.XMINUS;
|
||||
currentX--;
|
||||
currentZ--;
|
||||
}
|
||||
break;
|
||||
if (ourChunks == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (FLocation loc : ourChunks) {
|
||||
int x = loc.getChunk().getX();
|
||||
int z = loc.getChunk().getZ();
|
||||
|
||||
TempLine line = new TempLine(new Point(x * 16, z * 16), new Point(x * 16 + 16, z * 16));
|
||||
if (lines.containsKey(line)) {
|
||||
lines.put(line, lines.get(line) + 1);
|
||||
} else {
|
||||
lines.put(line, 1);
|
||||
}
|
||||
|
||||
line = new TempLine(new Point(x * 16 + 16, z * 16), new Point(x * 16 + 16, z * 16 + 16));
|
||||
if (lines.containsKey(line)) {
|
||||
lines.put(line, lines.get(line) + 1);
|
||||
} else {
|
||||
lines.put(line, 1);
|
||||
}
|
||||
|
||||
line = new TempLine(new Point(x * 16 + 16, z * 16 + 16), new Point(x * 16, z * 16 + 16));
|
||||
if (lines.containsKey(line)) {
|
||||
lines.put(line, lines.get(line) + 1);
|
||||
} else {
|
||||
lines.put(line, 1);
|
||||
}
|
||||
|
||||
line = new TempLine(new Point(x * 16, z * 16 + 16), new Point(x * 16, z * 16));
|
||||
if (lines.containsKey(line)) {
|
||||
lines.put(line, lines.get(line) + 1);
|
||||
} else {
|
||||
lines.put(line, 1);
|
||||
}
|
||||
}
|
||||
|
||||
int sz = linelist.size();
|
||||
double[] x = new double[sz];
|
||||
double[] z = new double[sz];
|
||||
for (int i = 0; i < sz; i++) {
|
||||
int[] line = linelist.get(i);
|
||||
x[i] = (double) line[0] * (double) BLOCKS_PER_CHUNK;
|
||||
z[i] = (double) line[1] * (double) BLOCKS_PER_CHUNK;
|
||||
Iterator<Entry<TempLine, Integer>> iterator = lines.entrySet().iterator();
|
||||
|
||||
List<TempLine> lineList = new ArrayList<TempLine>();
|
||||
lineList.addAll(lines.keySet());
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Entry<TempLine, Integer> entry = iterator.next();
|
||||
if (entry.getValue() > 1) {
|
||||
lineList.remove(entry.getKey());
|
||||
}
|
||||
}
|
||||
|
||||
// Find the leftmost MCRWPoint
|
||||
|
||||
TempLine l = null;
|
||||
for (Iterator<TempLine> it = lineList.iterator(); it.hasNext(); ) {
|
||||
TempLine tl = it.next();
|
||||
if (l == null || tl.getP1().x < l.getP1().x)
|
||||
l = tl;
|
||||
}
|
||||
|
||||
for (Iterator<TempLine> it = lineList.iterator(); it.hasNext(); ) {
|
||||
TempLine tl = it.next();
|
||||
if (tl.getP2().x < l.getP2().x)
|
||||
l = tl;
|
||||
}
|
||||
|
||||
outputLines.add(l);
|
||||
lineList.remove(l);
|
||||
while (lineList.size() > 0) {
|
||||
// MCRWPoint targetp = new MCRWPoint((int) lastLine.x1, (int) lastLine.y1);
|
||||
// MCRWPointWLines.get(targetp);
|
||||
|
||||
TempLine nextLine = null;
|
||||
for (Iterator<TempLine> it = lineList.iterator(); it.hasNext(); ) {
|
||||
TempLine line = it.next();
|
||||
if (l.getP2().x == line.getP1().x && l.getP2().y == line.getP1().y) {
|
||||
|
||||
nextLine = line;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (nextLine != null) {
|
||||
outputLines.add(nextLine);
|
||||
lineList.remove(nextLine);
|
||||
l = nextLine;
|
||||
} else {
|
||||
outputLines.get(outputLines.size() - 1).addAdditionLines(CamScan1(lineList));
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
List<Point> outputPoints = new ArrayList<Point>();
|
||||
|
||||
List<Point> polyPoints = new ArrayList<Point>();
|
||||
|
||||
for (int i = 0; i < outputLines.size(); i++) {
|
||||
Point p = new Point(outputLines.get(i).getP1().x, outputLines.get(i).getP1().y);
|
||||
outputPoints.add(p);
|
||||
polyPoints.add(p);
|
||||
if (outputLines.get(i).getConnectedLines().size() > 0) {
|
||||
|
||||
outputPoints.addAll(addRecursivePoints(new Point(outputLines.get(i).getP1().x, outputLines.get(i).getP1().y), outputLines.get(i)));
|
||||
}
|
||||
p = new Point(outputLines.get(i).getP2().x, outputLines.get(i).getP2().y);
|
||||
outputPoints.add(p);
|
||||
polyPoints.add(p);
|
||||
}
|
||||
polyLine.add(polyPoints);
|
||||
|
||||
// Build information for specific area
|
||||
double[] x = new double[outputPoints.size()];
|
||||
double[] z = new double[outputPoints.size()];
|
||||
|
||||
for (int i = 0; i < outputPoints.size(); i++) {
|
||||
x[i] = outputPoints.get(i).x;
|
||||
z[i] = outputPoints.get(i).y;
|
||||
}
|
||||
|
||||
String markerId = FACTIONS_ + world + "__" + faction.getId() + "__" + markerIndex;
|
||||
|
||||
TempAreaMarker temp = new TempAreaMarker();
|
||||
@@ -488,8 +551,10 @@ public class EngineDynmap {
|
||||
temp.fillOpacity = style.getFillOpacity();
|
||||
|
||||
temp.boost = style.getBoost();
|
||||
temp.setPolyLine(polyLine);
|
||||
|
||||
ret.put(markerId, temp);
|
||||
polyLine.clear();
|
||||
|
||||
markerIndex++;
|
||||
}
|
||||
@@ -497,10 +562,114 @@ public class EngineDynmap {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public List<Point> addRecursivePoints(Point returnPoint, TempLine line) {
|
||||
List<Point> ret = new ArrayList<Point>();
|
||||
boolean shouldReturn = false;
|
||||
List<TempLine> connectedLines = line.getConnectedLines();
|
||||
List<Point> polyPoints = new ArrayList<Point>();
|
||||
for (TempLine line2 : connectedLines) {
|
||||
Point p = new Point(line2.getP1().x, line2.getP1().y);
|
||||
ret.add(p);
|
||||
polyPoints.add(p);
|
||||
shouldReturn = true;
|
||||
if (line2.getConnectedLines().size() > 0) {
|
||||
ret.addAll(addRecursivePoints(new Point(line2.getP1().x, line2.getP1().y), line2));
|
||||
}
|
||||
p = new Point(line2.getP2().x, line2.getP2().y);
|
||||
ret.add(p);
|
||||
polyPoints.add(p);
|
||||
|
||||
}
|
||||
if (shouldReturn) {
|
||||
ret.add(returnPoint);
|
||||
}
|
||||
polyLine.add(polyPoints);
|
||||
return ret;
|
||||
}
|
||||
|
||||
private List<TempLine> CamScan1(List<TempLine> lineList) {
|
||||
List<TempLine> ret = new ArrayList<TempLine>();
|
||||
|
||||
// Find the leftmost MCRWPoint
|
||||
|
||||
TempLine l = null;
|
||||
for (Iterator<TempLine> it = lineList.iterator(); it.hasNext(); ) {
|
||||
|
||||
TempLine tl = it.next();
|
||||
if (l == null || tl.getP1().x < l.getP1().x)
|
||||
l = tl;
|
||||
}
|
||||
|
||||
for (Iterator<TempLine> it = lineList.iterator(); it.hasNext(); ) {
|
||||
TempLine tl = it.next();
|
||||
if (tl.getP2().x < l.getP2().x)
|
||||
l = tl;
|
||||
}
|
||||
|
||||
ret.add(l);
|
||||
lineList.remove(l);
|
||||
while (lineList.size() > 0) {
|
||||
// MCRWPoint targetp = new MCRWPoint((int) lastLine.x1, (int) lastLine.y1);
|
||||
// MCRWPointWLines.get(targetp);
|
||||
|
||||
TempLine thisChunkLine = null;
|
||||
for (Iterator<TempLine> it = lineList.iterator(); it.hasNext(); ) {
|
||||
TempLine line = it.next();
|
||||
if (l.getP2().x == line.getP1().x && l.getP2().y == line.getP1().y) {
|
||||
|
||||
thisChunkLine = line;
|
||||
}
|
||||
|
||||
}
|
||||
if (thisChunkLine != null) {
|
||||
ret.add(thisChunkLine);
|
||||
lineList.remove(thisChunkLine);
|
||||
l = thisChunkLine;
|
||||
} else {
|
||||
// break;
|
||||
ret.get(ret.size() - 1).addAdditionLines(CamScan1(lineList));
|
||||
}
|
||||
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// UTIL & SHARED
|
||||
// -------------------------------------------- //
|
||||
|
||||
public void updatePolys(Map<String, TempPolyLineMarker> polys) {
|
||||
// Map Current
|
||||
Map<String, PolyLineMarker> markers = new HashMap<>();
|
||||
for (PolyLineMarker marker : this.markerset.getPolyLineMarkers()) {
|
||||
markers.put(marker.getMarkerID(), marker);
|
||||
}
|
||||
|
||||
// Loop New
|
||||
for (Entry<String, TempPolyLineMarker> entry : polys.entrySet()) {
|
||||
String markerId = entry.getKey();
|
||||
TempPolyLineMarker temp = entry.getValue();
|
||||
|
||||
// Get Creative
|
||||
// NOTE: I remove from the map created just in the beginning of this method.
|
||||
// NOTE: That way what is left at the end will be outdated markers to remove.
|
||||
PolyLineMarker marker = markers.remove(markerId);
|
||||
if (marker == null) {
|
||||
marker = temp.create(this.markerset, markerId);
|
||||
if (marker == null) {
|
||||
severe("Could not get/create the area marker " + markerId);
|
||||
}
|
||||
} else {
|
||||
temp.update(marker);
|
||||
}
|
||||
}
|
||||
|
||||
// Only old/outdated should now be left. Delete them.
|
||||
for (PolyLineMarker marker : markers.values()) {
|
||||
marker.deleteMarker();
|
||||
}
|
||||
}
|
||||
|
||||
// Thread Safe: NO
|
||||
public void updateAreas(Map<String, TempAreaMarker> areas) {
|
||||
// Map Current
|
||||
@@ -658,7 +827,6 @@ public class EngineDynmap {
|
||||
money = String.format("%.2f", Econ.getBalance(faction.getAccountId()));
|
||||
ret = ret.replace("%money%", money);
|
||||
|
||||
|
||||
// Players
|
||||
Set<FPlayer> playersList = faction.getFPlayers();
|
||||
String playersCount = String.valueOf(playersList.size());
|
||||
@@ -675,7 +843,6 @@ public class EngineDynmap {
|
||||
String playersModeratorsCount = String.valueOf(playersModeratorsList.size());
|
||||
String playersModerators = getHtmlPlayerString(playersModeratorsList);
|
||||
|
||||
|
||||
ArrayList<FPlayer> playersNormalsList = faction.getFPlayersWhereRole(Role.NORMAL);
|
||||
String playersNormalsCount = String.valueOf(playersNormalsList.size());
|
||||
String playersNormals = getHtmlPlayerString(playersNormalsList);
|
||||
|
||||
@@ -3,6 +3,10 @@ package com.massivecraft.factions.integration.dynmap;
|
||||
import org.dynmap.markers.AreaMarker;
|
||||
import org.dynmap.markers.MarkerSet;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TempAreaMarker {
|
||||
|
||||
/**
|
||||
@@ -18,15 +22,13 @@ public class TempAreaMarker {
|
||||
public double[] x;
|
||||
public double[] z;
|
||||
public String description;
|
||||
|
||||
public int lineColor;
|
||||
public double lineOpacity;
|
||||
public int lineWeight;
|
||||
|
||||
public int fillColor;
|
||||
public double fillOpacity;
|
||||
|
||||
public boolean boost;
|
||||
private List<List<Point>> polyLine = new ArrayList<List<Point>>();
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CREATE
|
||||
@@ -54,6 +56,15 @@ public class TempAreaMarker {
|
||||
return true;
|
||||
}
|
||||
|
||||
public List<List<Point>> getPolyLine() {
|
||||
return polyLine;
|
||||
}
|
||||
|
||||
public void setPolyLine(List<List<Point>> points) {
|
||||
polyLine.clear();
|
||||
polyLine.addAll(points);
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// UPDATE
|
||||
// -------------------------------------------- //
|
||||
@@ -61,16 +72,17 @@ public class TempAreaMarker {
|
||||
public AreaMarker create(MarkerSet markerset, String markerId) {
|
||||
AreaMarker ret = markerset.createAreaMarker(markerId, this.label, false, this.world, this.x, this.z, false // not persistent
|
||||
);
|
||||
|
||||
if (ret == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
int counter = 0;
|
||||
|
||||
// Description
|
||||
ret.setDescription(this.description);
|
||||
|
||||
// Line Style
|
||||
ret.setLineStyle(this.lineWeight, this.lineOpacity, this.lineColor);
|
||||
ret.setLineStyle(0, 0, 0);
|
||||
|
||||
// Fill Style
|
||||
ret.setFillStyle(this.fillOpacity, this.fillColor);
|
||||
@@ -80,7 +92,6 @@ public class TempAreaMarker {
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// UTIL
|
||||
// -------------------------------------------- //
|
||||
@@ -95,18 +106,15 @@ public class TempAreaMarker {
|
||||
if (!marker.getLabel().equals(this.label)) {
|
||||
marker.setLabel(this.label);
|
||||
}
|
||||
|
||||
// Description
|
||||
if (!marker.getDescription().equals(this.description)) {
|
||||
marker.setDescription(this.description);
|
||||
}
|
||||
|
||||
// Line Style
|
||||
if (marker.getLineWeight() != this.lineWeight ||
|
||||
marker.getLineOpacity() != this.lineOpacity ||
|
||||
marker.getLineColor() != this.lineColor) {
|
||||
marker.setLineStyle(this.lineWeight, this.lineOpacity, this.lineColor);
|
||||
}
|
||||
// // Line Style
|
||||
// if (marker.getLineWeight() != this.lineWeight || marker.getLineOpacity() != this.lineOpacity || marker.getLineColor() != this.lineColor)
|
||||
// {
|
||||
// marker.setLineStyle(this.lineWeight, this.lineOpacity, this.lineColor);
|
||||
// }
|
||||
|
||||
// Fill Style
|
||||
if ((marker.getFillOpacity() != this.fillOpacity) || (marker.getFillColor() != this.fillColor)) {
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.massivecraft.factions.integration.dynmap;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TempLine {
|
||||
private Point p1;
|
||||
private Point p2;
|
||||
private List<TempLine> connectedLines = new ArrayList<TempLine>();
|
||||
|
||||
TempLine(Point p1, Point p2) {
|
||||
this.p1 = p1;
|
||||
this.p2 = p2;
|
||||
}
|
||||
|
||||
public Point getP1() {
|
||||
return p1;
|
||||
}
|
||||
|
||||
public Point getP2() {
|
||||
return p2;
|
||||
}
|
||||
|
||||
public void addAdditionLines(List<TempLine> connectedLines) {
|
||||
this.connectedLines = connectedLines;
|
||||
}
|
||||
|
||||
public List<TempLine> getConnectedLines() {
|
||||
return connectedLines;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
TempLine line = (TempLine) o;
|
||||
if (line.p1.x == this.p1.x && line.p2.x == this.p2.x && line.p1.y == this.p1.y && line.p2.y == this.p2.y) {
|
||||
return true;
|
||||
}
|
||||
return line.p1.x == this.p2.x && line.p2.x == this.p1.x && line.p1.y == this.p2.y && line.p2.y == this.p1.y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
String test = "" + (p1.x + p2.x);
|
||||
test += " " + (p1.y + p2.y);
|
||||
return test.hashCode();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.massivecraft.factions.integration.dynmap;
|
||||
|
||||
import org.dynmap.markers.MarkerSet;
|
||||
import org.dynmap.markers.PolyLineMarker;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TempPolyLineMarker {
|
||||
|
||||
/**
|
||||
* @author FactionsUUID Team
|
||||
*/
|
||||
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
public String world;
|
||||
|
||||
public List<Point> polyLine = new ArrayList<Point>();
|
||||
|
||||
public int lineColor;
|
||||
public double lineOpacity;
|
||||
public int lineWeight;
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CREATE
|
||||
// -------------------------------------------- //
|
||||
|
||||
public static boolean equals(PolyLineMarker marker, List<Point> points) {
|
||||
int length = marker.getCornerCount();
|
||||
|
||||
if (points.size() != length) {
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < length; i++) {
|
||||
if (marker.getCornerX(i) != points.get(i).x) {
|
||||
return false;
|
||||
}
|
||||
if (marker.getCornerZ(i) != points.get(i).y) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// UPDATE
|
||||
// -------------------------------------------- //
|
||||
|
||||
public PolyLineMarker create(MarkerSet markerset, String markerId) {
|
||||
double[] polyX = new double[polyLine.size()];
|
||||
double[] polyY = new double[polyLine.size()];
|
||||
double[] polyZ = new double[polyLine.size()];
|
||||
for (int i = 0; i < polyLine.size(); i++) {
|
||||
Point p = polyLine.get(i);
|
||||
polyX[i] = p.getX();
|
||||
polyY[i] = 64;
|
||||
polyZ[i] = p.getY();
|
||||
}
|
||||
PolyLineMarker poly = markerset.createPolyLineMarker(markerId, "", false, this.world, polyX, polyY, polyZ, false);
|
||||
// Poly Line Style
|
||||
if (poly != null) {
|
||||
poly.setLineStyle(this.lineWeight, this.lineOpacity, this.lineColor);
|
||||
}
|
||||
return poly;
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// UTIL
|
||||
// -------------------------------------------- //
|
||||
|
||||
public void update(PolyLineMarker marker) {
|
||||
// Corner Locations
|
||||
if (!equals(marker, polyLine)) {
|
||||
double[] polyX = new double[polyLine.size()];
|
||||
double[] polyY = new double[polyLine.size()];
|
||||
double[] polyZ = new double[polyLine.size()];
|
||||
for (int i = 0; i < polyLine.size(); i++) {
|
||||
Point p = polyLine.get(i);
|
||||
polyX[i] = p.getX();
|
||||
polyY[i] = 64;
|
||||
polyZ[i] = p.getY();
|
||||
}
|
||||
marker.setCornerLocations(polyX, polyY, polyZ);
|
||||
marker.setLineStyle(this.lineWeight, this.lineOpacity, this.lineColor);
|
||||
}
|
||||
|
||||
// Line Style
|
||||
if (marker.getLineWeight() != this.lineWeight || marker.getLineOpacity() != this.lineOpacity || marker.getLineColor() != this.lineColor) {
|
||||
marker.setLineStyle(this.lineWeight, this.lineOpacity, this.lineColor);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -186,7 +186,7 @@ public class FactionsBlockListener implements Listener {
|
||||
Faction to = Board.getInstance().getFactionAt(new FLocation(event.getToBlock()));
|
||||
if (from == to) return;
|
||||
// from faction != to faction
|
||||
if(to.isSystemFaction()) {
|
||||
if (to.isSystemFaction()) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
@@ -430,7 +430,8 @@ public class FactionsBlockListener implements Listener {
|
||||
if (!justCheck) fPlayer.setLastFrostwalkerMessage();
|
||||
|
||||
// Check if they have build permissions here. If not, block this from happening.
|
||||
if (!playerCanBuildDestroyBlock(player, location, PermissableAction.FROST_WALK.toString(), justCheck)) event.setCancelled(true);
|
||||
if (!playerCanBuildDestroyBlock(player, location, "frostwalk", justCheck))
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@@ -511,7 +512,6 @@ public class FactionsBlockListener implements Listener {
|
||||
Player p = (Player) event.getRemover();
|
||||
if (!playerCanBuildDestroyBlock(p, event.getEntity().getLocation(), "destroy", true)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -521,7 +521,7 @@ public class FactionsBlockListener implements Listener {
|
||||
public void onFarmLandDamage(EntityChangeBlockEvent event) {
|
||||
if (event.getEntity() instanceof Player) {
|
||||
Player player = (Player) event.getEntity();
|
||||
if (!playerCanBuildDestroyBlock(player, event.getBlock().getLocation(), PermissableAction.DESTROY.name(), true)) {
|
||||
if (!playerCanBuildDestroyBlock(player, event.getBlock().getLocation(), "destroy", true)) {
|
||||
FPlayer me = FPlayers.getInstance().getByPlayer(player);
|
||||
Faction otherFaction = Board.getInstance().getFactionAt(new FLocation(event.getBlock().getLocation()));
|
||||
me.msg(TL.ACTION_DENIED_OTHER, otherFaction.getTag(), "trample crops");
|
||||
@@ -529,4 +529,4 @@ public class FactionsBlockListener implements Listener {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import com.massivecraft.factions.*;
|
||||
import com.massivecraft.factions.event.PowerLossEvent;
|
||||
import com.massivecraft.factions.struct.Relation;
|
||||
import com.massivecraft.factions.util.MiscUtil;
|
||||
import com.massivecraft.factions.util.timer.type.GraceTimer;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.massivecraft.factions.*;
|
||||
import com.massivecraft.factions.cmd.CmdFGlobal;
|
||||
import com.massivecraft.factions.cmd.CmdFly;
|
||||
import com.massivecraft.factions.cmd.CmdSeeChunk;
|
||||
import com.massivecraft.factions.cmd.FCmdRoot;
|
||||
import com.massivecraft.factions.cmd.audit.FLogType;
|
||||
import com.massivecraft.factions.cmd.logout.LogoutHandler;
|
||||
import com.massivecraft.factions.cmd.wild.CmdWild;
|
||||
@@ -36,8 +35,6 @@ import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Boat;
|
||||
import org.bukkit.entity.Minecart;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@@ -57,7 +54,9 @@ import java.util.logging.Level;
|
||||
|
||||
public class FactionsPlayerListener implements Listener {
|
||||
|
||||
public final static Map<UUID, Location> lastLocations = new HashMap<>();
|
||||
public static Set<FLocation> corners;
|
||||
public static BukkitTask positionTask = null;
|
||||
/**
|
||||
* @author FactionsUUID Team
|
||||
*/
|
||||
@@ -490,7 +489,7 @@ public class FactionsPlayerListener implements Listener {
|
||||
|
||||
if (FactionsPlugin.instance.getConfig().getBoolean("scoreboard.default-enabled", false)) {
|
||||
FScoreboard.init(me);
|
||||
FScoreboard.get(me).setDefaultSidebar(new FDefaultSidebar(), FactionsPlugin.instance.getConfig().getInt("scoreboard.default-update-interval", 20));
|
||||
FScoreboard.get(me).setDefaultSidebar(new FDefaultSidebar());
|
||||
FScoreboard.get(me).setSidebarVisibility(me.showScoreboard());
|
||||
}
|
||||
|
||||
@@ -565,7 +564,7 @@ public class FactionsPlayerListener implements Listener {
|
||||
|
||||
CmdSeeChunk.seeChunkMap.remove(event.getPlayer().getName());
|
||||
|
||||
FScoreboard.remove(me);
|
||||
FScoreboard.remove(me, event.getPlayer());
|
||||
}
|
||||
|
||||
public String parseAllPlaceholders(String string, Faction faction, Player player) {
|
||||
@@ -655,9 +654,6 @@ public class FactionsPlayerListener implements Listener {
|
||||
return (result.length() == 3 ? result + "0" : result) + "/hrs ago";
|
||||
}
|
||||
|
||||
public static BukkitTask positionTask = null;
|
||||
public final static Map<UUID, Location> lastLocations = new HashMap<>();
|
||||
|
||||
public void startPositionCheck() {
|
||||
positionTask = Bukkit.getScheduler().runTaskTimer(FactionsPlugin.getInstance(), () -> {
|
||||
if (lastLocations.isEmpty()) return;
|
||||
@@ -741,7 +737,9 @@ public class FactionsPlayerListener implements Listener {
|
||||
me.attemptClaim(me.getAutoClaimFor(), newLocation, true);
|
||||
}
|
||||
FactionsPlugin.instance.logFactionEvent(me.getAutoClaimFor(), FLogType.CHUNK_CLAIMS, me.getName(), CC.GreenB + "CLAIMED", String.valueOf(1), (new FLocation(player.getLocation())).formatXAndZ(","));
|
||||
if (Conf.disableFlightOnFactionClaimChange) CmdFly.disableFlight(me);
|
||||
if (Conf.disableFlightOnFactionClaimChange && FactionsPlugin.getInstance().getConfig().getBoolean("enable-faction-flight"))
|
||||
CmdFly.disableFlight(me);
|
||||
|
||||
} else if (me.isAutoSafeClaimEnabled()) {
|
||||
if (!Permission.MANAGE_SAFE_ZONE.has(player)) {
|
||||
me.setIsAutoSafeClaimEnabled(false);
|
||||
@@ -863,7 +861,7 @@ public class FactionsPlayerListener implements Listener {
|
||||
Block block = event.getClickedBlock();
|
||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK && block.getType() == XMaterial.GRASS_BLOCK.parseMaterial()
|
||||
&& event.hasItem() && event.getItem().getType() == XMaterial.BONE_MEAL.parseMaterial()) {
|
||||
if (!FactionsBlockListener.playerCanBuildDestroyBlock(event.getPlayer(), block.getLocation(), PermissableAction.BUILD.name(), true)) {
|
||||
if (!FactionsBlockListener.playerCanBuildDestroyBlock(event.getPlayer(), block.getLocation(), "build", true)) {
|
||||
FPlayer me = FPlayers.getInstance().getById(event.getPlayer().getUniqueId().toString());
|
||||
Faction myFaction = me.getFaction();
|
||||
|
||||
|
||||
@@ -9,15 +9,27 @@ import org.bukkit.scoreboard.Team;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class BufferedObjective {
|
||||
|
||||
/**
|
||||
* @author FactionsUUID Team
|
||||
*/
|
||||
|
||||
private static final Method addEntryMethod;
|
||||
private static final int MAX_LINE_LENGTH;
|
||||
private static final Pattern PATTERN = Pattern.compile("(\u00A7[0-9a-fk-r])|(.)");
|
||||
|
||||
private final Scoreboard scoreboard;
|
||||
private final String baseName;
|
||||
|
||||
private Objective current;
|
||||
private List<Team> currentTeams = new ArrayList<>();
|
||||
private String title;
|
||||
private DisplaySlot displaySlot;
|
||||
|
||||
private int objPtr;
|
||||
private int teamPtr;
|
||||
private boolean requiresUpdate = false;
|
||||
|
||||
private final Map<Integer, String> contents = new HashMap<>();
|
||||
|
||||
static {
|
||||
// Check for long line support.
|
||||
@@ -39,17 +51,6 @@ public class BufferedObjective {
|
||||
}
|
||||
}
|
||||
|
||||
private final Scoreboard scoreboard;
|
||||
private final String baseName;
|
||||
private final Map<Integer, String> contents = new HashMap<>();
|
||||
private Objective current;
|
||||
private List<Team> currentTeams = new ArrayList<>();
|
||||
private String title;
|
||||
private DisplaySlot displaySlot;
|
||||
private int objPtr;
|
||||
private int teamPtr;
|
||||
private boolean requiresUpdate = false;
|
||||
|
||||
public BufferedObjective(Scoreboard scoreboard) {
|
||||
this.scoreboard = scoreboard;
|
||||
this.baseName = createBaseName();
|
||||
@@ -122,14 +123,75 @@ public class BufferedObjective {
|
||||
Team team = scoreboard.registerNewTeam(getNextTeamName());
|
||||
bufferTeams.add(team);
|
||||
|
||||
Iterator<String> split = Splitter.fixedLength(16).split(entry.getValue()).iterator();
|
||||
String name, prefix = null, suffix = null;
|
||||
|
||||
team.setPrefix(split.next());
|
||||
String name = split.next();
|
||||
if (split.hasNext()) { // We only guarantee two splits
|
||||
team.setSuffix(split.next());
|
||||
String value = entry.getValue();
|
||||
if (value.length() > 16) {
|
||||
String[] arrImAPirate = new String[3];
|
||||
Matcher matcherrr = PATTERN.matcher(value);
|
||||
StringBuilder builderrr = new StringBuilder();
|
||||
int sCURvy = 0;
|
||||
char currrentColorrr = 'r';
|
||||
char currrentFormat = 'r';
|
||||
while (sCURvy < 3 && matcherrr.find()) {
|
||||
String tharSheBlows = matcherrr.group();
|
||||
boolean hoist = false;
|
||||
if (tharSheBlows.length() == 1) {
|
||||
builderrr.append(tharSheBlows);
|
||||
if (builderrr.length() == 16) {
|
||||
hoist = true;
|
||||
}
|
||||
} else {
|
||||
char c = tharSheBlows.charAt(1);
|
||||
if (c >= 'k' && c <= 'r') { // format!
|
||||
currrentFormat = c;
|
||||
if (c == 'r') {
|
||||
currrentColorrr = 'r';
|
||||
}
|
||||
} else {
|
||||
currrentColorrr = c;
|
||||
currrentFormat = 'r';
|
||||
}
|
||||
if (builderrr.length() < 14) {
|
||||
builderrr.append(tharSheBlows);
|
||||
} else {
|
||||
hoist = true;
|
||||
}
|
||||
}
|
||||
if (hoist) {
|
||||
arrImAPirate[sCURvy++] = builderrr.toString();
|
||||
builderrr = new StringBuilder();
|
||||
if (currrentColorrr != 'r') {
|
||||
builderrr.append('\u00A7').append(currrentColorrr);
|
||||
}
|
||||
if (currrentFormat != 'r') {
|
||||
builderrr.append('\u00A7').append(currrentFormat);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sCURvy < 3 && builderrr.length() > 0) {
|
||||
arrImAPirate[sCURvy] = builderrr.toString();
|
||||
}
|
||||
if (arrImAPirate[2] == null) {
|
||||
name = arrImAPirate[0];
|
||||
suffix = arrImAPirate[1];
|
||||
} else {
|
||||
prefix = arrImAPirate[0];
|
||||
name = arrImAPirate[1];
|
||||
suffix = arrImAPirate[2];
|
||||
}
|
||||
} else {
|
||||
name = value;
|
||||
}
|
||||
|
||||
if (prefix != null) {
|
||||
team.setPrefix(prefix);
|
||||
}
|
||||
if (suffix != null) {
|
||||
team.setSuffix(suffix);
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
addEntryMethod.invoke(team, name);
|
||||
} catch (ReflectiveOperationException ignored) {
|
||||
|
||||
@@ -58,10 +58,13 @@ public class FScoreboard {
|
||||
FTeamWrapper.track(fboard);
|
||||
}
|
||||
|
||||
public static void remove(FPlayer fplayer) {
|
||||
public static void remove(FPlayer fplayer, Player player) {
|
||||
FScoreboard fboard = fscoreboards.remove(fplayer);
|
||||
|
||||
if (fboard != null) {
|
||||
if (fboard.scoreboard == player.getScoreboard()) { // No equals method implemented, so may as well skip a nullcheck
|
||||
player.setScoreboard(Bukkit.getScoreboardManager().getMainScoreboard());
|
||||
}
|
||||
fboard.removed = true;
|
||||
FTeamWrapper.untrack(fboard);
|
||||
}
|
||||
@@ -91,7 +94,7 @@ public class FScoreboard {
|
||||
bufferedObjective.setDisplaySlot(visible ? DisplaySlot.SIDEBAR : null);
|
||||
}
|
||||
|
||||
public void setDefaultSidebar(final FSidebarProvider provider, int updateInterval) {
|
||||
public void setDefaultSidebar(final FSidebarProvider provider) {
|
||||
if (!isSupportedByServer()) {
|
||||
return;
|
||||
}
|
||||
@@ -114,7 +117,7 @@ public class FScoreboard {
|
||||
updateObjective();
|
||||
}
|
||||
}
|
||||
}.runTaskTimer(FactionsPlugin.getInstance(), updateInterval, updateInterval);
|
||||
}.runTaskTimer(FactionsPlugin.getInstance(), 20, 20);
|
||||
}
|
||||
|
||||
public void setTemporarySidebar(final FSidebarProvider provider) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.massivecraft.factions.scoreboards;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import com.massivecraft.factions.tag.Tag;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import com.massivecraft.factions.zcore.util.TagUtil;
|
||||
|
||||
@@ -20,16 +21,16 @@ public abstract class FSidebarProvider {
|
||||
public abstract List<String> getLines(FPlayer fplayer);
|
||||
|
||||
public String replaceTags(FPlayer fPlayer, String s) {
|
||||
s = TagUtil.parsePlaceholders(fPlayer.getPlayer(), s);
|
||||
s = Tag.parsePlaceholders(fPlayer.getPlayer(), s);
|
||||
|
||||
return qualityAssure(TagUtil.parsePlain(fPlayer, s));
|
||||
return qualityAssure(Tag.parsePlain(fPlayer, s));
|
||||
}
|
||||
|
||||
public String replaceTags(Faction faction, FPlayer fPlayer, String s) {
|
||||
// Run through Placeholder API first
|
||||
s = TagUtil.parsePlaceholders(fPlayer.getPlayer(), s);
|
||||
s = Tag.parsePlaceholders(fPlayer.getPlayer(), s);
|
||||
|
||||
return qualityAssure(Objects.requireNonNull(TagUtil.parsePlain(faction, fPlayer, s)));
|
||||
return qualityAssure(Tag.parsePlain(faction, fPlayer, s));
|
||||
}
|
||||
|
||||
private String qualityAssure(String line) {
|
||||
|
||||
@@ -19,8 +19,9 @@ public class FTeamWrapper {
|
||||
|
||||
private static final Map<Faction, FTeamWrapper> wrappers = new HashMap<>();
|
||||
private static final List<FScoreboard> tracking = new ArrayList<>();
|
||||
private static final Set<Faction> updating = new HashSet<>();
|
||||
private static int factionTeamPtr;
|
||||
private static final Set<Faction> updating = new HashSet<>();
|
||||
|
||||
private final Map<FScoreboard, Team> teams = new HashMap<>();
|
||||
private final String teamName;
|
||||
private final Faction faction;
|
||||
@@ -36,18 +37,11 @@ public class FTeamWrapper {
|
||||
}
|
||||
|
||||
public static void applyUpdatesLater(final Faction faction) {
|
||||
if (!FScoreboard.isSupportedByServer()) {
|
||||
if (!FScoreboard.isSupportedByServer()) return;
|
||||
if (faction.isWilderness()) return;
|
||||
if (!FactionsPlugin.getInstance().getConfig().getBoolean("scoreboard.default-prefixes", false)
|
||||
|| FactionsPlugin.getInstance().getConfig().getBoolean("See-Invisible-Faction-Members"))
|
||||
return;
|
||||
}
|
||||
|
||||
if (faction.isWilderness()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!FactionsPlugin.getInstance().getConfig().getBoolean("scoreboard.default-prefixes", false) || FactionsPlugin.getInstance().getConfig().getBoolean("See-Invisible-Faction-Members")) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (updating.add(faction)) {
|
||||
Bukkit.getScheduler().runTask(FactionsPlugin.getInstance(), () -> {
|
||||
@@ -58,22 +52,17 @@ public class FTeamWrapper {
|
||||
}
|
||||
|
||||
public static void applyUpdates(Faction faction) {
|
||||
if (!FScoreboard.isSupportedByServer()) {
|
||||
return;
|
||||
}
|
||||
if (!FScoreboard.isSupportedByServer()) return;
|
||||
|
||||
if (faction.isWilderness()) {
|
||||
return;
|
||||
}
|
||||
if (faction.isWilderness()) return;
|
||||
|
||||
if (!FactionsPlugin.getInstance().getConfig().getBoolean("scoreboard.default-prefixes", false) || FactionsPlugin.getInstance().getConfig().getBoolean("See-Invisible-Faction-Members")) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (updating.contains(faction)) {
|
||||
// Faction will be updated soon.
|
||||
if (!FactionsPlugin.getInstance().getConfig().getBoolean("scoreboard.default-prefixes", false)
|
||||
|| FactionsPlugin.getInstance().getConfig().getBoolean("See-Invisible-Faction-Members"))
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (updating.contains(faction)) return;
|
||||
|
||||
FTeamWrapper wrapper = wrappers.get(faction);
|
||||
Set<FPlayer> factionMembers = faction.getFPlayers();
|
||||
@@ -98,21 +87,16 @@ public class FTeamWrapper {
|
||||
}
|
||||
|
||||
for (FPlayer fmember : factionMembers) {
|
||||
if (!fmember.isOnline()) {
|
||||
continue;
|
||||
}
|
||||
if (!fmember.isOnline()) continue;
|
||||
|
||||
// Scoreboard might not have player; add him/her
|
||||
wrapper.addPlayer(fmember.getPlayer());
|
||||
}
|
||||
|
||||
wrapper.updatePrefixes();
|
||||
}
|
||||
|
||||
public static void updatePrefixes(Faction faction) {
|
||||
if (!FScoreboard.isSupportedByServer()) {
|
||||
return;
|
||||
}
|
||||
if (!FScoreboard.isSupportedByServer()) return;
|
||||
|
||||
if (!wrappers.containsKey(faction)) {
|
||||
applyUpdates(faction);
|
||||
@@ -122,34 +106,22 @@ public class FTeamWrapper {
|
||||
}
|
||||
|
||||
protected static void track(FScoreboard fboard) {
|
||||
if (!FScoreboard.isSupportedByServer()) {
|
||||
return;
|
||||
}
|
||||
if (!FScoreboard.isSupportedByServer()) return;
|
||||
tracking.add(fboard);
|
||||
for (FTeamWrapper wrapper : wrappers.values()) {
|
||||
wrapper.add(fboard);
|
||||
}
|
||||
for (FTeamWrapper wrapper : wrappers.values()) wrapper.add(fboard);
|
||||
}
|
||||
|
||||
protected static void untrack(FScoreboard fboard) {
|
||||
if (!FScoreboard.isSupportedByServer()) {
|
||||
return;
|
||||
}
|
||||
if (!FScoreboard.isSupportedByServer()) return;
|
||||
tracking.remove(fboard);
|
||||
for (FTeamWrapper wrapper : wrappers.values()) {
|
||||
wrapper.remove(fboard);
|
||||
}
|
||||
for (FTeamWrapper wrapper : wrappers.values()) wrapper.remove(fboard);
|
||||
}
|
||||
|
||||
private void add(FScoreboard fboard) {
|
||||
Scoreboard board = fboard.getScoreboard();
|
||||
Team team = board.registerNewTeam(teamName);
|
||||
teams.put(fboard, team);
|
||||
|
||||
for (OfflinePlayer player : getPlayers()) {
|
||||
team.addPlayer(player);
|
||||
}
|
||||
|
||||
for (OfflinePlayer player : getPlayers()) team.addPlayer(player);
|
||||
updatePrefix(fboard);
|
||||
}
|
||||
|
||||
@@ -159,9 +131,7 @@ public class FTeamWrapper {
|
||||
|
||||
private void updatePrefixes() {
|
||||
if (FactionsPlugin.getInstance().getConfig().getBoolean("scoreboard.default-prefixes", false)) {
|
||||
for (FScoreboard fboard : teams.keySet()) {
|
||||
updatePrefix(fboard);
|
||||
}
|
||||
for (FScoreboard fboard : teams.keySet()) updatePrefix(fboard);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.massivecraft.factions.util.XMaterial;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -20,6 +21,9 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class ShopGUIFrame {
|
||||
@@ -31,20 +35,22 @@ public class ShopGUIFrame {
|
||||
private Gui gui;
|
||||
|
||||
public ShopGUIFrame(Faction f) {
|
||||
gui = new Gui(FactionsPlugin.getInstance(),
|
||||
FactionsPlugin.getInstance().getConfig().getInt("F-Shop.GUI.Rows", 4),
|
||||
FactionsPlugin.getInstance().color(FactionsPlugin.getInstance().getConfig().getString("F-Shop.GUI.Name")));
|
||||
gui = new Gui(FactionsPlugin.getInstance(), FactionsPlugin.getInstance().getConfig().getInt("F-Shop.GUI.Rows", 4), FactionsPlugin.getInstance().color(FactionsPlugin.getInstance().getConfig().getString("F-Shop.GUI.Name")));
|
||||
}
|
||||
|
||||
public void buildGUI(FPlayer fplayer) {
|
||||
PaginatedPane pane = new PaginatedPane(0, 0, 9, gui.getRows());
|
||||
List<GuiItem> GUIItems = new ArrayList<>();
|
||||
ItemStack dummy = buildDummyItem(fplayer.getFaction());
|
||||
for (int x = 0; x <= (gui.getRows() * 9) - 1; x++) GUIItems.add(new GuiItem(dummy, e -> e.setCancelled(true)));
|
||||
for (int x = 0; x <= (gui.getRows() * 9) - 1; x++)
|
||||
GUIItems.add(new GuiItem(dummy, e -> e.setCancelled(true)));
|
||||
|
||||
Set<String> items = FactionsPlugin.getInstance().getFileManager().getShop().getConfig().getConfigurationSection("items").getKeys(false);
|
||||
for (String s : items) {
|
||||
if (!checkShopConfig(s)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int items = FactionsPlugin.getInstance().getFileManager().getShop().getConfig().getConfigurationSection("items").getKeys(false).size();
|
||||
for (int a = 1; a <= items; a++) {
|
||||
String s = a + "";
|
||||
int slot = FactionsPlugin.getInstance().getFileManager().getShop().fetchInt("items." + s + ".slot");
|
||||
ItemStack item = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getFileManager().getShop().fetchString("items." + s + ".block")).get().parseItem();
|
||||
int cost = FactionsPlugin.getInstance().getFileManager().getShop().fetchInt("items." + s + ".cost");
|
||||
@@ -52,7 +58,6 @@ public class ShopGUIFrame {
|
||||
boolean glowing = FactionsPlugin.getInstance().getFileManager().getShop().fetchBoolean("items." + s + ".glowing");
|
||||
List<String> lore = FactionsPlugin.getInstance().getFileManager().getShop().fetchStringList("items." + s + ".lore");
|
||||
|
||||
|
||||
assert item != null;
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName(FactionsPlugin.instance.color(name));
|
||||
@@ -61,23 +66,26 @@ public class ShopGUIFrame {
|
||||
meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||
meta.addEnchant(Enchantment.DURABILITY, 1, true);
|
||||
}
|
||||
if (!glowing) meta.removeEnchant(Enchantment.DURABILITY);
|
||||
if (!glowing)
|
||||
meta.removeEnchant(Enchantment.DURABILITY);
|
||||
List<String> replacedLore = lore.stream().map(t -> t.replace("{cost}", cost + "")).collect(Collectors.toList());
|
||||
meta.setLore(FactionsPlugin.instance.colorList(replacedLore));
|
||||
item.setItemMeta(meta);
|
||||
GUIItems.set(slot, new GuiItem(item, e -> {
|
||||
GUIItems.set(slot, new GuiItem(item, e ->
|
||||
{
|
||||
e.setCancelled(true);
|
||||
FPlayer fme = FPlayers.getInstance().getByPlayer((Player) e.getWhoClicked());
|
||||
if (fplayer.getFaction().getPoints() >= cost) {
|
||||
fplayer.getFaction().setPoints(fplayer.getFaction().getPoints() - cost);
|
||||
runCommands(FactionsPlugin.getInstance().getFileManager().getShop().fetchStringList("items." + s + ".cmds"), fplayer.getPlayer());
|
||||
for (FPlayer fplayerBuy : fplayer.getFaction().getFPlayers()) {
|
||||
fplayerBuy.getPlayer().sendMessage(TL.SHOP_BOUGHT_BROADCAST_FACTION.toString()
|
||||
.replace("{player}", fplayer.getPlayer().getName())
|
||||
.replace("{item}", ChatColor.stripColor(FactionsPlugin.getInstance().color(name)))
|
||||
.replace("{cost}", cost + ""));
|
||||
if (runCommands(FactionsPlugin.getInstance().getFileManager().getShop().fetchStringList("items." + s + ".cmds"), fplayer.getPlayer())) {
|
||||
fplayer.getFaction().setPoints(fplayer.getFaction().getPoints() - cost);
|
||||
for (FPlayer fplayerBuy : fplayer.getFaction().getFPlayers()) {
|
||||
fplayerBuy.getPlayer().sendMessage(TL.SHOP_BOUGHT_BROADCAST_FACTION.toString().replace("{player}", fplayer.getPlayer().getName()).replace("{item}", ChatColor.stripColor(FactionsPlugin.getInstance().color(name)))
|
||||
.replace("{cost}", cost + ""));
|
||||
}
|
||||
buildGUI(fme);
|
||||
} else {
|
||||
fplayer.msg(TL.SHOP_ERROR_DURING_PURCHASE);
|
||||
}
|
||||
buildGUI(fme);
|
||||
} else {
|
||||
fplayer.msg(TL.SHOP_NOT_ENOUGH_POINTS);
|
||||
}
|
||||
@@ -89,7 +97,6 @@ public class ShopGUIFrame {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private ItemStack buildDummyItem(Faction f) {
|
||||
ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("F-Shop.GUI.dummy-item");
|
||||
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).get().parseItem();
|
||||
@@ -102,10 +109,83 @@ public class ShopGUIFrame {
|
||||
return item;
|
||||
}
|
||||
|
||||
public void runCommands(List<String> list, Player p) {
|
||||
public boolean checkShopConfig() {
|
||||
boolean ret = true;
|
||||
Set<String> items = FactionsPlugin.getInstance().getFileManager().getShop().getConfig().getConfigurationSection("items").getKeys(false);
|
||||
for (String s : items) {
|
||||
if (checkShopConfig(s) == false) {
|
||||
ret = false;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public boolean checkShopConfig(String s) {
|
||||
boolean ret = true;
|
||||
if (!FactionsPlugin.getInstance().getFileManager().getShop().containsKey("items." + s + ".slot")) {
|
||||
FactionsPlugin.getInstance().log(Level.WARNING, "Problem with config item '" + s + "' missing slot variable");
|
||||
ret = false;
|
||||
}
|
||||
if (!FactionsPlugin.getInstance().getFileManager().getShop().containsKey("items." + s + ".block")) {
|
||||
FactionsPlugin.getInstance().log(Level.WARNING, "Problem with config item '" + s + "' missing block variable");
|
||||
ret = false;
|
||||
}
|
||||
|
||||
if (!FactionsPlugin.getInstance().getFileManager().getShop().containsKey("items." + s + ".cmds")) {
|
||||
FactionsPlugin.getInstance().log(Level.WARNING, "Problee with config item '" + s + "' missing cmds variable");
|
||||
ret = false;
|
||||
}
|
||||
|
||||
if (!FactionsPlugin.getInstance().getFileManager().getShop().containsKey("items." + s + ".cost")) {
|
||||
FactionsPlugin.getInstance().log(Level.WARNING, "Problem with config item '" + s + "' missing cost variable this item will cost 0");
|
||||
}
|
||||
if (!FactionsPlugin.getInstance().getFileManager().getShop().containsKey("items." + s + ".name")) {
|
||||
FactionsPlugin.getInstance().log(Level.WARNING, "Problem with config item '" + s + "' missing name variable");
|
||||
ret = false;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list The list of commands to be ran.
|
||||
* @param p The player that is using the shop
|
||||
* @return if all commands are able to be ran or if they did run.
|
||||
*/
|
||||
public boolean runCommands(List<String> list, Player p) {
|
||||
for (String cmd : list) {
|
||||
cmd = cmd.replace("%player%", p.getName());
|
||||
if (cmd.toLowerCase().startsWith("give")) {
|
||||
String[] args = cmd.split(" ");
|
||||
if (args.length == 4) {
|
||||
Material material = Material.matchMaterial(args[2]);
|
||||
int amount = Integer.parseInt(args[3]);
|
||||
Player player = Bukkit.getPlayer(args[1]);
|
||||
if (!player.isOnline()) {
|
||||
return false;
|
||||
}
|
||||
// See if the player has this item in their inventory;
|
||||
if (player.getInventory().contains(material) && player.getInventory().firstEmpty() < 0) {
|
||||
int spacesAvailable = 0;
|
||||
Map<Integer, ? extends ItemStack> contents = player.getInventory().all(material);
|
||||
for (ItemStack stack : contents.values()) {
|
||||
spacesAvailable += stack.getMaxStackSize() - stack.getAmount();
|
||||
}
|
||||
if (spacesAvailable < amount) {
|
||||
return false;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (player.getInventory().firstEmpty() < 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (String cmd : list) {
|
||||
cmd = cmd.replace("%player%", p.getName());
|
||||
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), cmd);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,9 @@ import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import com.massivecraft.factions.integration.Econ;
|
||||
import com.massivecraft.factions.struct.Relation;
|
||||
import com.massivecraft.factions.util.timer.DateTimeFormats;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.apache.commons.lang.time.DurationFormatUtils;
|
||||
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
@@ -36,6 +38,11 @@ public enum FactionTag implements Tag {
|
||||
JOINING("{joining}", (fac) -> (fac.getOpen() ? TL.COMMAND_SHOW_UNINVITED.toString() : TL.COMMAND_SHOW_INVITATION.toString())),
|
||||
FACTION("{faction}", (Function<Faction, String>) Faction::getTag),
|
||||
FACTION_RELATION_COLOR("{faction-relation-color}", (fac, fp) -> fp == null ? "" : fp.getColorTo(fac).toString()),
|
||||
//SHIELD_STATUS("{shield-status}",(fac) -> {
|
||||
//if(fac.isProtected() && fac.getShieldFrame() != null) return String.valueOf(TL.SHIELD_CURRENTLY_ENABLE);
|
||||
//if(fac.getShieldFrame() == null) return String.valueOf(TL.SHIELD_NOT_SET);
|
||||
// return TL.SHIELD_CURRENTLY_NOT_ENABLED.toString();
|
||||
//}),
|
||||
HOME_WORLD("{world}", (fac) -> fac.hasHome() ? fac.getHome().getWorld().getName() : Tag.isMinimalShow() ? null : "{ig}"),
|
||||
RAIDABLE("{raidable}", (fac) -> {
|
||||
if (FactionsPlugin.getInstance().getConfig().getBoolean("hcf.raidable", false)) {
|
||||
|
||||
@@ -15,12 +15,15 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.Arrays;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class ClipPlaceholderAPIManager extends PlaceholderExpansion implements Relational {
|
||||
|
||||
private static void logInvalid(String placeholder) {
|
||||
FactionsPlugin.getInstance().getLogger().log(Level.INFO, "Invalid request through PlaceholderAPI for placeholder '" + placeholder + "'");
|
||||
}
|
||||
|
||||
// Identifier for this expansion
|
||||
@Override
|
||||
public String getIdentifier() {
|
||||
@@ -214,7 +217,7 @@ public class ClipPlaceholderAPIManager extends PlaceholderExpansion implements R
|
||||
case "faction_relation_color":
|
||||
return fPlayer.getColorTo(faction).toString();
|
||||
case "grace_time":
|
||||
if(FactionsPlugin.getInstance().getTimerManager().graceTimer.getRemaining() >= 0) {
|
||||
if (FactionsPlugin.getInstance().getTimerManager().graceTimer.getRemaining() >= 0) {
|
||||
return String.valueOf(TimerManager.getRemaining(FactionsPlugin.getInstance().getTimerManager().graceTimer.getRemaining(), true));
|
||||
} else {
|
||||
return TL.GRACE_DISABLED_PLACEHOLDER.toString();
|
||||
@@ -249,10 +252,6 @@ public class ClipPlaceholderAPIManager extends PlaceholderExpansion implements R
|
||||
return TL.PLACEHOLDERAPI_NULL.toString();
|
||||
}
|
||||
|
||||
private static void logInvalid(String placeholder) {
|
||||
FactionsPlugin.getInstance().getLogger().log(Level.INFO, "Invalid request through PlaceholderAPI for placeholder '" + placeholder + "'");
|
||||
}
|
||||
|
||||
private int countOn(Faction f, Relation relation, Boolean status, FPlayer player) {
|
||||
int count = 0;
|
||||
for (Faction faction : Factions.getInstance().getAllFactions()) {
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.massivecraft.factions.util;
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.metadata.FixedMetadataValue;
|
||||
import org.bukkit.metadata.MetadataValue;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
package com.massivecraft.factions.util.timer;
|
||||
|
||||
import com.massivecraft.factions.util.Config;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Factions - Developed by Driftay.
|
||||
* All rights reserved 2020.
|
||||
|
||||
@@ -8,8 +8,8 @@ import com.massivecraft.factions.util.Config;
|
||||
* Creation Date: 4/7/2020
|
||||
*/
|
||||
public abstract class Timer {
|
||||
protected final String name;
|
||||
public final long defaultCooldown;
|
||||
protected final String name;
|
||||
|
||||
|
||||
public Timer(String name, long defaultCooldown) {
|
||||
|
||||
@@ -16,14 +16,24 @@ import java.util.concurrent.TimeUnit;
|
||||
* Creation Date: 4/7/2020
|
||||
*/
|
||||
public class TimerManager implements Listener, Runnable {
|
||||
private final Set<Timer> timers;
|
||||
private final FactionsPlugin plugin;
|
||||
private final List<TimerRunnable> timerRunnableList = new ArrayList<>();
|
||||
private Config config;
|
||||
public GraceTimer graceTimer;
|
||||
private static final long MINUTE = TimeUnit.MINUTES.toMillis(1L);
|
||||
private static final long HOUR = TimeUnit.HOURS.toMillis(1L);
|
||||
private static final long MULTI_HOUR = TimeUnit.HOURS.toMillis(10);
|
||||
private final Set<Timer> timers;
|
||||
private final FactionsPlugin plugin;
|
||||
private final List<TimerRunnable> timerRunnableList = new ArrayList<>();
|
||||
public GraceTimer graceTimer;
|
||||
private Config config;
|
||||
|
||||
public TimerManager(FactionsPlugin plugin) {
|
||||
this.timers = new HashSet<>();
|
||||
this.plugin = plugin;
|
||||
plugin.getServer().getPluginManager().registerEvents(this, plugin);
|
||||
if (Conf.useGraceSystem) {
|
||||
this.registerTimer(this.graceTimer = new GraceTimer());
|
||||
}
|
||||
plugin.getServer().getScheduler().runTaskTimer(plugin, this, 4, 4);
|
||||
}
|
||||
|
||||
public static String getRemaining(long millis, boolean milliseconds) {
|
||||
return getRemaining(millis, milliseconds, true);
|
||||
@@ -31,21 +41,11 @@ public class TimerManager implements Listener, Runnable {
|
||||
|
||||
public static String getRemaining(long duration, boolean milliseconds, boolean trail) {
|
||||
if ((milliseconds) && (duration < MINUTE)) {
|
||||
return ( (trail ? DateTimeFormats.REMAINING_SECONDS_TRAILING : DateTimeFormats.REMAINING_SECONDS).get()).format(duration * 0.001D) + 's';
|
||||
return ((trail ? DateTimeFormats.REMAINING_SECONDS_TRAILING : DateTimeFormats.REMAINING_SECONDS).get()).format(duration * 0.001D) + 's';
|
||||
}
|
||||
return DurationFormatUtils.formatDuration(duration, (duration >= HOUR ? (duration >= MULTI_HOUR ? "d" : "") + "d:" : "") + "HH:mm:ss");
|
||||
}
|
||||
|
||||
public TimerManager(FactionsPlugin plugin) {
|
||||
this.timers = new HashSet<>();
|
||||
this.plugin = plugin;
|
||||
plugin.getServer().getPluginManager().registerEvents(this, plugin);
|
||||
if(Conf.useGraceSystem) {
|
||||
this.registerTimer(this.graceTimer = new GraceTimer());
|
||||
}
|
||||
plugin.getServer().getScheduler().runTaskTimer(plugin, this, 4, 4);
|
||||
}
|
||||
|
||||
public Collection<Timer> getTimers() {
|
||||
return this.timers;
|
||||
}
|
||||
|
||||
@@ -45,15 +45,13 @@ public class TimerRunnable {
|
||||
return getRemaining(false);
|
||||
}
|
||||
|
||||
public long getRemaining(long now) {
|
||||
return getRemaining(false, now);
|
||||
}
|
||||
|
||||
|
||||
public void setRemaining(long remaining) {
|
||||
setExpiryMillis(remaining);
|
||||
}
|
||||
|
||||
public long getRemaining(long now) {
|
||||
return getRemaining(false, now);
|
||||
}
|
||||
|
||||
public long getRemaining(boolean ignorePaused) {
|
||||
if ((!ignorePaused) && (this.pauseMillis != 0L)) return this.pauseMillis;
|
||||
|
||||
@@ -26,14 +26,14 @@ public class GraceTimer extends GlobalTimer implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onBreak(EntityExplodeEvent e) {
|
||||
if(getRemaining() > 0)
|
||||
e.setCancelled(true);
|
||||
if (getRemaining() > 0)
|
||||
e.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onTNTPlace(BlockPlaceEvent event) {
|
||||
FPlayer fp = FPlayers.getInstance().getByPlayer(event.getPlayer());
|
||||
if(getRemaining() > 0) {
|
||||
if (getRemaining() > 0) {
|
||||
if (!fp.isAdminBypassing()) {
|
||||
if (event.getBlock().getType().equals(Material.TNT)) {
|
||||
event.setCancelled(true);
|
||||
|
||||
@@ -3,7 +3,10 @@ package com.massivecraft.factions.zcore;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.massivecraft.factions.*;
|
||||
import com.massivecraft.factions.Board;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.FPlayers;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.zcore.persist.SaveTask;
|
||||
import com.massivecraft.factions.zcore.util.PermUtil;
|
||||
import com.massivecraft.factions.zcore.util.Persist;
|
||||
|
||||
@@ -56,6 +56,10 @@ public class CustomFile {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean containsKey(String key) {
|
||||
return getCachedObjects().containsKey(key) || getConfig().contains(key);
|
||||
}
|
||||
|
||||
public String fetchString(String key) {
|
||||
return (String) getObj(key, dataTypes.STRING);
|
||||
}
|
||||
|
||||
@@ -6,19 +6,18 @@ import com.github.stefvanschie.inventoryframework.pane.PaginatedPane;
|
||||
import com.massivecraft.factions.FPlayer;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import com.massivecraft.factions.cmd.audit.FLogType;
|
||||
import com.massivecraft.factions.util.XMaterial;
|
||||
import com.massivecraft.factions.zcore.fperms.Access;
|
||||
import com.massivecraft.factions.zcore.fperms.Permissable;
|
||||
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class PermissableActionFrame {
|
||||
|
||||
@@ -30,9 +29,10 @@ public class PermissableActionFrame {
|
||||
|
||||
public PermissableActionFrame(Faction f) {
|
||||
ConfigurationSection section = FactionsPlugin.getInstance().getConfig().getConfigurationSection("fperm-gui.action");
|
||||
assert section != null;
|
||||
gui = new Gui(FactionsPlugin.getInstance(),
|
||||
section.getInt("rows", 3),
|
||||
FactionsPlugin.getInstance().color(FactionsPlugin.getInstance().getConfig().getString("fperm-gui.action.name").replace("{faction}", f.getTag())));
|
||||
section.getInt("rows", 4),
|
||||
FactionsPlugin.getInstance().color(Objects.requireNonNull(FactionsPlugin.getInstance().getConfig().getString("fperm-gui.action.name")).replace("{faction}", f.getTag())));
|
||||
}
|
||||
|
||||
public void buildGUI(FPlayer fplayer, Permissable perm) {
|
||||
@@ -40,8 +40,7 @@ public class PermissableActionFrame {
|
||||
List<GuiItem> GUIItems = new ArrayList<>();
|
||||
ItemStack dumby = buildDummyItem();
|
||||
// Fill background of GUI with dumbyitem & replace GUI assets after
|
||||
for (int x = 0; x <= (gui.getRows() * 9) - 1; x++)
|
||||
GUIItems.add(new GuiItem(dumby, e -> e.setCancelled(true)));
|
||||
for (int x = 0; x <= (gui.getRows() * 9) - 1; x++) GUIItems.add(new GuiItem(dumby, e -> e.setCancelled(true)));
|
||||
for (PermissableAction action : PermissableAction.values()) {
|
||||
if (action.getSlot() == -1) continue;
|
||||
GUIItems.set(action.getSlot(), new GuiItem(action.buildAsset(fplayer, perm), e -> {
|
||||
@@ -53,17 +52,12 @@ public class PermissableActionFrame {
|
||||
case LEFT:
|
||||
access = Access.ALLOW;
|
||||
success = fplayer.getFaction().setPermission(perm, action, access);
|
||||
FactionsPlugin.instance.logFactionEvent(fplayer.getFaction(), FLogType.PERM_EDIT_DEFAULTS, fplayer.getName(), ChatColor.GREEN.toString() + ChatColor.BOLD + "ALLOWED", action.getName(), perm.name());
|
||||
break;
|
||||
case RIGHT:
|
||||
access = Access.DENY;
|
||||
success = fplayer.getFaction().setPermission(perm, action, access);
|
||||
FactionsPlugin.instance.logFactionEvent(fplayer.getFaction(), FLogType.PERM_EDIT_DEFAULTS, fplayer.getName(), ChatColor.RED.toString() + ChatColor.BOLD + "DENIED", action.getName(), perm.name());
|
||||
break;
|
||||
case MIDDLE:
|
||||
access = Access.UNDEFINED;
|
||||
success = fplayer.getFaction().setPermission(perm, action, access);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
@@ -93,9 +87,11 @@ public class PermissableActionFrame {
|
||||
ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("fperm-gui.dummy-item");
|
||||
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).get().parseItem();
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore")));
|
||||
meta.setDisplayName(FactionsPlugin.getInstance().color(config.getString("Name")));
|
||||
item.setItemMeta(meta);
|
||||
if (meta != null) {
|
||||
meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore")));
|
||||
meta.setDisplayName(FactionsPlugin.getInstance().color(config.getString("Name")));
|
||||
item.setItemMeta(meta);
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
@@ -103,9 +99,11 @@ public class PermissableActionFrame {
|
||||
ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("fperm-gui.back-item");
|
||||
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).get().parseItem();
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore")));
|
||||
meta.setDisplayName(FactionsPlugin.getInstance().color(config.getString("Name")));
|
||||
item.setItemMeta(meta);
|
||||
if (meta != null) {
|
||||
meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore")));
|
||||
meta.setDisplayName(FactionsPlugin.getInstance().color(config.getString("Name")));
|
||||
item.setItemMeta(meta);
|
||||
}
|
||||
return item;
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class PermissableRelationFrame {
|
||||
|
||||
@@ -27,9 +28,10 @@ public class PermissableRelationFrame {
|
||||
|
||||
public PermissableRelationFrame(Faction f) {
|
||||
ConfigurationSection section = FactionsPlugin.getInstance().getConfig().getConfigurationSection("fperm-gui.relation");
|
||||
assert section != null;
|
||||
gui = new Gui(FactionsPlugin.getInstance(),
|
||||
section.getInt("rows", 3),
|
||||
FactionsPlugin.getInstance().color(FactionsPlugin.getInstance().getConfig().getString("fperm-gui.relation.name").replace("{faction}", f.getTag())));
|
||||
section.getInt("rows", 4),
|
||||
FactionsPlugin.getInstance().color(Objects.requireNonNull(FactionsPlugin.getInstance().getConfig().getString("fperm-gui.relation.name")).replace("{faction}", f.getTag())));
|
||||
}
|
||||
|
||||
public void buildGUI(FPlayer fplayer) {
|
||||
@@ -37,8 +39,7 @@ public class PermissableRelationFrame {
|
||||
List<GuiItem> GUIItems = new ArrayList<>();
|
||||
ItemStack dumby = buildDummyItem();
|
||||
// Fill background of GUI with dumbyitem & replace GUI assets after
|
||||
for (int x = 0; x <= (gui.getRows() * 9) - 1; x++)
|
||||
GUIItems.add(new GuiItem(dumby, e -> e.setCancelled(true)));
|
||||
for (int x = 0; x <= (gui.getRows() * 9) - 1; x++) GUIItems.add(new GuiItem(dumby, e -> e.setCancelled(true)));
|
||||
ConfigurationSection sec = FactionsPlugin.getInstance().getConfig().getConfigurationSection("fperm-gui.relation");
|
||||
for (String key : sec.getConfigurationSection("slots").getKeys(false)) {
|
||||
if (key == null || sec.getInt("slots." + key) < 0) continue;
|
||||
@@ -58,8 +59,10 @@ public class PermissableRelationFrame {
|
||||
private ItemStack buildAsset(String loc, String relation) {
|
||||
ItemStack item = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString(loc)).get().parseItem();
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName(FactionsPlugin.getInstance().color(FactionsPlugin.getInstance().getConfig().getString("fperm-gui.relation.Placeholder-Item.Name").replace("{relation}", relation)));
|
||||
item.setItemMeta(meta);
|
||||
if (meta != null) {
|
||||
meta.setDisplayName(FactionsPlugin.getInstance().color(FactionsPlugin.getInstance().getConfig().getString("fperm-gui.relation.Placeholder-Item.Name").replace("{relation}", relation)));
|
||||
item.setItemMeta(meta);
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
@@ -67,9 +70,12 @@ public class PermissableRelationFrame {
|
||||
ConfigurationSection config = FactionsPlugin.getInstance().getConfig().getConfigurationSection("fperm-gui.dummy-item");
|
||||
ItemStack item = XMaterial.matchXMaterial(config.getString("Type")).get().parseItem();
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore")));
|
||||
meta.setDisplayName(FactionsPlugin.getInstance().color(config.getString("Name")));
|
||||
item.setItemMeta(meta);
|
||||
// So u can set it to air.
|
||||
if (meta != null) {
|
||||
meta.setLore(FactionsPlugin.getInstance().colorList(config.getStringList("Lore")));
|
||||
meta.setDisplayName(FactionsPlugin.getInstance().color(config.getString("Name")));
|
||||
item.setItemMeta(meta);
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author Saser
|
||||
@@ -36,7 +35,8 @@ public class FUpgradeFrame {
|
||||
PaginatedPane pane = new PaginatedPane(0, 0, 9, this.gui.getRows());
|
||||
List<GuiItem> GUIItems = new ArrayList<>();
|
||||
ItemStack dummy = buildDummyItem();
|
||||
for (int x = 0; x <= this.gui.getRows() * 9 - 1; ++x) GUIItems.add(new GuiItem(dummy, e -> e.setCancelled(true)));
|
||||
for (int x = 0; x <= this.gui.getRows() * 9 - 1; ++x)
|
||||
GUIItems.add(new GuiItem(dummy, e -> e.setCancelled(true)));
|
||||
for (UpgradeType value : UpgradeType.values()) {
|
||||
if (value.getSlot() != -1) {
|
||||
GUIItems.set(value.getSlot(), new GuiItem(value.buildAsset(fplayer.getFaction()), e -> {
|
||||
@@ -44,19 +44,19 @@ public class FUpgradeFrame {
|
||||
FPlayer fme = FPlayers.getInstance().getByPlayer((Player) e.getWhoClicked());
|
||||
if (fme.getFaction().getUpgrade(value) == value.getMaxLevel()) return;
|
||||
int cost = FactionsPlugin.getInstance().getConfig().getInt("fupgrades.MainMenu." + value.toString() + ".Cost.level-" + (fme.getFaction().getUpgrade(value) + 1));
|
||||
if (fme.hasMoney(cost)) {
|
||||
fme.takeMoney(cost);
|
||||
if (value == UpgradeType.CHEST) updateChests(fme.getFaction());
|
||||
if (fme.hasMoney(cost)) {
|
||||
fme.takeMoney(cost);
|
||||
if (value == UpgradeType.CHEST) updateChests(fme.getFaction());
|
||||
|
||||
if (value == UpgradeType.POWER) updateFactionPowerBoost(fme.getFaction());
|
||||
if (value == UpgradeType.POWER) updateFactionPowerBoost(fme.getFaction());
|
||||
|
||||
if (value == UpgradeType.TNT) updateTNT(fme.getFaction());
|
||||
if (value == UpgradeType.TNT) updateTNT(fme.getFaction());
|
||||
|
||||
if (value == UpgradeType.WARP) updateWarps(fme.getFaction());
|
||||
if (value == UpgradeType.WARP) updateWarps(fme.getFaction());
|
||||
|
||||
fme.getFaction().setUpgrade(value, fme.getFaction().getUpgrade(value) + 1);
|
||||
buildGUI(fme);
|
||||
}
|
||||
fme.getFaction().setUpgrade(value, fme.getFaction().getUpgrade(value) + 1);
|
||||
buildGUI(fme);
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public class UpgradesListener implements Listener {
|
||||
if (e.isCancelled()) return;
|
||||
|
||||
if (!(e.getDamager() instanceof Player) || !(e.getEntity() instanceof Player)) return;
|
||||
if(e.getEntity() == null) return;
|
||||
if (e.getEntity() == null) return;
|
||||
|
||||
FPlayer fme = FPlayers.getInstance().getByPlayer((Player) e.getEntity());
|
||||
FPlayer dame = FPlayers.getInstance().getByPlayer((Player) e.getDamager());
|
||||
@@ -36,7 +36,7 @@ public class UpgradesListener implements Listener {
|
||||
if (fme == null || dame == null) return;
|
||||
FLocation floc = new FLocation(fme.getPlayer().getLocation());
|
||||
|
||||
if(floc == null) return;
|
||||
if (floc == null) return;
|
||||
|
||||
if (Board.getInstance().getFactionAt(floc) == fme.getFaction()) {
|
||||
if (dame.getFaction() == fme.getFaction()) return;
|
||||
|
||||
@@ -738,7 +738,7 @@ public abstract class MemoryFPlayer implements FPlayer {
|
||||
public void sendFactionHereMessage(Faction from) {
|
||||
Faction toShow = Board.getInstance().getFactionAt(getLastStoodAt());
|
||||
|
||||
if(Conf.worldsNoClaiming.contains(getLastStoodAt().getWorldName())) return;
|
||||
if (Conf.worldsNoClaiming.contains(getLastStoodAt().getWorldName())) return;
|
||||
|
||||
if (showInfoBoard(toShow)) {
|
||||
FScoreboard.get(this).setTemporarySidebar(new FInfoSidebar(toShow));
|
||||
@@ -860,7 +860,7 @@ public abstract class MemoryFPlayer implements FPlayer {
|
||||
int factionBuffer = plugin.getConfig().getInt("hcf.buffer-zone", 0);
|
||||
int worldBuffer = plugin.getConfig().getInt("world-border.buffer", 0) - 1;
|
||||
|
||||
if (Conf.worldGuardChecking && Worldguard.getInstance().checkForRegionsInChunk(flocation)) {
|
||||
if (Conf.worldGuardChecking && Worldguard.getInstance().checkForRegionsInChunk(flocation)) {
|
||||
// Checks for WorldGuard regions in the chunk attempting to be claimed
|
||||
error = plugin.txt.parse(TL.CLAIM_PROTECTED.toString());
|
||||
} else if (flocation.isOutsideWorldBorder(plugin.getConfig().getInt("world-border.buffer", 0) - 1)) {
|
||||
@@ -873,7 +873,7 @@ public abstract class MemoryFPlayer implements FPlayer {
|
||||
return true;
|
||||
} else if (forFaction.isWarZone() && Permission.MANAGE_WAR_ZONE.has(getPlayer())) {
|
||||
return true;
|
||||
} else if (currentFaction.getAccess(this, PermissableAction.TERRITORY) == Access.ALLOW && forFaction != currentFaction ) {
|
||||
} else if (currentFaction.getAccess(this, PermissableAction.TERRITORY) == Access.ALLOW && forFaction != currentFaction) {
|
||||
return true;
|
||||
} else if (myFaction != forFaction) {
|
||||
error = plugin.txt.parse(TL.CLAIM_CANTCLAIM.toString(), forFaction.describeTo(this));
|
||||
@@ -972,36 +972,38 @@ public abstract class MemoryFPlayer implements FPlayer {
|
||||
}
|
||||
|
||||
public void setFFlying(boolean fly, boolean damage) {
|
||||
Player player = getPlayer();
|
||||
if (player == null) return;
|
||||
if (FactionsPlugin.getInstance().getConfig().getBoolean("enable-faction-flight")) {
|
||||
Player player = getPlayer();
|
||||
if (player == null) return;
|
||||
|
||||
player.setAllowFlight(fly);
|
||||
player.setFlying(fly);
|
||||
player.setAllowFlight(fly);
|
||||
player.setFlying(fly);
|
||||
|
||||
if (!damage) {
|
||||
msg(TL.COMMAND_FLY_CHANGE, fly ? "enabled" : "disabled");
|
||||
if (!damage) {
|
||||
msg(TL.COMMAND_FLY_CHANGE, fly ? "enabled" : "disabled");
|
||||
if (!fly) {
|
||||
sendMessage(TL.COMMAND_FLY_COOLDOWN.toString().replace("{amount}", FactionsPlugin.getInstance().getConfig().getInt("fly-falldamage-cooldown", 3) + ""));
|
||||
}
|
||||
} else {
|
||||
msg(TL.COMMAND_FLY_DAMAGE);
|
||||
}
|
||||
|
||||
// If leaving fly mode, don't let them take fall damage for x seconds.
|
||||
if (!fly) {
|
||||
sendMessage(TL.COMMAND_FLY_COOLDOWN.toString().replace("{amount}", FactionsPlugin.getInstance().getConfig().getInt("fly-falldamage-cooldown", 3) + ""));
|
||||
int cooldown = FactionsPlugin.getInstance().getConfig().getInt("fly-falldamage-cooldown", 3);
|
||||
CmdFly.flyMap.remove(player.getName());
|
||||
|
||||
// If the value is 0 or lower, make them take fall damage.
|
||||
// Otherwise, start a timer and have this cancel after a few seconds.
|
||||
// Short task so we're just doing it in method. Not clean but eh.
|
||||
if (cooldown > 0) {
|
||||
setTakeFallDamage(false);
|
||||
Bukkit.getScheduler().runTaskLater(FactionsPlugin.getInstance(), () -> setTakeFallDamage(true), 20L * cooldown);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
msg(TL.COMMAND_FLY_DAMAGE);
|
||||
|
||||
isFlying = fly;
|
||||
}
|
||||
|
||||
// If leaving fly mode, don't let them take fall damage for x seconds.
|
||||
if (!fly) {
|
||||
int cooldown = FactionsPlugin.getInstance().getConfig().getInt("fly-falldamage-cooldown", 3);
|
||||
CmdFly.flyMap.remove(player.getName());
|
||||
|
||||
// If the value is 0 or lower, make them take fall damage.
|
||||
// Otherwise, start a timer and have this cancel after a few seconds.
|
||||
// Short task so we're just doing it in method. Not clean but eh.
|
||||
if (cooldown > 0) {
|
||||
setTakeFallDamage(false);
|
||||
Bukkit.getScheduler().runTaskLater(FactionsPlugin.getInstance(), () -> setTakeFallDamage(true), 20L * cooldown);
|
||||
}
|
||||
}
|
||||
|
||||
isFlying = fly;
|
||||
}
|
||||
|
||||
public boolean isInFactionsChest() {
|
||||
@@ -1220,11 +1222,11 @@ public abstract class MemoryFPlayer implements FPlayer {
|
||||
}
|
||||
|
||||
|
||||
public boolean hasFriendlyFire(){
|
||||
public boolean hasFriendlyFire() {
|
||||
return friendlyFire;
|
||||
}
|
||||
|
||||
public void setFriendlyFire(boolean status){
|
||||
public void setFriendlyFire(boolean status) {
|
||||
friendlyFire = status;
|
||||
}
|
||||
|
||||
@@ -1302,7 +1304,7 @@ public abstract class MemoryFPlayer implements FPlayer {
|
||||
|
||||
|
||||
// announce success
|
||||
if(!FactionsPlugin.cachedRadiusClaim) {
|
||||
if (!FactionsPlugin.cachedRadiusClaim) {
|
||||
Set<FPlayer> informTheseFPlayers = new HashSet<>();
|
||||
informTheseFPlayers.add(this);
|
||||
informTheseFPlayers.addAll(forFaction.getFPlayersWhereOnline(true));
|
||||
|
||||
@@ -1277,7 +1277,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
|
||||
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" : "") + ".");
|
||||
|
||||
if(FactionsPlugin.getInstance().getConfig().getBoolean("faction-disband-broadcast")) {
|
||||
if (FactionsPlugin.getInstance().getConfig().getBoolean("faction-disband-broadcast")) {
|
||||
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers())
|
||||
fplayer.msg(TL.COMMAND_DISBAND_BROADCAST_GENERIC, this.getTag(fplayer));
|
||||
}
|
||||
|
||||
@@ -73,21 +73,22 @@ public class JSONFPlayers extends MemoryFPlayers {
|
||||
if (!this.file.exists()) return new HashMap<>();
|
||||
String content = DiscUtil.readCatch(this.file);
|
||||
if (content == null) return null;
|
||||
Map<String, JSONFPlayer> data = this.gson.fromJson(content, new TypeToken<Map<String, JSONFPlayer>>() {
|
||||
}.getType());
|
||||
Set<String> list = new HashSet<>();
|
||||
Set<String> invalidList = new HashSet<>();
|
||||
for (Entry<String, JSONFPlayer> entry : data.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
entry.getValue().setId(key);
|
||||
if (doesKeyNeedMigration(key)) {
|
||||
if (!isKeyInvalid(key)) {
|
||||
list.add(key);
|
||||
} else {
|
||||
invalidList.add(key);
|
||||
try {
|
||||
Map<String, JSONFPlayer> data = this.gson.fromJson(content, new TypeToken<Map<String, JSONFPlayer>>() {
|
||||
}.getType());
|
||||
Set<String> list = new HashSet<>();
|
||||
Set<String> invalidList = new HashSet<>();
|
||||
for (Entry<String, JSONFPlayer> entry : data.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
entry.getValue().setId(key);
|
||||
if (doesKeyNeedMigration(key)) {
|
||||
if (!isKeyInvalid(key)) {
|
||||
list.add(key);
|
||||
} else {
|
||||
invalidList.add(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (list.size() > 0) {
|
||||
// We've got some converting to do!
|
||||
@@ -150,6 +151,14 @@ public class JSONFPlayers extends MemoryFPlayers {
|
||||
Bukkit.getLogger().log(Level.INFO, "Done converting players.json to UUID.");
|
||||
}
|
||||
return data;
|
||||
} catch (NullPointerException exception) {
|
||||
exception.printStackTrace();
|
||||
if (this.file.length() < 200) {
|
||||
return new HashMap<>();
|
||||
} else {
|
||||
throw exception;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean doesKeyNeedMigration(String key) {
|
||||
|
||||
@@ -824,6 +824,7 @@ public enum TL {
|
||||
COMMAND_STRIKESINFO_DESCRIPTION("Get a faction's strikes"),
|
||||
|
||||
SHOP_NOT_ENOUGH_POINTS("&c&l[!] &7Your faction does not have enough points to purchase this!"),
|
||||
SHOP_ERROR_DURING_PURCHASE("&c&l[!] &7There was an error while trying to give items please check your inventory! Purchase was not completed!"),
|
||||
SHOP_BOUGHT_BROADCAST_FACTION("\n&c&l[!] &e&lFactionShop » &b{player} &7bought &b{item}&7 for &b{cost} &7points!\n"),
|
||||
|
||||
|
||||
@@ -1250,6 +1251,10 @@ public enum TL {
|
||||
PLAYER_PVP_NEUTRALFAIL("You can't hurt %s in their own territory unless you declare them as an enemy."),
|
||||
PLAYER_PVP_TRIED("%s tried to hurt you."),
|
||||
|
||||
SHIELD_CURRENTLY_ENABLE("&a&lCurrently Protected"),
|
||||
SHIELD_NOT_SET("&c&lNot Set"),
|
||||
SHIELD_CURRENTLY_NOT_ENABLED("&c&lCurrently Unprotected"),
|
||||
|
||||
/**
|
||||
* Strings lying around in other bits of the plugins
|
||||
*/
|
||||
|
||||
@@ -78,6 +78,7 @@ public enum TagReplacer {
|
||||
FACTION_BANCOUNT(TagType.FACTION, "{faction-bancount}"),
|
||||
FACTION_STRIKES(TagType.FACTION, "{strikes}"),
|
||||
FACTION_POINTS(TagType.FACTION, "{faction-points}"),
|
||||
SHIELD_STATUS(TagType.FACTION, "{shield-status}"),
|
||||
|
||||
|
||||
/**
|
||||
@@ -239,6 +240,10 @@ public enum TagReplacer {
|
||||
return fac.hasHome() ? String.valueOf(fac.getHome().getBlockY()) : minimal ? null : "{ig}";
|
||||
case HOME_Z:
|
||||
return fac.hasHome() ? String.valueOf(fac.getHome().getBlockZ()) : minimal ? null : "{ig}";
|
||||
//case SHIELD_STATUS:
|
||||
//if(fac.isProtected() && fac.getShieldFrame() != null) return String.valueOf(TL.SHIELD_CURRENTLY_ENABLE);
|
||||
//if(fac.getShieldFrame() == null) return String.valueOf(TL.SHIELD_NOT_SET);
|
||||
//return TL.SHIELD_CURRENTLY_NOT_ENABLED.toString();
|
||||
case LAND_VALUE:
|
||||
return Econ.shouldBeUsed() ? Econ.moneyString(Econ.calculateTotalLandValue(fac.getLandRounded())) : minimal ? null : TL.ECON_OFF.format("value");
|
||||
case LAND_REFUND:
|
||||
|
||||
@@ -282,6 +282,7 @@ show:
|
||||
- '&4* &cDescription: &f{description}'
|
||||
- '&4* &cLand / Power / Max Power: &f{chunks} &8/ &f{power} &8/ &f{maxPower}'
|
||||
- '&4* &cFaction Strikes: &f{strikes}'
|
||||
- '&4* &cShield Status: &f{shield-status}'
|
||||
- '&4* &cFaction Points: &f{faction-points}'
|
||||
- '&4* &cFounded: &f{create-date}'
|
||||
- '&4* &cBalance: &f{faction-balance}'
|
||||
@@ -293,6 +294,7 @@ show:
|
||||
- '&4* &cBans: &f{faction-bancount}'
|
||||
- '&8&m----------------------------------------'
|
||||
# For a /f show that does not display fancy messages that are essentially empty, use minimal-show
|
||||
relational-show: true
|
||||
minimal-show: false
|
||||
|
||||
# Factions that should be exempt from /f show, case sensitive, useful for a
|
||||
@@ -1448,7 +1450,7 @@ Wild:
|
||||
Zones:
|
||||
# You may create your own zones here please just follow the original format #
|
||||
Close:
|
||||
World: World
|
||||
World: world
|
||||
Range:
|
||||
MinX: -200
|
||||
MaxX: 200
|
||||
@@ -1463,7 +1465,7 @@ Wild:
|
||||
Name: '&cLow Range'
|
||||
Slot: 1
|
||||
Medium:
|
||||
World: World
|
||||
World: world
|
||||
Range:
|
||||
MinX: -400
|
||||
MaxX: 400
|
||||
@@ -1478,7 +1480,7 @@ Wild:
|
||||
Name: '&cMedium Range'
|
||||
Slot: 4
|
||||
Far:
|
||||
World: World
|
||||
World: world
|
||||
Range:
|
||||
MinX: -800
|
||||
MaxX: 800
|
||||
@@ -1558,6 +1560,7 @@ Wild:
|
||||
# - {tnt-balance} : # of tnt a faction has in their tnt bank
|
||||
# - {tnt-max-balance} : # of possible tnt a faction can have in their tnt bank
|
||||
# - {faction-strikes} : # of strikes a faction has
|
||||
# - {shield-status} : Status of the factions shield
|
||||
|
||||
# Faction Permissions GUI variables. Can only be used in GUI
|
||||
# - {relation} : Shows relation name (Can be used in action and relation)
|
||||
|
||||
@@ -226,7 +226,7 @@ COMMAND:
|
||||
ONLINEFACTIONLESS: 'Online factionless: '
|
||||
LOCK:
|
||||
LOCKED: <i>Factions is now locked
|
||||
UNLOCKED: <i>Factions in now unlocked
|
||||
UNLOCKED: <i>Factions is now unlocked
|
||||
LOGINS:
|
||||
TOGGLE: '<i>Set login / logout notifications for Faction members to: <a>%s'
|
||||
MAP:
|
||||
|
||||
508
src/main/resources/lang/zh_CN.yml
Normal file
508
src/main/resources/lang/zh_CN.yml
Normal file
@@ -0,0 +1,508 @@
|
||||
# Saber Factions 中文汉化语言包 @ Forbidden
|
||||
# Made with love <3
|
||||
|
||||
|
||||
|
||||
root:
|
||||
AUTHOR: Forbidden
|
||||
RESPONSIBLE: Forbidden
|
||||
LANGUAGE: Simplified Chinese
|
||||
ENCODING: UTF-8
|
||||
LOCALE: zh_CN
|
||||
REQUIRESUNICODE: 'true'
|
||||
DEFAULT: 'false'
|
||||
STATE: complete
|
||||
LOCAL:
|
||||
AUTHOR: Forbidden
|
||||
RESPONSIBLE: Forbidden
|
||||
LANGUAGE: 简体中文
|
||||
REGION: 中国大陆
|
||||
STATE: 完全汉化
|
||||
COMMAND:
|
||||
ADMIN:
|
||||
NOTMEMBER: '%1$s<i> 不是您派系的一员。'
|
||||
NOTADMIN: <b>您不是派系的管理员。
|
||||
TARGETSELF: <b>目标玩家不可为您本人。
|
||||
DEMOTES: <i>您降职了帮派管理员 %1$s<i>。
|
||||
DEMOTED: <i>您被 %1$s<i> 降职了。
|
||||
PROMOTES: <i>您被 %1$s<i> 升职到了派系管理员。
|
||||
PROMOTED: '%1$s<i> 给予了 %2$s<i> %3$s<i> 的管理员。'
|
||||
AUTOCLAIM:
|
||||
ENABLED: <i>正在为 <h>%1$s<i> 自动宣称领土。
|
||||
DISABLED: <i>已禁用自动宣称领土。
|
||||
REQUIREDRANK: <b>您必须为 <h>%1$s<b> 才能宣称领土。
|
||||
OTHERFACTION: <b>您不能为 <h>%1$s<b> 宣称领土。
|
||||
AUTOHELP:
|
||||
HELPFOR: 命令 " 的帮助:
|
||||
BOOM:
|
||||
PEACEFULONLY: <b>此指令仅限于和平状态下的帮派使用。
|
||||
TOTOGGLE: 来启用爆炸
|
||||
FORTOGGLE: 要开关爆炸
|
||||
ENABLED: '%1$s<i> 已%2$s您领土的爆炸功能。'
|
||||
BYPASS:
|
||||
ENABLE: <i>您已启用管理员绕过模式。您可在任意地点建造或破坏。
|
||||
ENABLELOG: ' 已启用管理员绕过模式。'
|
||||
DISABLE: <i>您已禁用管理员绕过模式。
|
||||
DISABLELOG: ' 已禁用管理员绕过模式。'
|
||||
CHAT:
|
||||
DISABLED: <b>此服务器禁止了内置聊天频道。
|
||||
INVALIDMODE: <b>无法识别的聊天模式,<i>请键入 'a'、'f' 或 'plugin'
|
||||
MODE:
|
||||
PUBLIC: <i>公共聊天模式。
|
||||
ALLIANCE: <i>盟友聊天模式。
|
||||
FACTION: <i>派系聊天模式。
|
||||
CHATSPY:
|
||||
ENABLE: <i>您已启用顺风耳模式。
|
||||
ENABLELOG: ' 已启用顺风耳模式'
|
||||
DISABLE: <i>您已禁用顺风耳模式。
|
||||
DISABLELOG: ' 已禁用顺风耳模式。'
|
||||
CLAIM:
|
||||
INVALIDRADIUS: <b>若您指定半径,则半径至少应为 1。
|
||||
DENIED: <b>您没有指定半径宣称领土的权限。
|
||||
CONFIG:
|
||||
NOEXIST: <b>"<h>%1$s<b>" 的配置设置不存在。
|
||||
SET:
|
||||
'TRUE': '" 选项已设置为 true (已启用)。'
|
||||
'FALSE': '" 选项已设置为 false (已禁用)。'
|
||||
ADDED: '"%1$s" 设置:已添加 "%2$s"。'
|
||||
REMOVED: '"%1$s" 设置:已移除 "%2$s"。'
|
||||
OPTIONSET: '" 选项已设置为 '
|
||||
COLOURSET: '" 颜色选项已设置为 "'
|
||||
INTREQUIRED: '无法设置 "%1$s":选项需要整数值。'
|
||||
LONGREQUIRED: '无法设置 "%1$s":选项需要长整数值。'
|
||||
DOUBLEREQUIRED: '无法设置 "%1$s":选项需要双精度值。'
|
||||
FLOATREQUIRED: '无法设置 "%1$s":选项需要浮点值。'
|
||||
INVALID:
|
||||
COLOUR: '无法设置 "%1$s":"%2$s" 不是有效颜色。'
|
||||
COLLECTION: '"%1$s" 不是可用此命令修改的数据集类型。'
|
||||
MATERIAL: '无法更改 "%1$s" 集:"%2$s" 不是有效的材料。'
|
||||
TYPESET: '"%1$s" 不是可用此命令修改的数据类型集类型。'
|
||||
MATERIAL:
|
||||
ADDED: '"%1$s" 设置:添加了材料 "%2$s"。'
|
||||
REMOVED: '"%1$s" 设置:移除了材料 "%2$s"。'
|
||||
LOG: ' (%1$s 运行了指令)'
|
||||
ERROR:
|
||||
SETTING: 设置配置选项 "%1$s" 至 "%2$s" 时发生错误。
|
||||
MATCHING: 无法匹配配置选项 "%1$s",请汇报此错误。
|
||||
TYPE: '''%1$s'' 的类型为 ''%2$s'',其无法被此命令修改。'
|
||||
CREATE:
|
||||
MUSTLEAVE: <b>您必须先离开当前派系。
|
||||
INUSE: <b>此标签已被使用。
|
||||
TOCREATE: 来创建新派系
|
||||
FORCREATE: 要创建新派系
|
||||
ERROR: <b>创建派系时发生内部错误,请重试。
|
||||
CREATED: '%1$s<i> 创建了新派系 %2$s'
|
||||
YOUSHOULD: '<i>您现在应:%1$s'
|
||||
CREATEDLOG: ' 创建了新派系:'
|
||||
DEINVITE:
|
||||
CANDEINVITE: '您可取消邀请的玩家:'
|
||||
CLICKTODEINVITE: 点击取消 %1$s 的邀请
|
||||
ALREADYMEMBER: '%1$s<i> 已是 %2$s 的成员'
|
||||
MIGHTWANT: '<i>您可能想要:%1$s'
|
||||
REVOKED: '%1$s<i> 撤回了您加入 <h>%2$s<i> 的邀请。'
|
||||
REVOKES: '%1$s<i> 撤回了 %2$s <i>的邀请。'
|
||||
DELFWARP:
|
||||
DELETED: <i>已删除传送点 <a>%1$s
|
||||
INVALID: <i>无法找到传送点 <a>%1$s
|
||||
TODELETE: 来删除传送点
|
||||
FORDELETE: 要删除传送点
|
||||
DESCRIPTION:
|
||||
CHANGES: '您更改了 <h>%1$s<i> 的描述至:'
|
||||
CHANGED: '<i>帮派 %1$s<i> 更改了其描述至:'
|
||||
TOCHANGE: 来更改帮派描述
|
||||
FORCHANGE: 要更改帮派描述
|
||||
DISBAND:
|
||||
IMMUTABLE: <i>您不可解散荒地 (Wilderness)、安全区 (SafeZone) 或是战区 (WarZone)。
|
||||
MARKEDPERMANENT: <i>此帮派已被标记为永久存在,您不可解散。
|
||||
BROADCAST:
|
||||
YOURS: <h>%1$s<i> 解散了您的帮派。
|
||||
NOTYOURS: <h>%1$s<i> 解散了帮派 %2$s。
|
||||
HOLDINGS: <i>您获得了解散帮派银行内的资产,共计 %1$s。
|
||||
FWARP:
|
||||
CLICKTOWARP: 点击传送!
|
||||
COMMANDFORMAT: <i>/f warp <传送点名>
|
||||
WARPED: <i>已传送至 <a>%1$s
|
||||
INVALID: <i>无法找到传送点 <a>%1$s
|
||||
TOWARP: 来传送
|
||||
FORWARPING: 要传送
|
||||
WARPS: '传送点:'
|
||||
HELP:
|
||||
'404': <b>此页面不存在
|
||||
NEXTCREATE: <i>您可在下一页了解如何创建帮派。
|
||||
HOME: '<i>另外,别忘记设置家:'
|
||||
BANK:
|
||||
'1': <i>您的帮派有着用于支付特定物品的银行。
|
||||
'2': <i>因此,银行内应储蓄有钱款。
|
||||
'3': <i>要了解更多,请使用 money 指令。
|
||||
PLAYERTITLES: <i>玩家头衔只是为了好玩而已,没有任何钦点的意思。
|
||||
OWNERSHIP:
|
||||
'1': <i>已宣称且占有的土地已被保护。
|
||||
'2': <i>故只有所有者、帮派管理员
|
||||
'3': <i>才有完整权限。
|
||||
RELATIONS:
|
||||
'1': <i>设置您想与其他帮派达成的关系。
|
||||
'2': <i>默认情况下,您与其他帮派的关系为中立。
|
||||
'3': <i>若双方选择盟友 (ally) 则你们将成为盟友。
|
||||
'4': <i>若单方选择敌人 (enemy) 则你们将互为对头。
|
||||
'5': <i>您不可伤害帮派成员或盟友。
|
||||
'6': <i>您不可在对方领土上伤害中立成员。
|
||||
'7': <i>您可伤害敌人及未加入帮派的玩家。
|
||||
'8': ''
|
||||
'9': <i>在您领土上,来自敌人的伤害将减少。
|
||||
'10': <i>在您死亡时,您将失去影响力。影响力将随时间恢复。
|
||||
'11': <i>一个帮派的影响力为所有成员影响力的总和。
|
||||
'12': <i>一个帮派的影响力决定了其可维持多少土地。
|
||||
'13': <i>您可在影响力过少的帮派的领土上进行宣称。
|
||||
PERMISSIONS:
|
||||
'1': <i>仅有帮派成员可在其自己的领土上建造或摧毁。
|
||||
'2': '<i>同时,下列物品的使用也将受限:'
|
||||
'3': <i>门、箱子、熔炉、发射器及红石中继器。
|
||||
'4': ''
|
||||
'5': <i>请确保为您的访客在门前放置压力板。
|
||||
'6': <i>否则他/她们将无法进入。
|
||||
'7': <i>您也可以利用此方法来创建仅限成员进入的区域。
|
||||
'8': <i>同时由于发射器受保护,您可制造陷阱而
|
||||
'9': <i>不必担忧箭矢被偷。
|
||||
ADMIN:
|
||||
'1': <c>/f claim safezone <i>宣称土地为安全区
|
||||
'2': <c>/f claim warzone <i>宣称土地为战区
|
||||
'3': <c>/f autoclaim [safezone|warzone] <i>随机宣称区域
|
||||
MOAR:
|
||||
'1': '终于,管理员有命令可用了:'
|
||||
'2': '<i>给管理员的更多命令:'
|
||||
'3': '<i>给管理员的甚至更多命令:'
|
||||
HOME:
|
||||
DISABLED: <b>很抱歉,此服务器上禁用了帮派家功能。
|
||||
TELEPORTDISABLED: <b>很抱歉,此服务器上禁用了传送至帮派家功能。
|
||||
NOHOME: '<b>您的帮派没有家。'
|
||||
INENEMY: <b>您无法在对立帮派的领土上传送至您的帮派家。
|
||||
WRONGWORLD: <b>您无法在别的世界传送至您的帮派家。
|
||||
ENEMYNEAR: <b>您无法在敌人距您 %s 方块时传送至您的帮派家。
|
||||
TOTELEPORT: 来传送至您的帮派家
|
||||
FORTELEPORT: 要传送至您的帮派家
|
||||
INVITE:
|
||||
TOINVITE: 来邀请某位玩家
|
||||
FORINVITE: 要邀请某位玩家
|
||||
CLICKTOJOIN: 点击加入!
|
||||
INVITEDYOU: ' 邀请您加入 '
|
||||
INVITED: '%1$s<i> 邀请了 %2$s<i> 至您的帮派。'
|
||||
ALREADYMEMBER: '%1$s<i> 已经是 %2$s 的成员。'
|
||||
JOIN:
|
||||
CANNOTFORCE: <b>您没有移动玩家至其他帮派的权限。
|
||||
SYSTEMFACTION: <b>玩家仅可加入普通帮派,而这是一个系统帮派。
|
||||
ALREADYMEMBER: <b>%1$s %2$s 已经是 %3$s 的成员。
|
||||
ATLIMIT: ' <b>!<white> 帮派 %1$s 已达到 %2$d 位成员的限制,故 %3$s 当前无法加入。'
|
||||
INOTHERFACTION: <b>%1$s 必须先离开 %2$s 当前帮派。
|
||||
NEGATIVEPOWER: <b>%1$s 无法加入影响力为负的帮派。
|
||||
REQUIRESINVITATION: <i>此帮派需要邀请。
|
||||
ATTEMPTEDJOIN: '%1$s<i> 尝试加入您的帮派。'
|
||||
TOJOIN: 来加入帮派
|
||||
FORJOIN: 要加入帮派
|
||||
SUCCESS: <i>%1$s 已成功加入 %2$s.
|
||||
MOVED: <i>%1$s 已移动您至帮派 %2$s。
|
||||
JOINED: <i>%1$s 加入了您的帮派。
|
||||
JOINEDLOG: '%1$s 加入了帮派 %2$s。'
|
||||
MOVEDLOG: '%1$s 移动了玩家 %2$s 至帮派 %3$s。'
|
||||
KICK:
|
||||
CANDIDATES: '您可踢出的玩家:'
|
||||
CLICKTOKICK: '点击踢出 '
|
||||
SELF: <b>您无法踢出您自己。
|
||||
NONE: 此玩家不在帮派里。.
|
||||
NOTMEMBER: '%1$s<b> 不是 %2$s 的成员。'
|
||||
INSUFFICIENTRANK: <b>您的等级不足以踢出此玩家。
|
||||
NEGATIVEPOWER: <b>您无法踢出影响力为负的成员。
|
||||
TOKICK: 来踢出帮派成员
|
||||
FORKICK: 要踢出帮派成员
|
||||
FACTION: '%1$s<i> 将 %2$s<i> 踢出了帮派!:O'
|
||||
KICKS: <i>您将 %1$s<i> 踢出了帮派 %2$s<i>!
|
||||
KICKED: '%1$s<i> 将您踢出了 %2$s<i>!:O'
|
||||
LIST:
|
||||
FACTIONLIST: '帮派列表 '
|
||||
TOLIST: 来列出帮派列表
|
||||
FORLIST: 要列出帮派列表
|
||||
ONLINEFACTIONLESS: '在线的非帮派玩家:'
|
||||
LOCK:
|
||||
LOCKED: <i>帮派现已锁定
|
||||
UNLOCKED: <i>帮派现已解锁
|
||||
LOGINS:
|
||||
TOGGLE: '<i>设置帮派成员登录 / 登出提示至:<a>%s'
|
||||
MAP:
|
||||
TOSHOW: 来展示地图
|
||||
FORSHOW: 要展示地图
|
||||
UPDATE:
|
||||
ENABLED: <i>地图自动更新<green>已启用<i>。
|
||||
DISABLED: <i>地图自动更新<red>已禁用<i>。
|
||||
MOD:
|
||||
CANDIDATES: '您可提拔的玩家列表:'
|
||||
CLICKTOPROMOTE: '点击提拔 '
|
||||
NOTMEMBER: '%1$s<b> 并不是您帮派的成员。'
|
||||
NOTADMIN: <b>您不是帮派管理员。
|
||||
SELF: <b>目标玩家不可为您自己。
|
||||
TARGETISADMIN: <b>目标玩家为帮派管理员,请先降职他/她。
|
||||
REVOKES: <i>您从 %1$s 移除了调停者状态<i>。
|
||||
REVOKED: '%1$s<i> 不再是您帮派的调停者。'
|
||||
PROMOTES: '%1$s<i> 晋升到了您帮派的调停者。'
|
||||
PROMOTED: <i>您提拔了 %1$s<i> 至调停者。
|
||||
MODIFYPOWER:
|
||||
ADDED: '<i>添加了 <a>%1$f <i>影响力至 <a>%2$s。<i>四舍五入后的现影响力为:<a>%3$d'
|
||||
MONEY:
|
||||
SHORT: 帮派金钱命令
|
||||
LONG: <i>帮派金钱指令。
|
||||
MONEYBALANCE:
|
||||
SHORT: 显示帮派余额
|
||||
MONEYDEPOSIT:
|
||||
SHORT: 储蓄钱款
|
||||
DEPOSITED: '%1$s 储蓄了 %2$s 进帮派银行:%3$s'
|
||||
MONEYTRANSFERFF:
|
||||
SHORT: 转账帮派 -> 帮派
|
||||
TRANSFER: '%1$s 从帮派 "%3$s" 转账了 %2$s 至帮派 "%4$s"'
|
||||
MONEYTRANSFERFP:
|
||||
SHORT: 转账帮派 -> 插件
|
||||
TRANSFER: '%1$s 从帮派 "%3$s" 转账了 %2$s 至玩家 "%4$s"'
|
||||
MONEYTRANSFERPF:
|
||||
SHORT: 转账插件 -> 帮派
|
||||
TRANSFER: '%1$s 从玩家 "%3$s" 转账了 %2$s 至帮派 "%4$s"'
|
||||
MONEYWITHDRAW:
|
||||
SHORT: 取出钱款
|
||||
WITHDRAW: '%1$s 从帮派银行 %3$s 中取出了 %2$s'
|
||||
OPEN:
|
||||
TOOPEN: 来开放或关闭帮派
|
||||
FOROPEN: 要开放或关闭帮派
|
||||
OPEN: 开放
|
||||
CLOSED: 关闭
|
||||
CHANGES: '%1$s<i> 更改了帮派至<h>%2$s<i>.'
|
||||
CHANGED: <i>帮派 %1$s<i> 现已%2$s
|
||||
OWNER:
|
||||
DISABLED: <b>很抱歉,但服务器禁用了占有区域。
|
||||
LIMIT: <b>很抱歉,但您超过了服务器每个帮派<h>最多 %1$d <b>块占有区域的限制。
|
||||
WRONGFACTION: <b>此地块尚未被您的帮派宣称,故您不可以设置它的主权。
|
||||
NOTCLAIMED: <b>此地块尚未被任何帮派宣称,主权不可用。
|
||||
NOTMEMBER: '%1$s<i> 不是此帮派的一员。'
|
||||
CLEARED: <i>您已清除此宣称区域的主权。
|
||||
REMOVED: <i>您已从 %1$s 清除此宣称地皮的主权<i>。
|
||||
TOSET: 来设置宣称地皮的主权
|
||||
FORSET: 要设置宣称地皮的主权
|
||||
ADDED: <i>您已添加 %1$s<i> 至此宣称地皮的所有者列表。
|
||||
OWNERLIST:
|
||||
DISABLED: <b>很抱歉,但服务器禁用了占有区域。
|
||||
WRONGFACTION: <b>此地块尚未被您的帮派宣称。
|
||||
NOTCLAIMED: <i>此地块尚未被任何的帮派宣称,因此虚位以待。
|
||||
NONE: <i>这里尚未设置所有者:帮派里的所有人均可访问。
|
||||
OWNERS: '<i>当前此地块的所有者:%1$s'
|
||||
POWER:
|
||||
TOSHOW: 来显示玩家影响力信息
|
||||
FORSHOW: 要显示玩家影响力信息
|
||||
POWER: '%1$s<a> - 影响力 / 最大影响力:<i>%2$d / %3$d %4$s'
|
||||
BONUS: ' (奖励:'
|
||||
PENALTY: ' (惩罚:'
|
||||
POWERBOOST:
|
||||
HELP:
|
||||
'1': <b>您必须指定插件 "plugin" 或玩家 "player" 来指定玩家或使用 "f" 或 "faction" 来指定帮派。
|
||||
'2': <b>示例:/f powerboost plugin 玩家 0.5 -或- /f powerboost f 帮派 -5
|
||||
INVALIDNUM: <b>您必须为影响力奖惩值指定有效的数值。
|
||||
PLAYER: 玩家 "%1$s"
|
||||
FACTION: 帮派 "%1$s"
|
||||
BOOST: <i>%1$s 的最低/最高影响力级别现有 %2$d 的奖惩。
|
||||
BOOSTLOG: '%1$s 为 %2$s 设置影响力奖惩值至 %3$d。'
|
||||
RELOAD:
|
||||
TIME: <i>已从磁盘重载 <h>conf.json <i>,共花费 <h>%1$d ms<i>。
|
||||
SAFEUNCLAIMALL:
|
||||
SHORT: 取消宣称使用安全区地块
|
||||
UNCLAIMED: <i>您已取消宣称使用安全区地块。
|
||||
UNCLAIMEDLOG: '%1$s 已取消宣称使用安全区地块。'
|
||||
SAVEALL: <i>帮派信息已保存至磁盘!
|
||||
SETFWARP:
|
||||
NOTCLAIMED: <i>您仅可在您的帮派区域里设置传送点。
|
||||
LIMIT: <i>您的帮派已达到了最多传送点的数量限制 <a>(%1$d)。
|
||||
SET: <i>已设置传送点 <a>%1$s <i>至您的位置。
|
||||
TOSET: 来设置传送点
|
||||
FORSET: 要设置传送点
|
||||
SETHOME:
|
||||
DISABLED: <b>很抱歉,此服务器上禁用了帮派家功能。
|
||||
NOTCLAIMED: <b>很抱歉,帮派家仅能设置在您的宣称领土内。
|
||||
TOSET: 来设置帮派家
|
||||
FORSET: 要设置帮派家
|
||||
SET: '%1$s<i> 为您的帮派设置了帮派家。您现在可使用:'
|
||||
SETOTHER: <b>您已为帮派 %1$s<i> 设置了家。
|
||||
SHOW:
|
||||
NOFACTION:
|
||||
SELF: 您不在帮派里。
|
||||
OTHER: 这不是帮派。
|
||||
TOSHOW: 来显示帮派信息
|
||||
FORSHOW: 要显示帮派信息
|
||||
DESCRIPTION: '<a>描述:<i>%1$s'
|
||||
PEACEFUL: 此帮派处于和平状态
|
||||
PERMANENT: <a>此帮派被标记为永久,即使无成员也依然存在。
|
||||
JOINING: '<a>正在加入:<i>%1$s '
|
||||
INVITATION: 需要邀请
|
||||
UNINVITED: 无需邀请
|
||||
POWER: '<a>地块 / 影响力 / 最大影响力:<i> %1$d/%2$d/%3$d %4$s'
|
||||
BONUS: ' (奖励:'
|
||||
PENALTY: ' (惩罚:'
|
||||
DEPRECIATED: (%1$s 已弃用)
|
||||
LANDVALUE: '<a>总地块价值:<i>%1$s %2$s'
|
||||
BANKCONTAINS: '<a>银行内有:<i>%1$s'
|
||||
ALLIES: '盟友:'
|
||||
ENEMIES: '敌人:'
|
||||
MEMBERSONLINE: '在线成员:'
|
||||
MEMBERSOFFLINE: '离线成员:'
|
||||
SHOWINVITES:
|
||||
PENDING: '等待接受邀请的玩家:'
|
||||
CLICKTOREVOKE: 点击撤回 %1$s 的邀请。
|
||||
STATUS:
|
||||
FORMAT: '%1$s 影响力:%2$s 上次在线:%3$s'
|
||||
ONLINE: 在线
|
||||
AGOSUFFIX: ' 前。'
|
||||
TAG:
|
||||
TAKEN: <b>此标签已被使用
|
||||
TOCHANGE: 来更改帮派标签
|
||||
FORCHANGE: 要更改帮派标签
|
||||
FACTION: '%1$s<i> 更改了您帮派标签至 %2$s'
|
||||
CHANGED: <i>帮派 %1$s<i> 更改了其名称至 %2$s。
|
||||
TITLE:
|
||||
TOCHANGE: 来更改玩家头衔
|
||||
FORCHANGE: 要更改玩家头衔
|
||||
CHANGED: '%1$s<i> 更改了头衔:%2$s'
|
||||
UNCLAIM:
|
||||
SAFEZONE:
|
||||
SUCCESS: <i>已取消宣称安全区。
|
||||
NOPERM: <b>这里是安全区,您缺少宣称权限。
|
||||
WARZONE:
|
||||
SUCCESS: <i>已取消宣称战区。
|
||||
NOPERM: <b>这里是战区,您缺少宣称权限。
|
||||
UNCLAIMED: '%1$s<i> 取消宣称了您的部分领土。'
|
||||
UNCLAIMS: <i>您取消宣称了此领土。
|
||||
LOG: '%1$s 从帮派 %3$s 取消宣称了在 (%2$s) 处的领土'
|
||||
WRONGFACTION: <b>您未拥有此领土。
|
||||
TOUNCLAIM: 来取消宣称此领土
|
||||
FORUNCLAIM: 要取消宣称此领土
|
||||
FACTIONUNCLAIMED: '%1$s<i> 取消宣称了部分领土。'
|
||||
UNCLAIMALL:
|
||||
TOUNCLAIM: 来取消宣称所有帮派领土
|
||||
FORUNCLAIM: 要取消宣称所有帮派领土
|
||||
UNCLAIMED: '%1$s<i> 取消宣称了您所有的帮派领土。'
|
||||
LOG: '%1$s 为 %2$s 取消宣称了所有的帮派领土'
|
||||
VERSION:
|
||||
VERSION: <i>您正运行 %1$s
|
||||
WARUNCLAIMALL:
|
||||
SHORT: 取消宣称所有战区领土
|
||||
SUCCESS: <i>您取消宣称了所有战区领土。
|
||||
LOG: '%1$s 取消宣称了所有战区领土。'
|
||||
RELATIONS:
|
||||
ALLTHENOPE: <b>并不可以哦!
|
||||
MORENOPE: <b>不行哦!您不可对您自己改变关系 :)
|
||||
ALREADYINRELATIONSHIP: <b>您已为 %1$s 设置了相同的关系意愿。
|
||||
TOMARRY: 来改变关系意愿
|
||||
FORMARRY: 要改变关系意愿
|
||||
MUTUAL: <i>您的帮派现已 %1$s<i> 至 %2$s
|
||||
PEACEFUL: <i>在您帮派处于和平状态时,这将毫无作用。
|
||||
PEACEFULOTHER: <i>在对方帮派处于和平状态时,这将毫无作用。
|
||||
PROPOSAL:
|
||||
'1': '%1$s<i> 想成为您的 %2$s'
|
||||
'2': <i>键入 <c>/%1$s %2$s %3$s<i> 来同意。
|
||||
SENT: '%1$s<i> 已悉知您想成为 %2$s 的意愿'
|
||||
command:
|
||||
convert:
|
||||
backend:
|
||||
running: 已正在运行此后端。
|
||||
invalid: 无效后端
|
||||
help:
|
||||
invitations: '<i>您可能想要关闭并使用邀请:'
|
||||
LEAVE:
|
||||
PASSADMIN: <b>您必须现将管理员角色转给他人。
|
||||
NEGATIVEPOWER: <b>您不可在影响力为正时离开帮派。
|
||||
TOLEAVE: 来离开您的帮派
|
||||
FORLEAVE: 要离开您的帮派
|
||||
LEFT: '%s<i> 离开了帮派 %s<i>。'
|
||||
DISBANDED: <i>%s<i> 被解散了。
|
||||
DISBANDEDLOG: 由于帮派 %s (%s) 的最后一名玩家 (%s) 也已离开,其已被解散。
|
||||
CLAIM:
|
||||
PROTECTED: <b>此地块已被保护
|
||||
DISABLED: <b>很抱歉,此世界禁用了领土宣称功能。
|
||||
CANTCLAIM: <b>您不能为 <h>%s<b> 宣称领土。
|
||||
ALREADYOWN: '%s<i> 已拥有此地块。'
|
||||
MUSTBE: <b>您必须为 <h>%s<b> 才能宣称领土。
|
||||
MEMBERS: 帮派必须有至少 <h>%s<b> 名成员才能宣称领土。
|
||||
SAFEZONE: <b>您不能宣称安全区。
|
||||
WARZONE: <b>您不能宣称战区。
|
||||
POWER: <b>您不能宣称更多领土!您需要更多影响力!
|
||||
LIMIT: <b>已达到限制。您不可宣称更多领土!
|
||||
ALLY: <b>您无法宣称您盟友的领土。
|
||||
CONTIGIOUS: <b>您仅可宣称连到您首块宣称领土或被其他帮派控制的领土的地块!
|
||||
FACTIONCONTIGUOUS: <b>您仅可宣称连到您首块宣称领土的地块!
|
||||
PEACEFUL: '%s<i> 拥有此领土。您的帮派处于和平状态,故您不可以宣称来自其他帮派的领土。'
|
||||
PEACEFULTARGET: '%s<i> 拥有此领土,且其处于和平状态,故您不可以宣称来自他们的领土。'
|
||||
THISISSPARTA: '%s<i> 拥有此领土,且强大到足以保持此领地。'
|
||||
BORDER: <b>您必须在领地边境才能开始宣称领土。
|
||||
TOCLAIM: 来宣称此领土
|
||||
FORCLAIM: 要宣称此领土
|
||||
CLAIMED: <h>%s<i> 为 <h>%s<i> 宣称了来自 <h>%s<i> 的领土。
|
||||
CLAIMEDLOG: '%s 在 (%s) 处为帮派 %s 宣称了领土'
|
||||
GENERIC:
|
||||
NOPERMISSION: <b>您没有 %1$s 的权限。
|
||||
DOTHAT: 进行此操作
|
||||
NOPLAYERMATCH: <b>未找到匹配 "<plugin>%1$s<b>" 的玩家。
|
||||
NOPLAYERFOUND: <b>无法找到玩家 "<plugin>%1$s<b>"。
|
||||
ARGS:
|
||||
TOOFEW: '<b>参数过少。<i>示例用法:'
|
||||
TOOMANY: '<b>未知参数 "<plugin>%1$s<b>"。<i>示例用法:'
|
||||
OWNERS: '所有者:%1$s'
|
||||
PUBLICLAND: 公共帮派领土。
|
||||
FACTIONLESS: 无帮派
|
||||
SERVERADMIN: 服务器管理员
|
||||
DISABLED: 已禁用
|
||||
ENABLED: 已启用
|
||||
CONSOLEONLY: 此命令无法作为玩家运行。
|
||||
PLAYERONLY: <b>此命令只可被游戏内玩家运行。
|
||||
ASKYOURLEADER: '<i> 询问您的领袖来:'
|
||||
YOUSHOULD: '<i>您应:'
|
||||
YOUMAYWANT: '<i>您可能想要:'
|
||||
TRANSLATION:
|
||||
VERSION: '翻译:%1$s(%2$s,%3$s) 状态:%4$s'
|
||||
CONTRIBUTORS: '翻译贡献者:%1$s'
|
||||
RESPONSIBLE: '翻译负责人:%1$s'
|
||||
FACTIONTAG:
|
||||
TOOSHORT: <i>帮派标签不可少于 <h>%1$s<i> 个字符。
|
||||
TOOLONG: <i>帮派标签不可长于 <h>%s<i> 个字符。
|
||||
ALPHANUMERIC: <i>帮派标签必须为英文字母,"<h>%s<i>" 不被允许。
|
||||
COMPASS:
|
||||
SHORT:
|
||||
NORTH: 北
|
||||
EAST: 东
|
||||
SOUTH: 南
|
||||
WEST: 西
|
||||
ACTIONS:
|
||||
NOPERMISSION: '<b>{faction} 不允许您 {action}</b>'
|
||||
NOPERMISSIONPAINFUL: '<b>在 {faction} 的领土上尝试 {action} 是徒劳的</b>'
|
||||
OWNEDTERRITORYDENY: <b>您不可在此领土进行此操作,其被 {owners} 所拥有</b>
|
||||
OWNEDTERRITORYPAINDENY: <b>在 {owners} 的领土上尝试 {action} 是徒劳的</b>
|
||||
MUSTBE: '<b>您</b><h>必须为 {role}</h><b>才能 {action}。</b>'
|
||||
NOSAMEROLE: <b>{role} 无法控制相同等级的成员...</b>
|
||||
NOFACTION: '您不是任何帮派的成员。'
|
||||
CHAT:
|
||||
FACTION: 帮派聊天
|
||||
ALLIANCE: 盟友聊天
|
||||
PUBLIC: 公共聊天
|
||||
RELATION:
|
||||
MEMBER: 成员
|
||||
ALLY: 盟友
|
||||
NEUTRAL: 中立
|
||||
ENEMY: 敌人
|
||||
NOPAGES: <i>很抱歉,无页面可用。
|
||||
INVALIDPAGE: <i>无效页面,页面数必须介于 1 与 %1$d 之间。
|
||||
title: '&b帮派 &0|&r'
|
||||
wilderness: '&2荒野'
|
||||
wilderness-description: ''
|
||||
warzone: '&4战区'
|
||||
warzone-description: 估计不是最安全的地方。
|
||||
safezone: '&6安全区'
|
||||
safezone-description: 远离 PVP 及怪物。
|
||||
toggle-sb: 您已设置计分板至 {value}
|
||||
default-prefix: '{relationcolor}[{faction}] &r'
|
||||
faction-login: '&e%1$s &9已登录。'
|
||||
faction-logout: '&e%1$s &9已登出。'
|
||||
WARMUPS:
|
||||
NOTIFY:
|
||||
TELEPORT: '&e您将于 &d%2$d &e秒内传送至 &d%1$s &e。'
|
||||
ALREADY: '&c您已在准备传送。'
|
||||
CANCELLED: '&c您已取消了准备传送。'
|
||||
Reference in New Issue
Block a user