Compare commits
9 Commits
2.2.0-BETA
...
2.2.2-BETA
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d1e1ea6ed | ||
|
|
372eed65a0 | ||
|
|
86f92a7fb0 | ||
|
|
897fdbf83a | ||
|
|
4e11234a08 | ||
|
|
3a22bb348e | ||
|
|
91ca08e66b | ||
|
|
11d9f9230b | ||
|
|
38cf542d8c |
4
pom.xml
4
pom.xml
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<groupId>com.massivecraft</groupId>
|
<groupId>com.massivecraft</groupId>
|
||||||
<artifactId>Factions</artifactId>
|
<artifactId>Factions</artifactId>
|
||||||
<version>1.6.9.5-U0.2.1-2.2.0-BETA</version>
|
<version>1.6.9.5-U0.2.1-2.2.2-BETA</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>SaberFactions</name>
|
<name>SaberFactions</name>
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
<version>1.13-R0.1-SNAPSHOT</version>
|
<version>1.15.1-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
|
|||||||
@@ -99,6 +99,8 @@ public class Conf {
|
|||||||
public static boolean autoLeaveDeleteFPlayerData = true; // Let them just remove player from Faction.
|
public static boolean autoLeaveDeleteFPlayerData = true; // Let them just remove player from Faction.
|
||||||
public static boolean worldGuardChecking = false;
|
public static boolean worldGuardChecking = false;
|
||||||
public static boolean worldGuardBuildPriority = false;
|
public static boolean worldGuardBuildPriority = false;
|
||||||
|
public static boolean factionsDrainEnabled = false;
|
||||||
|
|
||||||
//DISCORD
|
//DISCORD
|
||||||
public static boolean useDiscordSystem = false;
|
public static boolean useDiscordSystem = false;
|
||||||
public static String discordBotToken = "<token here>";
|
public static String discordBotToken = "<token here>";
|
||||||
@@ -252,7 +254,6 @@ public class Conf {
|
|||||||
|
|
||||||
public static Set<Material> territoryCancelAndAllowItemUseMaterial = new HashSet<>();
|
public static Set<Material> territoryCancelAndAllowItemUseMaterial = new HashSet<>();
|
||||||
public static Set<Material> territoryDenySwitchMaterials = new HashSet<>();
|
public static Set<Material> territoryDenySwitchMaterials = new HashSet<>();
|
||||||
public static Set<Material> territoryBypasssProtectedMaterials = EnumSet.noneOf(Material.class);
|
|
||||||
public static boolean allowCreeperEggingChests = true;
|
public static boolean allowCreeperEggingChests = true;
|
||||||
|
|
||||||
// Economy settings
|
// Economy settings
|
||||||
@@ -553,7 +554,6 @@ public class Conf {
|
|||||||
safeZoneNerfedCreatureTypes.add(EntityType.ZOMBIE);
|
safeZoneNerfedCreatureTypes.add(EntityType.ZOMBIE);
|
||||||
|
|
||||||
// Is this called lazy load?
|
// Is this called lazy load?
|
||||||
defaultFactionPermissions.put("LEADER", new DefaultPermissions(true));
|
|
||||||
defaultFactionPermissions.put("COLEADER", new DefaultPermissions(true));
|
defaultFactionPermissions.put("COLEADER", new DefaultPermissions(true));
|
||||||
defaultFactionPermissions.put("MODERATOR", new DefaultPermissions(true));
|
defaultFactionPermissions.put("MODERATOR", new DefaultPermissions(true));
|
||||||
defaultFactionPermissions.put("NORMAL MEMBER", new DefaultPermissions(false));
|
defaultFactionPermissions.put("NORMAL MEMBER", new DefaultPermissions(false));
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.massivecraft.factions.cmd;
|
|||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayers;
|
||||||
import com.massivecraft.factions.Faction;
|
import com.massivecraft.factions.Faction;
|
||||||
|
import com.massivecraft.factions.FactionsPlugin;
|
||||||
import com.massivecraft.factions.event.FPlayerJoinEvent;
|
import com.massivecraft.factions.event.FPlayerJoinEvent;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.struct.Role;
|
import com.massivecraft.factions.struct.Role;
|
||||||
@@ -29,65 +30,67 @@ public class CmdAdmin extends FCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void perform(CommandContext context) {
|
public void perform(CommandContext context) {
|
||||||
if (context.player == null) {
|
FactionsPlugin.getInstance().getServer().getScheduler().runTaskAsynchronously(FactionsPlugin.instance, () -> {
|
||||||
context.msg(TL.GENERIC_PLAYERONLY);
|
if (context.player == null) {
|
||||||
return;
|
context.msg(TL.GENERIC_PLAYERONLY);
|
||||||
}
|
return;
|
||||||
// Allows admins bypass this.
|
}
|
||||||
if (!context.fPlayer.isAdminBypassing() && !context.fPlayer.getRole().equals(Role.LEADER)) {
|
// Allows admins bypass this.
|
||||||
context.msg(TL.COMMAND_ADMIN_NOTADMIN);
|
if (!context.fPlayer.isAdminBypassing() && !context.fPlayer.getRole().equals(Role.LEADER)) {
|
||||||
return;
|
context.msg(TL.COMMAND_ADMIN_NOTADMIN);
|
||||||
}
|
return;
|
||||||
FPlayer fyou = context.argAsBestFPlayerMatch(0);
|
}
|
||||||
if (fyou == null) {
|
FPlayer fyou = context.argAsBestFPlayerMatch(0);
|
||||||
return;
|
if (fyou == null) {
|
||||||
}
|
|
||||||
|
|
||||||
boolean permAny = Permission.ADMIN_ANY.has(context.sender, false);
|
|
||||||
Faction targetFaction = fyou.getFaction();
|
|
||||||
|
|
||||||
if (targetFaction != context.faction && !permAny) {
|
|
||||||
context.msg(TL.COMMAND_ADMIN_NOTMEMBER, fyou.describeTo(context.fPlayer, true));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fyou == context.fPlayer && !permAny) {
|
|
||||||
context.msg(TL.COMMAND_ADMIN_TARGETSELF);
|
|
||||||
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);
|
|
||||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
|
||||||
if (event.isCancelled()) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
FPlayer admin = targetFaction.getFPlayerAdmin();
|
boolean permAny = Permission.ADMIN_ANY.has(context.sender, false);
|
||||||
|
Faction targetFaction = fyou.getFaction();
|
||||||
|
|
||||||
// if target player is currently admin, demote and replace him
|
if (targetFaction != context.faction && !permAny) {
|
||||||
if (fyou == admin) {
|
context.msg(TL.COMMAND_ADMIN_NOTMEMBER, fyou.describeTo(context.fPlayer, true));
|
||||||
targetFaction.promoteNewLeader();
|
return;
|
||||||
context.msg(TL.COMMAND_ADMIN_DEMOTES, fyou.describeTo(context.fPlayer, true));
|
}
|
||||||
fyou.msg(TL.COMMAND_ADMIN_DEMOTED, context.player == null ? TL.GENERIC_SERVERADMIN.toString() : context.fPlayer.describeTo(fyou, true));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// promote target player, and demote existing admin if one exists
|
if (fyou == context.fPlayer && !permAny) {
|
||||||
if (admin != null) {
|
context.msg(TL.COMMAND_ADMIN_TARGETSELF);
|
||||||
admin.setRole(Role.COLEADER);
|
return;
|
||||||
}
|
}
|
||||||
fyou.setRole(Role.LEADER);
|
|
||||||
context.msg(TL.COMMAND_ADMIN_PROMOTES, fyou.describeTo(context.fPlayer, true));
|
|
||||||
|
|
||||||
// Inform all players
|
// only perform a FPlayerJoinEvent when newLeader isn't actually in the faction
|
||||||
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
|
if (fyou.getFaction() != targetFaction) {
|
||||||
fplayer.msg(TL.COMMAND_ADMIN_PROMOTED,
|
FPlayerJoinEvent event = new FPlayerJoinEvent(FPlayers.getInstance().getByPlayer(context.player), targetFaction, FPlayerJoinEvent.PlayerJoinReason.LEADER);
|
||||||
context.player == null ? TL.GENERIC_SERVERADMIN.toString() : context.fPlayer.describeTo(fplayer, true),
|
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||||
fyou.describeTo(fplayer), targetFaction.describeTo(fplayer));
|
if (event.isCancelled()) {
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FPlayer admin = targetFaction.getFPlayerAdmin();
|
||||||
|
|
||||||
|
// if target player is currently admin, demote and replace him
|
||||||
|
if (fyou == admin) {
|
||||||
|
targetFaction.promoteNewLeader();
|
||||||
|
context.msg(TL.COMMAND_ADMIN_DEMOTES, fyou.describeTo(context.fPlayer, true));
|
||||||
|
fyou.msg(TL.COMMAND_ADMIN_DEMOTED, context.player == null ? TL.GENERIC_SERVERADMIN.toString() : context.fPlayer.describeTo(fyou, true));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// promote target player, and demote existing admin if one exists
|
||||||
|
if (admin != null) {
|
||||||
|
admin.setRole(Role.COLEADER);
|
||||||
|
}
|
||||||
|
fyou.setRole(Role.LEADER);
|
||||||
|
context.msg(TL.COMMAND_ADMIN_PROMOTES, fyou.describeTo(context.fPlayer, true));
|
||||||
|
|
||||||
|
// Inform all players
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public TL getUsageTranslation() {
|
public TL getUsageTranslation() {
|
||||||
|
|||||||
@@ -32,51 +32,47 @@ public class CmdDeinvite extends FCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void perform(CommandContext context) {
|
public void perform(CommandContext context) {
|
||||||
|
if (context.args.size() == 0) {
|
||||||
|
FancyMessage msg = new FancyMessage(TL.COMMAND_DEINVITE_CANDEINVITE.toString()).color(ChatColor.GOLD);
|
||||||
if (context.args.size() == 0) {
|
for (String id : context.faction.getInvites()) {
|
||||||
FancyMessage msg = new FancyMessage(TL.COMMAND_DEINVITE_CANDEINVITE.toString()).color(ChatColor.GOLD);
|
FPlayer fp = FPlayers.getInstance().getById(id);
|
||||||
for (String id : context.faction.getInvites()) {
|
String name = fp != null ? fp.getName() : id;
|
||||||
FPlayer fp = FPlayers.getInstance().getById(id);
|
msg.then(name + " ").color(ChatColor.WHITE).tooltip(TL.COMMAND_DEINVITE_CLICKTODEINVITE.format(name)).command("/" + Conf.baseCommandAliases.get(0) + " deinvite " + name);
|
||||||
String name = fp != null ? fp.getName() : id;
|
}
|
||||||
msg.then(name + " ").color(ChatColor.WHITE).tooltip(TL.COMMAND_DEINVITE_CLICKTODEINVITE.format(name)).command("/" + Conf.baseCommandAliases.get(0) + " deinvite " + name);
|
context.sendFancyMessage(msg);
|
||||||
}
|
|
||||||
context.sendFancyMessage(msg);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
FPlayer you = context.argAsBestFPlayerMatch(0);
|
|
||||||
if (!context.fPlayer.isAdminBypassing()) {
|
|
||||||
Access access = context.faction.getAccess(context.fPlayer, PermissableAction.INVITE);
|
|
||||||
if (access != Access.ALLOW && context.fPlayer.getRole() != Role.LEADER) {
|
|
||||||
context.msg(TL.GENERIC_FPERM_NOPERMISSION, "manage invites");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (you == null) {
|
FPlayer you = context.argAsBestFPlayerMatch(0);
|
||||||
FancyMessage msg = new FancyMessage(TL.COMMAND_DEINVITE_CANDEINVITE.toString()).color(ChatColor.GOLD);
|
if (!context.fPlayer.isAdminBypassing()) {
|
||||||
for (String id : context.faction.getInvites()) {
|
Access access = context.faction.getAccess(context.fPlayer, PermissableAction.INVITE);
|
||||||
if(context.faction.getInvites().isEmpty()) return;
|
if (access != Access.ALLOW && context.fPlayer.getRole() != Role.LEADER) {
|
||||||
FPlayer fp = FPlayers.getInstance().getById(id);
|
context.msg(TL.GENERIC_FPERM_NOPERMISSION, "manage invites");
|
||||||
String name = fp != null ? fp.getName() : id;
|
return;
|
||||||
msg.then(name + " ").color(ChatColor.WHITE).tooltip(TL.COMMAND_DEINVITE_CLICKTODEINVITE.format(name)).command("/" + Conf.baseCommandAliases.get(0) + " deinvite " + name);
|
}
|
||||||
}
|
}
|
||||||
context.sendFancyMessage(msg);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (you.getFaction() == context.faction) {
|
if (you == null) {
|
||||||
context.msg(TL.COMMAND_DEINVITE_ALREADYMEMBER, you.getName(), context.faction.getTag());
|
FancyMessage msg = new FancyMessage(TL.COMMAND_DEINVITE_CANDEINVITE.toString()).color(ChatColor.GOLD);
|
||||||
context.msg(TL.COMMAND_DEINVITE_MIGHTWANT, FactionsPlugin.getInstance().cmdBase.cmdKick.getUsageTemplate(context));
|
for (String id : context.faction.getInvites()) {
|
||||||
return;
|
if (context.faction.getInvites().isEmpty()) return;
|
||||||
}
|
FPlayer fp = FPlayers.getInstance().getById(id);
|
||||||
|
String name = fp != null ? fp.getName() : id;
|
||||||
|
msg.then(name + " ").color(ChatColor.WHITE).tooltip(TL.COMMAND_DEINVITE_CLICKTODEINVITE.format(name)).command("/" + Conf.baseCommandAliases.get(0) + " deinvite " + name);
|
||||||
|
}
|
||||||
|
context.sendFancyMessage(msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
context.faction.deinvite(you);
|
if (you.getFaction() == context.faction) {
|
||||||
|
context.msg(TL.COMMAND_DEINVITE_ALREADYMEMBER, you.getName(), context.faction.getTag());
|
||||||
|
context.msg(TL.COMMAND_DEINVITE_MIGHTWANT, FactionsPlugin.getInstance().cmdBase.cmdKick.getUsageTemplate(context));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
you.msg(TL.COMMAND_DEINVITE_REVOKED, context.fPlayer.describeTo(you), context.faction.describeTo(you));
|
context.faction.deinvite(you);
|
||||||
|
you.msg(TL.COMMAND_DEINVITE_REVOKED, context.fPlayer.describeTo(you), context.faction.describeTo(you));
|
||||||
context.faction.msg(TL.COMMAND_DEINVITE_REVOKES, context.fPlayer.describeTo(context.faction), you.describeTo(context.faction));
|
context.faction.msg(TL.COMMAND_DEINVITE_REVOKES, context.fPlayer.describeTo(context.faction), you.describeTo(context.faction));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.massivecraft.factions.cmd;
|
|||||||
import com.massivecraft.factions.Conf;
|
import com.massivecraft.factions.Conf;
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayers;
|
||||||
|
import com.massivecraft.factions.FactionsPlugin;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
import com.massivecraft.factions.zcore.util.TextUtil;
|
import com.massivecraft.factions.zcore.util.TextUtil;
|
||||||
@@ -29,26 +30,28 @@ public class CmdDescription extends FCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void perform(CommandContext context) {
|
public void perform(CommandContext context) {
|
||||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
FactionsPlugin.getInstance().getServer().getScheduler().runTaskAsynchronously(FactionsPlugin.instance, () -> {
|
||||||
if (!context.payForCommand(Conf.econCostDesc, TL.COMMAND_DESCRIPTION_TOCHANGE, TL.COMMAND_DESCRIPTION_FORCHANGE)) {
|
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||||
return;
|
if (!context.payForCommand(Conf.econCostDesc, TL.COMMAND_DESCRIPTION_TOCHANGE, TL.COMMAND_DESCRIPTION_FORCHANGE)) {
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// since "&" color tags seem to work even through plain old FPlayer.sendMessage() for some reason, we need to break those up
|
// since "&" color tags seem to work even through plain old FPlayer.sendMessage() for some reason, we need to break those up
|
||||||
// And replace all the % because it messes with string formatting and this is easy way around that.
|
// And replace all the % because it messes with string formatting and this is easy way around that.
|
||||||
context.faction.setDescription(TextUtil.implode(context.args, " ").replaceAll("%", "").replaceAll("(&([a-f0-9klmnor]))", "& $2"));
|
context.faction.setDescription(TextUtil.implode(context.args, " ").replaceAll("%", "").replaceAll("(&([a-f0-9klmnor]))", "& $2"));
|
||||||
|
|
||||||
if (!Conf.broadcastDescriptionChanges) {
|
if (!Conf.broadcastDescriptionChanges) {
|
||||||
context.msg(TL.COMMAND_DESCRIPTION_CHANGED, context.faction.describeTo(context.fPlayer));
|
context.msg(TL.COMMAND_DESCRIPTION_CHANGED, context.faction.describeTo(context.fPlayer));
|
||||||
context.sendMessage(context.faction.getDescription());
|
context.sendMessage(context.faction.getDescription());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Broadcast the description to everyone
|
// Broadcast the description to everyone
|
||||||
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
|
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
|
||||||
fplayer.msg(TL.COMMAND_DESCRIPTION_CHANGES, context.faction.describeTo(fplayer));
|
fplayer.msg(TL.COMMAND_DESCRIPTION_CHANGES, context.faction.describeTo(fplayer));
|
||||||
fplayer.sendMessage(context.faction.getDescription()); // players can inject "&" or "`" or "<i>" or whatever in their description; &k is particularly interesting looking
|
fplayer.sendMessage(context.faction.getDescription()); // players can inject "&" or "`" or "<i>" or whatever in their description; &k is particularly interesting looking
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
64
src/main/java/com/massivecraft/factions/cmd/CmdDrain.java
Normal file
64
src/main/java/com/massivecraft/factions/cmd/CmdDrain.java
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
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.zcore.fperms.PermissableAction;
|
||||||
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Saser
|
||||||
|
*/
|
||||||
|
public class CmdDrain extends FCommand{
|
||||||
|
public CmdDrain(){
|
||||||
|
this.aliases.add("drain");
|
||||||
|
this.requirements = new CommandRequirements.Builder(Permission.DRAIN)
|
||||||
|
.playerOnly()
|
||||||
|
.memberOnly()
|
||||||
|
.withAction(PermissableAction.DRAIN)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void perform(CommandContext context) {
|
||||||
|
if (!Conf.factionsDrainEnabled) {
|
||||||
|
context.fPlayer.msg(TL.GENERIC_DISABLED, "Factions Drain");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
double totalBalance = 0;
|
||||||
|
|
||||||
|
for(FPlayer fPlayer : context.faction.getFPlayers()) {
|
||||||
|
if(context.faction.getFPlayers().size() == 1){
|
||||||
|
context.fPlayer.msg(TL.COMMAND_DRAIN_NO_PLAYERS);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (FPlayers.getInstance().getByPlayer(context.player).equals(fPlayer)){
|
||||||
|
continue; // skip the command executor
|
||||||
|
}
|
||||||
|
double balance = FactionsPlugin.getInstance().getEcon().getBalance(fPlayer.getPlayer());
|
||||||
|
if (balance > 0) {
|
||||||
|
FactionsPlugin.getInstance().getEcon().depositPlayer(context.player, balance);
|
||||||
|
FactionsPlugin.getInstance().getEcon().withdrawPlayer(fPlayer.getPlayer(), balance);
|
||||||
|
totalBalance = (totalBalance + balance);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
context.fPlayer.msg(TL.COMMAND_DRAIN_RECIEVED_AMOUNT, commas(totalBalance));
|
||||||
|
}
|
||||||
|
|
||||||
|
public String commas(final double amount) {
|
||||||
|
final DecimalFormat formatter = new DecimalFormat("#,###.00");
|
||||||
|
return formatter.format(amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TL getUsageTranslation() {
|
||||||
|
return TL.COMMAND_DRAIN_DESCRIPTION;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -43,74 +43,76 @@ 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 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"))
|
if (!context.payForCommand(Conf.econCostList, "to list the factions", "for listing the factions"))
|
||||||
return;
|
return;
|
||||||
|
FactionsPlugin.getInstance().getServer().getScheduler().runTaskAsynchronously(FactionsPlugin.instance, () -> {
|
||||||
|
|
||||||
ArrayList<Faction> factionList = Factions.getInstance().getAllFactions();
|
ArrayList<Faction> factionList = Factions.getInstance().getAllFactions();
|
||||||
factionList.remove(Factions.getInstance().getWilderness());
|
factionList.remove(Factions.getInstance().getWilderness());
|
||||||
factionList.remove(Factions.getInstance().getSafeZone());
|
factionList.remove(Factions.getInstance().getSafeZone());
|
||||||
factionList.remove(Factions.getInstance().getWarZone());
|
factionList.remove(Factions.getInstance().getWarZone());
|
||||||
|
|
||||||
// remove exempt factions
|
// remove exempt factions
|
||||||
if (context.fPlayer != null && context.fPlayer.getPlayer() != null && !context.fPlayer.getPlayer().hasPermission("factions.show.bypassexempt")) {
|
if (context.fPlayer != null && context.fPlayer.getPlayer() != null && !context.fPlayer.getPlayer().hasPermission("factions.show.bypassexempt")) {
|
||||||
List<String> exemptFactions = FactionsPlugin.getInstance().getConfig().getStringList("show-exempt");
|
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;
|
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
|
// 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);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
54
src/main/java/com/massivecraft/factions/cmd/CmdLookup.java
Normal file
54
src/main/java/com/massivecraft/factions/cmd/CmdLookup.java
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
package com.massivecraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.factions.Board;
|
||||||
|
import com.massivecraft.factions.FLocation;
|
||||||
|
import com.massivecraft.factions.Faction;
|
||||||
|
import com.massivecraft.factions.struct.Permission;
|
||||||
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Saser
|
||||||
|
*/
|
||||||
|
public class CmdLookup extends FCommand {
|
||||||
|
|
||||||
|
private DecimalFormat format = new DecimalFormat("#.#");
|
||||||
|
|
||||||
|
public CmdLookup() {
|
||||||
|
super();
|
||||||
|
this.aliases.add("lookup");
|
||||||
|
this.requiredArgs.add("faction name");
|
||||||
|
|
||||||
|
this.requirements = new CommandRequirements.Builder(Permission.LOOKUP)
|
||||||
|
.playerOnly()
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void perform(CommandContext context) {
|
||||||
|
Faction faction = context.argAsFaction(0);
|
||||||
|
if (faction == null) {
|
||||||
|
context.msg(TL.COMMAND_LOOKUP_INVALID);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (faction.isNormal()) {
|
||||||
|
if (faction.getHome() != null) {
|
||||||
|
context.msg(TL.COMMAND_LOOKUP_FACTION_HOME, this.format.format(faction.getHome().getX()), this.format.format(faction.getHome().getY()), this.format.format(faction.getHome().getZ()));
|
||||||
|
}
|
||||||
|
Set<FLocation> locations = Board.getInstance().getAllClaims(faction);
|
||||||
|
context.msg(TL.COMMAND_LOOKUP_CLAIM_COUNT, locations.size(), faction.getTag());
|
||||||
|
for (FLocation flocation : locations) {
|
||||||
|
context.msg(TL.COMMAND_LOOKUP_CLAIM_LIST, flocation.getWorldName(), flocation.getX() * 16L, flocation.getZ() * 16L);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
context.msg(TL.COMMAND_LOOKUP_ONLY_NORMAL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TL getUsageTranslation() {
|
||||||
|
return TL.COMMAND_LOOKUP_DESCRIPTION;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ package com.massivecraft.factions.cmd;
|
|||||||
import com.massivecraft.factions.Conf;
|
import com.massivecraft.factions.Conf;
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.Faction;
|
import com.massivecraft.factions.Faction;
|
||||||
|
import com.massivecraft.factions.FactionsPlugin;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.struct.Role;
|
import com.massivecraft.factions.struct.Role;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
@@ -32,51 +33,51 @@ public class CmdMod extends FCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void perform(CommandContext context) {
|
public void perform(CommandContext context) {
|
||||||
FPlayer you = context.argAsBestFPlayerMatch(0);
|
FPlayer you = context.argAsBestFPlayerMatch(0);
|
||||||
if (you == null) {
|
if (you == null) {
|
||||||
FancyMessage msg = new FancyMessage(TL.COMMAND_MOD_CANDIDATES.toString()).color(ChatColor.GOLD);
|
FancyMessage msg = new FancyMessage(TL.COMMAND_MOD_CANDIDATES.toString()).color(ChatColor.GOLD);
|
||||||
for (FPlayer player : context.faction.getFPlayersWhereRole(Role.NORMAL)) {
|
for (FPlayer player : context.faction.getFPlayersWhereRole(Role.NORMAL)) {
|
||||||
String s = player.getName();
|
String s = player.getName();
|
||||||
msg.then(s + " ").color(ChatColor.WHITE).tooltip(TL.COMMAND_MOD_CLICKTOPROMOTE.toString() + s).command("/" + Conf.baseCommandAliases.get(0) + " mod " + s);
|
msg.then(s + " ").color(ChatColor.WHITE).tooltip(TL.COMMAND_MOD_CLICKTOPROMOTE.toString() + s).command("/" + Conf.baseCommandAliases.get(0) + " mod " + s);
|
||||||
|
}
|
||||||
|
|
||||||
|
context.sendFancyMessage(msg);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
context.sendFancyMessage(msg);
|
boolean permAny = Permission.MOD_ANY.has(context.sender, false);
|
||||||
return;
|
Faction targetFaction = you.getFaction();
|
||||||
}
|
if (targetFaction != context.faction && !permAny) {
|
||||||
|
context.msg(TL.COMMAND_MOD_NOTMEMBER, you.describeTo(context.fPlayer, true));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
boolean permAny = Permission.MOD_ANY.has(context.sender, false);
|
if (context.fPlayer != null && context.fPlayer.getRole() != Role.LEADER && !permAny) {
|
||||||
Faction targetFaction = you.getFaction();
|
context.msg(TL.COMMAND_MOD_NOTADMIN);
|
||||||
if (targetFaction != context.faction && !permAny) {
|
return;
|
||||||
context.msg(TL.COMMAND_MOD_NOTMEMBER, you.describeTo(context.fPlayer, true));
|
}
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (context.fPlayer != null && context.fPlayer.getRole() != Role.LEADER && !permAny) {
|
if (you == context.fPlayer && !permAny) {
|
||||||
context.msg(TL.COMMAND_MOD_NOTADMIN);
|
context.msg(TL.COMMAND_MOD_SELF);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (you == context.fPlayer && !permAny) {
|
if (you.getRole() == Role.LEADER) {
|
||||||
context.msg(TL.COMMAND_MOD_SELF);
|
context.msg(TL.COMMAND_MOD_TARGETISADMIN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (you.getRole() == Role.LEADER) {
|
if (you.getRole() == Role.MODERATOR) {
|
||||||
context.msg(TL.COMMAND_MOD_TARGETISADMIN);
|
// Revoke
|
||||||
return;
|
you.setRole(Role.NORMAL);
|
||||||
}
|
targetFaction.msg(TL.COMMAND_MOD_REVOKED, you.describeTo(targetFaction, true));
|
||||||
|
context.msg(TL.COMMAND_MOD_REVOKES, you.describeTo(context.fPlayer, true));
|
||||||
if (you.getRole() == Role.MODERATOR) {
|
} else {
|
||||||
// Revoke
|
// Give
|
||||||
you.setRole(Role.NORMAL);
|
you.setRole(Role.MODERATOR);
|
||||||
targetFaction.msg(TL.COMMAND_MOD_REVOKED, you.describeTo(targetFaction, true));
|
targetFaction.msg(TL.COMMAND_MOD_PROMOTED, you.describeTo(targetFaction, true));
|
||||||
context.msg(TL.COMMAND_MOD_REVOKES, you.describeTo(context.fPlayer, true));
|
context.msg(TL.COMMAND_MOD_PROMOTES, you.describeTo(context.fPlayer, true));
|
||||||
} else {
|
}
|
||||||
// Give
|
|
||||||
you.setRole(Role.MODERATOR);
|
|
||||||
targetFaction.msg(TL.COMMAND_MOD_PROMOTED, you.describeTo(targetFaction, true));
|
|
||||||
context.msg(TL.COMMAND_MOD_PROMOTES, you.describeTo(context.fPlayer, true));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.massivecraft.factions.cmd;
|
|||||||
import com.massivecraft.factions.Conf;
|
import com.massivecraft.factions.Conf;
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayers;
|
||||||
|
import com.massivecraft.factions.FactionsPlugin;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.struct.Role;
|
import com.massivecraft.factions.struct.Role;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
@@ -27,23 +28,25 @@ public class CmdOpen extends FCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void perform(CommandContext context) {
|
public void perform(CommandContext context) {
|
||||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
FactionsPlugin.getInstance().getServer().getScheduler().runTaskAsynchronously(FactionsPlugin.instance, () -> {
|
||||||
if (!context.payForCommand(Conf.econCostOpen, TL.COMMAND_OPEN_TOOPEN, TL.COMMAND_OPEN_FOROPEN)) {
|
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||||
return;
|
if (!context.payForCommand(Conf.econCostOpen, TL.COMMAND_OPEN_TOOPEN, TL.COMMAND_OPEN_FOROPEN)) {
|
||||||
}
|
return;
|
||||||
|
|
||||||
context.faction.setOpen(context.argAsBool(0, !context.faction.getOpen()));
|
|
||||||
|
|
||||||
String open = context.faction.getOpen() ? TL.COMMAND_OPEN_OPEN.toString() : TL.COMMAND_OPEN_CLOSED.toString();
|
|
||||||
|
|
||||||
// Inform
|
|
||||||
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
|
|
||||||
if (fplayer.getFactionId().equals(context.faction.getId())) {
|
|
||||||
fplayer.msg(TL.COMMAND_OPEN_CHANGES, context.fPlayer.getName(), open);
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
fplayer.msg(TL.COMMAND_OPEN_CHANGED, context.faction.getTag(fplayer.getFaction()), open);
|
|
||||||
}
|
context.faction.setOpen(context.argAsBool(0, !context.faction.getOpen()));
|
||||||
|
|
||||||
|
String open = context.faction.getOpen() ? TL.COMMAND_OPEN_OPEN.toString() : TL.COMMAND_OPEN_CLOSED.toString();
|
||||||
|
|
||||||
|
// Inform
|
||||||
|
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
|
||||||
|
if (fplayer.getFactionId().equals(context.faction.getId())) {
|
||||||
|
fplayer.msg(TL.COMMAND_OPEN_CHANGES, context.fPlayer.getName(), open);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
fplayer.msg(TL.COMMAND_OPEN_CHANGED, context.faction.getTag(fplayer.getFaction()), open);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -24,36 +24,38 @@ public class CmdSethome extends FCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void perform(CommandContext context) {
|
public void perform(CommandContext context) {
|
||||||
if (!Conf.homesEnabled) {
|
FactionsPlugin.getInstance().getServer().getScheduler().runTaskAsynchronously(FactionsPlugin.instance, () -> {
|
||||||
context.msg(TL.COMMAND_SETHOME_DISABLED);
|
if (!Conf.homesEnabled) {
|
||||||
return;
|
context.msg(TL.COMMAND_SETHOME_DISABLED);
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Faction faction = context.argAsFaction(0, context.faction);
|
Faction faction = context.argAsFaction(0, context.faction);
|
||||||
if (faction == null) {
|
if (faction == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Can the player set the faction home HERE?
|
// Can the player set the faction home HERE?
|
||||||
if (!Permission.BYPASS.has(context.player) &&
|
if (!Permission.BYPASS.has(context.player) &&
|
||||||
Conf.homesMustBeInClaimedTerritory &&
|
Conf.homesMustBeInClaimedTerritory &&
|
||||||
Board.getInstance().getFactionAt(new FLocation(context.player)) != faction) {
|
Board.getInstance().getFactionAt(new FLocation(context.player)) != faction) {
|
||||||
context.msg(TL.COMMAND_SETHOME_NOTCLAIMED);
|
context.msg(TL.COMMAND_SETHOME_NOTCLAIMED);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
// 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.econCostSethome, TL.COMMAND_SETHOME_TOSET, TL.COMMAND_SETHOME_FORSET)) {
|
if (!context.payForCommand(Conf.econCostSethome, TL.COMMAND_SETHOME_TOSET, TL.COMMAND_SETHOME_FORSET)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
faction.setHome(context.player.getLocation());
|
faction.setHome(context.player.getLocation());
|
||||||
|
|
||||||
faction.msg(TL.COMMAND_SETHOME_SET, context.fPlayer.describeTo(context.faction, true));
|
faction.msg(TL.COMMAND_SETHOME_SET, context.fPlayer.describeTo(context.faction, true));
|
||||||
faction.sendMessage(FactionsPlugin.getInstance().cmdBase.cmdHome.getUsageTemplate(context));
|
faction.sendMessage(FactionsPlugin.getInstance().cmdBase.cmdHome.getUsageTemplate(context));
|
||||||
if (faction != context.faction) {
|
if (faction != context.faction) {
|
||||||
context.msg(TL.COMMAND_SETHOME_SETOTHER, faction.getTag(context.fPlayer));
|
context.msg(TL.COMMAND_SETHOME_SETOTHER, faction.getTag(context.fPlayer));
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.massivecraft.factions.cmd;
|
|||||||
import com.massivecraft.factions.Conf;
|
import com.massivecraft.factions.Conf;
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayers;
|
||||||
|
import com.massivecraft.factions.FactionsPlugin;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
import mkremins.fanciful.FancyMessage;
|
import mkremins.fanciful.FancyMessage;
|
||||||
@@ -27,14 +28,12 @@ public class CmdShowInvites extends FCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void perform(CommandContext context) {
|
public void perform(CommandContext context) {
|
||||||
FancyMessage msg = new FancyMessage(TL.COMMAND_SHOWINVITES_PENDING.toString()).color(ChatColor.GOLD);
|
FancyMessage msg = new FancyMessage(TL.COMMAND_SHOWINVITES_PENDING.toString()).color(ChatColor.GOLD);
|
||||||
for (String id : context.faction.getInvites()) {
|
for (String id : context.faction.getInvites()) {
|
||||||
FPlayer fp = FPlayers.getInstance().getById(id);
|
FPlayer fp = FPlayers.getInstance().getById(id);
|
||||||
String name = fp != null ? fp.getName() : id;
|
String name = fp != null ? fp.getName() : id;
|
||||||
msg.then(name + " ").color(ChatColor.WHITE).tooltip(TL.COMMAND_SHOWINVITES_CLICKTOREVOKE.format(name)).command("/" + Conf.baseCommandAliases.get(0) + " deinvite " + name);
|
msg.then(name + " ").color(ChatColor.WHITE).tooltip(TL.COMMAND_SHOWINVITES_CLICKTOREVOKE.format(name)).command("/" + Conf.baseCommandAliases.get(0) + " deinvite " + name);
|
||||||
}
|
}
|
||||||
|
|
||||||
context.sendFancyMessage(msg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -33,56 +33,59 @@ public class CmdTag extends FCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void perform(CommandContext context) {
|
public void perform(CommandContext context) {
|
||||||
String tag = context.argAsString(0);
|
FactionsPlugin.getInstance().getServer().getScheduler().runTaskAsynchronously(FactionsPlugin.instance, () -> {
|
||||||
|
|
||||||
// TODO does not first test cover selfcase?
|
String tag = context.argAsString(0);
|
||||||
if (Factions.getInstance().isTagTaken(tag) && !MiscUtil.getComparisonString(tag).equals(context.faction.getComparisonTag())) {
|
|
||||||
context.msg(TL.COMMAND_TAG_TAKEN);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ArrayList<String> errors = MiscUtil.validateTag(tag);
|
// TODO does not first test cover selfcase?
|
||||||
if (errors.size() > 0) {
|
if (Factions.getInstance().isTagTaken(tag) && !MiscUtil.getComparisonString(tag).equals(context.faction.getComparisonTag())) {
|
||||||
context.sendMessage(errors);
|
context.msg(TL.COMMAND_TAG_TAKEN);
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make sure they can pay
|
|
||||||
if (!context.canAffordCommand(Conf.econCostTag, TL.COMMAND_TAG_TOCHANGE.toString())) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// trigger the faction rename event (cancellable)
|
|
||||||
FactionRenameEvent renameEvent = new FactionRenameEvent(context.fPlayer, tag);
|
|
||||||
Bukkit.getServer().getPluginManager().callEvent(renameEvent);
|
|
||||||
if (renameEvent.isCancelled()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// then make 'em pay (if applicable)
|
|
||||||
if (!context.payForCommand(Conf.econCostTag, TL.COMMAND_TAG_TOCHANGE, TL.COMMAND_TAG_FORCHANGE)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
String oldtag = context.faction.getTag();
|
|
||||||
context.faction.setTag(tag);
|
|
||||||
Discord.changeFactionTag(context.faction, oldtag);
|
|
||||||
|
|
||||||
// Inform
|
|
||||||
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
|
|
||||||
if (fplayer.getFactionId().equals(context.faction.getId())) {
|
|
||||||
fplayer.msg(TL.COMMAND_TAG_FACTION, context.fPlayer.describeTo(context.faction, true), context.faction.getTag(context.faction));
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Broadcast the tag change (if applicable)
|
ArrayList<String> errors = MiscUtil.validateTag(tag);
|
||||||
if (Conf.broadcastTagChanges) {
|
if (errors.size() > 0) {
|
||||||
Faction faction = fplayer.getFaction();
|
context.sendMessage(errors);
|
||||||
fplayer.msg(TL.COMMAND_TAG_CHANGED, context.fPlayer.getColorTo(faction) + oldtag, context.faction.getTag(faction));
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
FTeamWrapper.updatePrefixes(context.faction);
|
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make sure they can pay
|
||||||
|
if (!context.canAffordCommand(Conf.econCostTag, TL.COMMAND_TAG_TOCHANGE.toString())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// trigger the faction rename event (cancellable)
|
||||||
|
FactionRenameEvent renameEvent = new FactionRenameEvent(context.fPlayer, tag);
|
||||||
|
Bukkit.getServer().getPluginManager().callEvent(renameEvent);
|
||||||
|
if (renameEvent.isCancelled()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// then make 'em pay (if applicable)
|
||||||
|
if (!context.payForCommand(Conf.econCostTag, TL.COMMAND_TAG_TOCHANGE, TL.COMMAND_TAG_FORCHANGE)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String oldtag = context.faction.getTag();
|
||||||
|
context.faction.setTag(tag);
|
||||||
|
Discord.changeFactionTag(context.faction, oldtag);
|
||||||
|
|
||||||
|
// Inform
|
||||||
|
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
|
||||||
|
if (fplayer.getFactionId().equals(context.faction.getId())) {
|
||||||
|
fplayer.msg(TL.COMMAND_TAG_FACTION, context.fPlayer.describeTo(context.faction, true), context.faction.getTag(context.faction));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Broadcast the tag change (if applicable)
|
||||||
|
if (Conf.broadcastTagChanges) {
|
||||||
|
Faction faction = fplayer.getFaction();
|
||||||
|
fplayer.msg(TL.COMMAND_TAG_CHANGED, context.fPlayer.getColorTo(faction) + oldtag, context.faction.getTag(faction));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FTeamWrapper.updatePrefixes(context.faction);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.massivecraft.factions.cmd;
|
|||||||
|
|
||||||
import com.massivecraft.factions.Conf;
|
import com.massivecraft.factions.Conf;
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
|
import com.massivecraft.factions.FactionsPlugin;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
import com.massivecraft.factions.zcore.util.TextUtil;
|
import com.massivecraft.factions.zcore.util.TextUtil;
|
||||||
@@ -24,16 +25,19 @@ public class CmdTitle extends FCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void perform(CommandContext context) {
|
public void perform(CommandContext context) {
|
||||||
FPlayer you = context.argAsBestFPlayerMatch(0);
|
FactionsPlugin.getInstance().getServer().getScheduler().runTaskAsynchronously(FactionsPlugin.instance, () -> {
|
||||||
if (you == null) return;
|
FPlayer you = context.argAsBestFPlayerMatch(0);
|
||||||
context.args.remove(0);
|
if (you == null) return;
|
||||||
String title = TextUtil.implode(context.args, " ");
|
context.args.remove(0);
|
||||||
if (!context.canIAdministerYou(context.fPlayer, you)) return;
|
String title = TextUtil.implode(context.args, " ");
|
||||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
if (!context.canIAdministerYou(context.fPlayer, you)) return;
|
||||||
if (!context.payForCommand(Conf.econCostTitle, TL.COMMAND_TITLE_TOCHANGE, TL.COMMAND_TITLE_FORCHANGE)) return;
|
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||||
you.setTitle(context.sender, title);
|
if (!context.payForCommand(Conf.econCostTitle, TL.COMMAND_TITLE_TOCHANGE, TL.COMMAND_TITLE_FORCHANGE))
|
||||||
// Inform
|
return;
|
||||||
context.faction.msg(TL.COMMAND_TITLE_CHANGED, context.fPlayer.describeTo(context.faction, true), you.describeTo(context.faction, true));
|
you.setTitle(context.sender, title);
|
||||||
|
// Inform
|
||||||
|
context.faction.msg(TL.COMMAND_TITLE_CHANGED, context.fPlayer.describeTo(context.faction, true), you.describeTo(context.faction, true));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -29,8 +29,6 @@ public class CmdTpBanner extends FCommand {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final FactionsPlayerListener fpl = new FactionsPlayerListener();
|
|
||||||
|
|
||||||
if (FactionsBlockListener.bannerLocations.containsKey(context.fPlayer.getTag())) {
|
if (FactionsBlockListener.bannerLocations.containsKey(context.fPlayer.getTag())) {
|
||||||
context.msg(TL.COMMAND_TPBANNER_SUCCESS);
|
context.msg(TL.COMMAND_TPBANNER_SUCCESS);
|
||||||
context.doWarmUp(WarmUpUtil.Warmup.BANNER, TL.WARMUPS_NOTIFY_TELEPORT, "Banner", () -> {
|
context.doWarmUp(WarmUpUtil.Warmup.BANNER, TL.WARMUPS_NOTIFY_TELEPORT, "Banner", () -> {
|
||||||
|
|||||||
@@ -162,6 +162,8 @@ public class FCmdRoot extends FCommand implements CommandExecutor {
|
|||||||
public CmdSetGuild cmdSetGuild = new CmdSetGuild();
|
public CmdSetGuild cmdSetGuild = new CmdSetGuild();
|
||||||
public CmdDiscord cmdDiscord = new CmdDiscord();
|
public CmdDiscord cmdDiscord = new CmdDiscord();
|
||||||
public CmdDebug cmdDebug = new CmdDebug();
|
public CmdDebug cmdDebug = new CmdDebug();
|
||||||
|
public CmdDrain cmdDrain = new CmdDrain();
|
||||||
|
public CmdLookup cmdLookup = new CmdLookup();
|
||||||
//Variables to know if we already setup certain sub commands
|
//Variables to know if we already setup certain sub commands
|
||||||
public Boolean discordEnabled = false;
|
public Boolean discordEnabled = false;
|
||||||
public Boolean checkEnabled = false;
|
public Boolean checkEnabled = false;
|
||||||
@@ -291,6 +293,8 @@ public class FCmdRoot extends FCommand implements CommandExecutor {
|
|||||||
this.addSubCommand(this.cmdViewChest);
|
this.addSubCommand(this.cmdViewChest);
|
||||||
this.addSubCommand(this.cmdConvertConfig);
|
this.addSubCommand(this.cmdConvertConfig);
|
||||||
this.addSubCommand(this.cmdSpawnerLock);
|
this.addSubCommand(this.cmdSpawnerLock);
|
||||||
|
this.addSubCommand(this.cmdDrain);
|
||||||
|
this.addSubCommand(this.cmdLookup);
|
||||||
addVariableCommands();
|
addVariableCommands();
|
||||||
if (CommodoreProvider.isSupported()) brigadierManager.build();
|
if (CommodoreProvider.isSupported()) brigadierManager.build();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class CmdWild extends FCommand {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void perform(CommandContext context) {
|
public void perform(CommandContext context) {
|
||||||
if (!waitingTeleport.keySet().contains(context.player)) {
|
if (!waitingTeleport.containsKey(context.player)) {
|
||||||
context.player.openInventory(new WildGUI(context.player, context.fPlayer).getInventory());
|
context.player.openInventory(new WildGUI(context.player, context.fPlayer).getInventory());
|
||||||
} else {context.fPlayer.msg(TL.COMMAND_WILD_WAIT);}
|
} else {context.fPlayer.msg(TL.COMMAND_WILD_WAIT);}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.massivecraft.factions.cmd.wild;
|
|||||||
|
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.FactionsPlugin;
|
import com.massivecraft.factions.FactionsPlugin;
|
||||||
import com.massivecraft.factions.integration.Essentials;
|
|
||||||
import com.massivecraft.factions.util.FactionGUI;
|
import com.massivecraft.factions.util.FactionGUI;
|
||||||
import com.massivecraft.factions.util.XMaterial;
|
import com.massivecraft.factions.util.XMaterial;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
@@ -12,10 +11,12 @@ import org.bukkit.event.inventory.ClickType;
|
|||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
public class WildGUI implements FactionGUI {
|
public class WildGUI implements FactionGUI {
|
||||||
Player player;
|
Player player;
|
||||||
@@ -45,14 +46,16 @@ public class WildGUI implements FactionGUI {
|
|||||||
inv = Bukkit.createInventory(this, FactionsPlugin.getInstance().getConfig().getInt("Wild.GUI.Size"), FactionsPlugin.getInstance().color(FactionsPlugin.getInstance().getConfig().getString("Wild.GUI.Name")));
|
inv = Bukkit.createInventory(this, FactionsPlugin.getInstance().getConfig().getInt("Wild.GUI.Size"), FactionsPlugin.getInstance().color(FactionsPlugin.getInstance().getConfig().getString("Wild.GUI.Name")));
|
||||||
ItemStack fillItem = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("Wild.GUI.FillMaterial")).parseItem();
|
ItemStack fillItem = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("Wild.GUI.FillMaterial")).parseItem();
|
||||||
ItemMeta meta = fillItem.getItemMeta();
|
ItemMeta meta = fillItem.getItemMeta();
|
||||||
|
if(meta == null) return;
|
||||||
meta.setDisplayName("");
|
meta.setDisplayName("");
|
||||||
fillItem.setItemMeta(meta);
|
fillItem.setItemMeta(meta);
|
||||||
for (int fill = 0; fill < FactionsPlugin.getInstance().getConfig().getInt("Wild.GUI.Size"); ++fill) {
|
for (int fill = 0; fill < FactionsPlugin.getInstance().getConfig().getInt("Wild.GUI.Size"); ++fill) {
|
||||||
inv.setItem(fill, fillItem);
|
inv.setItem(fill, fillItem);
|
||||||
}
|
}
|
||||||
for (String key : FactionsPlugin.getInstance().getConfig().getConfigurationSection("Wild.Zones").getKeys(false)) {
|
for (String key : Objects.requireNonNull(FactionsPlugin.getInstance().getConfig().getConfigurationSection("Wild.Zones")).getKeys(false)) {
|
||||||
ItemStack zoneItem = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("Wild.Zones." + key + ".Material")).parseItem();
|
ItemStack zoneItem = XMaterial.matchXMaterial(FactionsPlugin.getInstance().getConfig().getString("Wild.Zones." + key + ".Material")).parseItem();
|
||||||
ItemMeta zoneMeta = zoneItem.getItemMeta();
|
ItemMeta zoneMeta = zoneItem.getItemMeta();
|
||||||
|
if(zoneMeta == null) return;
|
||||||
List<String> lore = new ArrayList<>();
|
List<String> lore = new ArrayList<>();
|
||||||
for (String s : FactionsPlugin.getInstance().getConfig().getStringList("Wild.Zones." + key + ".Lore")) {
|
for (String s : FactionsPlugin.getInstance().getConfig().getStringList("Wild.Zones." + key + ".Lore")) {
|
||||||
lore.add(FactionsPlugin.getInstance().color(s));
|
lore.add(FactionsPlugin.getInstance().color(s));
|
||||||
@@ -66,6 +69,7 @@ public class WildGUI implements FactionGUI {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Inventory getInventory() {
|
public Inventory getInventory() {
|
||||||
if (inv == null) {build();}
|
if (inv == null) {build();}
|
||||||
|
|||||||
@@ -38,15 +38,10 @@ import java.util.List;
|
|||||||
|
|
||||||
public class FactionsBlockListener implements Listener {
|
public class FactionsBlockListener implements Listener {
|
||||||
|
|
||||||
/**
|
|
||||||
* @author FactionsUUID Team
|
|
||||||
*/
|
|
||||||
|
|
||||||
public static HashMap<String, Location> bannerLocations = new HashMap<>();
|
public static HashMap<String, Location> bannerLocations = new HashMap<>();
|
||||||
private HashMap<String, Boolean> bannerCooldownMap = new HashMap<>();
|
private HashMap<String, Boolean> bannerCooldownMap = new HashMap<>();
|
||||||
|
|
||||||
public static boolean playerCanBuildDestroyBlock(Player player, Location location, String action, boolean justCheck) {
|
public static boolean playerCanBuildDestroyBlock(Player player, Location location, String action, boolean justCheck) {
|
||||||
|
|
||||||
if (Conf.playersWhoBypassAllProtection.contains(player.getName())) return true;
|
if (Conf.playersWhoBypassAllProtection.contains(player.getName())) return true;
|
||||||
|
|
||||||
FPlayer me = FPlayers.getInstance().getById(player.getUniqueId().toString());
|
FPlayer me = FPlayers.getInstance().getById(player.getUniqueId().toString());
|
||||||
@@ -75,20 +70,17 @@ public class FactionsBlockListener implements Listener {
|
|||||||
if (!justCheck) me.msg(TL.ACTION_DENIED_WARZONE, action);
|
if (!justCheck) me.msg(TL.ACTION_DENIED_WARZONE, action);
|
||||||
return false;
|
return false;
|
||||||
} else if (!otherFaction.getId().equals(myFaction.getId())) { // If the faction target is not my own
|
} else if (!otherFaction.getId().equals(myFaction.getId())) { // If the faction target is not my own
|
||||||
if (FactionsPlugin.instance.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() > otherFaction.getPowerRounded())
|
if (FactionsPlugin.getInstance().getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() > otherFaction.getPowerRounded())
|
||||||
return true;
|
return true;
|
||||||
// Get faction pain build access relation to me
|
|
||||||
boolean pain = !justCheck && otherFaction.getAccess(me, PermissableAction.PAIN_BUILD) == Access.ALLOW;
|
boolean pain = !justCheck && otherFaction.getAccess(me, PermissableAction.PAIN_BUILD) == Access.ALLOW;
|
||||||
return CheckActionState(otherFaction, loc, me, PermissableAction.fromString(action), pain);
|
return CheckActionState(otherFaction, loc, me, PermissableAction.fromString(action), pain);
|
||||||
} else if (otherFaction.getId().equals(myFaction.getId())) {
|
} else if (otherFaction.getId().equals(myFaction.getId())) {
|
||||||
boolean pain = !justCheck && myFaction.getAccess(me, PermissableAction.PAIN_BUILD) == Access.ALLOW;
|
boolean pain = !justCheck && myFaction.getAccess(me, PermissableAction.PAIN_BUILD) == Access.ALLOW;
|
||||||
return CheckActionState(myFaction, loc, me, PermissableAction.fromString(action), pain);
|
return CheckActionState(myFaction, loc, me, PermissableAction.fromString(action), pain);
|
||||||
}
|
}
|
||||||
// Something failed prevent build
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static boolean CheckPlayerAccess(Player player, FPlayer me, FLocation loc, Faction myFaction, Access access, PermissableAction action, boolean shouldHurt) {
|
private static boolean CheckPlayerAccess(Player player, FPlayer me, FLocation loc, Faction myFaction, Access access, PermissableAction action, boolean shouldHurt) {
|
||||||
boolean landOwned = (myFaction.doesLocationHaveOwnersSet(loc) && !myFaction.getOwnerList(loc).isEmpty());
|
boolean landOwned = (myFaction.doesLocationHaveOwnersSet(loc) && !myFaction.getOwnerList(loc).isEmpty());
|
||||||
if ((landOwned && myFaction.getOwnerListString(loc).contains(player.getName())) || (me.getRole() == Role.LEADER && me.getFactionId().equals(myFaction.getId())))
|
if ((landOwned && myFaction.getOwnerListString(loc).contains(player.getName())) || (me.getRole() == Role.LEADER && me.getFactionId().equals(myFaction.getId())))
|
||||||
@@ -131,20 +123,15 @@ public class FactionsBlockListener implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||||
public void onBlockPlace(BlockPlaceEvent event) {
|
public void onBlockPlace(BlockPlaceEvent event) {
|
||||||
if (!event.canBuild()) return;
|
if (!event.canBuild()) return;
|
||||||
|
|
||||||
// special case for flint&steel, which should only be prevented by DenyUsage list
|
|
||||||
if (event.getBlockPlaced().getType() == Material.FIRE) return;
|
if (event.getBlockPlaced().getType() == Material.FIRE) return;
|
||||||
boolean isSpawner = event.getBlock().getType().equals(XMaterial.SPAWNER.parseMaterial());
|
|
||||||
|
|
||||||
if (!playerCanBuildDestroyBlock(event.getPlayer(), event.getBlock().getLocation(), !isSpawner ? "build" : "mine spawners", false)) {
|
if (!playerCanBuildDestroyBlock(event.getPlayer(), event.getBlock().getLocation(), "build", false)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isSpawner) {
|
if (event.getBlock().getType().equals(XMaterial.SPAWNER.parseMaterial()) && Conf.spawnerLock) {
|
||||||
if (Conf.spawnerLock) {
|
event.setCancelled(true);
|
||||||
event.setCancelled(true);
|
event.getPlayer().sendMessage(FactionsPlugin.getInstance().color(TL.COMMAND_SPAWNER_LOCK_CANNOT_PLACE.toString()));
|
||||||
event.getPlayer().sendMessage(FactionsPlugin.getInstance().color(TL.COMMAND_SPAWNER_LOCK_CANNOT_PLACE.toString()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -428,9 +415,9 @@ public class FactionsBlockListener implements Listener {
|
|||||||
public void entityDamage(EntityDamageEvent e) {
|
public void entityDamage(EntityDamageEvent e) {
|
||||||
if (!Conf.gracePeriod) return;
|
if (!Conf.gracePeriod) return;
|
||||||
|
|
||||||
if (e.getEntity() instanceof Player) {
|
if (e.getEntity() instanceof Player) {
|
||||||
if (e.getCause() == EntityDamageEvent.DamageCause.PROJECTILE) {
|
if (e.getCause() == EntityDamageEvent.DamageCause.PROJECTILE) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -465,9 +452,17 @@ public class FactionsBlockListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||||
public void onBlockBreak(BlockBreakEvent event) {
|
public void onBlockBreak(BlockBreakEvent event) {
|
||||||
boolean isSpawner = event.getBlock().getType() == XMaterial.SPAWNER.parseMaterial();
|
FPlayer fme = FPlayers.getInstance().getByPlayer(event.getPlayer());
|
||||||
if (!playerCanBuildDestroyBlock(event.getPlayer(), event.getBlock().getLocation(), !isSpawner ? "destroy" : "mine spawners", false)) {
|
if (!playerCanBuildDestroyBlock(event.getPlayer(), event.getBlock().getLocation(), "destroy", false)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!fme.hasFaction()) return;
|
||||||
|
if (event.getBlock().getType() == XMaterial.SPAWNER.parseMaterial() && !fme.isAdminBypassing()) {
|
||||||
|
Access access = fme.getFaction().getAccess(fme, PermissableAction.SPAWNER);
|
||||||
|
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||||
|
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "mine spawners");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -626,6 +626,7 @@ public class FactionsEntityListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onTravel(PlayerPortalEvent event) {
|
public void onTravel(PlayerPortalEvent event) {
|
||||||
if (!FactionsPlugin.getInstance().getConfig().getBoolean("portals.limit", false))
|
if (!FactionsPlugin.getInstance().getConfig().getBoolean("portals.limit", false))
|
||||||
@@ -653,6 +654,7 @@ public class FactionsEntityListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onHit(EntityDamageByEntityEvent e) {
|
public void onHit(EntityDamageByEntityEvent e) {
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ public class FactionsExploitListener implements Listener {
|
|||||||
return ((from.getX() > target.getX() && (from.getX() - target.getX() < thickness)) || (target.getX() > from.getX() && (target.getX() - from.getX() < thickness)) || (from.getZ() > target.getZ() && (from.getZ() - target.getZ() < thickness)) || (target.getZ() > from.getZ() && (target.getZ() - from.getZ() < thickness)));
|
return ((from.getX() > target.getX() && (from.getX() - target.getX() < thickness)) || (target.getX() > from.getX() && (target.getX() - from.getX() < thickness)) || (from.getZ() > target.getZ() && (from.getZ() - target.getZ() < thickness)) || (target.getZ() > from.getZ() && (target.getZ() - from.getZ() < thickness)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||||
public void obsidianGenerator(BlockFromToEvent event) {
|
public void obsidianGenerator(BlockFromToEvent event) {
|
||||||
if (!Conf.handleExploitObsidianGenerators) {
|
if (!Conf.handleExploitObsidianGenerators) {
|
||||||
@@ -33,23 +32,11 @@ public class FactionsExploitListener implements Listener {
|
|||||||
// thanks to ObGenBlocker and WorldGuard for this method
|
// thanks to ObGenBlocker and WorldGuard for this method
|
||||||
Block block = event.getToBlock();
|
Block block = event.getToBlock();
|
||||||
|
|
||||||
// Added this so it wont die on 1.14 :)
|
Material source = event.getBlock().getType();
|
||||||
if (FactionsPlugin.getInstance().mc114) {
|
Material target = block.getType();
|
||||||
Material source = event.getBlock().getType();
|
if ((target == XMaterial.REDSTONE_WIRE.parseMaterial() || target == XMaterial.TRIPWIRE.parseMaterial()) && (source == XMaterial.AIR.parseMaterial() || source == XMaterial.LAVA.parseMaterial() || source.toString().equalsIgnoreCase("STATIONARY_LAVA"))) {
|
||||||
Material target = block.getType();
|
block.setType(XMaterial.AIR.parseMaterial());
|
||||||
if ((target == Material.REDSTONE_WIRE || target == Material.TRIPWIRE) && (source == Material.AIR || source == Material.LEGACY_STATIONARY_LAVA || source == Material.LEGACY_LAVA)) {
|
|
||||||
block.setType(Material.AIR);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// run this for all versions below 1.14
|
|
||||||
int source = event.getBlock().getType().getId();
|
|
||||||
int target = block.getType().getId();
|
|
||||||
if ((target == 55 || target == 132) && (source == 0 || source == 10 || source == 11)) {
|
|
||||||
block.setType(Material.AIR);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||||
|
|||||||
@@ -830,7 +830,7 @@ public class FactionsPlayerListener implements Listener {
|
|||||||
|
|
||||||
|
|
||||||
// territoryBypasssProtectedMaterials totally bypass the protection system
|
// territoryBypasssProtectedMaterials totally bypass the protection system
|
||||||
if (Conf.territoryBypasssProtectedMaterials.contains(block.getType())) return;
|
if (Conf.territoryBypassProtectedMaterials.contains(block.getType())) return;
|
||||||
// Do type null checks so if XMaterial has a parsing issue and fills null as a value it will not bypass.
|
// Do type null checks so if XMaterial has a parsing issue and fills null as a value it will not bypass.
|
||||||
// territoryCancelAndAllowItemUseMaterial bypass the protection system but only if they're not clicking on territoryDenySwitchMaterials
|
// territoryCancelAndAllowItemUseMaterial bypass the protection system but only if they're not clicking on territoryDenySwitchMaterials
|
||||||
// if they're clicking on territoryDenySwitchMaterials, let the protection system handle the permissions
|
// if they're clicking on territoryDenySwitchMaterials, let the protection system handle the permissions
|
||||||
@@ -1052,16 +1052,21 @@ public class FactionsPlayerListener implements Listener {
|
|||||||
if (!Discord.useDiscord) {
|
if (!Discord.useDiscord) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] msg = e.getChatMessage().split(" ");
|
String[] msg = e.getChatMessage().split(" ");
|
||||||
if (msg.length == 0 | !msg[msg.length - 1].contains("@")) {
|
if (msg.length == 0 | !msg[msg.length - 1].contains("@")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
FPlayer fp = FPlayers.getInstance().getByPlayer(e.getPlayer());
|
FPlayer fp = FPlayers.getInstance().getByPlayer(e.getPlayer());
|
||||||
if (fp == null | fp.getChatMode() != ChatMode.FACTION) {
|
|
||||||
|
if(fp == null) return;
|
||||||
|
|
||||||
|
if (fp.getChatMode() != ChatMode.FACTION) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Faction f = fp.getFaction();
|
Faction f = fp.getFaction();
|
||||||
if (f == null | f.isSystemFaction()) {
|
if(f == null) return;
|
||||||
|
if (f.isSystemFaction()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (f.getGuildId() == null | f.getFactionChatChannelId() == null) {
|
if (f.getGuildId() == null | f.getFactionChatChannelId() == null) {
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ public enum Permission {
|
|||||||
DISBAND("disband"),
|
DISBAND("disband"),
|
||||||
DISBAND_ANY("disband.any"),
|
DISBAND_ANY("disband.any"),
|
||||||
DISCORD("discord"),
|
DISCORD("discord"),
|
||||||
|
DRAIN("drain"),
|
||||||
FLY("fly"),
|
FLY("fly"),
|
||||||
FLY_WILD("fly.wilderness"),
|
FLY_WILD("fly.wilderness"),
|
||||||
FLY_SAFEZONE("fly.safezone"),
|
FLY_SAFEZONE("fly.safezone"),
|
||||||
@@ -67,6 +68,7 @@ public enum Permission {
|
|||||||
LOCK("lock"),
|
LOCK("lock"),
|
||||||
LOCKSPAWNERS("lockspawners"),
|
LOCKSPAWNERS("lockspawners"),
|
||||||
LOGOUT("logout"),
|
LOGOUT("logout"),
|
||||||
|
LOOKUP("lookup"),
|
||||||
MAP("map"),
|
MAP("map"),
|
||||||
MAPHEIGHT("mapheight"),
|
MAPHEIGHT("mapheight"),
|
||||||
MOD("mod"),
|
MOD("mod"),
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.massivecraft.factions.zcore.fperms;
|
package com.massivecraft.factions.zcore.fperms;
|
||||||
|
|
||||||
|
import com.massivecraft.factions.util.XMaterial;
|
||||||
|
|
||||||
public class DefaultPermissions {
|
public class DefaultPermissions {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -33,6 +35,7 @@ public class DefaultPermissions {
|
|||||||
public boolean withdraw;
|
public boolean withdraw;
|
||||||
public boolean chest;
|
public boolean chest;
|
||||||
public boolean check;
|
public boolean check;
|
||||||
|
public boolean drain;
|
||||||
public boolean spawner;
|
public boolean spawner;
|
||||||
|
|
||||||
public DefaultPermissions() {
|
public DefaultPermissions() {
|
||||||
@@ -66,6 +69,7 @@ public class DefaultPermissions {
|
|||||||
this.withdraw = def;
|
this.withdraw = def;
|
||||||
this.chest = def;
|
this.chest = def;
|
||||||
this.check = def;
|
this.check = def;
|
||||||
|
this.drain = def;
|
||||||
this.spawner = def;
|
this.spawner = def;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,6 +100,7 @@ public class DefaultPermissions {
|
|||||||
boolean canWithdraw,
|
boolean canWithdraw,
|
||||||
boolean canChest,
|
boolean canChest,
|
||||||
boolean canCheck,
|
boolean canCheck,
|
||||||
|
boolean canDrain,
|
||||||
boolean canSpawners) {
|
boolean canSpawners) {
|
||||||
this.ban = canBan;
|
this.ban = canBan;
|
||||||
this.build = canBuild;
|
this.build = canBuild;
|
||||||
@@ -124,6 +129,7 @@ public class DefaultPermissions {
|
|||||||
this.withdraw = canWithdraw;
|
this.withdraw = canWithdraw;
|
||||||
this.chest = canChest;
|
this.chest = canChest;
|
||||||
this.check = canCheck;
|
this.check = canCheck;
|
||||||
|
this.drain = canDrain;
|
||||||
this.spawner = canSpawners;
|
this.spawner = canSpawners;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,6 +162,7 @@ public class DefaultPermissions {
|
|||||||
else if (name == "withdraw") return this.withdraw;
|
else if (name == "withdraw") return this.withdraw;
|
||||||
else if (name == "chest") return this.chest;
|
else if (name == "chest") return this.chest;
|
||||||
else if (name == "check") return this.check;
|
else if (name == "check") return this.check;
|
||||||
|
else if (name == "drain") return this.drain;
|
||||||
else if (name == "spawner") return this.spawner;
|
else if (name == "spawner") return this.spawner;
|
||||||
else return false;
|
else return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ public enum PermissableAction {
|
|||||||
BAN("ban"),
|
BAN("ban"),
|
||||||
BUILD("build"),
|
BUILD("build"),
|
||||||
DESTROY("destroy"),
|
DESTROY("destroy"),
|
||||||
|
DRAIN("drain"),
|
||||||
FROST_WALK("frostwalk"),
|
FROST_WALK("frostwalk"),
|
||||||
PAIN_BUILD("painbuild"),
|
PAIN_BUILD("painbuild"),
|
||||||
DOOR("door"),
|
DOOR("door"),
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ public class FUpgradesGUI implements Listener {
|
|||||||
String invName = FactionsPlugin.getInstance().color(FactionsPlugin.getInstance().getConfig().getString("fchest.Inventory-Title"));
|
String invName = FactionsPlugin.getInstance().color(FactionsPlugin.getInstance().getConfig().getString("fchest.Inventory-Title"));
|
||||||
|
|
||||||
for (HumanEntity player : faction.getChestInventory().getViewers()) {
|
for (HumanEntity player : faction.getChestInventory().getViewers()) {
|
||||||
if (player.getInventory().getTitle() != null && player.getInventory().getTitle().equalsIgnoreCase(invName))
|
if (player.getOpenInventory().getTitle() != null && player.getOpenInventory().getTitle().equalsIgnoreCase(invName))
|
||||||
player.closeInventory();
|
player.closeInventory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
public abstract class MemoryFaction implements Faction, EconomyParticipator {
|
public abstract class MemoryFaction implements Faction, EconomyParticipator {
|
||||||
public HashMap<Integer, String> rules = new HashMap<Integer, String>();
|
public HashMap<Integer, String> rules = new HashMap<>();
|
||||||
public int tnt;
|
public int tnt;
|
||||||
public Location checkpoint;
|
public Location checkpoint;
|
||||||
public LazyLocation vault;
|
public LazyLocation vault;
|
||||||
@@ -186,7 +186,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addAnnouncement(FPlayer fPlayer, String msg) {
|
public void addAnnouncement(FPlayer fPlayer, String msg) {
|
||||||
List<String> list = announcements.containsKey(fPlayer.getId()) ? announcements.get(fPlayer.getId()) : new ArrayList<String>();
|
List<String> list = announcements.containsKey(fPlayer.getId()) ? announcements.get(fPlayer.getId()) : new ArrayList<>();
|
||||||
list.add(msg);
|
list.add(msg);
|
||||||
announcements.put(fPlayer.getId(), list);
|
announcements.put(fPlayer.getId(), list);
|
||||||
}
|
}
|
||||||
@@ -450,8 +450,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
|
|||||||
vault = null;
|
vault = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LazyLocation newlocation = new LazyLocation(vaultLocation);
|
vault = new LazyLocation(vaultLocation);
|
||||||
vault = newlocation;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getUpgrade(UpgradeType upgrade) {
|
public int getUpgrade(UpgradeType upgrade) {
|
||||||
@@ -899,47 +898,44 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void resetPerms() {
|
public void resetPerms() {
|
||||||
FactionsPlugin.getInstance().log(Level.WARNING, "Resetting permissions for Faction: " + tag);
|
FactionsPlugin.instance.log(Level.WARNING, "Resetting permissions for Faction: " + this.tag);
|
||||||
|
|
||||||
permissions.clear();
|
permissions.clear();
|
||||||
|
|
||||||
// First populate a map with undefined as the permission for each action.
|
// First populate a map with undefined as the permission for each action.
|
||||||
Map<PermissableAction, Access> freshMap = new HashMap<>();
|
Map<PermissableAction, Access> freshMap = new HashMap<>();
|
||||||
for (PermissableAction permissableAction : PermissableAction.values()) {
|
for (PermissableAction action : PermissableAction.values()) freshMap.put(action, Access.DENY);
|
||||||
freshMap.put(permissableAction, Access.UNDEFINED);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Put the map in there for each relation.
|
// Put the map in there for each relation.
|
||||||
for (Relation relation : Relation.values()) {
|
for (Relation relation : Relation.values()) {
|
||||||
if (relation != Relation.MEMBER) {
|
if (relation == Relation.MEMBER) continue;
|
||||||
permissions.put(relation, new HashMap<>(freshMap));
|
permissions.put(relation, new HashMap<>(freshMap));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// And each role.
|
// And each role.
|
||||||
for (Role role : Role.values()) {
|
for (Role role : Role.values()) {
|
||||||
if (role != Role.LEADER) {
|
if (role == Role.LEADER) continue;
|
||||||
permissions.put(role, new HashMap<>(freshMap));
|
permissions.put(role, new HashMap<>(freshMap));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDefaultPerms() {
|
public void setDefaultPerms() {
|
||||||
Map<PermissableAction, Access> defaultMap = new HashMap<>();
|
Map<PermissableAction, Access> defaultMap = new HashMap<>();
|
||||||
for (PermissableAction action : PermissableAction.values()) defaultMap.put(action, Access.UNDEFINED);
|
for (PermissableAction action : PermissableAction.values()) defaultMap.put(action, Access.DENY);
|
||||||
|
|
||||||
for (Relation rel : Relation.values()) {
|
for (Relation rel : Relation.values()) {
|
||||||
if (rel != Relation.MEMBER) {
|
if (rel == Relation.MEMBER) continue;
|
||||||
if (Conf.defaultFactionPermissions.containsKey(rel.nicename.toUpperCase())) {
|
|
||||||
permissions.put(rel, PermissableAction.fromDefaults(Conf.defaultFactionPermissions.get(rel.nicename.toUpperCase())));
|
|
||||||
} else permissions.put(rel, new HashMap<>(defaultMap));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Role rel : Role.values()) {
|
|
||||||
if (Conf.defaultFactionPermissions.containsKey(rel.nicename.toUpperCase())) {
|
if (Conf.defaultFactionPermissions.containsKey(rel.nicename.toUpperCase())) {
|
||||||
permissions.put(rel, PermissableAction.fromDefaults(Conf.defaultFactionPermissions.get(rel.nicename.toUpperCase())));
|
permissions.put(rel, PermissableAction.fromDefaults(Conf.defaultFactionPermissions.get(rel.nicename.toUpperCase())));
|
||||||
} else permissions.put(rel, new HashMap<>(defaultMap));
|
} else permissions.put(rel, new HashMap<>(defaultMap));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (Role role : Role.values()) {
|
||||||
|
if (role == Role.LEADER) continue;
|
||||||
|
if (Conf.defaultFactionPermissions.containsKey(role.nicename.toUpperCase())) {
|
||||||
|
permissions.put(role, PermissableAction.fromDefaults(Conf.defaultFactionPermissions.get(role.nicename.toUpperCase())));
|
||||||
|
} else permissions.put(role, new HashMap<>(defaultMap));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -515,6 +515,14 @@ public enum TL {
|
|||||||
COMMAND_LOWPOWER_FORMAT("&c{player} &8(&c{player_power}&8/&c{maxpower}&8)"),
|
COMMAND_LOWPOWER_FORMAT("&c{player} &8(&c{player_power}&8/&c{maxpower}&8)"),
|
||||||
COMMAND_LOWPOWER_DESCRIPTION("Shows a list of players in your faction with lower power levels"),
|
COMMAND_LOWPOWER_DESCRIPTION("Shows a list of players in your faction with lower power levels"),
|
||||||
|
|
||||||
|
COMMAND_LOOKUP_INVALID("&c&l[!] &cInvalid Faction Found!"),
|
||||||
|
COMMAND_LOOKUP_FACTION_HOME("&c&l[!] &cFaction Home: &f%1$dx %2$sy %3$sz"),
|
||||||
|
COMMAND_LOOKUP_CLAIM_COUNT("&c&l[!] &cFound &c&n%1$s &cClaimed Chunk(s) for &f%2$s"),
|
||||||
|
COMMAND_LOOKUP_CLAIM_LIST("&f%1$s &7(%2$sx, %2$sz)"),
|
||||||
|
COMMAND_LOOKUP_ONLY_NORMAL("&cYou can only enter normal factions."),
|
||||||
|
COMMAND_LOOKUP_DESCRIPTION("Lookup claim & home stats for faction"),
|
||||||
|
|
||||||
|
|
||||||
COMMAND_MAP_TOSHOW("to show the map"),
|
COMMAND_MAP_TOSHOW("to show the map"),
|
||||||
COMMAND_MAP_FORSHOW("for showing the map"),
|
COMMAND_MAP_FORSHOW("for showing the map"),
|
||||||
COMMAND_MAP_UPDATE_ENABLED("&c&l[!]&7 Map auto update &aENABLED."),
|
COMMAND_MAP_UPDATE_ENABLED("&c&l[!]&7 Map auto update &aENABLED."),
|
||||||
@@ -959,6 +967,13 @@ public enum TL {
|
|||||||
COMMAND_WARUNCLAIMALL_SUCCESS("You unclaimed ALL war zone land."),
|
COMMAND_WARUNCLAIMALL_SUCCESS("You unclaimed ALL war zone land."),
|
||||||
COMMAND_WARUNCLAIMALL_LOG("%1$s unclaimed all war zones."),
|
COMMAND_WARUNCLAIMALL_LOG("%1$s unclaimed all war zones."),
|
||||||
|
|
||||||
|
|
||||||
|
COMMAND_DRAIN_DESCRIPTION("The ability to obtain all the money in faction members balances."),
|
||||||
|
COMMAND_DRAIN_NO_PLAYERS("&c&l[!] &cYou cannot drain a faction with no other members!"),
|
||||||
|
COMMAND_DRAIN_RECIEVED_AMOUNT("&c&l[!] &fYou have drained all of your faction members for &b%1$s."),
|
||||||
|
COMMAND_DRAIN_INVALID_AMOUNT("&c&l[!] &fYou cannot drain a faction with no worth."),
|
||||||
|
|
||||||
|
|
||||||
COMMAND_WILD_DESCRIPTION("Teleport to a random location"),
|
COMMAND_WILD_DESCRIPTION("Teleport to a random location"),
|
||||||
COMMAND_WILD_WAIT("&c&l[!] &7Teleporting in %1$s"),
|
COMMAND_WILD_WAIT("&c&l[!] &7Teleporting in %1$s"),
|
||||||
COMMAND_WILD_SUCCESS("&c&l[!] &7Teleporting..."),
|
COMMAND_WILD_SUCCESS("&c&l[!] &7Teleporting..."),
|
||||||
@@ -1145,11 +1160,11 @@ public enum TL {
|
|||||||
/**
|
/**
|
||||||
* Roles
|
* Roles
|
||||||
*/
|
*/
|
||||||
ROLE_LEADER("Leader"),
|
ROLE_LEADER("leader"),
|
||||||
ROLE_COLEADER("Co-Leader"),
|
ROLE_COLEADER("coleader"),
|
||||||
ROLE_MODERATOR("Moderator"),
|
ROLE_MODERATOR("moderator"),
|
||||||
ROLE_NORMAL("Normal Member"),
|
ROLE_NORMAL("normal member"),
|
||||||
ROLE_RECRUIT("Recruit"),
|
ROLE_RECRUIT("recruit"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Region types.
|
* Region types.
|
||||||
|
|||||||
@@ -490,6 +490,7 @@ fperm-gui:
|
|||||||
tntfill: TNT
|
tntfill: TNT
|
||||||
chest: ENDER_CHEST
|
chest: ENDER_CHEST
|
||||||
check: WATCH
|
check: WATCH
|
||||||
|
drain: BUCKET
|
||||||
spawner: MOB_SPAWNER
|
spawner: MOB_SPAWNER
|
||||||
home: ENDER_EYE
|
home: ENDER_EYE
|
||||||
slots:
|
slots:
|
||||||
@@ -525,6 +526,7 @@ fperm-gui:
|
|||||||
chest: 42
|
chest: 42
|
||||||
check: 50
|
check: 50
|
||||||
spawner: 38
|
spawner: 38
|
||||||
|
drain: 49
|
||||||
home: 48
|
home: 48
|
||||||
# {action} Action name eg: Setwarp, Kick
|
# {action} Action name eg: Setwarp, Kick
|
||||||
# {action-access} Access name eg: Allow, Deny
|
# {action-access} Access name eg: Allow, Deny
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ permissions:
|
|||||||
factions.kit.halfplayer:
|
factions.kit.halfplayer:
|
||||||
description: Can do all but create factions.
|
description: Can do all but create factions.
|
||||||
children:
|
children:
|
||||||
|
factions.drain: true
|
||||||
factions.wild: true
|
factions.wild: true
|
||||||
factions.missions: true
|
factions.missions: true
|
||||||
factions.tntfill: true
|
factions.tntfill: true
|
||||||
@@ -153,6 +154,8 @@ permissions:
|
|||||||
description: auto-claim land as you walk around
|
description: auto-claim land as you walk around
|
||||||
factions.bypass:
|
factions.bypass:
|
||||||
description: enable admin bypass mode
|
description: enable admin bypass mode
|
||||||
|
factions.lookup:
|
||||||
|
description: Lookup claim & home stats for faction
|
||||||
factions.chat:
|
factions.chat:
|
||||||
description: change chat mode
|
description: change chat mode
|
||||||
factions.chatspy:
|
factions.chatspy:
|
||||||
|
|||||||
Reference in New Issue
Block a user