mirror of
https://github.com/RoinujNosde/SimpleClans.git
synced 2026-11-05 01:10:04 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af8cd133c2 | ||
|
|
fa66424402 | ||
|
|
2727203bed | ||
|
|
eedc743d5b | ||
|
|
4e12e4d6f5 | ||
|
|
32855c2611 | ||
|
|
d7118aea82 | ||
|
|
f472432eb6 | ||
|
|
e07c8a9343 | ||
|
|
b84e46d156 | ||
|
|
daba767a5a | ||
|
|
e59a760776 | ||
|
|
6aa30a5d2d | ||
|
|
9fe944fe5b | ||
|
|
178382e685 | ||
|
|
2fcc765447 | ||
|
|
6d5dc79568 | ||
|
|
29c8955f9d | ||
|
|
62f69e0a1e | ||
|
|
3518024428 | ||
|
|
ad7f6fd402 | ||
|
|
732932763d | ||
|
|
6440e937bc | ||
|
|
72ffaaa7fe | ||
|
|
9b69020677 | ||
|
|
50d25bb881 | ||
|
|
5fc0477e9f | ||
|
|
10482ecf23 | ||
|
|
00158a3e3c | ||
|
|
96d65c2d8f | ||
|
|
4036b13bad | ||
|
|
2abe64284b | ||
|
|
1b62ecf296 | ||
|
|
c59afd27b3 | ||
|
|
fecc50c083 | ||
|
|
230a0e9ba5 | ||
|
|
9f96f8c19f | ||
|
|
1b16fd3b2b | ||
|
|
4e5461b533 | ||
|
|
70f4a4a109 | ||
|
|
ae3ebee649 | ||
|
|
235a69cf15 | ||
|
|
2c18498f08 | ||
|
|
2ac4085915 | ||
|
|
9b5e727fed | ||
|
|
dcf1659e6b | ||
|
|
d64190cc8f | ||
|
|
dc1c417222 | ||
|
|
3872790c25 | ||
|
|
da1894e55d | ||
|
|
63763e9afd | ||
|
|
756a30303e |
No files matched your search
+4
-1
@@ -1,3 +1,6 @@
|
||||
/target/
|
||||
/.idea/
|
||||
SimpleClans.iml
|
||||
SimpleClans.iml
|
||||
/bin/
|
||||
/.classpath
|
||||
/.project
|
||||
+1
-1
@@ -5,7 +5,7 @@ language: java
|
||||
|
||||
script: mvn install
|
||||
|
||||
jdk: [openjdk7]
|
||||
jdk: [openjdk8]
|
||||
|
||||
# if one build failed, exit testing
|
||||
matrix:
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
SimpleClans
|
||||
==========
|
||||
|
||||
Full featured clan system for PVP Minecraft Servers
|
||||
|
||||
[](https://travis-ci.org/marcelo-mason/SimpleClans)
|
||||
[](http://104.236.246.108:8080/job/SimpleClans/)
|
||||
[](https://github.com/marcelo-mason/SimpleClans/issues)
|
||||
[](https://ghit.me/repo/marcelo-mason/SimpleClans)
|
||||
|
||||
## Disclaimer:
|
||||
|
||||
Active development for this plugin has stopped. It is in maintenance mode and will continue to be kept up to date as-is with any new Minecraft version indefinitely.
|
||||
|
||||
Pull-requests for bug fixes or new features are welcomed and will be merged in if they do not break existing functionalities.
|
||||
SimpleClans
|
||||
==========
|
||||
|
||||
Full featured clan system for PVP Minecraft Servers
|
||||
|
||||
[](https://travis-ci.org/marcelo-mason/SimpleClans)
|
||||
[](https://github.com/marcelo-mason/SimpleClans/releases)
|
||||
[](https://github.com/marcelo-mason/SimpleClans/issues)
|
||||
[](https://ghit.me/repo/marcelo-mason/SimpleClans)
|
||||
|
||||
## Disclaimer:
|
||||
|
||||
Active development for this plugin has stopped. It is in maintenance mode and will continue to be kept up to date as-is with any new Minecraft version indefinitely.
|
||||
|
||||
Pull-requests for bug fixes or new features are welcomed and will be merged in if they do not break existing functionalities.
|
||||
@@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>net.sacredlabyrinth.phaed.simpleclans</groupId>
|
||||
<artifactId>SimpleClans</artifactId>
|
||||
<version>2.7.12</version>
|
||||
<version>2.8.2</version>
|
||||
<name>SimpleClans</name>
|
||||
<url>http://dev.bukkit.org/server-mods/simpleclans/</url>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<include>plugin.yml</include>
|
||||
<include>config.yml</include>
|
||||
<include>language.yml</include>
|
||||
<include>language-br.yml</include>
|
||||
<include>language-pt-br.yml</include>
|
||||
<include>language-zh.yml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
@@ -33,8 +33,8 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.1</version>
|
||||
<configuration>
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<showDeprecation>true</showDeprecation>
|
||||
<showWarnings>true</showWarnings>
|
||||
<fork>true</fork>
|
||||
@@ -59,15 +59,15 @@
|
||||
<!-- Dependencies -->
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>1.12-R0.1-SNAPSHOT</version>
|
||||
<groupId>com.destroystokyo.paper</groupId>
|
||||
<artifactId>paper-api</artifactId>
|
||||
<version>1.13.2-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.milkbowl.vault</groupId>
|
||||
<artifactId>VaultAPI</artifactId>
|
||||
<version>1.6</version>
|
||||
<version>1.7</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -81,11 +81,11 @@
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>vault-repo</id>
|
||||
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
|
||||
<url>https://nexus.hc.to/content/repositories/pub_releases</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
<id>paper-repo</id>
|
||||
<url>https://repo.destroystokyo.com/repository/maven-public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
|
||||
@@ -638,6 +638,10 @@ public class ChatBlock {
|
||||
public static String[] say(String message) {
|
||||
return colorize(wordWrap(message));
|
||||
}
|
||||
|
||||
public static String[] getColorizedMessage(String msg) {
|
||||
return colorize(wordWrap(msg));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message
|
||||
@@ -697,4 +701,4 @@ public class ChatBlock {
|
||||
|
||||
return message;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,15 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans;
|
||||
|
||||
import net.md_5.bungee.api.chat.HoverEvent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.*;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.json.simple.JSONArray;
|
||||
@@ -15,6 +20,7 @@ import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author phaed
|
||||
@@ -26,7 +32,9 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
private String tag;
|
||||
private String colorTag;
|
||||
private String name;
|
||||
private String description;
|
||||
private double balance;
|
||||
private double fee;
|
||||
private boolean friendlyFire;
|
||||
private long founded;
|
||||
private long lastUsed;
|
||||
@@ -42,6 +50,7 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
private String homeWorld = "";
|
||||
private boolean allowWithdraw = false;
|
||||
private boolean allowDeposit = true;
|
||||
private boolean feeEnabled;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -152,7 +161,46 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the clan's description
|
||||
*
|
||||
* @return the description or null if it doesn't have one
|
||||
*/
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
/**
|
||||
* (used internally)
|
||||
*
|
||||
* @param description
|
||||
*/
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the clan's fee
|
||||
*
|
||||
* @param fee
|
||||
*/
|
||||
public void setMemberFee(double fee) {
|
||||
if (fee < 0) {
|
||||
fee = 0;
|
||||
}
|
||||
this.fee = fee;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the clan's fee
|
||||
*
|
||||
* @return the fee
|
||||
*/
|
||||
public double getMemberFee() {
|
||||
return fee;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the clan's balance
|
||||
*
|
||||
@@ -249,11 +297,7 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
* @return confirmation
|
||||
*/
|
||||
public boolean isMember(Player player) {
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
return this.members.contains(player.getUniqueId().toString());
|
||||
} else {
|
||||
return this.members.contains(player.getName().toLowerCase());
|
||||
}
|
||||
return this.members.contains(player.getUniqueId().toString());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -369,27 +413,33 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
* @param msg
|
||||
*/
|
||||
public void addBb(String msg) {
|
||||
addBbWithoutSaving(msg);
|
||||
SimpleClans.getInstance().getStorageManager().updateClan(this);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds a bulletin board message without saving it to the database
|
||||
*
|
||||
* @param msg
|
||||
*/
|
||||
public void addBbWithoutSaving(String msg) {
|
||||
while (bb.size() > SimpleClans.getInstance().getSettingsManager().getBbSize()) {
|
||||
bb.remove(0);
|
||||
}
|
||||
|
||||
bb.add(msg);
|
||||
SimpleClans.getInstance().getStorageManager().updateClan(this);
|
||||
bb.add(System.currentTimeMillis() + "_" + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a bulletin board message without announcer
|
||||
* Adds a bulletin board message without announcer and saves it to the database
|
||||
*
|
||||
* @param msg
|
||||
*
|
||||
* @param updateLastUsed should the clan's last used time be updated as well?
|
||||
*/
|
||||
public void addBb(String msg, boolean updateLastUsed) {
|
||||
while (bb.size() > SimpleClans.getInstance().getSettingsManager().getBbSize()) {
|
||||
bb.remove(0);
|
||||
}
|
||||
|
||||
bb.add(msg);
|
||||
addBbWithoutSaving(msg);
|
||||
SimpleClans.getInstance().getStorageManager().updateClan(this, updateLastUsed);
|
||||
}
|
||||
|
||||
@@ -407,18 +457,15 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
* @param cp
|
||||
*/
|
||||
public void importMember(ClanPlayer cp) {
|
||||
String NameOrUUID;
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
if (cp.getUniqueId() != null) {
|
||||
NameOrUUID = cp.getUniqueId().toString();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
NameOrUUID = cp.getCleanName();
|
||||
}
|
||||
if (!this.members.contains(NameOrUUID)) {
|
||||
this.members.add(NameOrUUID);
|
||||
String uuid;
|
||||
if (cp.getUniqueId() != null) {
|
||||
uuid = cp.getUniqueId().toString();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.members.contains(uuid)) {
|
||||
this.members.add(uuid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -661,12 +708,7 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
String out = "";
|
||||
|
||||
for (String member : members) {
|
||||
ClanPlayer cp;
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
cp = SimpleClans.getInstance().getClanManager().getClanPlayer(UUID.fromString(member));
|
||||
} else {
|
||||
cp = SimpleClans.getInstance().getClanManager().getClanPlayer(member.toLowerCase());
|
||||
}
|
||||
ClanPlayer cp = SimpleClans.getInstance().getClanManager().getClanPlayer(UUID.fromString(member));
|
||||
if (cp == null) {
|
||||
continue;
|
||||
}
|
||||
@@ -686,11 +728,7 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
* @return the leaders
|
||||
*/
|
||||
public boolean isLeader(Player player) {
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
return isLeader(player.getUniqueId());
|
||||
} else {
|
||||
return isLeader(player.getName());
|
||||
}
|
||||
return isLeader(player.getUniqueId());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -730,6 +768,24 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all members that must pay the fee (that excludes leaders and players with the permission to bypass it)
|
||||
*
|
||||
* @return the fee payers
|
||||
*/
|
||||
public Set<ClanPlayer> getFeePayers() {
|
||||
Set<ClanPlayer> feePayers = new HashSet<>();
|
||||
|
||||
getNonLeaders().forEach(cp -> {
|
||||
OfflinePlayer op= Bukkit.getOfflinePlayer(cp.getUniqueId());
|
||||
if (!SimpleClans.getInstance().getPermissionsManager().has(null, op, "simpleclans.member.bypass-fee")) {
|
||||
feePayers.add(cp);
|
||||
}
|
||||
});
|
||||
|
||||
return feePayers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all members (leaders, and non-leaders) in the clan
|
||||
*
|
||||
@@ -739,12 +795,7 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
List<ClanPlayer> out = new ArrayList<>();
|
||||
|
||||
for (String member : members) {
|
||||
ClanPlayer cp;
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
cp = SimpleClans.getInstance().getClanManager().getClanPlayer(UUID.fromString(member));
|
||||
} else {
|
||||
cp = SimpleClans.getInstance().getClanManager().getClanPlayer(member.toLowerCase());
|
||||
}
|
||||
ClanPlayer cp = SimpleClans.getInstance().getClanManager().getClanPlayer(UUID.fromString(member));
|
||||
if (cp == null) {
|
||||
continue;
|
||||
}
|
||||
@@ -763,12 +814,7 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
List<ClanPlayer> out = new ArrayList<>();
|
||||
|
||||
for (String member : members) {
|
||||
ClanPlayer cp;
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
cp = SimpleClans.getInstance().getClanManager().getClanPlayer(UUID.fromString(member));
|
||||
} else {
|
||||
cp = SimpleClans.getInstance().getClanManager().getClanPlayer(member.toLowerCase());
|
||||
}
|
||||
ClanPlayer cp = SimpleClans.getInstance().getClanManager().getClanPlayer(UUID.fromString(member));
|
||||
if (cp == null) {
|
||||
continue;
|
||||
}
|
||||
@@ -789,12 +835,7 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
List<ClanPlayer> out = new ArrayList<>();
|
||||
|
||||
for (String member : members) {
|
||||
ClanPlayer cp;
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
cp = SimpleClans.getInstance().getClanManager().getClanPlayer(UUID.fromString(member));
|
||||
} else {
|
||||
cp = SimpleClans.getInstance().getClanManager().getClanPlayer(member.toLowerCase());
|
||||
}
|
||||
ClanPlayer cp = SimpleClans.getInstance().getClanManager().getClanPlayer(UUID.fromString(member));
|
||||
if (cp == null) {
|
||||
continue;
|
||||
}
|
||||
@@ -816,12 +857,7 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
List<ClanPlayer> out = new ArrayList<>();
|
||||
|
||||
for (String member : members) {
|
||||
ClanPlayer cp;
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
cp = SimpleClans.getInstance().getClanManager().getClanPlayer(UUID.fromString(member));
|
||||
} else {
|
||||
cp = SimpleClans.getInstance().getClanManager().getClanPlayer(member.toLowerCase());
|
||||
}
|
||||
ClanPlayer cp = SimpleClans.getInstance().getClanManager().getClanPlayer(UUID.fromString(member));
|
||||
if (cp == null) {
|
||||
continue;
|
||||
}
|
||||
@@ -845,12 +881,7 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
List<ClanPlayer> out = new ArrayList<>();
|
||||
|
||||
for (String member : members) {
|
||||
ClanPlayer cp;
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
cp = SimpleClans.getInstance().getClanManager().getClanPlayer(UUID.fromString(member));
|
||||
} else {
|
||||
cp = SimpleClans.getInstance().getClanManager().getClanPlayer(member.toLowerCase());
|
||||
}
|
||||
ClanPlayer cp = SimpleClans.getInstance().getClanManager().getClanPlayer(UUID.fromString(member));
|
||||
if (cp == null) {
|
||||
continue;
|
||||
}
|
||||
@@ -896,12 +927,7 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
int totalDeaths = 0;
|
||||
|
||||
for (String member : members) {
|
||||
ClanPlayer cp;
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
cp = SimpleClans.getInstance().getClanManager().getClanPlayer(UUID.fromString(member));
|
||||
} else {
|
||||
cp = SimpleClans.getInstance().getClanManager().getClanPlayer(member.toLowerCase());
|
||||
}
|
||||
ClanPlayer cp = SimpleClans.getInstance().getClanManager().getClanPlayer(UUID.fromString(member));
|
||||
if (cp == null) {
|
||||
continue;
|
||||
}
|
||||
@@ -930,12 +956,7 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
}
|
||||
|
||||
for (String member : members) {
|
||||
ClanPlayer cp;
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
cp = SimpleClans.getInstance().getClanManager().getClanPlayer(UUID.fromString(member));
|
||||
} else {
|
||||
cp = SimpleClans.getInstance().getClanManager().getClanPlayer(member.toLowerCase());
|
||||
}
|
||||
ClanPlayer cp = SimpleClans.getInstance().getClanManager().getClanPlayer(UUID.fromString(member));
|
||||
if (cp == null) {
|
||||
continue;
|
||||
}
|
||||
@@ -959,12 +980,7 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
}
|
||||
|
||||
for (String member : members) {
|
||||
ClanPlayer cp;
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
cp = SimpleClans.getInstance().getClanManager().getClanPlayer(UUID.fromString(member));
|
||||
} else {
|
||||
cp = SimpleClans.getInstance().getClanManager().getClanPlayer(member.toLowerCase());
|
||||
}
|
||||
ClanPlayer cp = SimpleClans.getInstance().getClanManager().getClanPlayer(UUID.fromString(member));
|
||||
if (cp == null) {
|
||||
continue;
|
||||
}
|
||||
@@ -988,12 +1004,7 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
}
|
||||
|
||||
for (String member : members) {
|
||||
ClanPlayer cp;
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
cp = SimpleClans.getInstance().getClanManager().getClanPlayer(UUID.fromString(member));
|
||||
} else {
|
||||
cp = SimpleClans.getInstance().getClanManager().getClanPlayer(member.toLowerCase());
|
||||
}
|
||||
ClanPlayer cp = SimpleClans.getInstance().getClanManager().getClanPlayer(UUID.fromString(member));
|
||||
if (cp == null) {
|
||||
continue;
|
||||
}
|
||||
@@ -1017,12 +1028,7 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
}
|
||||
|
||||
for (String member : members) {
|
||||
ClanPlayer cp;
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
cp = SimpleClans.getInstance().getClanManager().getClanPlayer(UUID.fromString(member));
|
||||
} else {
|
||||
cp = SimpleClans.getInstance().getClanManager().getClanPlayer(member.toLowerCase());
|
||||
}
|
||||
ClanPlayer cp = SimpleClans.getInstance().getClanManager().getClanPlayer(UUID.fromString(member));
|
||||
if (cp == null) {
|
||||
continue;
|
||||
}
|
||||
@@ -1046,12 +1052,7 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
}
|
||||
|
||||
for (String member : members) {
|
||||
ClanPlayer cp;
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
cp = SimpleClans.getInstance().getClanManager().getClanPlayer(UUID.fromString(member));
|
||||
} else {
|
||||
cp = SimpleClans.getInstance().getClanManager().getClanPlayer(member.toLowerCase());
|
||||
}
|
||||
ClanPlayer cp = SimpleClans.getInstance().getClanManager().getClanPlayer(UUID.fromString(member));
|
||||
if (cp == null) {
|
||||
continue;
|
||||
}
|
||||
@@ -1095,13 +1096,9 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
|
||||
// add clan permission
|
||||
SimpleClans.getInstance().getPermissionsManager().addClanPermissions(cp);
|
||||
SimpleClans.getInstance().getPermissionsManager().addPlayerPermissions(cp);
|
||||
|
||||
Player player;
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
player = SimpleClans.getInstance().getServer().getPlayer(cp.getUniqueId());
|
||||
} else {
|
||||
player = SimpleClans.getInstance().getServer().getPlayerExact(cp.getName());
|
||||
}
|
||||
Player player = SimpleClans.getInstance().getServer().getPlayer(cp.getUniqueId());
|
||||
|
||||
if (player != null) {
|
||||
SimpleClans.getInstance().getClanManager().updateDisplayName(player);
|
||||
@@ -1327,21 +1324,42 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
* @return
|
||||
*/
|
||||
public boolean isAnyOnline() {
|
||||
for (String member : members) {
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
if (Helper.isOnline(UUID.fromString(member))) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (Helper.isOnline(member)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (String member : members) {
|
||||
if (Helper.isOnline(UUID.fromString(member))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if there are enough leaders online to vote
|
||||
*
|
||||
* @param cp the one to demote
|
||||
* @return true if there are
|
||||
*/
|
||||
public boolean enoughLeadersOnlineToDemote(ClanPlayer cp) {
|
||||
List<ClanPlayer> online = getOnlineLeaders();
|
||||
online.remove(cp);
|
||||
|
||||
double minimum = SimpleClans.getInstance().getSettingsManager().getPercentageOnlineToDemote();
|
||||
double totalLeaders = getLeaders().size();
|
||||
double onlineLeaders = online.size();
|
||||
|
||||
|
||||
return ((onlineLeaders / totalLeaders) * 100) >= minimum;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the online leaders
|
||||
*
|
||||
* @return the online leaders
|
||||
*/
|
||||
public List<ClanPlayer> getOnlineLeaders() {
|
||||
return getOnlineMembers().stream().filter(ClanPlayer::isLeader).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether all leaders of a clan are online
|
||||
*
|
||||
@@ -1350,17 +1368,11 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
public boolean allLeadersOnline() {
|
||||
List<ClanPlayer> leaders = getLeaders();
|
||||
|
||||
for (ClanPlayer leader : leaders) {
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
if (!Helper.isOnline(leader.getUniqueId())) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!Helper.isOnline(leader.getName())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (ClanPlayer leader : leaders) {
|
||||
if (!Helper.isOnline(leader.getUniqueId())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1504,12 +1516,72 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
}
|
||||
|
||||
for (String msg : bb) {
|
||||
ChatBlock.sendMessage(player, SimpleClans.getInstance().getSettingsManager().getBbAccentColor() + "* " + SimpleClans.getInstance().getSettingsManager().getBbColor() + Helper.parseColors(msg));
|
||||
if (!sendBbTime(player, msg)) {
|
||||
ChatBlock.sendMessage(player, SimpleClans.getInstance().getSettingsManager().getBbAccentColor() + "* " + SimpleClans.getInstance().getSettingsManager().getBbColor() + Helper.parseColors(msg));
|
||||
}
|
||||
}
|
||||
ChatBlock.sendBlank(player);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays bb to a player
|
||||
* @implNote may want to refactor displaybb(Player) to use this?
|
||||
*
|
||||
* @param player
|
||||
* @param maxSize amount of lines to display
|
||||
*/
|
||||
public void displayBb(Player player, int maxSize) {
|
||||
if (isVerified()) {
|
||||
ChatBlock.sendBlank(player);
|
||||
ChatBlock.saySingle(player, MessageFormat.format(SimpleClans.getInstance().getLang("bulletin.board.header"), SimpleClans.getInstance().getSettingsManager().getBbAccentColor(), SimpleClans.getInstance().getSettingsManager().getPageHeadingsColor(), Helper.capitalize(getName())));
|
||||
|
||||
List<String> localBb = new ArrayList<>(bb);
|
||||
while (localBb.size() > maxSize) {
|
||||
localBb.remove(0);
|
||||
}
|
||||
|
||||
for (String msg : localBb) {
|
||||
if (!sendBbTime(player, msg)) {
|
||||
ChatBlock.sendMessage(player, SimpleClans.getInstance().getSettingsManager().getBbAccentColor() + "* " + SimpleClans.getInstance().getSettingsManager().getBbColor() + Helper.parseColors(msg));
|
||||
}
|
||||
}
|
||||
ChatBlock.sendBlank(player);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a bb message with the timestamp in a hover message, if the bb message is timestamped
|
||||
* @param msg the bb message
|
||||
* @return true if sent
|
||||
*/
|
||||
private boolean sendBbTime(Player player, String msg) {
|
||||
try {
|
||||
int index = msg.indexOf("_");
|
||||
if (index < 1)
|
||||
return false;
|
||||
long time;
|
||||
time = (System.currentTimeMillis()
|
||||
- Long.parseLong(msg.substring(0, index))) / 1000L;
|
||||
msg = String.join("", ChatBlock
|
||||
.getColorizedMessage(SimpleClans.getInstance()
|
||||
.getSettingsManager().getBbAccentColor() + "* " +
|
||||
SimpleClans.getInstance().getSettingsManager()
|
||||
.getBbColor() + Helper.parseColors(
|
||||
msg.substring(++index, msg.length()))));
|
||||
TextComponent textComponent = new TextComponent(msg);
|
||||
textComponent.setHoverEvent(
|
||||
new HoverEvent(HoverEvent.Action.SHOW_TEXT,
|
||||
TextComponent.fromLegacyText(
|
||||
Dates.formatTime(time, 1) + SimpleClans
|
||||
.getInstance().getLang("bb.ago"))));
|
||||
player.spigot().sendMessage(textComponent);
|
||||
return true;
|
||||
} catch (Throwable rock) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disband a clan
|
||||
*/
|
||||
@@ -1633,7 +1705,8 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
*
|
||||
* @return the flags
|
||||
*/
|
||||
public String getFlags() {
|
||||
@SuppressWarnings("unchecked")
|
||||
public String getFlags() {
|
||||
JSONObject json = new JSONObject();
|
||||
|
||||
// writing the list of flags to json
|
||||
@@ -1703,8 +1776,8 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
}
|
||||
|
||||
public void validateWarring() {
|
||||
for (Iterator iter = warringClans.keySet().iterator(); iter.hasNext(); ) {
|
||||
String clanName = (String) iter.next();
|
||||
for (Iterator<String> iter = warringClans.keySet().iterator(); iter.hasNext(); ) {
|
||||
String clanName = iter.next();
|
||||
|
||||
Clan clan = SimpleClans.getInstance().getClanManager().getClan(clanName);
|
||||
|
||||
@@ -1776,6 +1849,24 @@ public class Clan implements Serializable, Comparable<Clan> {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the fee is enabled
|
||||
*
|
||||
* @return true if enabled
|
||||
*/
|
||||
public boolean isMemberFeeEnabled() {
|
||||
return feeEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables the fee
|
||||
*
|
||||
* @param enable
|
||||
*/
|
||||
public void setMemberFeeEnabled(boolean enable) {
|
||||
feeEnabled = enable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the allowWithdraw
|
||||
*/
|
||||
|
||||
@@ -10,6 +10,8 @@ import org.json.simple.JSONValue;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
import java.text.MessageFormat;
|
||||
import java.time.Instant;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
@@ -32,6 +34,7 @@ public class ClanPlayer implements Serializable, Comparable<ClanPlayer>
|
||||
private long lastSeen;
|
||||
private long joinDate;
|
||||
private Set<String> pastClans = new HashSet<>();
|
||||
private Map<String, Long> resignTimes = new HashMap<>();
|
||||
private VoteResult vote;
|
||||
private Channel channel;
|
||||
|
||||
@@ -116,15 +119,8 @@ public class ClanPlayer implements Serializable, Comparable<ClanPlayer>
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(ClanPlayer other)
|
||||
{
|
||||
if (SimpleClans.getInstance().hasUUID())
|
||||
{
|
||||
return this.getUniqueId().compareTo(other.getUniqueId());
|
||||
} else
|
||||
{
|
||||
return this.getName().compareToIgnoreCase(other.getName());
|
||||
}
|
||||
public int compareTo(ClanPlayer other) {
|
||||
return this.getUniqueId().compareTo(other.getUniqueId());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -329,6 +325,7 @@ public class ClanPlayer implements Serializable, Comparable<ClanPlayer>
|
||||
/**
|
||||
* Adds one rival kill to this player (does not update clanplayer to db)
|
||||
*/
|
||||
@Deprecated
|
||||
public void addRivalKill()
|
||||
{
|
||||
setRivalKills(getRivalKills() + 1);
|
||||
@@ -357,6 +354,7 @@ public class ClanPlayer implements Serializable, Comparable<ClanPlayer>
|
||||
/**
|
||||
* Adds one civilian kill to this player (does not update clanplayer to db)
|
||||
*/
|
||||
@Deprecated
|
||||
public void addCivilianKill()
|
||||
{
|
||||
setCivilianKills(getCivilianKills() + 1);
|
||||
@@ -385,10 +383,27 @@ public class ClanPlayer implements Serializable, Comparable<ClanPlayer>
|
||||
/**
|
||||
* Adds one civilian kill to this player (does not update clanplayer to db)
|
||||
*/
|
||||
@Deprecated
|
||||
public void addNeutralKill()
|
||||
{
|
||||
setNeutralKills(getNeutralKills() + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds one kill to this player (does not update to db)
|
||||
*/
|
||||
public void addKill(Kill.Type type) {
|
||||
switch (type) {
|
||||
case CIVILIAN:
|
||||
civilianKills++;
|
||||
break;
|
||||
case NEUTRAL:
|
||||
neutralKills++;
|
||||
break;
|
||||
case RIVAL:
|
||||
rivalKills++;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this player is allowing friendly fire
|
||||
@@ -628,6 +643,51 @@ public class ClanPlayer implements Serializable, Comparable<ClanPlayer>
|
||||
// return pc;
|
||||
return pastClans;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a map containing the time the player resigned from certain clans
|
||||
*
|
||||
* @return the resign times
|
||||
*/
|
||||
public Map<String, Long> getResignTimes() {
|
||||
return resignTimes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the time in millis when the player resigned from the clan
|
||||
*
|
||||
* @param tag
|
||||
* @return the time in millis
|
||||
*/
|
||||
public Long getResignTime(String tag) {
|
||||
return resignTimes.get(tag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the resign times (does not update to db)
|
||||
*
|
||||
* @param resignTimes
|
||||
*/
|
||||
public void setResignTimes(Map<String, Long> resignTimes) {
|
||||
if (resignTimes != null) {
|
||||
final int cooldown = SimpleClans.getInstance().getSettingsManager().getRejoinCooldown();
|
||||
resignTimes.forEach((k, v) -> {
|
||||
long timePassed = Instant.ofEpochMilli(v).until(Instant.now(), ChronoUnit.MINUTES);
|
||||
if (timePassed < cooldown) {
|
||||
this.resignTimes.put(k, v);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the clan to the resign times map
|
||||
*
|
||||
* @param tag
|
||||
*/
|
||||
public void addResignTime(String tag) {
|
||||
if (tag != null) resignTimes.put(tag, System.currentTimeMillis());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns this player's clan
|
||||
@@ -708,7 +768,8 @@ public class ClanPlayer implements Serializable, Comparable<ClanPlayer>
|
||||
*
|
||||
* @return the flags
|
||||
*/
|
||||
public String getFlags()
|
||||
@SuppressWarnings("unchecked")
|
||||
public String getFlags()
|
||||
{
|
||||
JSONObject json = new JSONObject();
|
||||
|
||||
|
||||
@@ -1,138 +1,196 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author phaed
|
||||
*/
|
||||
|
||||
public class Dates {
|
||||
|
||||
private Dates() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static double differenceInMonths(Timestamp date1, Timestamp date2) {
|
||||
return differenceInMonths(new Date(date1.getTime()), new Date(date2.getTime()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static double differenceInYears(Timestamp date1, Timestamp date2) {
|
||||
return differenceInYears(new Date(date1.getTime()), new Date(date2.getTime()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static double differenceInDays(Timestamp date1, Timestamp date2) {
|
||||
return differenceInDays(new Date(date1.getTime()), new Date(date2.getTime()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static double differenceInHours(Timestamp date1, Timestamp date2) {
|
||||
return differenceInHours(new Date(date1.getTime()), new Date(date2.getTime()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static double differenceInMinutes(Timestamp date1, Timestamp date2) {
|
||||
return differenceInMinutes(new Date(date1.getTime()), new Date(date2.getTime()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static double differenceInSeconds(Timestamp date1, Timestamp date2) {
|
||||
return differenceInSeconds(new Date(date1.getTime()), new Date(date2.getTime()));
|
||||
}
|
||||
|
||||
private static double differenceInMilliseconds(Timestamp date1, Timestamp date2) {
|
||||
return differenceInMilliseconds(new Date(date1.getTime()), new Date(date2.getTime()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static double differenceInMonths(Date date1, Date date2) {
|
||||
return differenceInYears(date1, date2) * 12;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static double differenceInYears(Date date1, Date date2) {
|
||||
double days = differenceInDays(date1, date2);
|
||||
return days / 365.2425;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static double differenceInDays(Date date1, Date date2) {
|
||||
return differenceInHours(date1, date2) / 24.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static double differenceInHours(Date date1, Date date2) {
|
||||
return differenceInMinutes(date1, date2) / 60.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static double differenceInMinutes(Date date1, Date date2) {
|
||||
return differenceInSeconds(date1, date2) / 60.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static double differenceInSeconds(Date date1, Date date2) {
|
||||
return differenceInMilliseconds(date1, date2) / 1000.0;
|
||||
}
|
||||
|
||||
private static double differenceInMilliseconds(Date date1, Date date2) {
|
||||
return Math.abs(getTimeInMilliseconds(date1) - getTimeInMilliseconds(date2));
|
||||
}
|
||||
|
||||
private static long getTimeInMilliseconds(Date date) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(date);
|
||||
return cal.getTimeInMillis() + cal.getTimeZone().getOffset(cal.getTimeInMillis());
|
||||
}
|
||||
}
|
||||
package net.sacredlabyrinth.phaed.simpleclans;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author phaed
|
||||
*/
|
||||
|
||||
public class Dates {
|
||||
|
||||
private Dates() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static double differenceInMonths(Timestamp date1, Timestamp date2) {
|
||||
return differenceInMonths(new Date(date1.getTime()), new Date(date2.getTime()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static double differenceInYears(Timestamp date1, Timestamp date2) {
|
||||
return differenceInYears(new Date(date1.getTime()), new Date(date2.getTime()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static double differenceInDays(Timestamp date1, Timestamp date2) {
|
||||
return differenceInDays(new Date(date1.getTime()), new Date(date2.getTime()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static double differenceInHours(Timestamp date1, Timestamp date2) {
|
||||
return differenceInHours(new Date(date1.getTime()), new Date(date2.getTime()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static double differenceInMinutes(Timestamp date1, Timestamp date2) {
|
||||
return differenceInMinutes(new Date(date1.getTime()), new Date(date2.getTime()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static double differenceInSeconds(Timestamp date1, Timestamp date2) {
|
||||
return differenceInSeconds(new Date(date1.getTime()), new Date(date2.getTime()));
|
||||
}
|
||||
|
||||
private static double differenceInMilliseconds(Timestamp date1, Timestamp date2) {
|
||||
return differenceInMilliseconds(new Date(date1.getTime()), new Date(date2.getTime()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static double differenceInMonths(Date date1, Date date2) {
|
||||
return differenceInYears(date1, date2) * 12;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static double differenceInYears(Date date1, Date date2) {
|
||||
double days = differenceInDays(date1, date2);
|
||||
return days / 365.2425;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static double differenceInDays(Date date1, Date date2) {
|
||||
return differenceInHours(date1, date2) / 24.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static double differenceInHours(Date date1, Date date2) {
|
||||
return differenceInMinutes(date1, date2) / 60.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static double differenceInMinutes(Date date1, Date date2) {
|
||||
return differenceInSeconds(date1, date2) / 60.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param date1
|
||||
* @param date2
|
||||
* @return
|
||||
*/
|
||||
public static double differenceInSeconds(Date date1, Date date2) {
|
||||
return differenceInMilliseconds(date1, date2) / 1000.0;
|
||||
}
|
||||
|
||||
private static double differenceInMilliseconds(Date date1, Date date2) {
|
||||
return Math.abs(getTimeInMilliseconds(date1) - getTimeInMilliseconds(date2));
|
||||
}
|
||||
|
||||
private static long getTimeInMilliseconds(Date date) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(date);
|
||||
return cal.getTimeInMillis() + cal.getTimeZone().getOffset(cal.getTimeInMillis());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the string representation of the amount of time labeled as days, hours, minutes, seconds
|
||||
* @author RoboMWM, LaxWasHere
|
||||
* @param seconds the time in seconds
|
||||
* @param depth Max amount of detail (e.g. only display days and hours if set to 1 and seconds > 1 day)
|
||||
* @return
|
||||
*/
|
||||
public static String formatTime(Long seconds, int depth)
|
||||
{
|
||||
SimpleClans plugin = SimpleClans.getInstance();
|
||||
if (seconds == null || seconds < 1) {
|
||||
return plugin.getLang("bb.moments");
|
||||
}
|
||||
|
||||
if (seconds < 60) {
|
||||
return seconds + plugin.getLang("bb.seconds");
|
||||
}
|
||||
|
||||
if (seconds < 3600) {
|
||||
Long count = (long) Math.ceil(seconds / 60);
|
||||
String res;
|
||||
if (count > 1) {
|
||||
res = count + plugin.getLang("bb.minutes");
|
||||
} else {
|
||||
res = plugin.getLang("bb.one.minute");
|
||||
}
|
||||
Long remaining = seconds % 60;
|
||||
if (depth > 0 && remaining >= 5) {
|
||||
return res + ", " + formatTime(remaining, --depth);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
if (seconds < 86400) {
|
||||
Long count = (long) Math.ceil(seconds / 3600);
|
||||
String res;
|
||||
if (count > 1) {
|
||||
res = count + plugin.getLang("bb.hours");
|
||||
} else {
|
||||
res = plugin.getLang("bb.one.hour");
|
||||
}
|
||||
if (depth > 0) {
|
||||
return res + ", " + formatTime(seconds % 3600, --depth);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
Long count = (long) Math.ceil(seconds / 86400);
|
||||
String res;
|
||||
if (count > 1) {
|
||||
res = count + plugin.getLang("bb.days");
|
||||
} else {
|
||||
res = plugin.getLang("bb.one.day");
|
||||
}
|
||||
if (depth > 0) {
|
||||
return res + ", " + formatTime(seconds % 86400, --depth);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -5,14 +5,19 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
import org.json.simple.parser.ParseException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.regex.Matcher;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.SettingsManager;
|
||||
|
||||
/**
|
||||
@@ -31,6 +36,53 @@ public class Helper {
|
||||
SimpleClans.debug(el.toString());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a resign times map to a JSON String
|
||||
*
|
||||
* @param resignTimes
|
||||
* @return a JSON String
|
||||
*/
|
||||
public static String resignTimesToJson(Map<String, Long> resignTimes) {
|
||||
return JSONObject.toJSONString(resignTimes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a JSON String to a resign times map
|
||||
*
|
||||
* @param json JSON String
|
||||
* @return a map
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static Map<String, Long> resignTimesFromJson(String json) {
|
||||
if (json != null) {
|
||||
try {
|
||||
return (Map<String, Long>) new JSONParser().parse(json);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the delay in seconds to the specified hour and minute.
|
||||
*
|
||||
* @param hour hour
|
||||
* @param minute minute
|
||||
* @return the delay in seconds
|
||||
*/
|
||||
public static long getDelayTo(int hour, int minute) {
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
LocalDateTime d = LocalDateTime.of(now.toLocalDate(), LocalTime.of(1, 0));
|
||||
long delay;
|
||||
if (now.isAfter(d)) {
|
||||
delay = now.until(d.plusDays(1), ChronoUnit.SECONDS);
|
||||
} else {
|
||||
delay = now.until(d, ChronoUnit.SECONDS);
|
||||
}
|
||||
return delay;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a players full color name if he is online
|
||||
@@ -348,9 +400,9 @@ public class Helper {
|
||||
* @return
|
||||
*/
|
||||
public static String stripColors(String msg) {
|
||||
String out = msg.replaceAll("[&][0-9a-f]", "");
|
||||
String out = msg.replaceAll("[&][0-9a-fk-or]", "");
|
||||
out = out.replaceAll(String.valueOf((char) 194), "");
|
||||
return out.replaceAll("[\u00a7][0-9a-f]", "");
|
||||
return out.replaceAll("[\u00a7][0-9a-fk-or]", "");
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -605,11 +657,7 @@ public class Helper {
|
||||
}
|
||||
|
||||
public static Player getPlayer(String playerName) {
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
return SimpleClans.getInstance().getServer().getPlayer(UUIDMigration.getForcedPlayerUUID(playerName));
|
||||
}
|
||||
|
||||
return SimpleClans.getInstance().getServer().getPlayer(playerName);
|
||||
return SimpleClans.getInstance().getServer().getPlayer(UUIDMigration.getForcedPlayerUUID(playerName));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -626,24 +674,24 @@ public class Helper {
|
||||
String leaderColor = sm.getAllyChatLeaderColor();
|
||||
String memberColor = sm.getAllyChatMemberColor();
|
||||
String rank = cp.getRank().isEmpty() ? null : ChatColor.translateAlternateColorCodes('&', cp.getRank());
|
||||
String rankFormat = rank != null ? ChatColor.translateAlternateColorCodes('&', sm.getAllyChatRank()).replaceAll("%rank%", rank) : "";
|
||||
String rankFormat = rank != null ? ChatColor.translateAlternateColorCodes('&', sm.getAllyChatRank()).replace("%rank%", rank) : "";
|
||||
|
||||
String message = replacePlaceholders(sm, cp, leaderColor, memberColor, rankFormat, msg);
|
||||
String message = replacePlaceholders(sm.getAllyChatFormat(), cp, leaderColor, memberColor, rankFormat, msg);
|
||||
if (placeholders != null) {
|
||||
for (Entry<String, String> e : placeholders.entrySet()) {
|
||||
message = message.replaceAll("%"+e.getKey()+"%", e.getValue());
|
||||
message = message.replace("%"+e.getKey()+"%", e.getValue());
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
private static String replacePlaceholders(SettingsManager sm, ClanPlayer cp, String leaderColor, String memberColor, String rankFormat, String msg) {
|
||||
String message = ChatColor.translateAlternateColorCodes('&', sm.getAllyChatFormat())
|
||||
.replaceAll("%clan%", cp.getClan().getColorTag())
|
||||
.replaceAll("%nick-color%", (cp.isLeader() ? leaderColor : memberColor))
|
||||
.replaceAll("%player%", cp.getName())
|
||||
.replaceAll("%rank%", rankFormat)
|
||||
.replaceAll("%message%", Matcher.quoteReplacement(msg));
|
||||
private static String replacePlaceholders(String messageFormat, ClanPlayer cp, String leaderColor, String memberColor, String rankFormat, String msg) {
|
||||
String message = ChatColor.translateAlternateColorCodes('&', messageFormat)
|
||||
.replace("%clan%", cp.getClan().getColorTag())
|
||||
.replace("%nick-color%", (cp.isLeader() ? leaderColor : memberColor))
|
||||
.replace("%player%", cp.getName())
|
||||
.replace("%rank%", rankFormat)
|
||||
.replace("%message%", msg);
|
||||
return message;
|
||||
}
|
||||
|
||||
@@ -661,13 +709,13 @@ public class Helper {
|
||||
String leaderColor = sm.getClanChatLeaderColor();
|
||||
String memberColor = sm.getClanChatMemberColor();
|
||||
String rank = cp.getRank().isEmpty() ? null : ChatColor.translateAlternateColorCodes('&', cp.getRank());
|
||||
String rankFormat = rank != null ? ChatColor.translateAlternateColorCodes('&', sm.getClanChatRank()).replaceAll("%rank%", rank) : "";
|
||||
String rankFormat = rank != null ? ChatColor.translateAlternateColorCodes('&', sm.getClanChatRank()).replace("%rank%", rank) : "";
|
||||
|
||||
String message = replacePlaceholders(sm, cp, leaderColor, memberColor, rankFormat, msg);
|
||||
String message = replacePlaceholders(sm.getClanChatFormat(), cp, leaderColor, memberColor, rankFormat, msg);
|
||||
|
||||
if (placeholders != null) {
|
||||
for (Entry<String, String> e : placeholders.entrySet()) {
|
||||
message = message.replaceAll("%"+e.getKey()+"%", e.getValue());
|
||||
message = message.replace("%"+e.getKey()+"%", e.getValue());
|
||||
}
|
||||
}
|
||||
return message;
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class Kill {
|
||||
|
||||
private final ClanPlayer killer;
|
||||
private final ClanPlayer victim;
|
||||
private final LocalDateTime time;
|
||||
|
||||
public Kill(ClanPlayer killer, ClanPlayer victim, LocalDateTime time) {
|
||||
this.killer = killer;
|
||||
this.victim = victim;
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public ClanPlayer getKiller() {
|
||||
return killer;
|
||||
}
|
||||
|
||||
public ClanPlayer getVictim() {
|
||||
return victim;
|
||||
}
|
||||
|
||||
public LocalDateTime getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public enum Type {
|
||||
CIVILIAN("c"), RIVAL("r"), NEUTRAL("n");
|
||||
|
||||
Type(String shortName) {
|
||||
this.shortName = shortName;
|
||||
}
|
||||
|
||||
private final String shortName;
|
||||
|
||||
public String getShortname() {
|
||||
return shortName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,33 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.executors.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.listeners.SCEntityListener;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.listeners.SCPlayerListener;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
|
||||
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.executors.AcceptCommandExecutor;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.executors.AllyCommandExecutor;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.executors.ClanCommandExecutor;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.executors.DenyCommandExecutor;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.executors.GlobalCommandExecutor;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.executors.MoreCommandExecutor;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.listeners.SCEntityListener;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.listeners.SCPlayerListener;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.ClanManager;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.LanguageManager;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.PermissionsManager;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.RequestManager;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.SettingsManager;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.StorageManager;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.TeleportManager;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.tasks.CollectFeeTask;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.tasks.CollectUpkeepTask;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.tasks.UpkeepWarningTask;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
|
||||
|
||||
/**
|
||||
* @author Phaed
|
||||
*/
|
||||
@@ -106,6 +120,18 @@ public class SimpleClans extends JavaPlugin {
|
||||
logger.info("[SimpleClans] Online Mode: " + hasUUID); //TODO: Is this necessary?
|
||||
logger.info("[SimpleClans] Modo Multithreading: " + SimpleClans.getInstance().getSettingsManager().getUseThreads());
|
||||
logger.info("[SimpleClans] Modo BungeeCord: " + SimpleClans.getInstance().getSettingsManager().getUseBungeeCord());
|
||||
|
||||
startTasks();
|
||||
}
|
||||
|
||||
private void startTasks() {
|
||||
if (getSettingsManager().isMemberFee()) {
|
||||
new CollectFeeTask().start();
|
||||
}
|
||||
if (getSettingsManager().isClanUpkeep()) {
|
||||
new CollectUpkeepTask().start();
|
||||
new UpkeepWarningTask().start();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -169,6 +195,7 @@ public class SimpleClans extends JavaPlugin {
|
||||
/**
|
||||
* @return the hasUUID
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean hasUUID() {
|
||||
return this.hasUUID;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import java.util.UUID;
|
||||
|
||||
public class TeleportState {
|
||||
private UUID playerUniqueId;
|
||||
private String playerName;
|
||||
private Location playerLocation;
|
||||
private Location destination;
|
||||
private int counter;
|
||||
@@ -17,7 +16,6 @@ public class TeleportState {
|
||||
public TeleportState(Player player, Location dest, String clanName) {
|
||||
this.destination = dest;
|
||||
this.playerLocation = player.getLocation();
|
||||
this.playerName = player.getName();
|
||||
this.clanName = clanName;
|
||||
this.counter = SimpleClans.getInstance().getSettingsManager().getWaitSecs();
|
||||
this.playerUniqueId = player.getUniqueId();
|
||||
@@ -50,11 +48,7 @@ public class TeleportState {
|
||||
* @return
|
||||
*/
|
||||
public Player getPlayer() {
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
return SimpleClans.getInstance().getServer().getPlayer(this.playerUniqueId);
|
||||
} else {
|
||||
return SimpleClans.getInstance().getServer().getPlayer(this.playerName);
|
||||
}
|
||||
return SimpleClans.getInstance().getServer().getPlayer(this.playerUniqueId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -36,38 +36,24 @@ public class BanCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
String banned = arg[0];
|
||||
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
UUID PlayerUniqueId = UUIDMigration.getForcedPlayerUUID(banned);
|
||||
if (plugin.getSettingsManager().isBanned(PlayerUniqueId)) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("this.player.is.already.banned"));
|
||||
return;
|
||||
}
|
||||
|
||||
Player pl = SimpleClans.getInstance().getServer().getPlayer(PlayerUniqueId);
|
||||
|
||||
if (pl != null) {
|
||||
ChatBlock.sendMessage(pl, ChatColor.AQUA + plugin.getLang("you.banned"));
|
||||
}
|
||||
|
||||
plugin.getClanManager().ban(banned);
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("player.added.to.banned.list"));
|
||||
} else {
|
||||
if (plugin.getSettingsManager().isBanned(banned)) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("this.player.is.already.banned"));
|
||||
return;
|
||||
}
|
||||
|
||||
Player pl = SimpleClans.getInstance().getServer().getPlayerExact(banned);
|
||||
|
||||
if (pl != null) {
|
||||
ChatBlock.sendMessage(pl, ChatColor.AQUA + plugin.getLang("you.banned"));
|
||||
}
|
||||
|
||||
plugin.getClanManager().ban(banned);
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("player.added.to.banned.list"));
|
||||
UUID uuid = UUIDMigration.getForcedPlayerUUID(arg[0]);
|
||||
if (uuid == null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.matched"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (plugin.getSettingsManager().isBanned(uuid)) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("this.player.is.already.banned"));
|
||||
return;
|
||||
}
|
||||
|
||||
Player pl = SimpleClans.getInstance().getServer().getPlayer(uuid);
|
||||
|
||||
if (pl != null) {
|
||||
ChatBlock.sendMessage(pl, ChatColor.AQUA + plugin.getLang("you.banned"));
|
||||
}
|
||||
|
||||
plugin.getClanManager().ban(uuid);
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("player.added.to.banned.list"));
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@ import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
|
||||
* @author phaed
|
||||
*/
|
||||
public class DemoteCommand {
|
||||
|
||||
public DemoteCommand() {
|
||||
}
|
||||
|
||||
@@ -29,6 +30,40 @@ public class DemoteCommand {
|
||||
public void execute(Player player, String[] arg) {
|
||||
SimpleClans plugin = SimpleClans.getInstance();
|
||||
|
||||
if (arg.length != 1) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.demote.leader"), plugin.getSettingsManager().getCommandClan()));
|
||||
return;
|
||||
}
|
||||
|
||||
String demotedName = arg[0];
|
||||
|
||||
if (demotedName == null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.matched"));
|
||||
return;
|
||||
}
|
||||
ClanPlayer toDemote;
|
||||
UUID uuid = UUIDMigration.getForcedPlayerUUID(demotedName);
|
||||
toDemote = plugin.getClanManager().getAnyClanPlayer(uuid);
|
||||
|
||||
if (plugin.getPermissionsManager().has(player, "simpleclans.admin.demote")) {
|
||||
if (!toDemote.isLeader()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("player.is.not.a.leader.of.any.clan"));
|
||||
return;
|
||||
}
|
||||
final Clan clan = toDemote.getClan();
|
||||
|
||||
if (clan.getLeaders().size() == 1) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("you.cannot.demote.the.last.leader"));
|
||||
return;
|
||||
}
|
||||
|
||||
clan.demote(toDemote.getUniqueId());
|
||||
|
||||
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("demoted.back.to.member"), Helper.capitalize(demotedName)));
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("player.successfully.demoted"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.demote")) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
|
||||
return;
|
||||
@@ -46,61 +81,25 @@ public class DemoteCommand {
|
||||
if (!clan.isLeader(player)) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
|
||||
return;
|
||||
}
|
||||
if (arg.length != 1) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.demote.leader"), plugin.getSettingsManager().getCommandClan()));
|
||||
}
|
||||
|
||||
if (!clan.enoughLeadersOnlineToDemote(toDemote)) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.enough.leaders.online.to.vote.on.demotion"));
|
||||
return;
|
||||
}
|
||||
|
||||
String demotedName = arg[0];
|
||||
boolean allOtherLeadersOnline;
|
||||
|
||||
if (demotedName == null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.matched"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
UUID PlayerUniqueId = UUIDMigration.getForcedPlayerUUID(demotedName);
|
||||
if (PlayerUniqueId == null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.matched"));
|
||||
return;
|
||||
}
|
||||
allOtherLeadersOnline = clan.allOtherLeadersOnline(PlayerUniqueId);
|
||||
} else {
|
||||
allOtherLeadersOnline = clan.allOtherLeadersOnline(demotedName);
|
||||
}
|
||||
|
||||
if (!allOtherLeadersOnline) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("leaders.must.be.online.to.vote.on.demotion"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
UUID PlayerUniqueId = UUIDMigration.getForcedPlayerUUID(demotedName);
|
||||
if (!clan.isLeader(PlayerUniqueId)) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("player.is.not.a.leader.of.your.clan"));
|
||||
return;
|
||||
}
|
||||
if (clan.getLeaders().size() != 1 && plugin.getSettingsManager().isConfirmationForDemote()) {
|
||||
plugin.getRequestManager().addDemoteRequest(cp, demotedName, clan);
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("demotion.vote.has.been.requested.from.all.leaders"));
|
||||
return;
|
||||
}
|
||||
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("demoted.back.to.member"), Helper.capitalize(demotedName)));
|
||||
clan.demote(PlayerUniqueId);
|
||||
} else {
|
||||
if (!clan.isLeader(demotedName)) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("player.is.not.a.leader.of.your.clan"));
|
||||
return;
|
||||
}
|
||||
if (clan.getLeaders().size() != 1 && plugin.getSettingsManager().isConfirmationForDemote()) {
|
||||
plugin.getRequestManager().addDemoteRequest(cp, demotedName, clan);
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("demotion.vote.has.been.requested.from.all.leaders"));
|
||||
return;
|
||||
}
|
||||
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("demoted.back.to.member"), Helper.capitalize(demotedName)));
|
||||
clan.demote(demotedName);
|
||||
}
|
||||
if (!clan.isLeader(uuid)) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("player.is.not.a.leader.of.your.clan"));
|
||||
return;
|
||||
}
|
||||
if (clan.getLeaders().size() != 1 && plugin.getSettingsManager().isConfirmationForDemote()) {
|
||||
plugin.getRequestManager().addDemoteRequest(cp, demotedName, clan);
|
||||
ChatBlock.sendMessage(player,
|
||||
ChatColor.AQUA + plugin.getLang("demotion.vote.has.been.requested.from.all.leaders"));
|
||||
return;
|
||||
}
|
||||
clan.addBb(player.getName(), ChatColor.AQUA
|
||||
+ MessageFormat.format(plugin.getLang("demoted.back.to.member"), Helper.capitalize(demotedName)));
|
||||
clan.demote(uuid);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Helper;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.SettingsManager;
|
||||
|
||||
public class DescriptionCommand {
|
||||
|
||||
/**
|
||||
* Execute the command
|
||||
*
|
||||
* @param player
|
||||
* @param args
|
||||
*/
|
||||
public void execute(Player player, String[] args) {
|
||||
final SimpleClans plugin = SimpleClans.getInstance();
|
||||
final SettingsManager sm = plugin.getSettingsManager();
|
||||
|
||||
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.description")) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
|
||||
return;
|
||||
}
|
||||
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
if (cp == null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
|
||||
return;
|
||||
}
|
||||
|
||||
Clan clan = cp.getClan();
|
||||
|
||||
if (!clan.isVerified()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
|
||||
return;
|
||||
}
|
||||
if (!clan.isLeader(player)) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.length < 1) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.description"), plugin.getSettingsManager().getCommandClan()));
|
||||
return;
|
||||
}
|
||||
|
||||
String description = Helper.toMessage(args);
|
||||
if (description.length() < sm.getClanMinDescriptionLength()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("your.clan.description.must.be.longer.than"), sm.getClanMinDescriptionLength()));
|
||||
return;
|
||||
}
|
||||
if (description.length() > sm.getClanMaxDescriptionLength()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("your.clan.description.cannot.be.longer.than"), sm.getClanMaxDescriptionLength()));
|
||||
return;
|
||||
}
|
||||
|
||||
clan.setDescription(description);
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("description.changed"));
|
||||
plugin.getStorageManager().updateClanAsync(clan);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author roinujnosde
|
||||
*/
|
||||
public class FeeCommand {
|
||||
|
||||
/**
|
||||
* Executes the command
|
||||
*
|
||||
* @param player
|
||||
* @param args
|
||||
*/
|
||||
public void execute(Player player, String[] args) {
|
||||
SimpleClans plugin = SimpleClans.getInstance();
|
||||
if (!plugin.getSettingsManager().isMemberFee()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.length >= 1) {
|
||||
ClanPlayer cp = plugin.getClanManager().getAnyClanPlayer(player.getUniqueId());
|
||||
Clan clan = cp.getClan();
|
||||
if (!clan.isVerified()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (args[0].equalsIgnoreCase("check")) {
|
||||
if (!plugin.getPermissionsManager().has(player, "simpleclans.member.fee-check")) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
|
||||
return;
|
||||
}
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA
|
||||
+ MessageFormat.format(
|
||||
plugin.getLang("the.fee.is.0.and.its.current.value.is.1"),
|
||||
clan.isMemberFeeEnabled() ? plugin.getLang("fee.enabled") : plugin.getLang("fee.disabled"),
|
||||
clan.getMemberFee()
|
||||
));
|
||||
return;
|
||||
}
|
||||
if (args.length == 2 && args[0].equalsIgnoreCase("set")) {
|
||||
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.fee")) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
|
||||
return;
|
||||
}
|
||||
if (!cp.isLeader()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
|
||||
return;
|
||||
}
|
||||
double newFee = 0;
|
||||
try {
|
||||
newFee = Double.parseDouble(args[1]);
|
||||
} catch (NumberFormatException ignored) {
|
||||
player.sendMessage(ChatColor.RED + plugin.getLang("invalid.fee"));
|
||||
return;
|
||||
}
|
||||
double maxFee = plugin.getSettingsManager().getMaxMemberFee();
|
||||
if (newFee > maxFee) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED
|
||||
+ MessageFormat.format(plugin.getLang("max.fee.allowed.is.0"), maxFee));
|
||||
return;
|
||||
}
|
||||
|
||||
if (plugin.getClanManager().purchaseMemberFeeSet(player)) {
|
||||
clan.setMemberFee(newFee);
|
||||
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("bb.fee.set"), newFee));
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("fee.set"));
|
||||
plugin.getStorageManager().updateClanAsync(clan);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
ChatBlock.sendMessage(player, ChatColor.RED
|
||||
+ MessageFormat.format(plugin.getLang("usage.fee"), plugin.getSettingsManager().getCommandClan()));
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,17 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
|
||||
import java.text.MessageFormat;
|
||||
import java.time.Instant;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Helper;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
|
||||
/**
|
||||
* @author phaed
|
||||
@@ -60,17 +66,31 @@ public class InviteCommand {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("you.cannot.invite.yourself"));
|
||||
return;
|
||||
}
|
||||
if (plugin.getSettingsManager().isBanned(player.getName())) {
|
||||
if (plugin.getSettingsManager().isBanned(player.getUniqueId())) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("this.player.is.banned.from.using.clan.commands"));
|
||||
return;
|
||||
}
|
||||
|
||||
ClanPlayer cpInv = plugin.getClanManager().getClanPlayer(invited);
|
||||
ClanPlayer cpInv = plugin.getClanManager().getAnyClanPlayer(invited.getUniqueId());
|
||||
|
||||
if (cpInv != null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("the.player.is.already.member.of.another.clan"));
|
||||
return;
|
||||
if (cpInv.getClan() != null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("the.player.is.already.member.of.another.clan"));
|
||||
return;
|
||||
}
|
||||
if (plugin.getSettingsManager().isRejoinCooldown()) {
|
||||
Long resign = cpInv.getResignTime(clan.getTag());
|
||||
if (resign != null) {
|
||||
long timePassed = Instant.ofEpochMilli(resign).until(Instant.now(), ChronoUnit.MINUTES);
|
||||
int cooldown = plugin.getSettingsManager().getRejoinCooldown();
|
||||
if (timePassed < cooldown) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("the.player.must.wait.0.before.joining.your.clan.again"), cooldown - timePassed));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!plugin.getClanManager().purchaseInvite(player)) {
|
||||
return;
|
||||
}
|
||||
@@ -78,7 +98,7 @@ public class InviteCommand {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("the.clan.members.reached.limit"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
plugin.getRequestManager().addInviteRequest(cp, invited.getName(), clan);
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + MessageFormat.format(plugin.getLang("has.been.asked.to.join"), Helper.capitalize(invited.getName()), clan.getName()));
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.UUID;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
|
||||
|
||||
@@ -51,13 +52,12 @@ public class KickCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
String kicked = arg[0];
|
||||
|
||||
UUID kicked = UUIDMigration.getForcedPlayerUUID(arg[0]);
|
||||
if (kicked == null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.matched"));
|
||||
return;
|
||||
}
|
||||
if (kicked.equalsIgnoreCase(player.getName())) {
|
||||
if (kicked.equals(player.getUniqueId())) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("you.cannot.kick.yourself"));
|
||||
return;
|
||||
}
|
||||
@@ -70,12 +70,7 @@ public class KickCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("has.been.kicked.by"), Helper.capitalize(kicked), player.getName()));
|
||||
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
clan.removePlayerFromClan(UUIDMigration.getForcedPlayerUUID(kicked));
|
||||
} else {
|
||||
clan.removePlayerFromClan(kicked);
|
||||
}
|
||||
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("has.been.kicked.by"), Helper.capitalize(arg[0]), player.getName()));
|
||||
clan.removePlayerFromClan(kicked);
|
||||
}
|
||||
}
|
||||
@@ -1,90 +1,103 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.*;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
public class KillsCommand {
|
||||
public KillsCommand() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the command
|
||||
*
|
||||
* @param player
|
||||
* @param arg
|
||||
*/
|
||||
public void execute(Player player, String[] arg) {
|
||||
SimpleClans plugin = SimpleClans.getInstance();
|
||||
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
|
||||
String subColor = plugin.getSettingsManager().getPageSubTitleColor();
|
||||
|
||||
if (!plugin.getPermissionsManager().has(player, "simpleclans.member.kills")) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
|
||||
return;
|
||||
}
|
||||
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
|
||||
if (cp == null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
|
||||
return;
|
||||
}
|
||||
|
||||
Clan clan = cp.getClan();
|
||||
|
||||
if (!clan.isVerified()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
|
||||
return;
|
||||
}
|
||||
if (!cp.isTrusted()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("only.trusted.players.can.access.clan.stats"));
|
||||
return;
|
||||
}
|
||||
|
||||
String polledPlayerName = player.getName();
|
||||
|
||||
if (arg.length == 1) {
|
||||
polledPlayerName = arg[0];
|
||||
}
|
||||
|
||||
ChatBlock chatBlock = new ChatBlock();
|
||||
chatBlock.setFlexibility(true, false);
|
||||
chatBlock.setAlignment("l", "c");
|
||||
chatBlock.addRow(" " + headColor + plugin.getLang("victim"), plugin.getLang("killcount"));
|
||||
|
||||
Map<String, Integer> killsPerPlayerUnordered = plugin.getStorageManager().getKillsPerPlayer(polledPlayerName);
|
||||
|
||||
if (killsPerPlayerUnordered.isEmpty()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("nokillsfound"));
|
||||
return;
|
||||
}
|
||||
|
||||
Map<String, Integer> killsPerPlayer = Helper.sortByValue(killsPerPlayerUnordered);
|
||||
|
||||
for (Entry<String, Integer> playerKills : killsPerPlayer.entrySet()) {
|
||||
int count = playerKills.getValue();
|
||||
chatBlock.addRow(" " + playerKills.getKey(), ChatColor.AQUA + "" + count);
|
||||
}
|
||||
|
||||
ChatBlock.saySingle(player, plugin.getSettingsManager().getPageClanNameColor() + Helper.capitalize(polledPlayerName) + subColor + " " + plugin.getLang("kills") + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
|
||||
ChatBlock.sendBlank(player);
|
||||
|
||||
boolean more = chatBlock.sendBlock(player, plugin.getSettingsManager().getPageSize());
|
||||
|
||||
if (more) {
|
||||
plugin.getStorageManager().addChatBlock(player, chatBlock);
|
||||
ChatBlock.sendBlank(player);
|
||||
ChatBlock.sendMessage(player, headColor + MessageFormat.format(plugin.getLang("view.next.page"), plugin.getSettingsManager().getCommandMore()));
|
||||
}
|
||||
|
||||
ChatBlock.sendBlank(player);
|
||||
}
|
||||
}
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.StorageManager.DataCallback;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
public class KillsCommand {
|
||||
public KillsCommand() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the command
|
||||
*
|
||||
* @param player
|
||||
* @param arg
|
||||
*/
|
||||
public void execute(Player player, String[] arg) {
|
||||
SimpleClans plugin = SimpleClans.getInstance();
|
||||
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
|
||||
String subColor = plugin.getSettingsManager().getPageSubTitleColor();
|
||||
|
||||
if (!plugin.getPermissionsManager().has(player, "simpleclans.member.kills")) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
|
||||
return;
|
||||
}
|
||||
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
|
||||
if (cp == null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
|
||||
return;
|
||||
}
|
||||
|
||||
Clan clan = cp.getClan();
|
||||
|
||||
if (!clan.isVerified()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
|
||||
return;
|
||||
}
|
||||
if (!cp.isTrusted()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("only.trusted.players.can.access.clan.stats"));
|
||||
return;
|
||||
}
|
||||
|
||||
String polledPlayerName = player.getName();
|
||||
|
||||
if (arg.length == 1) {
|
||||
polledPlayerName = arg[0];
|
||||
}
|
||||
|
||||
final String name = polledPlayerName;
|
||||
|
||||
plugin.getStorageManager().getKillsPerPlayer(polledPlayerName, new DataCallback<Map<String, Integer>>() {
|
||||
@Override
|
||||
public void onResultReady(Map<String, Integer> data) {
|
||||
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
ChatBlock chatBlock = new ChatBlock();
|
||||
chatBlock.setFlexibility(true, false);
|
||||
chatBlock.setAlignment("l", "c");
|
||||
chatBlock.addRow(" " + headColor + plugin.getLang("victim"), plugin.getLang("killcount"));
|
||||
|
||||
if (data.isEmpty()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("nokillsfound"));
|
||||
return;
|
||||
}
|
||||
|
||||
Map<String, Integer> killsPerPlayer = Helper.sortByValue(data);
|
||||
|
||||
for (Entry<String, Integer> playerKills : killsPerPlayer.entrySet()) {
|
||||
int count = playerKills.getValue();
|
||||
chatBlock.addRow(" " + playerKills.getKey(), ChatColor.AQUA + "" + count);
|
||||
}
|
||||
|
||||
ChatBlock.saySingle(player, plugin.getSettingsManager().getPageClanNameColor() + Helper.capitalize(name) + subColor + " " + plugin.getLang("kills") + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
|
||||
ChatBlock.sendBlank(player);
|
||||
|
||||
boolean more = chatBlock.sendBlock(player, plugin.getSettingsManager().getPageSize());
|
||||
|
||||
if (more) {
|
||||
plugin.getStorageManager().addChatBlock(player, chatBlock);
|
||||
ChatBlock.sendBlank(player);
|
||||
ChatBlock.sendMessage(player, headColor + MessageFormat.format(plugin.getLang("view.next.page"), plugin.getSettingsManager().getCommandMore()));
|
||||
}
|
||||
|
||||
ChatBlock.sendBlank(player);
|
||||
}
|
||||
}.runTask(plugin);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,92 +1,137 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Helper;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.MessageFormat;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author phaed
|
||||
*/
|
||||
public class ListCommand {
|
||||
public ListCommand() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the command
|
||||
*
|
||||
* @param player
|
||||
* @param arg
|
||||
*/
|
||||
public void execute(Player player, String[] arg) {
|
||||
SimpleClans plugin = SimpleClans.getInstance();
|
||||
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
|
||||
String subColor = plugin.getSettingsManager().getPageSubTitleColor();
|
||||
NumberFormat formatter = new DecimalFormat("#.#");
|
||||
|
||||
if (!plugin.getPermissionsManager().has(player, "simpleclans.anyone.list")) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
|
||||
return;
|
||||
}
|
||||
if (arg.length != 0) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.list"), plugin.getSettingsManager().getCommandClan()));
|
||||
return;
|
||||
}
|
||||
|
||||
List<Clan> clans = plugin.getClanManager().getClans();
|
||||
plugin.getClanManager().sortClansByKDR(clans);
|
||||
|
||||
if (clans.isEmpty()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.clans.have.been.created"));
|
||||
return;
|
||||
}
|
||||
|
||||
ChatBlock chatBlock = new ChatBlock();
|
||||
ChatBlock.sendBlank(player);
|
||||
ChatBlock.saySingle(player, plugin.getSettingsManager().getServerName() + subColor + " " + plugin.getLang("clans.lower") + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
|
||||
ChatBlock.sendBlank(player);
|
||||
ChatBlock.sendMessage(player, headColor + plugin.getLang("total.clans") + " " + subColor + clans.size());
|
||||
ChatBlock.sendBlank(player);
|
||||
chatBlock.setAlignment("c", "l", "c", "c");
|
||||
chatBlock.setFlexibility(false, true, false, false);
|
||||
chatBlock.addRow(" " + headColor + plugin.getLang("rank"), plugin.getLang("name"), plugin.getLang("kdr"), plugin.getLang("members"));
|
||||
|
||||
int rank = 1;
|
||||
|
||||
for (Clan clan : clans) {
|
||||
if (!plugin.getSettingsManager().isShowUnverifiedOnList() && !clan.isVerified()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String tag = plugin.getSettingsManager().getClanChatBracketColor() + plugin.getSettingsManager().getClanChatTagBracketLeft() + plugin.getSettingsManager().getTagDefaultColor() + clan.getColorTag() + plugin.getSettingsManager().getClanChatBracketColor() + plugin.getSettingsManager().getClanChatTagBracketRight();
|
||||
String name = (clan.isVerified() ? plugin.getSettingsManager().getPageClanNameColor() : ChatColor.GRAY) + clan.getName();
|
||||
String fullname = tag + " " + name;
|
||||
String size = ChatColor.WHITE + "" + clan.getSize();
|
||||
String kdr = clan.isVerified() ? ChatColor.YELLOW + "" + formatter.format(clan.getTotalKDR()) : "";
|
||||
|
||||
chatBlock.addRow(" " + rank, fullname, kdr, size);
|
||||
rank++;
|
||||
}
|
||||
|
||||
boolean more = chatBlock.sendBlock(player, plugin.getSettingsManager().getPageSize());
|
||||
|
||||
if (more) {
|
||||
plugin.getStorageManager().addChatBlock(player, chatBlock);
|
||||
ChatBlock.sendBlank(player);
|
||||
ChatBlock.sendMessage(player, headColor + MessageFormat.format(plugin.getLang("view.next.page"), plugin.getSettingsManager().getCommandMore()));
|
||||
}
|
||||
|
||||
ChatBlock.sendBlank(player);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Helper;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.ClanManager;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.SettingsManager;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.MessageFormat;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author phaed
|
||||
*/
|
||||
public class ListCommand {
|
||||
public ListCommand() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the command
|
||||
*
|
||||
* @param player
|
||||
* @param args
|
||||
*/
|
||||
public void execute(Player player, String[] args) {
|
||||
SimpleClans plugin = SimpleClans.getInstance();
|
||||
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
|
||||
String subColor = plugin.getSettingsManager().getPageSubTitleColor();
|
||||
NumberFormat formatter = new DecimalFormat("#.#");
|
||||
|
||||
if (!plugin.getPermissionsManager().has(player, "simpleclans.anyone.list")) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
|
||||
return;
|
||||
}
|
||||
if (args.length > 2) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.list"), plugin.getSettingsManager().getCommandClan()));
|
||||
return;
|
||||
}
|
||||
List<Clan> clans = plugin.getClanManager().getClans();
|
||||
|
||||
sort(plugin, clans, args);
|
||||
|
||||
if (clans.isEmpty()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.clans.have.been.created"));
|
||||
return;
|
||||
}
|
||||
|
||||
ChatBlock chatBlock = new ChatBlock();
|
||||
ChatBlock.sendBlank(player);
|
||||
ChatBlock.saySingle(player, plugin.getSettingsManager().getServerName() + subColor + " " + plugin.getLang("clans.lower") + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
|
||||
ChatBlock.sendBlank(player);
|
||||
ChatBlock.sendMessage(player, headColor + plugin.getLang("total.clans") + " " + subColor + clans.size());
|
||||
ChatBlock.sendBlank(player);
|
||||
chatBlock.setAlignment("c", "l", "c", "c");
|
||||
chatBlock.setFlexibility(false, true, false, false);
|
||||
chatBlock.addRow(" " + headColor + plugin.getLang("rank"), plugin.getLang("name"), plugin.getLang("kdr"), plugin.getLang("members"));
|
||||
|
||||
int rank = 1;
|
||||
|
||||
for (Clan clan : clans) {
|
||||
if (!plugin.getSettingsManager().isShowUnverifiedOnList() && !clan.isVerified()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String tag = plugin.getSettingsManager().getClanChatBracketColor() + plugin.getSettingsManager().getClanChatTagBracketLeft() + plugin.getSettingsManager().getTagDefaultColor() + clan.getColorTag() + plugin.getSettingsManager().getClanChatBracketColor() + plugin.getSettingsManager().getClanChatTagBracketRight();
|
||||
String name = (clan.isVerified() ? plugin.getSettingsManager().getPageClanNameColor() : ChatColor.GRAY) + clan.getName();
|
||||
String fullname = tag + " " + name;
|
||||
String size = ChatColor.WHITE + "" + clan.getSize();
|
||||
String kdr = clan.isVerified() ? ChatColor.YELLOW + "" + formatter.format(clan.getTotalKDR()) : "";
|
||||
|
||||
chatBlock.addRow(" " + rank, fullname, kdr, size);
|
||||
rank++;
|
||||
}
|
||||
|
||||
boolean more = chatBlock.sendBlock(player, plugin.getSettingsManager().getPageSize());
|
||||
|
||||
if (more) {
|
||||
plugin.getStorageManager().addChatBlock(player, chatBlock);
|
||||
ChatBlock.sendBlank(player);
|
||||
ChatBlock.sendMessage(player, headColor + MessageFormat.format(plugin.getLang("view.next.page"), plugin.getSettingsManager().getCommandMore()));
|
||||
}
|
||||
|
||||
ChatBlock.sendBlank(player);
|
||||
}
|
||||
|
||||
private void sort(SimpleClans plugin, List<Clan> clans, String[] args) {
|
||||
SettingsManager sm = plugin.getSettingsManager();
|
||||
String type = sm.getListDefault();
|
||||
String order = null;
|
||||
if (args.length > 0) {
|
||||
type = args[0];
|
||||
}
|
||||
String asc = sm.getListAsc();
|
||||
String desc = sm.getListDesc();
|
||||
if (args.length == 2) {
|
||||
order = args[1];
|
||||
if (!order.equalsIgnoreCase(asc) && !order.equalsIgnoreCase(desc)) {
|
||||
order = null;
|
||||
}
|
||||
}
|
||||
ClanManager cm = plugin.getClanManager();
|
||||
//in case the default type is invalid
|
||||
cm.sortClansByKDR(clans);
|
||||
|
||||
if (type.equalsIgnoreCase(sm.getListActive())) {
|
||||
cm.sortClansByActive(clans, asc.equalsIgnoreCase(order));
|
||||
}
|
||||
if (type.equalsIgnoreCase(sm.getListFounded())) {
|
||||
if (order == null) {
|
||||
order = asc;
|
||||
}
|
||||
cm.sortClansByFounded(clans, asc.equalsIgnoreCase(order));
|
||||
}
|
||||
if (type.equalsIgnoreCase(sm.getListKdr())) {
|
||||
cm.sortClansByKDR(clans, asc.equalsIgnoreCase(order));
|
||||
}
|
||||
if (type.equalsIgnoreCase(sm.getListName())) {
|
||||
if (order == null) {
|
||||
order = asc;
|
||||
}
|
||||
cm.sortClansByName(clans, asc.equalsIgnoreCase(order));
|
||||
}
|
||||
if (type.equalsIgnoreCase(sm.getListSize())) {
|
||||
cm.sortClansBySize(clans, asc.equalsIgnoreCase(order));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,111 +1,119 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.*;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.MessageFormat;
|
||||
import java.text.NumberFormat;
|
||||
|
||||
/**
|
||||
* @author phaed
|
||||
*/
|
||||
public class LookupCommand {
|
||||
public LookupCommand() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the command
|
||||
*
|
||||
* @param player
|
||||
* @param arg
|
||||
*/
|
||||
public void execute(Player player, String[] arg) {
|
||||
SimpleClans plugin = SimpleClans.getInstance();
|
||||
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
|
||||
String subColor = plugin.getSettingsManager().getPageSubTitleColor();
|
||||
NumberFormat formatter = new DecimalFormat("#.#");
|
||||
|
||||
String playerName = null;
|
||||
|
||||
if (arg.length == 0) {
|
||||
if (!plugin.getPermissionsManager().has(player, "simpleclans.member.lookup")) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
|
||||
return;
|
||||
}
|
||||
playerName = player.getName();
|
||||
} else if (arg.length == 1) {
|
||||
if (!plugin.getPermissionsManager().has(player, "simpleclans.anyone.lookup")) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
|
||||
return;
|
||||
}
|
||||
playerName = arg[0];
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.lookup.tag"), plugin.getSettingsManager().getCommandClan()));
|
||||
return;
|
||||
}
|
||||
|
||||
ClanPlayer targetCp = plugin.getClanManager().getAnyClanPlayer(playerName);
|
||||
ClanPlayer myCp = plugin.getClanManager().getClanPlayer(player.getName());
|
||||
Clan myClan = myCp == null ? null : myCp.getClan();
|
||||
|
||||
if (targetCp != null) {
|
||||
Clan targetClan = targetCp.getClan();
|
||||
|
||||
ChatBlock.sendBlank(player);
|
||||
ChatBlock.saySingle(player, MessageFormat.format(plugin.getLang("s.player.info"), plugin.getSettingsManager().getPageClanNameColor() + targetCp.getName() + subColor) + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
|
||||
ChatBlock.sendBlank(player);
|
||||
|
||||
String clanName = ChatColor.WHITE + plugin.getLang("none");
|
||||
|
||||
if (targetClan != null) {
|
||||
clanName = plugin.getSettingsManager().getClanChatBracketColor() + plugin.getSettingsManager().getClanChatTagBracketLeft() + plugin.getSettingsManager().getTagDefaultColor() + targetClan.getColorTag() + plugin.getSettingsManager().getClanChatBracketColor() + plugin.getSettingsManager().getClanChatTagBracketRight() + " " + plugin.getSettingsManager().getPageClanNameColor() + targetClan.getName();
|
||||
}
|
||||
|
||||
String status = targetClan == null ? ChatColor.WHITE + plugin.getLang("free.agent") : (targetCp.isLeader() ? plugin.getSettingsManager().getPageLeaderColor() + plugin.getLang("leader") : (targetCp.isTrusted() ? plugin.getSettingsManager().getPageTrustedColor() + plugin.getLang("trusted") : plugin.getSettingsManager().getPageUnTrustedColor() + plugin.getLang("untrusted")));
|
||||
String rank = ChatColor.WHITE + "" + Helper.parseColors(targetCp.getRank());
|
||||
String joinDate = ChatColor.WHITE + "" + targetCp.getJoinDateString();
|
||||
String lastSeen = ChatColor.WHITE + "" + targetCp.getLastSeenString();
|
||||
String inactive = ChatColor.WHITE + "" + targetCp.getInactiveDays() + subColor + "/" + ChatColor.WHITE + plugin.getSettingsManager().getPurgePlayers() + " days";
|
||||
String rival = ChatColor.WHITE + "" + targetCp.getRivalKills();
|
||||
String neutral = ChatColor.WHITE + "" + targetCp.getNeutralKills();
|
||||
String civilian = ChatColor.WHITE + "" + targetCp.getCivilianKills();
|
||||
String deaths = ChatColor.WHITE + "" + targetCp.getDeaths();
|
||||
String kdr = ChatColor.YELLOW + "" + formatter.format(targetCp.getKDR());
|
||||
String pastClans = ChatColor.WHITE + "" + targetCp.getPastClansString(headColor + ", ");
|
||||
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("clan.0"), clanName));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("rank.0"), rank));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("status.0"), status));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("kdr.0"), kdr));
|
||||
ChatBlock.sendMessage(player, " " + subColor + plugin.getLang("kill.totals") + " " + headColor + "[" + plugin.getLang("rival") + ":" + rival + " " + headColor + "" + plugin.getLang("neutral") + ":" + neutral + " " + headColor + "" + plugin.getLang("civilian") + ":" + civilian + headColor + "]");
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("deaths.0"), deaths));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("join.date.0"), joinDate));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("last.seen.0"), lastSeen));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("past.clans.0"), pastClans));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("inactive.0"), inactive));
|
||||
|
||||
if (arg.length == 1 && !targetCp.equals(myCp)) {
|
||||
String killType = ChatColor.GRAY + plugin.getLang("neutral");
|
||||
|
||||
if (targetClan == null) {
|
||||
killType = ChatColor.DARK_GRAY + plugin.getLang("civilian");
|
||||
} else if (myClan != null && myClan.isRival(targetClan.getTag())) {
|
||||
killType = ChatColor.WHITE + plugin.getLang("rival");
|
||||
}
|
||||
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("kill.type.0"), killType));
|
||||
}
|
||||
|
||||
ChatBlock.sendBlank(player);
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.data.found"));
|
||||
|
||||
if (arg.length == 1 && myClan != null) {
|
||||
ChatBlock.sendBlank(player);
|
||||
ChatBlock.sendMessage(player, MessageFormat.format(plugin.getLang("kill.type.civilian"), ChatColor.DARK_GRAY));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.MessageFormat;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author phaed
|
||||
*/
|
||||
public class LookupCommand {
|
||||
public LookupCommand() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the command
|
||||
*
|
||||
* @param player
|
||||
* @param arg
|
||||
*/
|
||||
public void execute(Player player, String[] arg) {
|
||||
SimpleClans plugin = SimpleClans.getInstance();
|
||||
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
|
||||
String subColor = plugin.getSettingsManager().getPageSubTitleColor();
|
||||
NumberFormat formatter = new DecimalFormat("#.#");
|
||||
|
||||
String playerName = null;
|
||||
|
||||
if (arg.length == 0) {
|
||||
if (!plugin.getPermissionsManager().has(player, "simpleclans.member.lookup")) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
|
||||
return;
|
||||
}
|
||||
playerName = player.getName();
|
||||
} else if (arg.length == 1) {
|
||||
if (!plugin.getPermissionsManager().has(player, "simpleclans.anyone.lookup")) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
|
||||
return;
|
||||
}
|
||||
playerName = arg[0];
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.lookup.tag"), plugin.getSettingsManager().getCommandClan()));
|
||||
return;
|
||||
}
|
||||
|
||||
UUID targetUuid = UUIDMigration.getForcedPlayerUUID(playerName);
|
||||
if (targetUuid == null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.matched"));
|
||||
return;
|
||||
}
|
||||
ClanPlayer targetCp = plugin.getClanManager().getAnyClanPlayer(targetUuid);
|
||||
ClanPlayer myCp = plugin.getClanManager().getClanPlayer(player.getUniqueId());
|
||||
Clan myClan = myCp == null ? null : myCp.getClan();
|
||||
|
||||
if (targetCp != null) {
|
||||
Clan targetClan = targetCp.getClan();
|
||||
|
||||
ChatBlock.sendBlank(player);
|
||||
ChatBlock.saySingle(player, MessageFormat.format(plugin.getLang("s.player.info"), plugin.getSettingsManager().getPageClanNameColor() + targetCp.getName() + subColor) + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
|
||||
ChatBlock.sendBlank(player);
|
||||
|
||||
String clanName = ChatColor.WHITE + plugin.getLang("none");
|
||||
|
||||
if (targetClan != null) {
|
||||
clanName = plugin.getSettingsManager().getClanChatBracketColor() + plugin.getSettingsManager().getClanChatTagBracketLeft() + plugin.getSettingsManager().getTagDefaultColor() + targetClan.getColorTag() + plugin.getSettingsManager().getClanChatBracketColor() + plugin.getSettingsManager().getClanChatTagBracketRight() + " " + plugin.getSettingsManager().getPageClanNameColor() + targetClan.getName();
|
||||
}
|
||||
|
||||
String status = targetClan == null ? ChatColor.WHITE + plugin.getLang("free.agent") : (targetCp.isLeader() ? plugin.getSettingsManager().getPageLeaderColor() + plugin.getLang("leader") : (targetCp.isTrusted() ? plugin.getSettingsManager().getPageTrustedColor() + plugin.getLang("trusted") : plugin.getSettingsManager().getPageUnTrustedColor() + plugin.getLang("untrusted")));
|
||||
String rank = ChatColor.WHITE + "" + Helper.parseColors(targetCp.getRank());
|
||||
String joinDate = ChatColor.WHITE + "" + targetCp.getJoinDateString();
|
||||
String lastSeen = ChatColor.WHITE + "" + targetCp.getLastSeenString();
|
||||
String inactive = ChatColor.WHITE + "" + targetCp.getInactiveDays() + subColor + "/" + ChatColor.WHITE + plugin.getSettingsManager().getPurgePlayers() + " days";
|
||||
String rival = ChatColor.WHITE + "" + targetCp.getRivalKills();
|
||||
String neutral = ChatColor.WHITE + "" + targetCp.getNeutralKills();
|
||||
String civilian = ChatColor.WHITE + "" + targetCp.getCivilianKills();
|
||||
String deaths = ChatColor.WHITE + "" + targetCp.getDeaths();
|
||||
String kdr = ChatColor.YELLOW + "" + formatter.format(targetCp.getKDR());
|
||||
String pastClans = ChatColor.WHITE + "" + targetCp.getPastClansString(headColor + ", ");
|
||||
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("clan.0"), clanName));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("rank.0"), rank));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("status.0"), status));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("kdr.0"), kdr));
|
||||
ChatBlock.sendMessage(player, " " + subColor + plugin.getLang("kill.totals") + " " + headColor + "[" + plugin.getLang("rival") + ":" + rival + " " + headColor + "" + plugin.getLang("neutral") + ":" + neutral + " " + headColor + "" + plugin.getLang("civilian") + ":" + civilian + headColor + "]");
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("deaths.0"), deaths));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("join.date.0"), joinDate));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("last.seen.0"), lastSeen));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("past.clans.0"), pastClans));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("inactive.0"), inactive));
|
||||
|
||||
if (arg.length == 1 && !targetCp.equals(myCp)) {
|
||||
String killType = ChatColor.GRAY + plugin.getLang("neutral");
|
||||
|
||||
if (targetClan == null) {
|
||||
killType = ChatColor.DARK_GRAY + plugin.getLang("civilian");
|
||||
} else if (myClan != null && myClan.isRival(targetClan.getTag())) {
|
||||
killType = ChatColor.WHITE + plugin.getLang("rival");
|
||||
}
|
||||
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("kill.type.0"), killType));
|
||||
}
|
||||
|
||||
ChatBlock.sendBlank(player);
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.data.found"));
|
||||
|
||||
if (arg.length == 1 && myClan != null) {
|
||||
ChatBlock.sendBlank(player);
|
||||
ChatBlock.sendMessage(player, MessageFormat.format(plugin.getLang("kill.type.civilian"), ChatColor.DARK_GRAY));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -96,6 +96,12 @@ public class MenuCommand {
|
||||
if (isVerified && isTrusted && plugin.getPermissionsManager().has(player, "simpleclans.member.kills")) {
|
||||
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.killsplayer"), clanCommand, ChatColor.WHITE));
|
||||
}
|
||||
if (isVerified && plugin.getPermissionsManager().has(player, "simpleclans.member.fee-check")) {
|
||||
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.fee.check"), clanCommand, ChatColor.WHITE));
|
||||
}
|
||||
if (isVerified && isLeader && plugin.getPermissionsManager().has(player, "simpleclans.leader.fee")) {
|
||||
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.fee.set"), clanCommand, ChatColor.WHITE));
|
||||
}
|
||||
if (isVerified && isLeader && plugin.getPermissionsManager().has(player, "simpleclans.leader.ally")) {
|
||||
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.ally.add.remove.tag.1.add.remove.an.ally.clan"), clanCommand, ChatColor.WHITE));
|
||||
}
|
||||
@@ -129,6 +135,9 @@ public class MenuCommand {
|
||||
if (isVerified && isLeader && plugin.getPermissionsManager().has(player, "simpleclans.leader.modtag")) {
|
||||
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.modtag.tag.1.modify.the.clan.s.tag"), clanCommand, ChatColor.WHITE));
|
||||
}
|
||||
if (isVerified && isLeader && plugin.getPermissionsManager().has(player, "simpleclans.leader.description")) {
|
||||
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.description.description.1.modify.the.clan.s.description"), clanCommand, ChatColor.WHITE));
|
||||
}
|
||||
|
||||
String toggles = "";
|
||||
|
||||
@@ -139,6 +148,10 @@ public class MenuCommand {
|
||||
if (isVerified && isTrusted && plugin.getPermissionsManager().has(player, "simpleclans.member.tag-toggle")) {
|
||||
toggles += "tag/";
|
||||
}
|
||||
|
||||
if (isVerified && isLeader && plugin.getPermissionsManager().has(player, "simpleclans.leader.fee")) {
|
||||
toggles += "fee/";
|
||||
}
|
||||
|
||||
if (!toggles.isEmpty()) {
|
||||
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.toggle.command"), clanCommand, ChatColor.WHITE, Helper.stripTrailing(toggles, "/")));
|
||||
@@ -203,6 +216,12 @@ public class MenuCommand {
|
||||
if (plugin.getPermissionsManager().has(player, "simpleclans.mod.globalff")) {
|
||||
chatBlock.addRow(ChatColor.DARK_RED + " " + MessageFormat.format(plugin.getLang("0.globalff.allow.auto.1.set.global.friendly.fire"), clanCommand, ChatColor.WHITE));
|
||||
}
|
||||
if (plugin.getPermissionsManager().has(player, "simpleclans.admin.demote")) {
|
||||
chatBlock.addRow(ChatColor.DARK_RED + " " + MessageFormat.format(plugin.getLang("0.demote.leader.1.demote.a.leader.to.member"), clanCommand, ChatColor.WHITE));
|
||||
}
|
||||
if (plugin.getPermissionsManager().has(player, "simpleclans.admin.purge")) {
|
||||
chatBlock.addRow(ChatColor.DARK_RED + " " + MessageFormat.format(plugin.getLang("0.purge.player.1.purge.a.player"), clanCommand, ChatColor.WHITE));
|
||||
}
|
||||
if (plugin.getPermissionsManager().has(player, "simpleclans.admin.resetkdr")) {
|
||||
chatBlock.addRow(ChatColor.DARK_RED + " " + MessageFormat.format(plugin.getLang("0.resetkdr.1.resets.kdr"), clanCommand, ChatColor.WHITE));
|
||||
}
|
||||
@@ -244,6 +263,7 @@ public class MenuCommand {
|
||||
|
||||
ChatBlock chatBlock = new ChatBlock();
|
||||
|
||||
chatBlock.addRow(ChatColor.DARK_RED + " " + MessageFormat.format(plugin.getLang("0.purge.player.1.purge.a.player"), clanCommand, ChatColor.WHITE));
|
||||
chatBlock.addRow(ChatColor.DARK_RED + " " + MessageFormat.format(plugin.getLang("0.verify.tag.1.verify.an.unverified.clan"), clanCommand, ChatColor.WHITE));
|
||||
chatBlock.addRow(ChatColor.DARK_RED + " " + MessageFormat.format(plugin.getLang("0.reload.1.reload.configuration"), clanCommand, ChatColor.WHITE));
|
||||
|
||||
|
||||
+106
-93
@@ -1,93 +1,106 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.*;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
public class MostKilledCommand {
|
||||
public MostKilledCommand() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the command
|
||||
*
|
||||
* @param player
|
||||
* @param arg
|
||||
*/
|
||||
public void execute(Player player, String[] arg) {
|
||||
SimpleClans plugin = SimpleClans.getInstance();
|
||||
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
|
||||
String subColor = plugin.getSettingsManager().getPageSubTitleColor();
|
||||
|
||||
if (!plugin.getPermissionsManager().has(player, "simpleclans.mod.mostkilled")) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
|
||||
return;
|
||||
}
|
||||
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
|
||||
if (cp == null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
|
||||
return;
|
||||
}
|
||||
|
||||
Clan clan = cp.getClan();
|
||||
|
||||
if (!clan.isVerified()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
|
||||
return;
|
||||
}
|
||||
if (!cp.isTrusted()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("only.trusted.players.can.access.clan.stats"));
|
||||
return;
|
||||
}
|
||||
|
||||
ChatBlock chatBlock = new ChatBlock();
|
||||
chatBlock.setFlexibility(true, false, false);
|
||||
chatBlock.setAlignment("l", "c", "l");
|
||||
chatBlock.addRow(" " + headColor + plugin.getLang("victim"), headColor + plugin.getLang("killcount"), headColor + plugin.getLang("attacker"));
|
||||
|
||||
Map<String, Integer> killsPerPlayerUnordered = plugin.getStorageManager().getMostKilled();
|
||||
|
||||
if (killsPerPlayerUnordered.isEmpty()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("nokillsfound"));
|
||||
return;
|
||||
}
|
||||
|
||||
Map<String, Integer> killsPerPlayer = Helper.sortByValue(killsPerPlayerUnordered);
|
||||
|
||||
for (Entry<String, Integer> attackerVictim : killsPerPlayer.entrySet()) {
|
||||
String[] split = attackerVictim.getKey().split(" ");
|
||||
|
||||
if (split.length < 2) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int count = attackerVictim.getValue();
|
||||
String attacker = split[0];
|
||||
String victim = split[1];
|
||||
|
||||
chatBlock.addRow(" " + ChatColor.WHITE + victim, ChatColor.AQUA + "" + count, ChatColor.YELLOW + attacker);
|
||||
}
|
||||
|
||||
ChatBlock.saySingle(player, plugin.getSettingsManager().getServerName() + subColor + " " + plugin.getLang("mostkilled") + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
|
||||
ChatBlock.sendBlank(player);
|
||||
|
||||
boolean more = chatBlock.sendBlock(player, plugin.getSettingsManager().getPageSize());
|
||||
|
||||
if (more) {
|
||||
plugin.getStorageManager().addChatBlock(player, chatBlock);
|
||||
ChatBlock.sendBlank(player);
|
||||
ChatBlock.sendMessage(player, headColor + MessageFormat.format(plugin.getLang("view.next.page"), plugin.getSettingsManager().getCommandMore()));
|
||||
}
|
||||
|
||||
ChatBlock.sendBlank(player);
|
||||
}
|
||||
}
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.StorageManager.DataCallback;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
public class MostKilledCommand {
|
||||
public MostKilledCommand() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the command
|
||||
*
|
||||
* @param player
|
||||
* @param arg
|
||||
*/
|
||||
public void execute(Player player, String[] arg) {
|
||||
SimpleClans plugin = SimpleClans.getInstance();
|
||||
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
|
||||
String subColor = plugin.getSettingsManager().getPageSubTitleColor();
|
||||
|
||||
if (!plugin.getPermissionsManager().has(player, "simpleclans.mod.mostkilled")) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
|
||||
return;
|
||||
}
|
||||
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
|
||||
if (cp == null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
|
||||
return;
|
||||
}
|
||||
|
||||
Clan clan = cp.getClan();
|
||||
|
||||
if (!clan.isVerified()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
|
||||
return;
|
||||
}
|
||||
if (!cp.isTrusted()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("only.trusted.players.can.access.clan.stats"));
|
||||
return;
|
||||
}
|
||||
|
||||
plugin.getStorageManager().getMostKilled(new DataCallback<Map<String, Integer>>() {
|
||||
|
||||
@Override
|
||||
public void onResultReady(Map<String, Integer> data) {
|
||||
new BukkitRunnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
ChatBlock chatBlock = new ChatBlock();
|
||||
chatBlock.setFlexibility(true, false, false);
|
||||
chatBlock.setAlignment("l", "c", "l");
|
||||
chatBlock.addRow(" " + headColor + plugin.getLang("victim"), headColor + plugin.getLang("killcount"), headColor + plugin.getLang("attacker"));
|
||||
|
||||
if (data.isEmpty()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("nokillsfound"));
|
||||
return;
|
||||
}
|
||||
Map<String, Integer> killsPerPlayer = Helper.sortByValue(data);
|
||||
|
||||
for (Entry<String, Integer> attackerVictim : killsPerPlayer.entrySet()) {
|
||||
String[] split = attackerVictim.getKey().split(" ");
|
||||
|
||||
if (split.length < 2) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int count = attackerVictim.getValue();
|
||||
String attacker = split[0];
|
||||
String victim = split[1];
|
||||
|
||||
chatBlock.addRow(" " + ChatColor.WHITE + victim, ChatColor.AQUA + "" + count, ChatColor.YELLOW + attacker);
|
||||
}
|
||||
|
||||
ChatBlock.saySingle(player, plugin.getSettingsManager().getServerName() + subColor + " " + plugin.getLang("mostkilled") + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
|
||||
ChatBlock.sendBlank(player);
|
||||
|
||||
boolean more = chatBlock.sendBlock(player, plugin.getSettingsManager().getPageSize());
|
||||
|
||||
if (more) {
|
||||
plugin.getStorageManager().addChatBlock(player, chatBlock);
|
||||
ChatBlock.sendBlank(player);
|
||||
ChatBlock.sendMessage(player, headColor + MessageFormat.format(plugin.getLang("view.next.page"), plugin.getSettingsManager().getCommandMore()));
|
||||
}
|
||||
|
||||
ChatBlock.sendBlank(player);
|
||||
|
||||
}
|
||||
}.runTask(plugin);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
@@ -59,12 +59,7 @@ public class PlaceCommand {
|
||||
oldClan.disband();
|
||||
} else {
|
||||
oldClan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("0.has.resigned"), Helper.capitalize(player.getName())));
|
||||
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
oldClan.removePlayerFromClan(player.getUniqueId());
|
||||
} else {
|
||||
oldClan.removePlayerFromClan(player.getName());
|
||||
}
|
||||
oldClan.removePlayerFromClan(player.getUniqueId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+106
-101
@@ -1,101 +1,106 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.*;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.MessageFormat;
|
||||
import java.text.NumberFormat;
|
||||
|
||||
/**
|
||||
* @author phaed
|
||||
*/
|
||||
public class ProfileCommand {
|
||||
public ProfileCommand() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the command
|
||||
*
|
||||
* @param player
|
||||
* @param arg
|
||||
*/
|
||||
public void execute(Player player, String[] arg) {
|
||||
SimpleClans plugin = SimpleClans.getInstance();
|
||||
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
|
||||
String subColor = plugin.getSettingsManager().getPageSubTitleColor();
|
||||
NumberFormat formatter = new DecimalFormat("#.#");
|
||||
|
||||
Clan clan = null;
|
||||
|
||||
if (arg.length == 0) {
|
||||
if (plugin.getPermissionsManager().has(player, "simpleclans.member.profile")) {
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
|
||||
if (cp == null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
|
||||
} else {
|
||||
if (cp.getClan().isVerified()) {
|
||||
clan = cp.getClan();
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
|
||||
}
|
||||
} else if (arg.length == 1) {
|
||||
if (plugin.getPermissionsManager().has(player, "simpleclans.anyone.profile")) {
|
||||
clan = plugin.getClanManager().getClan(arg[0]);
|
||||
|
||||
if (clan == null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.clan.matched"));
|
||||
}
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
|
||||
}
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.0.profile.tag"), plugin.getSettingsManager().getCommandClan()));
|
||||
}
|
||||
|
||||
if (clan != null) {
|
||||
if (clan.isVerified()) {
|
||||
ChatBlock.sendBlank(player);
|
||||
ChatBlock.saySingle(player, plugin.getSettingsManager().getPageClanNameColor() + Helper.capitalize(clan.getName()) + subColor + " " + plugin.getLang("profile") + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
|
||||
ChatBlock.sendBlank(player);
|
||||
|
||||
String name = plugin.getSettingsManager().getClanChatBracketColor() + plugin.getSettingsManager().getClanChatTagBracketLeft() + plugin.getSettingsManager().getTagDefaultColor() + clan.getColorTag() + plugin.getSettingsManager().getClanChatBracketColor() + plugin.getSettingsManager().getClanChatTagBracketRight() + " " + plugin.getSettingsManager().getPageClanNameColor() + clan.getName();
|
||||
String leaders = clan.getLeadersString(plugin.getSettingsManager().getPageLeaderColor(), subColor + ", ");
|
||||
String onlineCount = ChatColor.WHITE + "" + Helper.stripOffLinePlayers(clan.getMembers()).size();
|
||||
String membersOnline = onlineCount + subColor + "/" + ChatColor.WHITE + clan.getSize();
|
||||
String inactive = ChatColor.WHITE + "" + clan.getInactiveDays() + subColor + "/" + ChatColor.WHITE + (clan.isVerified() ? plugin.getSettingsManager().getPurgeClan() : plugin.getSettingsManager().getPurgeUnverified()) + " " + plugin.getLang("days");
|
||||
String founded = ChatColor.WHITE + "" + clan.getFoundedString();
|
||||
String allies = ChatColor.WHITE + "" + clan.getAllyString(subColor + ", ");
|
||||
String rivals = ChatColor.WHITE + "" + clan.getRivalString(subColor + ", ");
|
||||
String kdr = ChatColor.YELLOW + "" + formatter.format(clan.getTotalKDR());
|
||||
String deaths = ChatColor.WHITE + "" + clan.getTotalDeaths();
|
||||
String rival = ChatColor.WHITE + "" + clan.getTotalRival();
|
||||
String neutral = ChatColor.WHITE + "" + clan.getTotalNeutral();
|
||||
String civ = ChatColor.WHITE + "" + clan.getTotalCivilian();
|
||||
String status = ChatColor.WHITE + "" + (clan.isVerified() ? plugin.getSettingsManager().getPageTrustedColor() + plugin.getLang("verified") : plugin.getSettingsManager().getPageUnTrustedColor() + plugin.getLang("unverified"));
|
||||
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("name.0"), name));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("status.0"), status));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("leaders.0"), leaders));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("members.online.0"), membersOnline));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("kdr.0"), kdr));
|
||||
ChatBlock.sendMessage(player, " " + subColor + plugin.getLang("kill.totals") + " " + headColor + "[" + plugin.getLang("rival") + ":" + rival + " " + headColor + "" + plugin.getLang("neutral") + ":" + neutral + " " + headColor + "" + plugin.getLang("civilian") + ":" + civ + headColor + "]");
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("deaths.0"), deaths));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("allies.0"), allies));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("rivals.0"), rivals));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("founded.0"), founded));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("inactive.0"), inactive));
|
||||
|
||||
ChatBlock.sendBlank(player);
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.*;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.MessageFormat;
|
||||
import java.text.NumberFormat;
|
||||
|
||||
/**
|
||||
* @author phaed
|
||||
*/
|
||||
public class ProfileCommand {
|
||||
public ProfileCommand() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the command
|
||||
*
|
||||
* @param player
|
||||
* @param arg
|
||||
*/
|
||||
public void execute(Player player, String[] arg) {
|
||||
SimpleClans plugin = SimpleClans.getInstance();
|
||||
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
|
||||
String subColor = plugin.getSettingsManager().getPageSubTitleColor();
|
||||
NumberFormat formatter = new DecimalFormat("#.#");
|
||||
|
||||
Clan clan = null;
|
||||
|
||||
if (arg.length == 0) {
|
||||
if (plugin.getPermissionsManager().has(player, "simpleclans.member.profile")) {
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
|
||||
if (cp == null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
|
||||
} else {
|
||||
if (cp.getClan().isVerified()) {
|
||||
clan = cp.getClan();
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
|
||||
}
|
||||
} else if (arg.length == 1) {
|
||||
if (plugin.getPermissionsManager().has(player, "simpleclans.anyone.profile")) {
|
||||
clan = plugin.getClanManager().getClan(arg[0]);
|
||||
|
||||
if (clan == null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.clan.matched"));
|
||||
}
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
|
||||
}
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.0.profile.tag"), plugin.getSettingsManager().getCommandClan()));
|
||||
}
|
||||
|
||||
if (clan != null) {
|
||||
if (clan.isVerified()) {
|
||||
ChatBlock.sendBlank(player);
|
||||
ChatBlock.saySingle(player, plugin.getSettingsManager().getPageClanNameColor() + Helper.capitalize(clan.getName()) + subColor + " " + plugin.getLang("profile") + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
|
||||
ChatBlock.sendBlank(player);
|
||||
|
||||
String name = plugin.getSettingsManager().getClanChatBracketColor() + plugin.getSettingsManager().getClanChatTagBracketLeft() + plugin.getSettingsManager().getTagDefaultColor() + clan.getColorTag() + plugin.getSettingsManager().getClanChatBracketColor() + plugin.getSettingsManager().getClanChatTagBracketRight() + " " + plugin.getSettingsManager().getPageClanNameColor() + clan.getName();
|
||||
String description = ChatColor.WHITE + (clan.getDescription() != null && !clan.getDescription().isEmpty() ? clan.getDescription() : plugin.getLang("no.description"));
|
||||
String leaders = clan.getLeadersString(plugin.getSettingsManager().getPageLeaderColor(), subColor + ", ");
|
||||
String onlineCount = ChatColor.WHITE + "" + Helper.stripOffLinePlayers(clan.getMembers()).size();
|
||||
String membersOnline = onlineCount + subColor + "/" + ChatColor.WHITE + clan.getSize();
|
||||
String inactive = ChatColor.WHITE + "" + clan.getInactiveDays() + subColor + "/" + ChatColor.WHITE + (clan.isVerified() ? plugin.getSettingsManager().getPurgeClan() : plugin.getSettingsManager().getPurgeUnverified()) + " " + plugin.getLang("days");
|
||||
String founded = ChatColor.WHITE + "" + clan.getFoundedString();
|
||||
String allies = ChatColor.WHITE + "" + clan.getAllyString(subColor + ", ");
|
||||
String rivals = ChatColor.WHITE + "" + clan.getRivalString(subColor + ", ");
|
||||
String kdr = ChatColor.YELLOW + "" + formatter.format(clan.getTotalKDR());
|
||||
String deaths = ChatColor.WHITE + "" + clan.getTotalDeaths();
|
||||
String rival = ChatColor.WHITE + "" + clan.getTotalRival();
|
||||
String neutral = ChatColor.WHITE + "" + clan.getTotalNeutral();
|
||||
String civ = ChatColor.WHITE + "" + clan.getTotalCivilian();
|
||||
String status = ChatColor.WHITE + "" + (clan.isVerified() ? plugin.getSettingsManager().getPageTrustedColor() + plugin.getLang("verified") : plugin.getSettingsManager().getPageUnTrustedColor() + plugin.getLang("unverified"));
|
||||
String feeEnabled = ChatColor.WHITE + (clan.isMemberFeeEnabled() ? plugin.getLang("fee.enabled") : plugin.getLang("fee.disabled"));
|
||||
String feeValue = ChatColor.WHITE + "" + clan.getMemberFee();
|
||||
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("name.0"), name));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("description.0"), description));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("status.0"), status));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("leaders.0"), leaders));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("members.online.0"), membersOnline));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("kdr.0"), kdr));
|
||||
ChatBlock.sendMessage(player, " " + subColor + plugin.getLang("kill.totals") + " " + headColor + "[" + plugin.getLang("rival") + ":" + rival + " " + headColor + "" + plugin.getLang("neutral") + ":" + neutral + " " + headColor + "" + plugin.getLang("civilian") + ":" + civ + headColor + "]");
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("deaths.0"), deaths));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("fee.0.value.1"), feeEnabled, feeValue));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("allies.0"), allies));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("rivals.0"), rivals));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("founded.0"), founded));
|
||||
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("inactive.0"), inactive));
|
||||
|
||||
ChatBlock.sendBlank(player);
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@@ -70,11 +69,7 @@ public class PromoteCommand {
|
||||
}
|
||||
|
||||
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("promoted.to.leader"), Helper.capitalize(promoted.getName())));
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
clan.promote(promoted.getUniqueId());
|
||||
} else {
|
||||
clan.promote(promoted.getName());
|
||||
}
|
||||
clan.promote(promoted.getUniqueId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.UUID;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author roinujnosde
|
||||
*/
|
||||
public class PurgeCommand {
|
||||
|
||||
/**
|
||||
* Executes the command
|
||||
*
|
||||
* @param sender
|
||||
* @param args
|
||||
*/
|
||||
public void execute(CommandSender sender, String args[]) {
|
||||
SimpleClans plugin = SimpleClans.getInstance();
|
||||
if (sender instanceof Player) {
|
||||
if (!plugin.getPermissionsManager().has((Player) sender, "simpleclans.admin.purge")) {
|
||||
ChatBlock.sendMessage(sender, ChatColor.RED + plugin.getLang("insufficient.permissions"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (args.length == 1) {
|
||||
UUID uuid = UUIDMigration.getForcedPlayerUUID(args[0]);
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(uuid);
|
||||
if (uuid == null || cp == null) {
|
||||
ChatBlock.sendMessage(sender, ChatColor.RED + plugin.getLang("no.player.matched"));
|
||||
return;
|
||||
}
|
||||
|
||||
plugin.getClanManager().deleteClanPlayer(cp);
|
||||
ChatBlock.sendMessage(sender, ChatColor.AQUA + plugin.getLang("player.purged"));
|
||||
return;
|
||||
}
|
||||
|
||||
ChatBlock.sendMessage(sender, ChatColor.RED
|
||||
+ MessageFormat.format(plugin.getLang("usage.purge"), plugin.getSettingsManager().getCommandClan()));
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.UUID;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.*;
|
||||
import org.bukkit.Bukkit;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
@@ -52,18 +54,18 @@ public class ResetKDRCommand {
|
||||
}
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("you.have.reseted.kdr.of.all.players"));
|
||||
} else {
|
||||
OfflinePlayer toReset = Bukkit.getOfflinePlayer(arg[0]);
|
||||
if (toReset == null) {
|
||||
UUID uuid = UUIDMigration.getForcedPlayerUUID(arg[0]);
|
||||
if (uuid == null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.matched"));
|
||||
return;
|
||||
}
|
||||
ClanPlayer trcp = plugin.getClanManager().getClanPlayer(toReset);
|
||||
ClanPlayer trcp = plugin.getClanManager().getClanPlayer(uuid);
|
||||
if (trcp == null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.data.found"));
|
||||
return;
|
||||
}
|
||||
plugin.getClanManager().resetKdr(trcp);
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("you.have.reseted.0.kdr"), toReset.getName()));
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("you.have.reseted.0.kdr"), trcp.getName()));
|
||||
}
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Helper;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.conversation.ResignPrompt;
|
||||
import org.bukkit.conversations.ConversationFactory;
|
||||
|
||||
/**
|
||||
* @author phaed
|
||||
@@ -36,20 +35,11 @@ public class ResignCommand {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
|
||||
return;
|
||||
}
|
||||
Clan clan = cp.getClan();
|
||||
|
||||
if (!clan.isLeader(player) || clan.getLeaders().size() > 1) {
|
||||
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("0.has.resigned"), Helper.capitalize(player.getName())));
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
clan.removePlayerFromClan(player.getUniqueId());
|
||||
} else {
|
||||
clan.removePlayerFromClan(player.getName());
|
||||
}
|
||||
} else if (clan.isLeader(player) && clan.getLeaders().size() == 1) {
|
||||
plugin.getClanManager().serverAnnounce(ChatColor.AQUA + MessageFormat.format(plugin.getLang("clan.has.been.disbanded"), clan.getName()));
|
||||
clan.disband();
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("last.leader.cannot.resign.you.must.appoint.another.leader.or.disband.the.clan"));
|
||||
}
|
||||
|
||||
new ConversationFactory(plugin)
|
||||
.withFirstPrompt(new ResignPrompt())
|
||||
.withLocalEcho(true)
|
||||
.withTimeout(10)
|
||||
.buildConversation(player).begin();
|
||||
}
|
||||
}
|
||||
@@ -80,7 +80,7 @@ public class RosterCommand {
|
||||
String name = plugin.getSettingsManager().getPageLeaderColor() + cp.getName();
|
||||
String lastSeen = p != null && p.isOnline() && !Helper.isVanished(p) ? ChatColor.GREEN + plugin.getLang("online") : ChatColor.WHITE + cp.getLastSeenDaysString();
|
||||
|
||||
chatBlock.addRow(" " + name, ChatColor.YELLOW + Helper.parseColors(cp.getRank()), lastSeen);
|
||||
chatBlock.addRow(" " + name, ChatColor.YELLOW + Helper.parseColors(cp.getRank()) + ChatColor.RESET, lastSeen);
|
||||
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ public class RosterCommand {
|
||||
String name = (cp.isTrusted() ? plugin.getSettingsManager().getPageTrustedColor() : plugin.getSettingsManager().getPageUnTrustedColor()) + cp.getName();
|
||||
String lastSeen = p != null && p.isOnline() && !Helper.isVanished(p) ? ChatColor.GREEN + plugin.getLang("online") : ChatColor.WHITE + cp.getLastSeenDaysString();
|
||||
|
||||
chatBlock.addRow(" " + name, ChatColor.YELLOW + Helper.parseColors(cp.getRank()), lastSeen);
|
||||
chatBlock.addRow(" " + name, ChatColor.YELLOW + Helper.parseColors(cp.getRank()) + ChatColor.RESET, lastSeen);
|
||||
}
|
||||
|
||||
boolean more = chatBlock.sendBlock(player, plugin.getSettingsManager().getPageSize());
|
||||
|
||||
@@ -1,68 +1,71 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.*;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
public class SetRankCommand {
|
||||
public SetRankCommand() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the command
|
||||
*
|
||||
* @param player
|
||||
* @param arg
|
||||
*/
|
||||
public void execute(Player player, String[] arg) {
|
||||
SimpleClans plugin = SimpleClans.getInstance();
|
||||
|
||||
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.setrank")) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
|
||||
return;
|
||||
}
|
||||
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
|
||||
if (cp == null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
|
||||
return;
|
||||
}
|
||||
|
||||
Clan clan = cp.getClan();
|
||||
|
||||
if (!clan.isVerified()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
|
||||
return;
|
||||
}
|
||||
if (!clan.isLeader(player)) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
|
||||
return;
|
||||
}
|
||||
if (arg.length < 1) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.setrank"), plugin.getSettingsManager().getCommandClan()));
|
||||
return;
|
||||
}
|
||||
|
||||
String playerName = arg[0];
|
||||
String rank = Helper.toMessage(Helper.removeFirst(arg));
|
||||
|
||||
if (!clan.isMember(playerName) && !clan.isLeader(playerName)) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.matched"));
|
||||
return;
|
||||
}
|
||||
|
||||
ClanPlayer cpm = plugin.getClanManager().getClanPlayer(playerName);
|
||||
cpm.setRank(rank);
|
||||
plugin.getStorageManager().updateClanPlayer(cpm);
|
||||
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("player.rank.changed"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.UUID;
|
||||
|
||||
public class SetRankCommand {
|
||||
public SetRankCommand() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the command
|
||||
*
|
||||
* @param player
|
||||
* @param arg
|
||||
*/
|
||||
public void execute(Player player, String[] arg) {
|
||||
SimpleClans plugin = SimpleClans.getInstance();
|
||||
|
||||
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.setrank")) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
|
||||
return;
|
||||
}
|
||||
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
|
||||
if (cp == null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
|
||||
return;
|
||||
}
|
||||
|
||||
Clan clan = cp.getClan();
|
||||
|
||||
if (!clan.isVerified()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
|
||||
return;
|
||||
}
|
||||
if (!clan.isLeader(player)) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
|
||||
return;
|
||||
}
|
||||
if (arg.length < 1) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.setrank"), plugin.getSettingsManager().getCommandClan()));
|
||||
return;
|
||||
}
|
||||
|
||||
UUID uuid = UUIDMigration.getForcedPlayerUUID(arg[0]);
|
||||
String rank = Helper.toMessage(Helper.removeFirst(arg));
|
||||
|
||||
if (uuid == null || (!clan.isMember(uuid) && !clan.isLeader(uuid))) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.matched"));
|
||||
return;
|
||||
}
|
||||
|
||||
ClanPlayer cpm = plugin.getClanManager().getClanPlayer(uuid);
|
||||
cpm.setRank(rank);
|
||||
plugin.getStorageManager().updateClanPlayer(cpm);
|
||||
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("player.rank.changed"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,138 +1,159 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
* @author phaed
|
||||
*/
|
||||
public class ToggleCommand {
|
||||
|
||||
public ToggleCommand() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the command
|
||||
*
|
||||
* @param player
|
||||
* @param arg
|
||||
*/
|
||||
public void execute(Player player, String[] arg) {
|
||||
SimpleClans plugin = SimpleClans.getInstance();
|
||||
|
||||
if (arg.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
String cmd = arg[0];
|
||||
|
||||
if (cmd.equalsIgnoreCase("cape")) {
|
||||
if (plugin.getPermissionsManager().has(player, "simpleclans.member.cape-toggle")) {
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
|
||||
if (cp != null) {
|
||||
Clan clan = cp.getClan();
|
||||
|
||||
if (clan.isVerified()) {
|
||||
if (cp.isCapeEnabled()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("capeoff"));
|
||||
cp.setCapeEnabled(false);
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("capeon"));
|
||||
cp.setCapeEnabled(true);
|
||||
}
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
|
||||
}
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
|
||||
}
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd.equalsIgnoreCase("bb") && plugin.getPermissionsManager().has(player, "simpleclans.member.bb-toggle")) {
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
|
||||
if (cp != null) {
|
||||
Clan clan = cp.getClan();
|
||||
|
||||
if (clan.isVerified()) {
|
||||
if (cp.isBbEnabled()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("bboff"));
|
||||
cp.setBbEnabled(false);
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("bbon"));
|
||||
cp.setBbEnabled(true);
|
||||
}
|
||||
plugin.getStorageManager().updateClanPlayer(cp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd.equalsIgnoreCase("tag") && plugin.getPermissionsManager().has(player, "simpleclans.member.tag-toggle")) {
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
|
||||
if (cp != null) {
|
||||
Clan clan = cp.getClan();
|
||||
|
||||
if (clan.isVerified()) {
|
||||
if (cp.isTagEnabled()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("tagoff"));
|
||||
cp.setTagEnabled(false);
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("tagon"));
|
||||
cp.setTagEnabled(true);
|
||||
}
|
||||
plugin.getStorageManager().updateClanPlayer(cp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd.equalsIgnoreCase("deposit") && plugin.getPermissionsManager().has(player, "simpleclans.leader.deposit-toggle")) {
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
|
||||
if (cp != null) {
|
||||
Clan clan = cp.getClan();
|
||||
if (clan.isLeader(player)) {
|
||||
if (clan.isVerified()) {
|
||||
if (clan.isAllowDeposit()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("depositoff"));
|
||||
clan.setAllowDeposit(false);
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("depositon"));
|
||||
clan.setAllowDeposit(true);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd.equalsIgnoreCase("withdraw") && plugin.getPermissionsManager().has(player, "simpleclans.leader.withdraw-toggle")) {
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
if (cp != null) {
|
||||
Clan clan = cp.getClan();
|
||||
if (clan.isVerified()) {
|
||||
if (clan.isLeader(player)) {
|
||||
if (clan.isAllowWithdraw()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("withdrawoff"));
|
||||
clan.setAllowWithdraw(false);
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("withdrawon"));
|
||||
clan.setAllowWithdraw(true);
|
||||
}
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
* @author phaed
|
||||
*/
|
||||
public class ToggleCommand {
|
||||
|
||||
public ToggleCommand() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the command
|
||||
*
|
||||
* @param player
|
||||
* @param arg
|
||||
*/
|
||||
public void execute(Player player, String[] arg) {
|
||||
SimpleClans plugin = SimpleClans.getInstance();
|
||||
|
||||
if (arg.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
String cmd = arg[0];
|
||||
|
||||
if (cmd.equalsIgnoreCase("cape")) {
|
||||
if (plugin.getPermissionsManager().has(player, "simpleclans.member.cape-toggle")) {
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
|
||||
if (cp != null) {
|
||||
Clan clan = cp.getClan();
|
||||
|
||||
if (clan.isVerified()) {
|
||||
if (cp.isCapeEnabled()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("capeoff"));
|
||||
cp.setCapeEnabled(false);
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("capeon"));
|
||||
cp.setCapeEnabled(true);
|
||||
}
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
|
||||
}
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
|
||||
}
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd.equalsIgnoreCase("bb") && plugin.getPermissionsManager().has(player, "simpleclans.member.bb-toggle")) {
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
|
||||
if (cp != null) {
|
||||
Clan clan = cp.getClan();
|
||||
|
||||
if (clan.isVerified()) {
|
||||
if (cp.isBbEnabled()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("bboff"));
|
||||
cp.setBbEnabled(false);
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("bbon"));
|
||||
cp.setBbEnabled(true);
|
||||
}
|
||||
plugin.getStorageManager().updateClanPlayer(cp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd.equalsIgnoreCase("tag") && plugin.getPermissionsManager().has(player, "simpleclans.member.tag-toggle")) {
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
|
||||
if (cp != null) {
|
||||
Clan clan = cp.getClan();
|
||||
|
||||
if (clan.isVerified()) {
|
||||
if (cp.isTagEnabled()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("tagoff"));
|
||||
cp.setTagEnabled(false);
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("tagon"));
|
||||
cp.setTagEnabled(true);
|
||||
}
|
||||
plugin.getStorageManager().updateClanPlayer(cp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd.equalsIgnoreCase("deposit") && plugin.getPermissionsManager().has(player, "simpleclans.leader.deposit-toggle")) {
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
|
||||
if (cp != null) {
|
||||
Clan clan = cp.getClan();
|
||||
if (clan.isLeader(player)) {
|
||||
if (clan.isVerified()) {
|
||||
if (clan.isAllowDeposit()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("depositoff"));
|
||||
clan.setAllowDeposit(false);
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("depositon"));
|
||||
clan.setAllowDeposit(true);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd.equalsIgnoreCase("fee") && plugin.getPermissionsManager().has(player, "simpleclans.leader.fee")) {
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
if (cp != null) {
|
||||
Clan clan = cp.getClan();
|
||||
if (clan.isVerified()) {
|
||||
if (clan.isLeader(player)) {
|
||||
if (clan.isMemberFeeEnabled()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("feeoff"));
|
||||
clan.setMemberFeeEnabled(false);
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("feeon"));
|
||||
clan.setMemberFeeEnabled(true);
|
||||
}
|
||||
plugin.getStorageManager().updateClanAsync(clan);
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd.equalsIgnoreCase("withdraw") && plugin.getPermissionsManager().has(player, "simpleclans.leader.withdraw-toggle")) {
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
if (cp != null) {
|
||||
Clan clan = cp.getClan();
|
||||
if (clan.isVerified()) {
|
||||
if (clan.isLeader(player)) {
|
||||
if (clan.isAllowWithdraw()) {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("withdrawoff"));
|
||||
clan.setAllowWithdraw(false);
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("withdrawon"));
|
||||
clan.setAllowWithdraw(true);
|
||||
}
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,10 +5,13 @@ import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Helper;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author phaed
|
||||
@@ -49,13 +52,12 @@ public class TrustCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
String trusted = arg[0];
|
||||
|
||||
UUID trusted = UUIDMigration.getForcedPlayerUUID(arg[0]);
|
||||
if (trusted == null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.matched"));
|
||||
return;
|
||||
}
|
||||
if (trusted.equals(player.getName())) {
|
||||
if (trusted.equals(player.getUniqueId())) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("you.cannot.trust.yourself"));
|
||||
return;
|
||||
}
|
||||
@@ -80,7 +82,7 @@ public class TrustCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("has.been.given.trusted.status.by"), Helper.capitalize(trusted), player.getName()));
|
||||
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("has.been.given.trusted.status.by"), Helper.capitalize(arg[0]), player.getName()));
|
||||
tcp.setTrusted(true);
|
||||
plugin.getStorageManager().updateClanPlayer(tcp);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.commands;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Helper;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
|
||||
|
||||
/**
|
||||
* @author phaed
|
||||
@@ -34,20 +36,23 @@ public class UnbanCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
String banned = arg[0];
|
||||
UUID uuid = UUIDMigration.getForcedPlayerUUID(arg[0]);
|
||||
if (uuid == null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.matched"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!plugin.getSettingsManager().isBanned(banned)) {
|
||||
if (!plugin.getSettingsManager().isBanned(uuid)) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("this.player.is.not.banned"));
|
||||
return;
|
||||
}
|
||||
|
||||
Player pl = Helper.getPlayer(banned);
|
||||
|
||||
Player pl = Bukkit.getPlayer(uuid);
|
||||
if (pl != null) {
|
||||
ChatBlock.sendMessage(pl, ChatColor.AQUA + plugin.getLang("you.have.been.unbanned.from.clan.commands"));
|
||||
}
|
||||
|
||||
plugin.getSettingsManager().removeBanned(banned);
|
||||
plugin.getSettingsManager().removeBanned(uuid);
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("player.removed.from.the.banned.list"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,10 +5,13 @@ import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Helper;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author phaed
|
||||
@@ -49,26 +52,25 @@ public class UntrustCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
String trusted = arg[0];
|
||||
|
||||
if (trusted == null) {
|
||||
UUID trustedId = UUIDMigration.getForcedPlayerUUID(arg[0]);
|
||||
if (trustedId == null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.matched"));
|
||||
return;
|
||||
}
|
||||
if (trusted.equals(player.getName())) {
|
||||
if (trustedId.equals(player.getUniqueId())) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("you.cannot.untrust.yourself"));
|
||||
return;
|
||||
}
|
||||
if (!clan.isMember(trusted)) {
|
||||
if (!clan.isMember(trustedId)) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("the.player.is.not.a.member.of.your.clan"));
|
||||
return;
|
||||
}
|
||||
if (clan.isLeader(trusted)) {
|
||||
if (clan.isLeader(trustedId)) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("leaders.cannot.be.untrusted"));
|
||||
return;
|
||||
}
|
||||
|
||||
ClanPlayer tcp = plugin.getClanManager().getClanPlayer(trusted);
|
||||
ClanPlayer tcp = plugin.getClanManager().getClanPlayer(trustedId);
|
||||
|
||||
if (tcp == null) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.matched"));
|
||||
@@ -79,7 +81,7 @@ public class UntrustCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("has.been.given.untrusted.status.by"), Helper.capitalize(trusted), player.getName()));
|
||||
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("has.been.given.untrusted.status.by"), Helper.capitalize(arg[0]), player.getName()));
|
||||
tcp.setTrusted(false);
|
||||
plugin.getStorageManager().updateClanPlayer(tcp);
|
||||
}
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.conversation;
|
||||
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.Prompt;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author roinujnosde
|
||||
*/
|
||||
public class MessagePromptImpl extends org.bukkit.conversations.MessagePrompt {
|
||||
|
||||
private final String message;
|
||||
|
||||
public MessagePromptImpl(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Prompt getNextPrompt(ConversationContext cc) {
|
||||
return END_OF_CONVERSATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPromptText(ConversationContext cc) {
|
||||
return message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.conversation;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Arrays;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Helper;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.ClanManager;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.Prompt;
|
||||
import static org.bukkit.conversations.Prompt.END_OF_CONVERSATION;
|
||||
import org.bukkit.conversations.StringPrompt;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author roinujnosde
|
||||
*/
|
||||
public class ResignPrompt extends StringPrompt {
|
||||
|
||||
@Override
|
||||
public Prompt acceptInput(ConversationContext cc, String input) {
|
||||
final SimpleClans plugin = (SimpleClans) cc.getPlugin();
|
||||
|
||||
String yes = plugin.getLang("resign.yes");
|
||||
Player player = (Player) cc.getForWhom();
|
||||
ClanManager cm = plugin.getClanManager();
|
||||
ClanPlayer cp = cm.getClanPlayer(player);
|
||||
Clan clan = cp.getClan();
|
||||
|
||||
if (yes.equalsIgnoreCase(input)) {
|
||||
if (!clan.isLeader(player) || clan.getLeaders().size() > 1) {
|
||||
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("0.has.resigned"), Helper.capitalize(player.getName())));
|
||||
cp.addResignTime(clan.getTag());
|
||||
clan.removePlayerFromClan(player.getUniqueId());
|
||||
|
||||
return new MessagePromptImpl(ChatColor.AQUA + plugin.getLang("resign.success"));
|
||||
} else if (clan.isLeader(player) && clan.getLeaders().size() == 1) {
|
||||
plugin.getClanManager().serverAnnounce(ChatColor.AQUA + MessageFormat.format(plugin.getLang("clan.has.been.disbanded"), clan.getName()));
|
||||
clan.disband();
|
||||
} else {
|
||||
return new MessagePromptImpl(ChatColor.RED + plugin.getLang("last.leader.cannot.resign.you.must.appoint.another.leader.or.disband.the.clan"));
|
||||
}
|
||||
}
|
||||
|
||||
return END_OF_CONVERSATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPromptText(ConversationContext cc) {
|
||||
final SimpleClans plugin = (SimpleClans) cc.getPlugin();
|
||||
|
||||
return ChatColor.RED + MessageFormat.format(
|
||||
plugin.getLang("resign.confirmation"), Arrays.asList(
|
||||
plugin.getLang("resign.yes"), plugin.getLang("resign.no")));
|
||||
}
|
||||
|
||||
}
|
||||
+3
-7
@@ -20,7 +20,7 @@ public class AcceptCommandExecutor implements CommandExecutor {
|
||||
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
|
||||
Player player = (Player) commandSender;
|
||||
|
||||
if (plugin.getSettingsManager().isBanned(player.getName())) {
|
||||
if (plugin.getSettingsManager().isBanned(player.getUniqueId())) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("banned"));
|
||||
return false;
|
||||
}
|
||||
@@ -49,12 +49,8 @@ public class AcceptCommandExecutor implements CommandExecutor {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("nothing.to.accept"));
|
||||
return false;
|
||||
}
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
cp = plugin.getClanManager().getCreateClanPlayer(player.getUniqueId());
|
||||
cp.setName(player.getName());
|
||||
} else {
|
||||
cp = plugin.getClanManager().getCreateClanPlayer(player.getName());
|
||||
}
|
||||
cp = plugin.getClanManager().getCreateClanPlayer(player.getUniqueId());
|
||||
cp.setName(player.getName());
|
||||
plugin.getRequestManager().accept(cp);
|
||||
}
|
||||
|
||||
|
||||
+58
-45
@@ -12,47 +12,50 @@ import java.text.MessageFormat;
|
||||
* @author phaed
|
||||
*/
|
||||
public final class ClanCommandExecutor implements CommandExecutor {
|
||||
private SimpleClans plugin;
|
||||
private CreateCommand createCommand;
|
||||
private ListCommand listCommand;
|
||||
private ProfileCommand profileCommand;
|
||||
private RosterCommand rosterCommand;
|
||||
private LookupCommand lookupCommand;
|
||||
private LeaderboardCommand leaderboardCommand;
|
||||
private AlliancesCommand alliancesCommand;
|
||||
private RivalriesCommand rivalriesCommand;
|
||||
private VitalsCommand vitalsCommand;
|
||||
private CoordsCommand coordsCommand;
|
||||
private StatsCommand statsCommand;
|
||||
private AllyCommand allyCommand;
|
||||
private RivalCommand rivalCommand;
|
||||
private BbCommand bbCommand;
|
||||
private ModtagCommand modtagCommand;
|
||||
private ToggleCommand toggleCommand;
|
||||
private InviteCommand inviteCommand;
|
||||
private KickCommand kickCommand;
|
||||
private TrustCommand trustCommand;
|
||||
private UntrustCommand untrustCommand;
|
||||
private PromoteCommand promoteCommand;
|
||||
private DemoteCommand demoteCommand;
|
||||
private ClanffCommand clanffCommand;
|
||||
private FfCommand ffCommand;
|
||||
private ResignCommand resignCommand;
|
||||
private DisbandCommand disbandCommand;
|
||||
private VerifyCommand verifyCommand;
|
||||
private BanCommand banCommand;
|
||||
private UnbanCommand unbanCommand;
|
||||
private ReloadCommand reloadCommand;
|
||||
private GlobalffCommand globalffCommand;
|
||||
private MenuCommand menuCommand;
|
||||
private WarCommand warCommand;
|
||||
private HomeCommand homeCommand;
|
||||
private KillsCommand killsCommand;
|
||||
private MostKilledCommand mostKilledCommand;
|
||||
private SetRankCommand setRankCommand;
|
||||
private BankCommand bankCommand;
|
||||
private PlaceCommand placeCommand;
|
||||
private ResetKDRCommand resetKDRCommand;
|
||||
private final SimpleClans plugin;
|
||||
private final CreateCommand createCommand;
|
||||
private final ListCommand listCommand;
|
||||
private final ProfileCommand profileCommand;
|
||||
private final RosterCommand rosterCommand;
|
||||
private final LookupCommand lookupCommand;
|
||||
private final LeaderboardCommand leaderboardCommand;
|
||||
private final AlliancesCommand alliancesCommand;
|
||||
private final RivalriesCommand rivalriesCommand;
|
||||
private final VitalsCommand vitalsCommand;
|
||||
private final CoordsCommand coordsCommand;
|
||||
private final StatsCommand statsCommand;
|
||||
private final AllyCommand allyCommand;
|
||||
private final RivalCommand rivalCommand;
|
||||
private final BbCommand bbCommand;
|
||||
private final ModtagCommand modtagCommand;
|
||||
private final ToggleCommand toggleCommand;
|
||||
private final InviteCommand inviteCommand;
|
||||
private final KickCommand kickCommand;
|
||||
private final TrustCommand trustCommand;
|
||||
private final UntrustCommand untrustCommand;
|
||||
private final PromoteCommand promoteCommand;
|
||||
private final DemoteCommand demoteCommand;
|
||||
private final ClanffCommand clanffCommand;
|
||||
private final FfCommand ffCommand;
|
||||
private final ResignCommand resignCommand;
|
||||
private final DisbandCommand disbandCommand;
|
||||
private final VerifyCommand verifyCommand;
|
||||
private final BanCommand banCommand;
|
||||
private final FeeCommand feeCommand;
|
||||
private final UnbanCommand unbanCommand;
|
||||
private final ReloadCommand reloadCommand;
|
||||
private final GlobalffCommand globalffCommand;
|
||||
private final MenuCommand menuCommand;
|
||||
private final WarCommand warCommand;
|
||||
private final HomeCommand homeCommand;
|
||||
private final KillsCommand killsCommand;
|
||||
private final MostKilledCommand mostKilledCommand;
|
||||
private final SetRankCommand setRankCommand;
|
||||
private final BankCommand bankCommand;
|
||||
private final PlaceCommand placeCommand;
|
||||
private final ResetKDRCommand resetKDRCommand;
|
||||
private final PurgeCommand purgeCommand;
|
||||
private final DescriptionCommand descriptionCommand;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -99,6 +102,9 @@ public final class ClanCommandExecutor implements CommandExecutor {
|
||||
bankCommand = new BankCommand();
|
||||
placeCommand = new PlaceCommand();
|
||||
resetKDRCommand = new ResetKDRCommand();
|
||||
feeCommand = new FeeCommand();
|
||||
purgeCommand = new PurgeCommand();
|
||||
descriptionCommand = new DescriptionCommand();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -111,7 +117,7 @@ public final class ClanCommandExecutor implements CommandExecutor {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (plugin.getSettingsManager().isBanned(player.getName())) {
|
||||
if (plugin.getSettingsManager().isBanned(player.getUniqueId())) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("banned"));
|
||||
return false;
|
||||
}
|
||||
@@ -200,7 +206,13 @@ public final class ClanCommandExecutor implements CommandExecutor {
|
||||
placeCommand.execute(player, subargs);
|
||||
} else if (subcommand.equalsIgnoreCase(plugin.getLang("resetkdr.command")) || subcommand.equalsIgnoreCase("resetkdr")) {
|
||||
resetKDRCommand.execute(player, subargs);
|
||||
} else {
|
||||
} else if (subcommand.equalsIgnoreCase(plugin.getLang("fee.command")) || subcommand.equalsIgnoreCase("fee")) {
|
||||
feeCommand.execute(player, subargs);
|
||||
} else if (subcommand.equalsIgnoreCase(plugin.getLang("purge.command")) || subcommand.equalsIgnoreCase("purge")){
|
||||
purgeCommand.execute(player, subargs);
|
||||
} else if (subcommand.equalsIgnoreCase(plugin.getLang("description.command")) || subcommand.equalsIgnoreCase("description")) {
|
||||
descriptionCommand.execute(player, subargs);
|
||||
} else {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("does.not.match"));
|
||||
}
|
||||
}
|
||||
@@ -219,8 +231,9 @@ public final class ClanCommandExecutor implements CommandExecutor {
|
||||
placeCommand.execute(sender, subargs);
|
||||
} else if (subcommand.equalsIgnoreCase(plugin.getLang("globalff.command")) || subcommand.equalsIgnoreCase("globalff")) {
|
||||
globalffCommand.execute(sender, subargs);
|
||||
}
|
||||
else {
|
||||
} else if (subcommand.equalsIgnoreCase(plugin.getLang("purge.command")) || subcommand.equalsIgnoreCase("purge")) {
|
||||
purgeCommand.execute(sender, subargs);
|
||||
} else {
|
||||
ChatBlock.sendMessage(sender, ChatColor.RED + plugin.getLang("does.not.match"));
|
||||
}
|
||||
}
|
||||
|
||||
+3
-6
@@ -20,7 +20,7 @@ public class DenyCommandExecutor implements CommandExecutor {
|
||||
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
|
||||
Player player = (Player) commandSender;
|
||||
|
||||
if (plugin.getSettingsManager().isBanned(player.getName())) {
|
||||
if (plugin.getSettingsManager().isBanned(player.getUniqueId())) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("banned"));
|
||||
return false;
|
||||
}
|
||||
@@ -50,11 +50,8 @@ public class DenyCommandExecutor implements CommandExecutor {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("nothing.to.deny"));
|
||||
return false;
|
||||
}
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
cp = plugin.getClanManager().getCreateClanPlayer(player.getUniqueId());
|
||||
} else {
|
||||
cp = plugin.getClanManager().getCreateClanPlayer(player.getName());
|
||||
}
|
||||
cp = plugin.getClanManager().getCreateClanPlayer(player.getUniqueId());
|
||||
|
||||
plugin.getRequestManager().deny(cp);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ public class MoreCommandExecutor implements CommandExecutor {
|
||||
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
|
||||
Player player = (Player) commandSender;
|
||||
|
||||
if (plugin.getSettingsManager().isBanned(player.getName())) {
|
||||
if (plugin.getSettingsManager().isBanned(player.getUniqueId())) {
|
||||
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("banned"));
|
||||
return false;
|
||||
}
|
||||
|
||||
+76
-27
@@ -2,7 +2,12 @@ package net.sacredlabyrinth.phaed.simpleclans.listeners;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Kill;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.PermissionsManager;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.StorageManager.DataCallback;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Kill.Type;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.*;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@@ -15,6 +20,9 @@ import org.bukkit.event.entity.EntityTargetLivingEntityEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
|
||||
/**
|
||||
* @author phaed
|
||||
@@ -78,64 +86,105 @@ public class SCEntityListener implements Listener
|
||||
|
||||
if (attacker != null && victim != null)
|
||||
{
|
||||
ClanPlayer acp;
|
||||
ClanPlayer vcp;
|
||||
if (SimpleClans.getInstance().hasUUID())
|
||||
{
|
||||
acp = plugin.getClanManager().getCreateClanPlayer(attacker.getUniqueId());
|
||||
vcp = plugin.getClanManager().getCreateClanPlayer(victim.getUniqueId());
|
||||
} else
|
||||
{
|
||||
acp = plugin.getClanManager().getCreateClanPlayer(attacker.getName());
|
||||
vcp = plugin.getClanManager().getCreateClanPlayer(victim.getName());
|
||||
}
|
||||
if (SimpleClans.getInstance().getSettingsManager().isDenySameIPKills())
|
||||
{
|
||||
if (attacker.getAddress().getHostString().equals(victim.getAddress().getHostString()))
|
||||
{
|
||||
plugin.getLogger().log(Level.INFO, "Blocked same IP kill calculating: {0} killed {1}. IP: {2}", new Object[]{
|
||||
attacker.getDisplayName(), victim.getDisplayName(), attacker.getAddress().getHostString()
|
||||
});
|
||||
return;
|
||||
|
||||
}
|
||||
}
|
||||
String kdrExempt = "simpleclans.anyone.kdr-exempt";
|
||||
PermissionsManager pm = plugin.getPermissionsManager();
|
||||
if (pm.has(attacker, kdrExempt) || pm.has(victim, kdrExempt)) {
|
||||
return;
|
||||
}
|
||||
|
||||
ClanPlayer attackerCp = plugin.getClanManager().getCreateClanPlayer(attacker.getUniqueId());
|
||||
ClanPlayer victimCp = plugin.getClanManager().getCreateClanPlayer(victim.getUniqueId());
|
||||
|
||||
double reward = 0;
|
||||
double multipier = plugin.getSettingsManager().getKDRMultipliesPerKill();
|
||||
float kdr = acp.getKDR();
|
||||
float kdr = attackerCp.getKDR();
|
||||
|
||||
if (vcp.getClan() == null || acp.getClan() == null || !vcp.getClan().isVerified() || !acp.getClan().isVerified())
|
||||
if (victimCp.getClan() == null || attackerCp.getClan() == null || !victimCp.getClan().isVerified() || !attackerCp.getClan().isVerified())
|
||||
{
|
||||
acp.addCivilianKill();
|
||||
plugin.getStorageManager().insertKill(attacker, acp.getTag(), victim, "", "c");
|
||||
} else if (acp.getClan().isRival(vcp.getTag()))
|
||||
addKill(Type.CIVILIAN, attackerCp, victimCp);
|
||||
} else if (attackerCp.getClan().isRival(victimCp.getTag()))
|
||||
{
|
||||
if (acp.getClan().isWarring(vcp.getClan()))
|
||||
if (attackerCp.getClan().isWarring(victimCp.getClan()))
|
||||
{
|
||||
reward = (double) kdr * multipier * 4;
|
||||
} else
|
||||
{
|
||||
reward = (double) kdr * multipier * 2;
|
||||
}
|
||||
acp.addRivalKill();
|
||||
plugin.getStorageManager().insertKill(attacker, acp.getTag(), victim, vcp.getTag(), "r");
|
||||
} else if (acp.getClan().isAlly(vcp.getTag()))
|
||||
addKill(Type.RIVAL, attackerCp, victimCp);
|
||||
} else if (attackerCp.getClan().isAlly(victimCp.getTag()))
|
||||
{
|
||||
reward = (double) kdr * multipier * -1;
|
||||
} else
|
||||
{
|
||||
reward = (double) kdr * multipier;
|
||||
acp.addNeutralKill();
|
||||
plugin.getStorageManager().insertKill(attacker, acp.getTag(), victim, vcp.getTag(), "n");
|
||||
addKill(Type.NEUTRAL, attackerCp, victimCp);
|
||||
}
|
||||
|
||||
if (reward != 0 && plugin.getSettingsManager().isMoneyPerKill())
|
||||
{
|
||||
for (ClanPlayer cp : acp.getClan().getOnlineMembers())
|
||||
for (ClanPlayer cp : attackerCp.getClan().getOnlineMembers())
|
||||
{
|
||||
double money = Math.round((reward / acp.getClan().getOnlineMembers().size()) * 100D) / 100D;
|
||||
double money = Math.round((reward / attackerCp.getClan().getOnlineMembers().size()) * 100D) / 100D;
|
||||
cp.toPlayer().sendMessage(ChatColor.AQUA + MessageFormat.format(plugin.getLang("player.got.money"), money, victim.getName(), kdr));
|
||||
plugin.getPermissionsManager().playerGrantMoney(cp.getName(), money);
|
||||
plugin.getPermissionsManager().playerGrantMoney(cp.toPlayer(), money);
|
||||
}
|
||||
}
|
||||
|
||||
// record death for victim
|
||||
vcp.addDeath();
|
||||
plugin.getStorageManager().updateClanPlayerAsync(vcp);
|
||||
victimCp.addDeath();
|
||||
plugin.getStorageManager().updateClanPlayerAsync(victimCp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addKill(Kill.Type type, ClanPlayer attacker, ClanPlayer victim) {
|
||||
if (type == null || attacker == null || victim == null) {
|
||||
return;
|
||||
}
|
||||
final Kill kill = new Kill(attacker, victim, LocalDateTime.now());
|
||||
if (plugin.getSettingsManager().isDelayBetweenKills() && plugin.getClanManager().isKillBeforeDelay(kill)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (plugin.getSettingsManager().isMaxKillsPerVictim()) {
|
||||
plugin.getStorageManager().getKillsPerPlayer(attacker.getName(), new DataCallback<Map<String,Integer>>() {
|
||||
|
||||
@Override
|
||||
public void onResultReady(Map<String, Integer> data) {
|
||||
final int max = plugin.getSettingsManager().getMaxKillsPerVictim();
|
||||
Integer kills = data.get(kill.getVictim().getName());
|
||||
if (kills != null) {
|
||||
if (kills.intValue() < max) {
|
||||
saveKill(kill, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
saveKill(kill, type);
|
||||
}
|
||||
|
||||
private void saveKill(Kill kill, Kill.Type type) {
|
||||
plugin.getClanManager().addKill(kill);
|
||||
ClanPlayer killer = kill.getKiller();
|
||||
ClanPlayer victim = kill.getVictim();
|
||||
killer.addKill(type);
|
||||
plugin.getStorageManager().insertKill(killer.toPlayer(), killer.getTag(), victim.toPlayer(), victim.getTag(), type.getShortname());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param event
|
||||
*/
|
||||
|
||||
@@ -259,7 +259,7 @@ public class SCPlayerListener implements Listener {
|
||||
SimpleClans.getInstance().getPermissionsManager().addPlayerPermissions(cp);
|
||||
|
||||
if (plugin.getSettingsManager().isBbShowOnLogin() && cp.isBbEnabled()) {
|
||||
cp.getClan().displayBb(player);
|
||||
cp.getClan().displayBb(player, plugin.getSettingsManager().getBbLoginSize());
|
||||
}
|
||||
|
||||
SimpleClans.getInstance().getPermissionsManager().addClanPermissions(cp);
|
||||
|
||||
@@ -10,10 +10,13 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.PlayerInventory;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.events.ChatEvent;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
/**
|
||||
* @author phaed
|
||||
@@ -23,6 +26,7 @@ public final class ClanManager {
|
||||
private SimpleClans plugin;
|
||||
private HashMap<String, Clan> clans = new HashMap<>();
|
||||
private HashMap<String, ClanPlayer> clanPlayers = new HashMap<>();
|
||||
private HashMap<ClanPlayer, List<Kill>> kills = new HashMap<>();
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -37,8 +41,76 @@ public final class ClanManager {
|
||||
public void cleanData() {
|
||||
clans.clear();
|
||||
clanPlayers.clear();
|
||||
kills.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a kill to the memory
|
||||
*
|
||||
* @param kill
|
||||
*/
|
||||
public void addKill(Kill kill) {
|
||||
if (kill == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<Kill> list = kills.get(kill.getKiller());
|
||||
if (list == null) {
|
||||
list = new ArrayList<>();
|
||||
kills.put(kill.getKiller(), list);
|
||||
}
|
||||
|
||||
Iterator<Kill> iterator = list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Kill oldKill = iterator.next();
|
||||
if (oldKill.getVictim().equals(kill.getKiller())) {
|
||||
iterator.remove();
|
||||
continue;
|
||||
}
|
||||
|
||||
//cleaning
|
||||
final int delay = plugin.getSettingsManager().getDelayBetweenKills();
|
||||
long timePassed = oldKill.getTime().until(LocalDateTime.now(), ChronoUnit.MINUTES);
|
||||
if (timePassed >= delay) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
list.add(kill);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if this kill respects the delay
|
||||
*
|
||||
* @param kill
|
||||
* @return
|
||||
*/
|
||||
public boolean isKillBeforeDelay(Kill kill) {
|
||||
if (kill == null) {
|
||||
return false;
|
||||
}
|
||||
List<Kill> list = kills.get(kill.getKiller());
|
||||
if (list == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Iterator<Kill> iterator = list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
|
||||
Kill oldKill = iterator.next();
|
||||
if (oldKill.getVictim().equals(kill.getVictim())) {
|
||||
|
||||
final int delay = plugin.getSettingsManager().getDelayBetweenKills();
|
||||
long timePassed = oldKill.getTime().until(kill.getTime(), ChronoUnit.MINUTES);
|
||||
if (timePassed < delay) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Import a clan into the in-memory store
|
||||
*
|
||||
@@ -54,13 +126,9 @@ public final class ClanManager {
|
||||
* @param cp
|
||||
*/
|
||||
public void importClanPlayer(ClanPlayer cp) {
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
if (cp.getUniqueId() != null) {
|
||||
this.clanPlayers.put(cp.getUniqueId().toString(), cp);
|
||||
}
|
||||
} else {
|
||||
this.clanPlayers.put(cp.getCleanName(), cp);
|
||||
}
|
||||
if (cp.getUniqueId() != null) {
|
||||
this.clanPlayers.put(cp.getUniqueId().toString(), cp);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,12 +139,7 @@ public final class ClanManager {
|
||||
* @param name
|
||||
*/
|
||||
public void createClan(Player player, String colorTag, String name) {
|
||||
ClanPlayer cp;
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
cp = getCreateClanPlayer(player.getUniqueId());
|
||||
} else {
|
||||
cp = getCreateClanPlayer(player.getName());
|
||||
}
|
||||
ClanPlayer cp = getCreateClanPlayer(player.getUniqueId());
|
||||
|
||||
boolean verified = !plugin.getSettingsManager().isRequireVerification() || plugin.getPermissionsManager().has(player, "simpleclans.mod.verify");
|
||||
|
||||
@@ -91,10 +154,11 @@ public final class ClanManager {
|
||||
SimpleClans.getInstance().getPermissionsManager().updateClanPermissions(clan);
|
||||
SimpleClans.getInstance().getServer().getPluginManager().callEvent(new CreateClanEvent(clan));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reset a player's kdr
|
||||
* @param cp
|
||||
*
|
||||
* @param cp
|
||||
*/
|
||||
public void resetKdr(ClanPlayer cp) {
|
||||
cp.setCivilianKills(0);
|
||||
@@ -110,7 +174,11 @@ public final class ClanManager {
|
||||
* @param cp
|
||||
*/
|
||||
public void deleteClanPlayer(ClanPlayer cp) {
|
||||
clanPlayers.remove(cp.getCleanName());
|
||||
Clan clan = cp.getClan();
|
||||
if (clan != null) {
|
||||
clan.removePlayerFromClan(cp.getUniqueId());
|
||||
}
|
||||
clanPlayers.remove(cp.getUniqueId().toString());
|
||||
plugin.getStorageManager().deleteClanPlayer(cp);
|
||||
}
|
||||
|
||||
@@ -211,11 +279,7 @@ public final class ClanManager {
|
||||
*/
|
||||
public ClanPlayer getClanPlayerJoinEvent(Player player) {
|
||||
SimpleClans.getInstance().getStorageManager().importFromDatabaseOnePlayer(player);
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
return getClanPlayer(player.getUniqueId());
|
||||
} else {
|
||||
return getClanPlayer(player.getName());
|
||||
}
|
||||
return getClanPlayer(player.getUniqueId());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -226,14 +290,9 @@ public final class ClanManager {
|
||||
* @return
|
||||
*/
|
||||
public ClanPlayer getClanPlayer(OfflinePlayer player) {
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
return getClanPlayer(player.getUniqueId());
|
||||
} else {
|
||||
return getClanPlayer(player.getName());
|
||||
}
|
||||
return getClanPlayer(player.getUniqueId());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Gets the ClanPlayer data object if a player is currently in a clan, null
|
||||
* if he's not in a clan
|
||||
@@ -378,16 +437,12 @@ public final class ClanManager {
|
||||
* @return
|
||||
*/
|
||||
public ClanPlayer getCreateClanPlayerUUID(String playerDisplayName) {
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
UUID playerUniqueId = UUIDMigration.getForcedPlayerUUID(playerDisplayName);
|
||||
if (playerUniqueId != null) {
|
||||
return getCreateClanPlayer(playerUniqueId);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return getCreateClanPlayer(playerDisplayName);
|
||||
}
|
||||
UUID playerUniqueId = UUIDMigration.getForcedPlayerUUID(playerDisplayName);
|
||||
if (playerUniqueId != null) {
|
||||
return getCreateClanPlayer(playerUniqueId);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -487,9 +542,38 @@ public final class ClanManager {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Bans a player from clan commands
|
||||
*
|
||||
* @param uuid the player's uuid
|
||||
*/
|
||||
public void ban(UUID uuid) {
|
||||
ClanPlayer cp = getClanPlayer(uuid);
|
||||
Clan clan = cp.getClan();
|
||||
|
||||
if (clan != null) {
|
||||
if (clan.getSize() == 1) {
|
||||
clan.disband();
|
||||
} else {
|
||||
cp.setClan(null);
|
||||
cp.addPastClan(clan.getColorTag() + (cp.isLeader() ? ChatColor.DARK_RED + "*" : ""));
|
||||
cp.setLeader(false);
|
||||
cp.setJoinDate(0);
|
||||
clan.removeMember(uuid);
|
||||
|
||||
plugin.getStorageManager().updateClanPlayer(cp);
|
||||
plugin.getStorageManager().updateClan(clan);
|
||||
}
|
||||
}
|
||||
|
||||
plugin.getSettingsManager().addBanned(uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param playerName
|
||||
*/
|
||||
@Deprecated
|
||||
public void ban(String playerName) {
|
||||
ClanPlayer cp = getClanPlayer(playerName);
|
||||
Clan clan = cp.getClan();
|
||||
@@ -545,7 +629,7 @@ public final class ClanManager {
|
||||
out += ChatColor.WHITE + plugin.getLang("armor.h");
|
||||
} else if (h.getType().equals(Material.DIAMOND_HELMET)) {
|
||||
out += ChatColor.AQUA + plugin.getLang("armor.h");
|
||||
} else if (h.getType().equals(Material.GOLD_HELMET)) {
|
||||
} else if (h.getType().equals(Material.GOLDEN_HELMET)) {
|
||||
out += ChatColor.YELLOW + plugin.getLang("armor.h");
|
||||
} else if (h.getType().equals(Material.IRON_HELMET)) {
|
||||
out += ChatColor.GRAY + plugin.getLang("armor.h");
|
||||
@@ -564,7 +648,7 @@ public final class ClanManager {
|
||||
out += ChatColor.WHITE + plugin.getLang("armor.c");
|
||||
} else if (c.getType().equals(Material.DIAMOND_CHESTPLATE)) {
|
||||
out += ChatColor.AQUA + plugin.getLang("armor.c");
|
||||
} else if (c.getType().equals(Material.GOLD_CHESTPLATE)) {
|
||||
} else if (c.getType().equals(Material.GOLDEN_CHESTPLATE)) {
|
||||
out += ChatColor.YELLOW + plugin.getLang("armor.c");
|
||||
} else if (c.getType().equals(Material.IRON_CHESTPLATE)) {
|
||||
out += ChatColor.GRAY + plugin.getLang("armor.c");
|
||||
@@ -583,7 +667,7 @@ public final class ClanManager {
|
||||
out += ChatColor.WHITE + plugin.getLang("armor.l");
|
||||
} else if (l.getType().equals(Material.DIAMOND_LEGGINGS)) {
|
||||
out += plugin.getLang("armor.l");
|
||||
} else if (l.getType().equals(Material.GOLD_LEGGINGS)) {
|
||||
} else if (l.getType().equals(Material.GOLDEN_LEGGINGS)) {
|
||||
out += plugin.getLang("armor.l");
|
||||
} else if (l.getType().equals(Material.IRON_LEGGINGS)) {
|
||||
out += plugin.getLang("armor.l");
|
||||
@@ -602,7 +686,7 @@ public final class ClanManager {
|
||||
out += ChatColor.WHITE + plugin.getLang("armor.B");
|
||||
} else if (b.getType().equals(Material.DIAMOND_BOOTS)) {
|
||||
out += ChatColor.AQUA + plugin.getLang("armor.B");
|
||||
} else if (b.getType().equals(Material.GOLD_BOOTS)) {
|
||||
} else if (b.getType().equals(Material.GOLDEN_BOOTS)) {
|
||||
out += ChatColor.YELLOW + plugin.getLang("armor.B");
|
||||
} else if (b.getType().equals(Material.IRON_BOOTS)) {
|
||||
out += ChatColor.WHITE + plugin.getLang("armor.B");
|
||||
@@ -640,7 +724,7 @@ public final class ClanManager {
|
||||
out += ChatColor.AQUA + plugin.getLang("weapon.S") + headColor + countString;
|
||||
}
|
||||
|
||||
count = getItemCount(inv.all(Material.GOLD_SWORD));
|
||||
count = getItemCount(inv.all(Material.GOLDEN_SWORD));
|
||||
|
||||
if (count > 0) {
|
||||
String countString = count > 1 ? count + "" : "";
|
||||
@@ -661,7 +745,7 @@ public final class ClanManager {
|
||||
out += ChatColor.GRAY + plugin.getLang("weapon.S") + headColor + countString;
|
||||
}
|
||||
|
||||
count = getItemCount(inv.all(Material.WOOD_SWORD));
|
||||
count = getItemCount(inv.all(Material.WOODEN_SWORD));
|
||||
|
||||
if (count > 0) {
|
||||
String countString = count > 1 ? count + "" : "";
|
||||
@@ -680,7 +764,7 @@ public final class ClanManager {
|
||||
count += getItemCount(inv.all(Material.TIPPED_ARROW));
|
||||
|
||||
if (count > 0) {
|
||||
out += ChatColor.WHITE + headColor + count;
|
||||
out += ChatColor.WHITE + plugin.getLang("weapon.A") + headColor + count;
|
||||
}
|
||||
|
||||
if (out.length() == 0) {
|
||||
@@ -724,30 +808,30 @@ public final class ClanManager {
|
||||
count += getFoodPoints(inv, Material.CAKE, 14, 2.8);
|
||||
count += getFoodPoints(inv, Material.CARROT, 3, 3.6);
|
||||
count += getFoodPoints(inv, Material.CHORUS_FRUIT, 4, 2.4);
|
||||
count += getFoodPoints(inv, Material.RAW_FISH, 2, 5, .2); //clownfish
|
||||
count += getFoodPoints(inv, Material.COOKED_CHICKEN, 6, 7.2);
|
||||
count += getFoodPoints(inv, Material.COOKED_FISH, 5, 6);
|
||||
count += getFoodPoints(inv, Material.COOKED_MUTTON, 6, 9.6);
|
||||
count += getFoodPoints(inv, Material.GRILLED_PORK, 8, 12.8);
|
||||
count += getFoodPoints(inv, Material.COOKED_PORKCHOP, 8, 12.8);
|
||||
count += getFoodPoints(inv, Material.COOKED_RABBIT, 5, 6);
|
||||
count += getFoodPoints(inv, Material.COOKED_FISH, 1, 6, 9.6); //salmon
|
||||
count += getFoodPoints(inv, Material.COOKED_SALMON, 1, 6, 9.6);
|
||||
count += getFoodPoints(inv, Material.COOKIE, 2, .4);
|
||||
count += getFoodPoints(inv, Material.GOLDEN_APPLE, 4, 9.6);
|
||||
count += getFoodPoints(inv, Material.GOLDEN_CARROT, 6, 14.4);
|
||||
count += getFoodPoints(inv, Material.MELON, 2, 1.2);
|
||||
count += getFoodPoints(inv, Material.MUSHROOM_SOUP, 6, 7.2);
|
||||
count += getFoodPoints(inv, Material.MUSHROOM_STEW, 6, 7.2);
|
||||
count += getFoodPoints(inv, Material.POISONOUS_POTATO, 2, 1.2);
|
||||
count += getFoodPoints(inv, Material.POTATO, 1, 0.6);
|
||||
count += getFoodPoints(inv, Material.RAW_FISH, 3, 1, 0.2); //pufferfish
|
||||
count += getFoodPoints(inv, Material.PUFFERFISH, 3, 1, 0.2);
|
||||
count += getFoodPoints(inv, Material.PUMPKIN_PIE, 8, 4.8);
|
||||
count += getFoodPoints(inv, Material.RABBIT_STEW, 10, 12);
|
||||
count += getFoodPoints(inv, Material.RAW_BEEF, 3, 1.8);
|
||||
count += getFoodPoints(inv, Material.RAW_CHICKEN, 2, 1.2);
|
||||
count += getFoodPoints(inv, Material.RAW_FISH, 0, 4, .4); //fish
|
||||
count += getFoodPoints(inv, Material.BEEF, 3, 1.8);
|
||||
count += getFoodPoints(inv, Material.CHICKEN, 2, 1.2);
|
||||
count += getFoodPoints(inv, Material.MUTTON, 2, 1.2);
|
||||
count += getFoodPoints(inv, Material.PORK, 3, 1.8);
|
||||
count += getFoodPoints(inv, Material.PORKCHOP, 3, 1.8);
|
||||
count += getFoodPoints(inv, Material.RABBIT, 3, 1.8);
|
||||
count += getFoodPoints(inv, Material.RAW_FISH, 1, .4); //raw salmon
|
||||
count += getFoodPoints(inv, Material.SALMON, 1, .4);
|
||||
count += getFoodPoints(inv, Material.COD, 2, .4);
|
||||
count += getFoodPoints(inv, Material.COOKED_COD, 5, 6);
|
||||
count += getFoodPoints(inv, Material.TROPICAL_FISH, 1, .2);
|
||||
count += getFoodPoints(inv, Material.ROTTEN_FLESH, 4, .8);
|
||||
count += getFoodPoints(inv, Material.SPIDER_EYE, 2, 3.2);
|
||||
count += getFoodPoints(inv, Material.COOKED_BEEF, 8, 12.8);
|
||||
@@ -806,6 +890,90 @@ public final class ClanManager {
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort clans by active
|
||||
*
|
||||
* @param clans
|
||||
* @param asc
|
||||
*/
|
||||
public void sortClansByActive(List<Clan> clans, boolean asc) {
|
||||
clans.sort((c1, c2) -> {
|
||||
int o = 1;
|
||||
if (!asc) {
|
||||
o = -1;
|
||||
}
|
||||
|
||||
return ((Long) c1.getLastUsed()).compareTo(c2.getLastUsed()) * o;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort clans by founded date
|
||||
*
|
||||
* @param clans
|
||||
* @param asc
|
||||
*/
|
||||
public void sortClansByFounded(List<Clan> clans, boolean asc) {
|
||||
clans.sort((c1, c2) -> {
|
||||
int o = 1;
|
||||
if (!asc) {
|
||||
o = -1;
|
||||
}
|
||||
|
||||
return ((Long) c1.getFounded()).compareTo(c2.getFounded()) * o;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort clans by kdr
|
||||
*
|
||||
* @param clans
|
||||
* @param asc
|
||||
*/
|
||||
public void sortClansByKDR(List<Clan> clans, boolean asc) {
|
||||
clans.sort((c1, c2) -> {
|
||||
int o = 1;
|
||||
if (!asc) {
|
||||
o = -1;
|
||||
}
|
||||
|
||||
return ((Float) c1.getTotalKDR()).compareTo(c2.getTotalKDR()) * o;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort clans by size
|
||||
*
|
||||
* @param clans
|
||||
* @param asc
|
||||
*/
|
||||
public void sortClansBySize(List<Clan> clans, boolean asc) {
|
||||
clans.sort((c1, c2) -> {
|
||||
int o = 1;
|
||||
if (!asc) {
|
||||
o = -1;
|
||||
}
|
||||
|
||||
return ((Integer) c1.getSize()).compareTo(c2.getSize()) * o;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort clans by name
|
||||
*
|
||||
* @param clans
|
||||
*/
|
||||
public void sortClansByName(List<Clan> clans, boolean asc) {
|
||||
clans.sort((c1, c2) -> {
|
||||
int o = 1;
|
||||
if (!asc) {
|
||||
o = -1;
|
||||
}
|
||||
|
||||
return c1.getName().compareTo(c2.getName()) * o;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort clans by KDR
|
||||
@@ -880,6 +1048,32 @@ public final class ClanManager {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Purchase member fee set
|
||||
*
|
||||
* @param player
|
||||
* @return
|
||||
*/
|
||||
public boolean purchaseMemberFeeSet(Player player) {
|
||||
if (!plugin.getSettingsManager().isePurchaseMemberFeeSet()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
double price = plugin.getSettingsManager().geteMemberFeeSetPrice();
|
||||
|
||||
if (plugin.getPermissionsManager().hasEconomy()) {
|
||||
if (plugin.getPermissionsManager().playerHasMoney(player, price)) {
|
||||
plugin.getPermissionsManager().playerChargeMoney(player, price);
|
||||
player.sendMessage(ChatColor.RED + MessageFormat.format(plugin.getLang("account.has.been.debited"), price));
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + plugin.getLang("not.sufficient.money"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Purchase clan creation
|
||||
@@ -984,10 +1178,10 @@ public final class ClanManager {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Purchase Reset Kdr
|
||||
*
|
||||
*
|
||||
* @param player
|
||||
* @return
|
||||
*/
|
||||
@@ -995,9 +1189,9 @@ public final class ClanManager {
|
||||
if (!plugin.getSettingsManager().isePurchaseResetKdr()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
double price = plugin.getSettingsManager().geteResetKdr();
|
||||
|
||||
|
||||
if (plugin.getPermissionsManager().hasEconomy()) {
|
||||
if (plugin.getPermissionsManager().playerHasMoney(player, price)) {
|
||||
plugin.getPermissionsManager().playerChargeMoney(player, price);
|
||||
@@ -1101,8 +1295,8 @@ public final class ClanManager {
|
||||
* @param player
|
||||
* @param msg
|
||||
*/
|
||||
public void processClanChat(Player player, String msg) {
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
public void processClanChat(Player player, final String msg) {
|
||||
final ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
|
||||
if (cp == null) {
|
||||
return;
|
||||
@@ -1141,29 +1335,34 @@ public final class ClanManager {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + "You have unmuted clan chat");
|
||||
}
|
||||
} else {
|
||||
List<ClanPlayer> receivers = new LinkedList<>();
|
||||
final List<ClanPlayer> receivers = new LinkedList<>();
|
||||
for (ClanPlayer p : cp.getClan().getOnlineMembers()) {
|
||||
if (!p.isMuted()) {
|
||||
receivers.add(p);
|
||||
}
|
||||
}
|
||||
|
||||
ChatEvent ce = new ChatEvent(msg, cp, receivers, ChatEvent.Type.CLAN);
|
||||
Bukkit.getServer().getPluginManager().callEvent(ce);
|
||||
|
||||
if (ce.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
String message = Helper.formatClanChat(cp, ce.getMessage(), ce.getPlaceholders());
|
||||
String eyeMessage = Helper.formatSpyClanChat(cp, message);
|
||||
plugin.getServer().getConsoleSender().sendMessage(eyeMessage);
|
||||
|
||||
for (ClanPlayer p : ce.getReceivers()) {
|
||||
ChatBlock.sendMessage(p.toPlayer(), message);
|
||||
}
|
||||
|
||||
sendToAllSeeing(eyeMessage, ce.getReceivers());
|
||||
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ChatEvent ce = new ChatEvent(msg, cp, receivers, ChatEvent.Type.CLAN);
|
||||
Bukkit.getServer().getPluginManager().callEvent(ce);
|
||||
|
||||
if (ce.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
String message = Helper.formatClanChat(cp, ce.getMessage(), ce.getPlaceholders());
|
||||
String eyeMessage = Helper.formatSpyClanChat(cp, message);
|
||||
plugin.getServer().getConsoleSender().sendMessage(eyeMessage);
|
||||
|
||||
for (ClanPlayer p : ce.getReceivers()) {
|
||||
ChatBlock.sendMessage(p.toPlayer(), message);
|
||||
}
|
||||
|
||||
sendToAllSeeing(eyeMessage, ce.getReceivers());
|
||||
}
|
||||
}.runTask(plugin);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1199,8 +1398,8 @@ public final class ClanManager {
|
||||
* @param player
|
||||
* @param msg
|
||||
*/
|
||||
public void processAllyChat(Player player, String msg) {
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
public void processAllyChat(Player player, final String msg) {
|
||||
final ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
|
||||
|
||||
if (cp == null) {
|
||||
return;
|
||||
@@ -1239,41 +1438,40 @@ public final class ClanManager {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + "You have unmuted ally chat");
|
||||
}
|
||||
} else {
|
||||
List<ClanPlayer> receivers = new LinkedList<>();
|
||||
final List<ClanPlayer> receivers = new LinkedList<>();
|
||||
Set<ClanPlayer> allies = cp.getClan().getAllAllyMembers();
|
||||
allies.addAll(cp.getClan().getMembers());
|
||||
for (ClanPlayer ally : allies) {
|
||||
if (ally.isMutedAlly()) {
|
||||
continue;
|
||||
}
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
if (player.getUniqueId().equals(ally.getUniqueId())) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (player.getName().equalsIgnoreCase(ally.getName())) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (player.getUniqueId().equals(ally.getUniqueId())) {
|
||||
continue;
|
||||
}
|
||||
receivers.add(ally);
|
||||
}
|
||||
|
||||
ChatEvent ce = new ChatEvent(msg, cp, receivers, ChatEvent.Type.ALLY);
|
||||
Bukkit.getServer().getPluginManager().callEvent(ce);
|
||||
|
||||
if (ce.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
String message = Helper.formatAllyChat(cp, ce.getMessage(), ce.getPlaceholders());
|
||||
SimpleClans.log(message);
|
||||
|
||||
Player self = cp.toPlayer();
|
||||
ChatBlock.sendMessage(self, message);
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ChatEvent ce = new ChatEvent(msg, cp, receivers, ChatEvent.Type.ALLY);
|
||||
Bukkit.getServer().getPluginManager().callEvent(ce);
|
||||
|
||||
for (ClanPlayer p : ce.getReceivers()) {
|
||||
ChatBlock.sendMessage(p.toPlayer(), message);
|
||||
}
|
||||
if (ce.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
String message = Helper.formatAllyChat(cp, ce.getMessage(), ce.getPlaceholders());
|
||||
SimpleClans.log(message);
|
||||
|
||||
Player self = cp.toPlayer();
|
||||
ChatBlock.sendMessage(self, message);
|
||||
|
||||
for (ClanPlayer p : ce.getReceivers()) {
|
||||
ChatBlock.sendMessage(p.toPlayer(), message);
|
||||
}
|
||||
}
|
||||
}.runTask(plugin);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1285,12 +1483,7 @@ public final class ClanManager {
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean processGlobalChat(Player player, String msg) {
|
||||
ClanPlayer cp;
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
cp = plugin.getClanManager().getClanPlayer(player.getUniqueId());
|
||||
} else {
|
||||
cp = plugin.getClanManager().getClanPlayer(player.getName());
|
||||
}
|
||||
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player.getUniqueId());
|
||||
|
||||
if (cp == null) {
|
||||
return false;
|
||||
|
||||
@@ -7,7 +7,6 @@ import org.yaml.snakeyaml.Yaml;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.HashMap;
|
||||
import java.util.TreeMap;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public class LanguageManager {
|
||||
@@ -85,6 +84,6 @@ public class LanguageManager {
|
||||
return o.toString();
|
||||
}
|
||||
|
||||
return null;
|
||||
return "Missing language for "+key;
|
||||
}
|
||||
}
|
||||
+40
-1
@@ -157,6 +157,29 @@ public final class PermissionsManager {
|
||||
public Map<Player, PermissionAttachment> getPermAttaches() {
|
||||
return permAttaches;
|
||||
}
|
||||
|
||||
/**
|
||||
* Charge a player some money
|
||||
*
|
||||
* @param player
|
||||
* @param money
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean playerChargeMoney(String player, double money) {
|
||||
return economy.withdrawPlayer(player, money).transactionSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* Charge a player some money
|
||||
*
|
||||
* @param player
|
||||
* @param money
|
||||
* @return
|
||||
*/
|
||||
public boolean playerChargeMoney(OfflinePlayer player, double money) {
|
||||
return economy.withdrawPlayer(player, money).transactionSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* Charge a player some money
|
||||
@@ -166,7 +189,7 @@ public final class PermissionsManager {
|
||||
* @return
|
||||
*/
|
||||
public boolean playerChargeMoney(Player player, double money) {
|
||||
return economy.withdrawPlayer(player, money).transactionSuccess();
|
||||
return playerChargeMoney((OfflinePlayer) player, money);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -224,6 +247,22 @@ public final class PermissionsManager {
|
||||
return economy.getBalance(player);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a player has permissions
|
||||
*
|
||||
* @param world the world
|
||||
* @param player the player
|
||||
* @param perm the permission
|
||||
* @return whether he has the permission
|
||||
*/
|
||||
public boolean has(String world, OfflinePlayer player, String perm) {
|
||||
if (player != null && permission != null) {
|
||||
return permission.playerHas(world, player, perm);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a player has permissions
|
||||
*
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.*;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
/**
|
||||
* @author phaed
|
||||
@@ -339,11 +340,7 @@ public final class RequestManager {
|
||||
|
||||
if (denies.isEmpty()) {
|
||||
clan.addBb(plugin.getLang("leaders"), ChatColor.AQUA + MessageFormat.format(plugin.getLang("demoted.back.to.member"), Helper.capitalize(demoted)));
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
clan.demote(demotedUniqueId);
|
||||
} else {
|
||||
clan.demote(demoted);
|
||||
}
|
||||
clan.demote(demotedUniqueId);
|
||||
} else {
|
||||
String deniers = Helper.capitalize(Helper.toMessage(Helper.toArray(denies), ", "));
|
||||
clan.leaderAnnounce(ChatColor.RED + MessageFormat.format(plugin.getLang("denied.demotion"), deniers, demoted));
|
||||
@@ -358,11 +355,7 @@ public final class RequestManager {
|
||||
}
|
||||
if (denies.isEmpty()) {
|
||||
clan.addBb(plugin.getLang("leaders"), ChatColor.AQUA + MessageFormat.format(plugin.getLang("promoted.to.leader"), Helper.capitalize(promoted)));
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
clan.promote(promotedUniqueId);
|
||||
} else {
|
||||
clan.promote(promoted);
|
||||
}
|
||||
clan.promote(promotedUniqueId);
|
||||
} else {
|
||||
String deniers = Helper.capitalize(Helper.toMessage(Helper.toArray(denies), ", "));
|
||||
clan.leaderAnnounce(ChatColor.RED + MessageFormat.format(plugin.getLang("denied.the.promotion"), deniers, promoted));
|
||||
@@ -436,7 +429,7 @@ public final class RequestManager {
|
||||
*
|
||||
* @param req
|
||||
*/
|
||||
public void ask(Request req) {
|
||||
public void ask(final Request req) {
|
||||
final String tag = plugin.getSettingsManager().getClanChatBracketColor() + plugin.getSettingsManager().getClanChatTagBracketLeft() + plugin.getSettingsManager().getTagDefaultColor() + req.getClan().getColorTag() + plugin.getSettingsManager().getClanChatBracketColor() + plugin.getSettingsManager().getClanChatTagBracketRight();
|
||||
final String message = tag + " " + plugin.getSettingsManager().getRequestMessageColor() + req.getMsg();
|
||||
final String options = MessageFormat.format(plugin.getLang("accept.or.deny"), ChatBlock.makeEmpty(Helper.stripColors(tag)) + " " + ChatColor.DARK_GREEN + "/" + plugin.getSettingsManager().getCommandAccept() + plugin.getSettingsManager().getPageHeadingsColor(), ChatColor.DARK_RED + "/" + plugin.getSettingsManager().getCommandDeny());
|
||||
@@ -465,6 +458,11 @@ public final class RequestManager {
|
||||
}
|
||||
}
|
||||
|
||||
SimpleClans.getInstance().getServer().getPluginManager().callEvent(new RequestEvent(req));
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
SimpleClans.getInstance().getServer().getPluginManager().callEvent(new RequestEvent(req));
|
||||
}
|
||||
}.runTask(plugin);
|
||||
}
|
||||
}
|
||||
+262
-12
@@ -3,6 +3,7 @@ package net.sacredlabyrinth.phaed.simpleclans.managers;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Helper;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
|
||||
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
@@ -23,17 +24,27 @@ public final class SettingsManager {
|
||||
private boolean dropOnHome;
|
||||
private boolean keepOnHome;
|
||||
private boolean debugging;
|
||||
@SuppressWarnings("FieldMayBeFinal")
|
||||
private SimpleClans plugin;
|
||||
private final SimpleClans plugin;
|
||||
private boolean mChatIntegration;
|
||||
private boolean pvpOnlywhileInWar;
|
||||
private boolean useColorCodeFromPrefix;
|
||||
private boolean confirmationForPromote;
|
||||
private boolean confirmationForDemote;
|
||||
private double percentageOnlineToDemote;
|
||||
private boolean globalff;
|
||||
private boolean allowResetKdr;
|
||||
private boolean showUnverifiedOnList;
|
||||
private boolean requireVerification;
|
||||
private boolean rejoinCooldownEnabled;
|
||||
private int rejoinCooldown;
|
||||
private String listDefault;
|
||||
private String listSize;
|
||||
private String listKdr;
|
||||
private String listName;
|
||||
private String listFounded;
|
||||
private String listActive;
|
||||
private String listAsc;
|
||||
private String listDesc;
|
||||
private List<Integer> itemsList;
|
||||
private List<String> blacklistedWorlds;
|
||||
private List<String> bannedPlayers;
|
||||
@@ -50,6 +61,11 @@ public final class SettingsManager {
|
||||
private boolean eIssuerPaysRegroup;
|
||||
private boolean ePurchaseHomeTeleportSet;
|
||||
private boolean ePurchaseResetKdr;
|
||||
private boolean eMemberFee;
|
||||
private boolean ePurchaseMemberFeeSet;
|
||||
private boolean eClanUpkeepEnabled;
|
||||
private boolean eMultiplyUpkeepBySize;
|
||||
private boolean eChargeUpkeepOnlyIfMemberFeeEnabled;
|
||||
private double eCreationPrice;
|
||||
private double eVerificationPrice;
|
||||
private double eInvitePrice;
|
||||
@@ -57,6 +73,9 @@ public final class SettingsManager {
|
||||
private double eHomeRegroupPrice;
|
||||
private double eHomeTeleportPriceSet;
|
||||
private double eResetKdr;
|
||||
private double eMaxMemberFee;
|
||||
private double eMemberFeeSetPrice;
|
||||
private double eClanUpkeep;
|
||||
private String serverName;
|
||||
private boolean chatTags;
|
||||
private int purgeClan;
|
||||
@@ -73,6 +92,7 @@ public final class SettingsManager {
|
||||
private String pageUnTrustedColor;
|
||||
private boolean bbShowOnLogin;
|
||||
private int bbSize;
|
||||
private int bbLoginSize;
|
||||
private String bbColor;
|
||||
private String bbAccentColor;
|
||||
private String commandClan;
|
||||
@@ -86,6 +106,8 @@ public final class SettingsManager {
|
||||
private int clanMinSizeToRival;
|
||||
private int clanMinLength;
|
||||
private int clanMaxLength;
|
||||
private int clanMaxDescriptionLength;
|
||||
private int clanMinDescriptionLength;
|
||||
private String pageClanNameColor;
|
||||
private int tagMinLength;
|
||||
private int tagMaxLength;
|
||||
@@ -135,14 +157,13 @@ public final class SettingsManager {
|
||||
private String username;
|
||||
private String password;
|
||||
private boolean safeCivilians;
|
||||
@SuppressWarnings("FieldMayBeFinal")
|
||||
private File main;
|
||||
@SuppressWarnings("FieldMayBeFinal")
|
||||
private FileConfiguration config;
|
||||
private final File main;
|
||||
private final FileConfiguration config;
|
||||
private boolean compatMode;
|
||||
private boolean homebaseSetOnce;
|
||||
private int waitSecs;
|
||||
private boolean enableAutoGroups;
|
||||
private boolean denySameIPKills;
|
||||
private boolean moneyperkill;
|
||||
private double KDRMultipliesPerKill;
|
||||
private boolean teleportBlocks;
|
||||
@@ -154,6 +175,10 @@ public final class SettingsManager {
|
||||
private boolean forceCommandPriority;
|
||||
private int maxAsksPerRequest;
|
||||
private int maxMembers;
|
||||
private boolean maxKillsPerVictimEnabled;
|
||||
private int maxKillsPerVictim;
|
||||
private boolean delayBetweenKillsEnabled;
|
||||
private int delayBetweenKills;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -204,6 +229,16 @@ public final class SettingsManager {
|
||||
unRivableClans = getConfig().getStringList("settings.unrivable-clans");
|
||||
showUnverifiedOnList = getConfig().getBoolean("settings.show-unverified-on-list");
|
||||
requireVerification = getConfig().getBoolean("settings.new-clan-verification-required");
|
||||
rejoinCooldown = getConfig().getInt("settings.rejoin-cooldown");
|
||||
rejoinCooldownEnabled = getConfig().getBoolean("settings.rejoin-cooldown-enabled");
|
||||
listActive = getConfig().getString("list.active", "active");
|
||||
listKdr = getConfig().getString("list.kdr", "kdr");
|
||||
listDefault = getConfig().getString("list.default", listKdr);
|
||||
listSize = getConfig().getString("list.size", "size");
|
||||
listName = getConfig().getString("list.name", "name");
|
||||
listFounded = getConfig().getString("list.founded", "founded");
|
||||
listAsc = getConfig().getString("list.asc", "asc");
|
||||
listDesc = getConfig().getString("list.desc", "desc");
|
||||
serverName = getConfig().getString("settings.server-name");
|
||||
chatTags = getConfig().getBoolean("settings.display-chat-tags");
|
||||
rivalLimitPercent = getConfig().getInt("settings.rival-limit-percent");
|
||||
@@ -214,6 +249,8 @@ public final class SettingsManager {
|
||||
ePurchaseHomeRegroup = getConfig().getBoolean("economy.purchase-home-regroup");
|
||||
ePurchaseHomeTeleportSet = getConfig().getBoolean("economy.purchase-home-teleport-set");
|
||||
ePurchaseResetKdr = getConfig().getBoolean("economy.purchase-reset-kdr");
|
||||
ePurchaseMemberFeeSet = getConfig().getBoolean("economy.purchase-member-fee-set");
|
||||
eMemberFeeSetPrice = getConfig().getDouble("economy.member-fee-set-price");
|
||||
eResetKdr = getConfig().getDouble("economy.reset-kdr-price");
|
||||
eCreationPrice = getConfig().getDouble("economy.creation-price");
|
||||
eVerificationPrice = getConfig().getDouble("economy.verification-price");
|
||||
@@ -223,6 +260,12 @@ public final class SettingsManager {
|
||||
eUniqueTaxOnRegroup = getConfig().getBoolean("economy.unique-tax-on-regroup");
|
||||
eIssuerPaysRegroup = getConfig().getBoolean("economy.issuer-pays-regroup");
|
||||
eHomeTeleportPriceSet = getConfig().getDouble("economy.home-teleport-set-price");
|
||||
eMaxMemberFee = getConfig().getDouble("economy.max-member-fee");
|
||||
eClanUpkeep = getConfig().getDouble("economy.upkeep");
|
||||
eClanUpkeepEnabled = getConfig().getBoolean("economy.upkeep-enabled");
|
||||
eChargeUpkeepOnlyIfMemberFeeEnabled = getConfig().getBoolean("economy.charge-upkeep-only-if-member-fee-enabled");
|
||||
eMultiplyUpkeepBySize = getConfig().getBoolean("economy.multiply-upkeep-by-clan-size");
|
||||
eMemberFee = getConfig().getBoolean("economy.member-fee-enabled");
|
||||
purgeClan = getConfig().getInt("purge.inactive-clan-days");
|
||||
purgeUnverified = getConfig().getInt("purge.unverified-clan-days");
|
||||
purgePlayers = getConfig().getInt("purge.inactive-player-data-days");
|
||||
@@ -239,6 +282,7 @@ public final class SettingsManager {
|
||||
pageClanNameColor = getConfig().getString("page.clan-name-color");
|
||||
bbShowOnLogin = getConfig().getBoolean("bb.show-on-login");
|
||||
bbSize = getConfig().getInt("bb.size");
|
||||
bbLoginSize = getConfig().getInt("bb.login-size", bbSize);
|
||||
bbColor = getConfig().getString("bb.color");
|
||||
bbAccentColor = getConfig().getString("bb.accent-color");
|
||||
commandClan = getConfig().getString("commands.clan");
|
||||
@@ -253,11 +297,14 @@ public final class SettingsManager {
|
||||
waitSecs = getConfig().getInt("clan.homebase-teleport-wait-secs");
|
||||
confirmationForPromote = getConfig().getBoolean("clan.confirmation-for-demote");
|
||||
confirmationForDemote = getConfig().getBoolean("clan.confirmation-for-promote");
|
||||
percentageOnlineToDemote = getConfig().getDouble("clan.percentage-online-to-demote");
|
||||
clanTrustByDefault = getConfig().getBoolean("clan.trust-members-by-default");
|
||||
clanMinSizeToAlly = getConfig().getInt("clan.min-size-to-set-ally");
|
||||
clanMinSizeToRival = getConfig().getInt("clan.min-size-to-set-rival");
|
||||
clanMinLength = getConfig().getInt("clan.min-length");
|
||||
clanMaxLength = getConfig().getInt("clan.max-length");
|
||||
clanMaxDescriptionLength = getConfig().getInt("clan.max-description-length");
|
||||
clanMinDescriptionLength = getConfig().getInt("clan.min-description-length");
|
||||
clanFFOnByDefault = getConfig().getBoolean("clan.ff-on-by-default");
|
||||
tagMinLength = getConfig().getInt("tag.min-length");
|
||||
tagMaxLength = getConfig().getInt("tag.max-length");
|
||||
@@ -300,6 +347,7 @@ public final class SettingsManager {
|
||||
kwRival = getConfig().getDouble("kill-weights.rival");
|
||||
kwNeutral = getConfig().getDouble("kill-weights.neutral");
|
||||
kwCivilian = getConfig().getDouble("kill-weights.civilian");
|
||||
denySameIPKills = getConfig().getBoolean("kill-weights.deny-same-ip-kills");
|
||||
useMysql = getConfig().getBoolean("mysql.enable");
|
||||
host = getConfig().getString("mysql.host");
|
||||
port = getConfig().getInt("mysql.port");
|
||||
@@ -317,7 +365,11 @@ public final class SettingsManager {
|
||||
useThreads = getConfig().getBoolean("performance.use-threads");
|
||||
useBungeeCord = getConfig().getBoolean("performance.use-bungeecord");
|
||||
maxMembers = getConfig().getInt("clan.max-members");
|
||||
|
||||
maxKillsPerVictim = getConfig().getInt("kdr-grinding-prevention.max-kills-per-victim");
|
||||
maxKillsPerVictimEnabled = getConfig().getBoolean("kdr-grinding-prevention.enable-max-kills");
|
||||
delayBetweenKills = getConfig().getInt("kdr-grinding-prevention.delay-between-kills");
|
||||
delayBetweenKillsEnabled = getConfig().getBoolean("kdr-grinding-prevention.enable-kill-delay");
|
||||
|
||||
// migrate from old way of adding ports
|
||||
if (database.contains(":")) {
|
||||
String[] strings = database.split(":");
|
||||
@@ -336,6 +388,42 @@ public final class SettingsManager {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the delay between kills
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getDelayBetweenKills() {
|
||||
return delayBetweenKills;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the delay between kills is enabled
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isDelayBetweenKills() {
|
||||
return delayBetweenKillsEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the max number of kills per victim
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getMaxKillsPerVictim() {
|
||||
return maxKillsPerVictim;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if there is a max number of kills per victim
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isMaxKillsPerVictim() {
|
||||
return maxKillsPerVictimEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether an item is in the list
|
||||
@@ -388,6 +476,62 @@ public final class SettingsManager {
|
||||
return word.equalsIgnoreCase("clan") || word.equalsIgnoreCase(commandMore) || word.equalsIgnoreCase(commandDeny) || word.equalsIgnoreCase(commandAccept);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the upkeep is to be charged only from clans with the member fee enabled
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isChargeUpkeepOnlyIfMemberFeeEnabled() {
|
||||
return eChargeUpkeepOnlyIfMemberFeeEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the upkeep should be multiplied by the clan size
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isMultiplyUpkeepBySize() {
|
||||
return eMultiplyUpkeepBySize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the upkeep is enabled
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isClanUpkeep() {
|
||||
return eClanUpkeepEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the upkeep
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public double getClanUpkeep() {
|
||||
if (eClanUpkeep < 0) {
|
||||
eClanUpkeep = 0;
|
||||
}
|
||||
return eClanUpkeep;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the max member fee allowed
|
||||
* @return
|
||||
*/
|
||||
public double getMaxMemberFee() {
|
||||
return eMaxMemberFee;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the member fee is enabled
|
||||
* @return
|
||||
*/
|
||||
public boolean isMemberFee() {
|
||||
return eMemberFee;
|
||||
}
|
||||
|
||||
public boolean isAllowResetKdr() {
|
||||
return allowResetKdr;
|
||||
@@ -396,6 +540,23 @@ public final class SettingsManager {
|
||||
public boolean isePurchaseResetKdr() {
|
||||
return ePurchaseResetKdr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the price to pay for setting the member fee
|
||||
*
|
||||
* @return the price
|
||||
*/
|
||||
public double geteMemberFeeSetPrice() {
|
||||
return eMemberFeeSetPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* Do leaders need to pay for setting the member fee?
|
||||
* @return true if so
|
||||
*/
|
||||
public boolean isePurchaseMemberFeeSet() {
|
||||
return ePurchaseMemberFeeSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the price to reset the KDR
|
||||
@@ -449,7 +610,7 @@ public final class SettingsManager {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check whether a player is banned
|
||||
*
|
||||
@@ -469,7 +630,7 @@ public final class SettingsManager {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add a player to the banned list
|
||||
*
|
||||
@@ -529,7 +690,8 @@ public final class SettingsManager {
|
||||
if (!bannedPlayers.contains(playerUniqueId.toString())) {
|
||||
bannedPlayers.add(playerUniqueId.toString());
|
||||
}
|
||||
|
||||
|
||||
getConfig().set("settings.banned-players", bannedPlayers);
|
||||
save();
|
||||
}
|
||||
|
||||
@@ -542,7 +704,8 @@ public final class SettingsManager {
|
||||
if (bannedPlayers.contains(playerUniqueId.toString())) {
|
||||
bannedPlayers.remove(playerUniqueId.toString());
|
||||
}
|
||||
|
||||
|
||||
getConfig().set("settings.banned-players", bannedPlayers);
|
||||
save();
|
||||
}
|
||||
|
||||
@@ -559,8 +722,48 @@ public final class SettingsManager {
|
||||
public boolean isRequireVerification() {
|
||||
return requireVerification;
|
||||
}
|
||||
|
||||
public boolean isRejoinCooldown() {
|
||||
return rejoinCooldownEnabled;
|
||||
}
|
||||
|
||||
public int getRejoinCooldown() {
|
||||
return rejoinCooldown;
|
||||
}
|
||||
|
||||
public String getListDefault() {
|
||||
return listDefault;
|
||||
}
|
||||
|
||||
/**
|
||||
public String getListSize() {
|
||||
return listSize;
|
||||
}
|
||||
|
||||
public String getListKdr() {
|
||||
return listKdr;
|
||||
}
|
||||
|
||||
public String getListName() {
|
||||
return listName;
|
||||
}
|
||||
|
||||
public String getListFounded() {
|
||||
return listFounded;
|
||||
}
|
||||
|
||||
public String getListActive() {
|
||||
return listActive;
|
||||
}
|
||||
|
||||
public String getListAsc() {
|
||||
return listAsc;
|
||||
}
|
||||
|
||||
public String getListDesc() {
|
||||
return listDesc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the bannedPlayers
|
||||
*/
|
||||
public List<String> getBannedPlayers() {
|
||||
@@ -679,6 +882,13 @@ public final class SettingsManager {
|
||||
return bbSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the bbLoginSize
|
||||
*/
|
||||
public int getBbLoginSize() {
|
||||
return bbLoginSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the bbColor
|
||||
*/
|
||||
@@ -734,8 +944,32 @@ public final class SettingsManager {
|
||||
public int getClanMinSizeToRival() {
|
||||
return clanMinSizeToRival;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the max length of the clan description
|
||||
*
|
||||
* @return the max length
|
||||
*/
|
||||
public int getClanMaxDescriptionLength() {
|
||||
if (clanMaxDescriptionLength > 255 || clanMaxDescriptionLength < 0) {
|
||||
clanMaxDescriptionLength = 255;
|
||||
}
|
||||
return clanMaxDescriptionLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the min length of the clan description
|
||||
*
|
||||
* @return the min length
|
||||
*/
|
||||
public int getClanMinDescriptionLength() {
|
||||
if (clanMinDescriptionLength < 0 || clanMinDescriptionLength > getClanMaxDescriptionLength()) {
|
||||
clanMinDescriptionLength = 0;
|
||||
}
|
||||
return clanMinDescriptionLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the clanMinLength
|
||||
*/
|
||||
public int getClanMinLength() {
|
||||
@@ -1068,6 +1302,22 @@ public final class SettingsManager {
|
||||
public boolean isConfirmationForDemote() {
|
||||
return confirmationForDemote;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the min percentage of leaders online required to demote someone
|
||||
*
|
||||
* @return the percentage
|
||||
*/
|
||||
public double getPercentageOnlineToDemote() {
|
||||
if (percentageOnlineToDemote <= 0 || percentageOnlineToDemote > 100) {
|
||||
percentageOnlineToDemote = 100;
|
||||
}
|
||||
return percentageOnlineToDemote;
|
||||
}
|
||||
|
||||
public boolean isDenySameIPKills() {
|
||||
return denySameIPKills;
|
||||
}
|
||||
|
||||
public boolean isUseColorCodeFromPrefix() {
|
||||
return useColorCodeFromPrefix;
|
||||
|
||||
@@ -12,6 +12,7 @@ import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
@@ -45,11 +46,7 @@ public final class StorageManager {
|
||||
* @return
|
||||
*/
|
||||
public ChatBlock getChatBlock(Player player) {
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
return chatBlocks.get(player.getUniqueId().toString());
|
||||
} else {
|
||||
return chatBlocks.get(player.getName());
|
||||
}
|
||||
return chatBlocks.get(player.getUniqueId().toString());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -59,17 +56,13 @@ public final class StorageManager {
|
||||
* @param cb
|
||||
*/
|
||||
public void addChatBlock(CommandSender player, ChatBlock cb) {
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
UUID uuid = UUIDMigration.getForcedPlayerUUID(player.getName());
|
||||
UUID uuid = UUIDMigration.getForcedPlayerUUID(player.getName());
|
||||
|
||||
if (uuid == null) {
|
||||
return;
|
||||
}
|
||||
if (uuid == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
chatBlocks.put(uuid.toString(), cb);
|
||||
} else {
|
||||
chatBlocks.put(player.getName(), cb);
|
||||
}
|
||||
chatBlocks.put(uuid.toString(), cb);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,21 +78,64 @@ public final class StorageManager {
|
||||
if (!core.existsTable("sc_clans")) {
|
||||
SimpleClans.log("Creating table: sc_clans");
|
||||
|
||||
String query = "CREATE TABLE IF NOT EXISTS `sc_clans` ( `id` bigint(20) NOT NULL auto_increment, `verified` tinyint(1) default '0', `tag` varchar(25) NOT NULL, `color_tag` varchar(25) NOT NULL, `name` varchar(100) NOT NULL, `friendly_fire` tinyint(1) default '0', `founded` bigint NOT NULL, `last_used` bigint NOT NULL, `packed_allies` text NOT NULL, `packed_rivals` text NOT NULL, `packed_bb` mediumtext NOT NULL, `cape_url` varchar(255) NOT NULL, `flags` text NOT NULL, `balance` double(64,2), PRIMARY KEY (`id`), UNIQUE KEY `uq_simpleclans_1` (`tag`));";
|
||||
String query = "CREATE TABLE IF NOT EXISTS `sc_clans` ("
|
||||
+ " `id` bigint(20) NOT NULL auto_increment,"
|
||||
+ " `verified` tinyint(1) default '0',"
|
||||
+ " `tag` varchar(25) NOT NULL,"
|
||||
+ " `color_tag` varchar(25) NOT NULL,"
|
||||
+ " `name` varchar(100) NOT NULL,"
|
||||
+ " `description` varchar(255),"
|
||||
+ " `friendly_fire` tinyint(1) default '0',"
|
||||
+ " `founded` bigint NOT NULL,"
|
||||
+ " `last_used` bigint NOT NULL,"
|
||||
+ " `packed_allies` text NOT NULL,"
|
||||
+ " `packed_rivals` text NOT NULL,"
|
||||
+ " `packed_bb` mediumtext NOT NULL,"
|
||||
+ " `cape_url` varchar(255) NOT NULL,"
|
||||
+ " `flags` text NOT NULL,"
|
||||
+ " `balance` double(64,2),"
|
||||
+ " `fee_enabled` tinyint(1) default '0',"
|
||||
+ " `fee_value` double(64,2),"
|
||||
+ " PRIMARY KEY (`id`),"
|
||||
+ " UNIQUE KEY `uq_simpleclans_1` (`tag`));";
|
||||
core.execute(query);
|
||||
}
|
||||
|
||||
if (!core.existsTable("sc_players")) {
|
||||
SimpleClans.log("Creating table: sc_players");
|
||||
|
||||
String query = "CREATE TABLE IF NOT EXISTS `sc_players` ( `id` bigint(20) NOT NULL auto_increment, `name` varchar(16) NOT NULL, `leader` tinyint(1) default '0', `tag` varchar(25) NOT NULL, `friendly_fire` tinyint(1) default '0', `neutral_kills` int(11) default NULL, `rival_kills` int(11) default NULL, `civilian_kills` int(11) default NULL, `deaths` int(11) default NULL, `last_seen` bigint NOT NULL, `join_date` bigint NOT NULL, `trusted` tinyint(1) default '0', `flags` text NOT NULL, `packed_past_clans` text, PRIMARY KEY (`id`), UNIQUE KEY `uq_sc_players_1` (`name`));";
|
||||
String query = "CREATE TABLE IF NOT EXISTS `sc_players` ("
|
||||
+ " `id` bigint(20) NOT NULL auto_increment,"
|
||||
+ " `name` varchar(16) NOT NULL,"
|
||||
+ " `leader` tinyint(1) default '0',"
|
||||
+ " `tag` varchar(25) NOT NULL,"
|
||||
+ " `friendly_fire` tinyint(1) default '0',"
|
||||
+ " `neutral_kills` int(11) default NULL,"
|
||||
+ " `rival_kills` int(11) default NULL,"
|
||||
+ " `civilian_kills` int(11) default NULL,"
|
||||
+ " `deaths` int(11) default NULL,"
|
||||
+ " `last_seen` bigint NOT NULL,"
|
||||
+ " `join_date` bigint NOT NULL,"
|
||||
+ " `trusted` tinyint(1) default '0',"
|
||||
+ " `flags` text NOT NULL,"
|
||||
+ " `packed_past_clans` text,"
|
||||
+ " `resign_times` text,"
|
||||
+ " PRIMARY KEY (`id`),"
|
||||
+ " UNIQUE KEY `uq_sc_players_1` (`name`));";
|
||||
core.execute(query);
|
||||
}
|
||||
|
||||
if (!core.existsTable("sc_kills")) {
|
||||
SimpleClans.log("Creating table: sc_kills");
|
||||
|
||||
String query = "CREATE TABLE IF NOT EXISTS `sc_kills` ( `kill_id` bigint(20) NOT NULL auto_increment, `attacker` varchar(16) NOT NULL, `attacker_tag` varchar(16) NOT NULL, `victim` varchar(16) NOT NULL, `victim_tag` varchar(16) NOT NULL, `kill_type` varchar(1) NOT NULL, PRIMARY KEY (`kill_id`));";
|
||||
String query = "CREATE TABLE IF NOT EXISTS `sc_kills` ("
|
||||
+ " `kill_id` bigint(20) NOT NULL auto_increment,"
|
||||
+ " `attacker` varchar(16) NOT NULL,"
|
||||
+ " `attacker_tag` varchar(16) NOT NULL,"
|
||||
+ " `victim` varchar(16) NOT NULL,"
|
||||
+ " `victim_tag` varchar(16) NOT NULL,"
|
||||
+ " `kill_type` varchar(1) NOT NULL,"
|
||||
+ " PRIMARY KEY (`kill_id`));";
|
||||
core.execute(query);
|
||||
}
|
||||
} else {
|
||||
@@ -114,21 +150,64 @@ public final class StorageManager {
|
||||
if (!core.existsTable("sc_clans")) {
|
||||
SimpleClans.log("Creating table: sc_clans");
|
||||
|
||||
String query = "CREATE TABLE IF NOT EXISTS `sc_clans` ( `id` bigint(20), `verified` tinyint(1) default '0', `tag` varchar(25) NOT NULL, `color_tag` varchar(25) NOT NULL, `name` varchar(100) NOT NULL, `friendly_fire` tinyint(1) default '0', `founded` bigint NOT NULL, `last_used` bigint NOT NULL, `packed_allies` text NOT NULL, `packed_rivals` text NOT NULL, `packed_bb` mediumtext NOT NULL, `cape_url` varchar(255) NOT NULL, `flags` text NOT NULL, `balance` double(64,2) default 0.0, PRIMARY KEY (`id`), UNIQUE (`tag`));";
|
||||
String query = "CREATE TABLE IF NOT EXISTS `sc_clans` ("
|
||||
+ " `id` bigint(20),"
|
||||
+ " `verified` tinyint(1) default '0',"
|
||||
+ " `tag` varchar(25) NOT NULL,"
|
||||
+ " `color_tag` varchar(25) NOT NULL,"
|
||||
+ " `name` varchar(100) NOT NULL,"
|
||||
+ " `description` varchar(255),"
|
||||
+ " `friendly_fire` tinyint(1) default '0',"
|
||||
+ " `founded` bigint NOT NULL,"
|
||||
+ " `last_used` bigint NOT NULL,"
|
||||
+ " `packed_allies` text NOT NULL,"
|
||||
+ " `packed_rivals` text NOT NULL,"
|
||||
+ " `packed_bb` mediumtext NOT NULL,"
|
||||
+ " `cape_url` varchar(255) NOT NULL,"
|
||||
+ " `flags` text NOT NULL,"
|
||||
+ " `balance` double(64,2) default 0.0,"
|
||||
+ " `fee_enabled` tinyint(1) default '0',"
|
||||
+ " `fee_value` double(64,2),"
|
||||
+ " PRIMARY KEY (`id`),"
|
||||
+ " UNIQUE (`tag`));";
|
||||
core.execute(query);
|
||||
}
|
||||
|
||||
if (!core.existsTable("sc_players")) {
|
||||
SimpleClans.log("Creating table: sc_players");
|
||||
|
||||
String query = "CREATE TABLE IF NOT EXISTS `sc_players` ( `id` bigint(20), `name` varchar(16) NOT NULL, `leader` tinyint(1) default '0', `tag` varchar(25) NOT NULL, `friendly_fire` tinyint(1) default '0', `neutral_kills` int(11) default NULL, `rival_kills` int(11) default NULL, `civilian_kills` int(11) default NULL, `deaths` int(11) default NULL, `last_seen` bigint NOT NULL, `join_date` bigint NOT NULL, `trusted` tinyint(1) default '0', `flags` text NOT NULL, `packed_past_clans` text, PRIMARY KEY (`id`), UNIQUE (`name`));";
|
||||
String query = "CREATE TABLE IF NOT EXISTS `sc_players` ("
|
||||
+ " `id` bigint(20),"
|
||||
+ " `name` varchar(16) NOT NULL,"
|
||||
+ " `leader` tinyint(1) default '0',"
|
||||
+ " `tag` varchar(25) NOT NULL,"
|
||||
+ " `friendly_fire` tinyint(1) default '0',"
|
||||
+ " `neutral_kills` int(11) default NULL,"
|
||||
+ " `rival_kills` int(11) default NULL,"
|
||||
+ " `civilian_kills` int(11) default NULL,"
|
||||
+ " `deaths` int(11) default NULL,"
|
||||
+ " `last_seen` bigint NOT NULL,"
|
||||
+ " `join_date` bigint NOT NULL,"
|
||||
+ " `trusted` tinyint(1) default '0',"
|
||||
+ " `flags` text NOT NULL,"
|
||||
+ " `packed_past_clans` text,"
|
||||
+ " `resign_times` text,"
|
||||
+ " PRIMARY KEY (`id`),"
|
||||
+ " UNIQUE (`name`));";
|
||||
core.execute(query);
|
||||
}
|
||||
|
||||
if (!core.existsTable("sc_kills")) {
|
||||
SimpleClans.log("Creating table: sc_kills");
|
||||
|
||||
String query = "CREATE TABLE IF NOT EXISTS `sc_kills` ( `kill_id` bigint(20), `attacker` varchar(16) NOT NULL, `attacker_tag` varchar(16) NOT NULL, `victim` varchar(16) NOT NULL, `victim_tag` varchar(16) NOT NULL, `kill_type` varchar(1) NOT NULL, PRIMARY KEY (`kill_id`));";
|
||||
String query = "CREATE TABLE IF NOT EXISTS `sc_kills` ("
|
||||
+ " `kill_id` bigint(20),"
|
||||
+ " `attacker` varchar(16) NOT NULL,"
|
||||
+ " `attacker_tag` varchar(16) NOT NULL,"
|
||||
+ " `victim` varchar(16) NOT NULL,"
|
||||
+ " `victim_tag` varchar(16) NOT NULL,"
|
||||
+ " `kill_type` varchar(1) NOT NULL,"
|
||||
+ " PRIMARY KEY (`kill_id`));";
|
||||
core.execute(query);
|
||||
}
|
||||
} else {
|
||||
@@ -263,6 +342,7 @@ public final class StorageManager {
|
||||
String tag = res.getString("tag");
|
||||
String color_tag = Helper.parseColors(res.getString("color_tag"));
|
||||
String name = res.getString("name");
|
||||
String description = res.getString("description");
|
||||
String packed_allies = res.getString("packed_allies");
|
||||
String packed_rivals = res.getString("packed_rivals");
|
||||
String packed_bb = res.getString("packed_bb");
|
||||
@@ -271,6 +351,8 @@ public final class StorageManager {
|
||||
long founded = res.getLong("founded");
|
||||
long last_used = res.getLong("last_used");
|
||||
double balance = res.getDouble("balance");
|
||||
double feeValue = res.getDouble("fee_value");
|
||||
boolean feeEnabled = res.getBoolean("fee_enabled");
|
||||
|
||||
if (founded == 0) {
|
||||
founded = (new Date()).getTime();
|
||||
@@ -287,6 +369,7 @@ public final class StorageManager {
|
||||
clan.setTag(tag);
|
||||
clan.setColorTag(color_tag);
|
||||
clan.setName(name);
|
||||
clan.setDescription(description);
|
||||
clan.setPackedAllies(packed_allies);
|
||||
clan.setPackedRivals(packed_rivals);
|
||||
clan.setPackedBb(packed_bb);
|
||||
@@ -294,6 +377,8 @@ public final class StorageManager {
|
||||
clan.setFounded(founded);
|
||||
clan.setLastUsed(last_used);
|
||||
clan.setBalance(balance);
|
||||
clan.setMemberFee(feeValue);
|
||||
clan.setMemberFeeEnabled(feeEnabled);
|
||||
|
||||
out.add(clan);
|
||||
} catch (Exception ex) {
|
||||
@@ -333,6 +418,7 @@ public final class StorageManager {
|
||||
String tag = res.getString("tag");
|
||||
String color_tag = Helper.parseColors(res.getString("color_tag"));
|
||||
String name = res.getString("name");
|
||||
String description = res.getString("description");
|
||||
String packed_allies = res.getString("packed_allies");
|
||||
String packed_rivals = res.getString("packed_rivals");
|
||||
String packed_bb = res.getString("packed_bb");
|
||||
@@ -341,6 +427,8 @@ public final class StorageManager {
|
||||
long founded = res.getLong("founded");
|
||||
long last_used = res.getLong("last_used");
|
||||
double balance = res.getDouble("balance");
|
||||
double feeValue = res.getDouble("fee_value");
|
||||
boolean feeEnabled = res.getBoolean("fee_enabled");
|
||||
|
||||
if (founded == 0) {
|
||||
founded = (new Date()).getTime();
|
||||
@@ -357,6 +445,7 @@ public final class StorageManager {
|
||||
clan.setTag(tag);
|
||||
clan.setColorTag(color_tag);
|
||||
clan.setName(name);
|
||||
clan.setDescription(description);
|
||||
clan.setPackedAllies(packed_allies);
|
||||
clan.setPackedRivals(packed_rivals);
|
||||
clan.setPackedBb(packed_bb);
|
||||
@@ -364,6 +453,8 @@ public final class StorageManager {
|
||||
clan.setFounded(founded);
|
||||
clan.setLastUsed(last_used);
|
||||
clan.setBalance(balance);
|
||||
clan.setMemberFee(feeValue);
|
||||
clan.setMemberFeeEnabled(feeEnabled);
|
||||
|
||||
out = clan;
|
||||
} catch (Exception ex) {
|
||||
@@ -410,7 +501,8 @@ public final class StorageManager {
|
||||
long join_date = res.getLong("join_date");
|
||||
String flags = res.getString("flags");
|
||||
String packed_past_clans = Helper.parseColors(res.getString("packed_past_clans"));
|
||||
|
||||
String resign_times = res.getString("resign_times");
|
||||
|
||||
if (last_seen == 0) {
|
||||
last_seen = (new Date()).getTime();
|
||||
}
|
||||
@@ -435,6 +527,7 @@ public final class StorageManager {
|
||||
cp.setJoinDate(join_date);
|
||||
cp.setPackedPastClans(packed_past_clans);
|
||||
cp.setTrusted(leader || trusted);
|
||||
cp.setResignTimes(Helper.resignTimesFromJson(resign_times));
|
||||
|
||||
if (!tag.isEmpty()) {
|
||||
Clan clan = SimpleClans.getInstance().getClanManager().getClan(tag);
|
||||
@@ -491,7 +584,8 @@ public final class StorageManager {
|
||||
long join_date = res.getLong("join_date");
|
||||
String flags = res.getString("flags");
|
||||
String packed_past_clans = Helper.parseColors(res.getString("packed_past_clans"));
|
||||
|
||||
String resign_times = res.getString("resign_times");
|
||||
|
||||
if (last_seen == 0) {
|
||||
last_seen = (new Date()).getTime();
|
||||
}
|
||||
@@ -516,7 +610,8 @@ public final class StorageManager {
|
||||
cp.setJoinDate(join_date);
|
||||
cp.setPackedPastClans(packed_past_clans);
|
||||
cp.setTrusted(leader || trusted);
|
||||
|
||||
cp.setResignTimes(Helper.resignTimesFromJson(resign_times));
|
||||
|
||||
if (!tag.isEmpty()) {
|
||||
Clan clanDB = retrieveOneClan(tag);
|
||||
Clan clan = SimpleClans.getInstance().getClanManager().getClan(tag);
|
||||
@@ -567,8 +662,8 @@ public final class StorageManager {
|
||||
* @param clan
|
||||
*/
|
||||
public void insertClan(Clan clan) {
|
||||
String query = "INSERT INTO `sc_clans` ( `verified`, `tag`, `color_tag`, `name`, `friendly_fire`, `founded`, `last_used`, `packed_allies`, `packed_rivals`, `packed_bb`, `cape_url`, `flags`, `balance`) ";
|
||||
String values = "VALUES ( " + (clan.isVerified() ? 1 : 0) + ",'" + Helper.escapeQuotes(clan.getTag()) + "','" + Helper.escapeQuotes(clan.getColorTag()) + "','" + Helper.escapeQuotes(clan.getName()) + "'," + (clan.isFriendlyFire() ? 1 : 0) + ",'" + clan.getFounded() + "','" + clan.getLastUsed() + "','" + Helper.escapeQuotes(clan.getPackedAllies()) + "','" + Helper.escapeQuotes(clan.getPackedRivals()) + "','" + Helper.escapeQuotes(clan.getPackedBb()) + "','" + Helper.escapeQuotes(clan.getCapeUrl()) + "','" + Helper.escapeQuotes(clan.getFlags()) + "','" + Helper.escapeQuotes(String.valueOf(clan.getBalance())) + "');";
|
||||
String query = "INSERT INTO `sc_clans` (`description`, `fee_enabled`, `fee_value`, `verified`, `tag`, `color_tag`, `name`, `friendly_fire`, `founded`, `last_used`, `packed_allies`, `packed_rivals`, `packed_bb`, `cape_url`, `flags`, `balance`) ";
|
||||
String values = "VALUES ( '" + Helper.escapeQuotes(clan.getDescription()) + "'," + (clan.isMemberFeeEnabled() ? 1 : 0) +","+ Helper.escapeQuotes(String.valueOf(clan.getMemberFee())) + "," + (clan.isVerified() ? 1 : 0) + ",'" + Helper.escapeQuotes(clan.getTag()) + "','" + Helper.escapeQuotes(clan.getColorTag()) + "','" + Helper.escapeQuotes(clan.getName()) + "'," + (clan.isFriendlyFire() ? 1 : 0) + ",'" + clan.getFounded() + "','" + clan.getLastUsed() + "','" + Helper.escapeQuotes(clan.getPackedAllies()) + "','" + Helper.escapeQuotes(clan.getPackedRivals()) + "','" + Helper.escapeQuotes(clan.getPackedBb()) + "','" + Helper.escapeQuotes(clan.getCapeUrl()) + "','" + Helper.escapeQuotes(clan.getFlags()) + "','" + Helper.escapeQuotes(String.valueOf(clan.getBalance())) + "');";
|
||||
core.insert(query + values);
|
||||
}
|
||||
|
||||
@@ -577,14 +672,13 @@ public final class StorageManager {
|
||||
*
|
||||
* @param clan
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public void updateClanAsync(final Clan clan) {
|
||||
plugin.getServer().getScheduler().scheduleAsyncDelayedTask(plugin, new Runnable() {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
updateClan(clan);
|
||||
}
|
||||
});
|
||||
}.runTaskAsynchronously(plugin);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -592,18 +686,17 @@ public final class StorageManager {
|
||||
*
|
||||
* @param p to update
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public void updatePlayerNameAsync(final Player p) {
|
||||
plugin.getServer().getScheduler().scheduleAsyncDelayedTask(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
updatePlayerName(p);
|
||||
}
|
||||
});
|
||||
}
|
||||
}.runTaskAsynchronously(plugin);
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the name of a player in the database asynchronously
|
||||
* Change the name of a player in the database
|
||||
*
|
||||
* @param p to update
|
||||
*/
|
||||
@@ -618,9 +711,7 @@ public final class StorageManager {
|
||||
* @param clan
|
||||
*/
|
||||
public void updateClan(Clan clan) {
|
||||
clan.updateLastUsed();
|
||||
String query = "UPDATE `sc_clans` SET verified = " + (clan.isVerified() ? 1 : 0) + ", tag = '" + Helper.escapeQuotes(clan.getTag()) + "', color_tag = '" + Helper.escapeQuotes(clan.getColorTag()) + "', name = '" + Helper.escapeQuotes(clan.getName()) + "', friendly_fire = " + (clan.isFriendlyFire() ? 1 : 0) + ", founded = '" + clan.getFounded() + "', last_used = '" + clan.getLastUsed() + "', packed_allies = '" + Helper.escapeQuotes(clan.getPackedAllies()) + "', packed_rivals = '" + Helper.escapeQuotes(clan.getPackedRivals()) + "', packed_bb = '" + Helper.escapeQuotes(clan.getPackedBb()) + "', cape_url = '" + Helper.escapeQuotes(clan.getCapeUrl()) + "', cape_url = '" + Helper.escapeQuotes(String.valueOf(clan.getCapeUrl())) + "', balance = '" + clan.getBalance() + "', flags = '" + Helper.escapeQuotes(clan.getFlags()) + "' WHERE tag = '" + Helper.escapeQuotes(clan.getTag()) + "';";
|
||||
core.update(query);
|
||||
updateClan(clan, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -633,8 +724,8 @@ public final class StorageManager {
|
||||
public void updateClan(Clan clan, boolean updateLastUsed) {
|
||||
if (updateLastUsed) {
|
||||
clan.updateLastUsed();
|
||||
}
|
||||
String query = "UPDATE `sc_clans` SET verified = " + (clan.isVerified() ? 1 : 0) + ", tag = '" + Helper.escapeQuotes(clan.getTag()) + "', color_tag = '" + Helper.escapeQuotes(clan.getColorTag()) + "', name = '" + Helper.escapeQuotes(clan.getName()) + "', friendly_fire = " + (clan.isFriendlyFire() ? 1 : 0) + ", founded = '" + clan.getFounded() + "', last_used = '" + clan.getLastUsed() + "', packed_allies = '" + Helper.escapeQuotes(clan.getPackedAllies()) + "', packed_rivals = '" + Helper.escapeQuotes(clan.getPackedRivals()) + "', packed_bb = '" + Helper.escapeQuotes(clan.getPackedBb()) + "', cape_url = '" + Helper.escapeQuotes(clan.getCapeUrl()) + "', cape_url = '" + Helper.escapeQuotes(String.valueOf(clan.getCapeUrl())) + "', balance = '" + clan.getBalance() + "', flags = '" + Helper.escapeQuotes(clan.getFlags()) + "' WHERE tag = '" + Helper.escapeQuotes(clan.getTag()) + "';";
|
||||
}
|
||||
String query = "UPDATE `sc_clans` SET description = '" + Helper.escapeQuotes(clan.getDescription())+ "', fee_enabled = "+ (clan.isMemberFeeEnabled() ? 1 : 0) +", fee_value = '" + clan.getMemberFee() + "', verified = " + (clan.isVerified() ? 1 : 0) + ", tag = '" + Helper.escapeQuotes(clan.getTag()) + "', color_tag = '" + Helper.escapeQuotes(clan.getColorTag()) + "', name = '" + Helper.escapeQuotes(clan.getName()) + "', friendly_fire = " + (clan.isFriendlyFire() ? 1 : 0) + ", founded = '" + clan.getFounded() + "', last_used = '" + clan.getLastUsed() + "', packed_allies = '" + Helper.escapeQuotes(clan.getPackedAllies()) + "', packed_rivals = '" + Helper.escapeQuotes(clan.getPackedRivals()) + "', packed_bb = '" + Helper.escapeQuotes(clan.getPackedBb()) + "', cape_url = '" + Helper.escapeQuotes(clan.getCapeUrl()) + "', cape_url = '" + Helper.escapeQuotes(String.valueOf(clan.getCapeUrl())) + "', balance = '" + clan.getBalance() + "', flags = '" + Helper.escapeQuotes(clan.getFlags()) + "' WHERE tag = '" + Helper.escapeQuotes(clan.getTag()) + "';";
|
||||
core.update(query);
|
||||
}
|
||||
|
||||
@@ -654,15 +745,9 @@ public final class StorageManager {
|
||||
* @param cp
|
||||
*/
|
||||
public void insertClanPlayer(ClanPlayer cp) {
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
String query = "INSERT INTO `sc_players` ( `uuid`, `name`, `leader`, `tag`, `friendly_fire`, `neutral_kills`, `rival_kills`, `civilian_kills`, `deaths`, `last_seen`, `join_date`, `packed_past_clans`, `flags`) ";
|
||||
String values = "VALUES ( '" + cp.getUniqueId().toString() + "', '" + cp.getName() + "'," + (cp.isLeader() ? 1 : 0) + ",'" + Helper.escapeQuotes(cp.getTag()) + "'," + (cp.isFriendlyFire() ? 1 : 0) + "," + cp.getNeutralKills() + "," + cp.getRivalKills() + "," + cp.getCivilianKills() + "," + cp.getDeaths() + ",'" + cp.getLastSeen() + "',' " + cp.getJoinDate() + "','" + Helper.escapeQuotes(cp.getPackedPastClans()) + "','" + Helper.escapeQuotes(cp.getFlags()) + "');";
|
||||
core.insert(query + values);
|
||||
} else {
|
||||
String query = "INSERT INTO `sc_players` ( `name`, `leader`, `tag`, `friendly_fire`, `neutral_kills`, `rival_kills`, `civilian_kills`, `deaths`, `last_seen`, `join_date`, `packed_past_clans`, `flags`) ";
|
||||
String values = "VALUES ( '" + cp.getName() + "'," + (cp.isLeader() ? 1 : 0) + ",'" + Helper.escapeQuotes(cp.getTag()) + "'," + (cp.isFriendlyFire() ? 1 : 0) + "," + cp.getNeutralKills() + "," + cp.getRivalKills() + "," + cp.getCivilianKills() + "," + cp.getDeaths() + ",'" + cp.getLastSeen() + "',' " + cp.getJoinDate() + "','" + Helper.escapeQuotes(cp.getPackedPastClans()) + "','" + Helper.escapeQuotes(cp.getFlags()) + "');";
|
||||
core.insert(query + values);
|
||||
}
|
||||
String query = "INSERT INTO `sc_players` (`resign_times`, `uuid`, `name`, `leader`, `tag`, `friendly_fire`, `neutral_kills`, `rival_kills`, `civilian_kills`, `deaths`, `last_seen`, `join_date`, `packed_past_clans`, `flags`) ";
|
||||
String values = "VALUES ( '"+ Helper.escapeQuotes(Helper.resignTimesToJson(cp.getResignTimes()))+ "', '" + cp.getUniqueId().toString() + "', '" + cp.getName() + "'," + (cp.isLeader() ? 1 : 0) + ",'" + Helper.escapeQuotes(cp.getTag()) + "'," + (cp.isFriendlyFire() ? 1 : 0) + "," + cp.getNeutralKills() + "," + cp.getRivalKills() + "," + cp.getCivilianKills() + "," + cp.getDeaths() + ",'" + cp.getLastSeen() + "',' " + cp.getJoinDate() + "','" + Helper.escapeQuotes(cp.getPackedPastClans()) + "','" + Helper.escapeQuotes(cp.getFlags()) + "');";
|
||||
core.insert(query + values);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -670,14 +755,13 @@ public final class StorageManager {
|
||||
*
|
||||
* @param cp
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public void updateClanPlayerAsync(final ClanPlayer cp) {
|
||||
plugin.getServer().getScheduler().scheduleAsyncDelayedTask(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
updateClanPlayer(cp);
|
||||
}
|
||||
});
|
||||
}
|
||||
}.runTaskAsynchronously(plugin);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -687,13 +771,8 @@ public final class StorageManager {
|
||||
*/
|
||||
public void updateClanPlayer(ClanPlayer cp) {
|
||||
cp.updateLastSeen();
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
String query = "UPDATE `sc_players` SET leader = " + (cp.isLeader() ? 1 : 0) + ", tag = '" + Helper.escapeQuotes(cp.getTag()) + "' , friendly_fire = " + (cp.isFriendlyFire() ? 1 : 0) + ", neutral_kills = " + cp.getNeutralKills() + ", rival_kills = " + cp.getRivalKills() + ", civilian_kills = " + cp.getCivilianKills() + ", deaths = " + cp.getDeaths() + ", last_seen = '" + cp.getLastSeen() + "', packed_past_clans = '" + Helper.escapeQuotes(cp.getPackedPastClans()) + "', trusted = " + (cp.isTrusted() ? 1 : 0) + ", flags = '" + Helper.escapeQuotes(cp.getFlags()) + "', name = '" + cp.getName() + "' WHERE `uuid` = '" + cp.getUniqueId().toString() + "';";
|
||||
core.update(query);
|
||||
} else {
|
||||
String query = "UPDATE `sc_players` SET leader = " + (cp.isLeader() ? 1 : 0) + ", tag = '" + Helper.escapeQuotes(cp.getTag()) + "' , friendly_fire = " + (cp.isFriendlyFire() ? 1 : 0) + ", neutral_kills = " + cp.getNeutralKills() + ", rival_kills = " + cp.getRivalKills() + ", civilian_kills = " + cp.getCivilianKills() + ", deaths = " + cp.getDeaths() + ", last_seen = '" + cp.getLastSeen() + "', packed_past_clans = '" + Helper.escapeQuotes(cp.getPackedPastClans()) + "', trusted = " + (cp.isTrusted() ? 1 : 0) + ", flags = '" + Helper.escapeQuotes(cp.getFlags()) + "' WHERE name = '" + cp.getName() + "';";
|
||||
core.update(query);
|
||||
}
|
||||
String query = "UPDATE `sc_players` SET resign_times = '"+ Helper.escapeQuotes(Helper.resignTimesToJson(cp.getResignTimes())) +"', leader = " + (cp.isLeader() ? 1 : 0) + ", tag = '" + Helper.escapeQuotes(cp.getTag()) + "' , friendly_fire = " + (cp.isFriendlyFire() ? 1 : 0) + ", neutral_kills = " + cp.getNeutralKills() + ", rival_kills = " + cp.getRivalKills() + ", civilian_kills = " + cp.getCivilianKills() + ", deaths = " + cp.getDeaths() + ", last_seen = '" + cp.getLastSeen() + "', packed_past_clans = '" + Helper.escapeQuotes(cp.getPackedPastClans()) + "', trusted = " + (cp.isTrusted() ? 1 : 0) + ", flags = '" + Helper.escapeQuotes(cp.getFlags()) + "', name = '" + cp.getName() + "' WHERE `uuid` = '" + cp.getUniqueId().toString() + "';";
|
||||
core.update(query);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -702,17 +781,16 @@ public final class StorageManager {
|
||||
* @param cp
|
||||
*/
|
||||
public void deleteClanPlayer(ClanPlayer cp) {
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
String query = "DELETE FROM `sc_players` WHERE uuid = '" + cp.getUniqueId() + "';";
|
||||
core.delete(query);
|
||||
deleteKills(cp.getUniqueId());
|
||||
} else {
|
||||
String query = "DELETE FROM `sc_players` WHERE name = '" + cp.getName() + "';";
|
||||
core.delete(query);
|
||||
deleteKills(cp.getName());
|
||||
final Clan clan = cp.getClan();
|
||||
if (clan != null) {
|
||||
clan.addBbWithoutSaving(ChatColor.AQUA + MessageFormat.format(plugin.getLang("has.been.purged"), cp.getName()));
|
||||
updateClan(clan, false);
|
||||
}
|
||||
String query = "DELETE FROM `sc_players` WHERE uuid = '" + cp.getUniqueId() + "';";
|
||||
core.delete(query);
|
||||
deleteKills(cp.getUniqueId());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Insert a kill into the database
|
||||
*
|
||||
@@ -723,15 +801,9 @@ public final class StorageManager {
|
||||
* @param type
|
||||
*/
|
||||
public void insertKill(Player attacker, String attackerTag, Player victim, String victimTag, String type) {
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
String query = "INSERT INTO `sc_kills` ( `attacker_uuid`, `attacker`, `attacker_tag`, `victim_uuid`, `victim`, `victim_tag`, `kill_type`) ";
|
||||
String values = "VALUES ( '" + attacker.getUniqueId() + "','" + attacker.getName() + "','" + attackerTag + "','" + victim.getUniqueId() + "','" + victim.getName() + "','" + victimTag + "','" + type + "');";
|
||||
core.insert(query + values);
|
||||
} else {
|
||||
String query = "INSERT INTO `sc_kills` ( `attacker`, `attacker_tag`, `victim`, `victim_tag`, `kill_type`) ";
|
||||
String values = "VALUES ( '" + attacker.getName() + "','" + attackerTag + "','" + victim.getName() + "','" + victimTag + "','" + type + "');";
|
||||
core.insert(query + values);
|
||||
}
|
||||
String query = "INSERT INTO `sc_kills` ( `attacker_uuid`, `attacker`, `attacker_tag`, `victim_uuid`, `victim`, `victim_tag`, `kill_type`) ";
|
||||
String values = "VALUES ( '" + attacker.getUniqueId() + "','" + attacker.getName() + "','" + attackerTag + "','" + victim.getUniqueId() + "','" + victim.getName() + "','" + victimTag + "','" + type + "');";
|
||||
core.insert(query + values);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -823,6 +895,51 @@ public final class StorageManager {
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets, asynchronously, a map of tag->count of all kills and notifies via callback when it's ready
|
||||
*
|
||||
* @param callback
|
||||
*/
|
||||
public void getMostKilled(DataCallback<Map<String, Integer>> callback) {
|
||||
new BukkitRunnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
callback.onResultReady(getMostKilled());
|
||||
}
|
||||
}.runTaskAsynchronously(plugin);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets, asynchronously, a map of victim->count of all kills that specific player did and notifies via callback when it's ready
|
||||
*
|
||||
* @param playerName
|
||||
* @param callback
|
||||
*/
|
||||
public void getKillsPerPlayer(final String playerName, final DataCallback<Map<String, Integer>> callback) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
callback.onResultReady(getKillsPerPlayer(playerName));
|
||||
}
|
||||
}.runTaskAsynchronously(plugin);
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback that returns some data
|
||||
*
|
||||
* @author roinujnosde
|
||||
*
|
||||
*/
|
||||
public interface DataCallback<T> {
|
||||
/**
|
||||
* Notifies when the result is ready
|
||||
*
|
||||
* @param data
|
||||
*/
|
||||
void onResultReady(T data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the database to the latest version
|
||||
*
|
||||
@@ -838,6 +955,34 @@ public final class StorageManager {
|
||||
query = "ALTER TABLE sc_clans ADD COLUMN `balance` double(64,2);";
|
||||
core.execute(query);
|
||||
}
|
||||
|
||||
/**
|
||||
* From 2.7.16 to 2.7.17
|
||||
*/
|
||||
if (!core.existsColumn("sc_clans", "fee_enabled")) {
|
||||
query = "ALTER TABLE sc_clans ADD COLUMN `fee_enabled` tinyint(1) default '0';";
|
||||
core.execute(query);
|
||||
}
|
||||
if (!core.existsColumn("sc_clans", "fee_value")) {
|
||||
query = "ALTER TABLE sc_clans ADD COLUMN `fee_value` double(64,2);";
|
||||
core.execute(query);
|
||||
}
|
||||
|
||||
/**
|
||||
* From 2.7.21 to 2.7.22
|
||||
*/
|
||||
if (!core.existsColumn("sc_clans", "description")) {
|
||||
query = "ALTER TABLE sc_clans ADD COLUMN `description` varchar(255);";
|
||||
core.execute(query);
|
||||
}
|
||||
|
||||
/**
|
||||
* From 2.7.22 to 2.7.23
|
||||
*/
|
||||
if (!core.existsColumn("sc_players", "resign_times")) {
|
||||
query = "ALTER TABLE sc_players ADD COLUMN `resign_times` text;";
|
||||
core.execute(query);
|
||||
}
|
||||
|
||||
/**
|
||||
* Bukkit 1.7.5+ UUID Migration
|
||||
|
||||
@@ -36,17 +36,13 @@ public final class TeleportManager {
|
||||
* @param clanName
|
||||
*/
|
||||
public void addPlayer(Player player, Location dest, String clanName) {
|
||||
int secs = SimpleClans.getInstance().getSettingsManager().getWaitSecs();
|
||||
int secs = SimpleClans.getInstance().getSettingsManager().getWaitSecs();
|
||||
waitingPlayers.put(player.getUniqueId().toString(), new TeleportState(player, dest, clanName));
|
||||
|
||||
if (SimpleClans.getInstance().hasUUID()) {
|
||||
waitingPlayers.put(player.getUniqueId().toString(), new TeleportState(player, dest, clanName));
|
||||
} else {
|
||||
waitingPlayers.put(player.getName(), new TeleportState(player, dest, clanName));
|
||||
}
|
||||
|
||||
if (secs > 0) {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA + MessageFormat.format(plugin.getLang("waiting.for.teleport.stand.still.for.0.seconds"), secs));
|
||||
}
|
||||
if (secs > 0) {
|
||||
ChatBlock.sendMessage(player, ChatColor.AQUA
|
||||
+ MessageFormat.format(plugin.getLang("waiting.for.teleport.stand.still.for.0.seconds"), secs));
|
||||
}
|
||||
}
|
||||
|
||||
private void dropItems(Player player) {
|
||||
@@ -61,7 +57,7 @@ public final class TeleportManager {
|
||||
|
||||
List<Integer> itemsList = plugin.getSettingsManager().getItemsList();
|
||||
|
||||
if (itemsList.contains(item.getTypeId())) {
|
||||
if (itemsList.contains(item.getType().getId())) {
|
||||
player.getWorld().dropItemNaturally(player.getLocation(), item);
|
||||
inv.remove(item);
|
||||
}
|
||||
@@ -78,7 +74,7 @@ public final class TeleportManager {
|
||||
|
||||
List<Integer> itemsList = plugin.getSettingsManager().getItemsList();
|
||||
|
||||
if (!itemsList.contains(item.getTypeId())) {
|
||||
if (!itemsList.contains(item.getType().getId())) {
|
||||
player.getWorld().dropItemNaturally(player.getLocation(), item);
|
||||
inv.remove(item);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.tasks;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Clan;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Helper;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author roinujnosde
|
||||
*/
|
||||
public class CollectFeeTask extends BukkitRunnable {
|
||||
|
||||
/**
|
||||
* Starts the repetitive task
|
||||
*/
|
||||
public void start() {
|
||||
long delay = Helper.getDelayTo(1, 0);
|
||||
|
||||
this.runTaskTimerAsynchronously(SimpleClans.getInstance(), delay * 20, 86400 * 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* (used internally)
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
final SimpleClans plugin = SimpleClans.getInstance();
|
||||
|
||||
for (Clan clan : plugin.getClanManager().getClans()) {
|
||||
final double memberFee = clan.getMemberFee();
|
||||
|
||||
if (clan.isMemberFeeEnabled() && memberFee > 0) {
|
||||
for (ClanPlayer cp : clan.getFeePayers()) {
|
||||
|
||||
final boolean success = plugin.getPermissionsManager()
|
||||
.playerChargeMoney(Bukkit.getOfflinePlayer(cp.getUniqueId()), memberFee);
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (success) {
|
||||
ChatBlock.sendMessage(cp.toPlayer(), ChatColor.AQUA +
|
||||
MessageFormat.format(plugin.getLang("fee.collected"), memberFee));
|
||||
clan.setBalance(clan.getBalance() + memberFee);
|
||||
plugin.getStorageManager().updateClanAsync(clan);
|
||||
} else {
|
||||
clan.removePlayerFromClan(cp.getUniqueId());
|
||||
clan.addBb(ChatColor.AQUA +
|
||||
MessageFormat.format(plugin.getLang("bb.fee.player.kicked"), cp.getName()));
|
||||
}
|
||||
}
|
||||
}.runTask(plugin);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.tasks;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Helper;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.SettingsManager;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author roinujnosde
|
||||
*/
|
||||
public class CollectUpkeepTask extends BukkitRunnable {
|
||||
|
||||
/**
|
||||
* Starts the repetitive task
|
||||
*/
|
||||
public void start() {
|
||||
long delay = Helper.getDelayTo(1, 30);
|
||||
|
||||
this.runTaskTimerAsynchronously(SimpleClans.getInstance(), delay * 20, 86400 * 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* (used internally)
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
final SimpleClans plugin = SimpleClans.getInstance();
|
||||
final SettingsManager settingsManager = plugin.getSettingsManager();
|
||||
plugin.getClanManager().getClans().forEach((clan) -> {
|
||||
if (settingsManager.isChargeUpkeepOnlyIfMemberFeeEnabled() && !clan.isMemberFeeEnabled()) {
|
||||
return;
|
||||
}
|
||||
double upkeep = settingsManager.getClanUpkeep();
|
||||
if (settingsManager.isMultiplyUpkeepBySize()) {
|
||||
upkeep = upkeep * clan.getSize();
|
||||
}
|
||||
final double balance = clan.getBalance();
|
||||
if (balance >= upkeep) {
|
||||
clan.setBalance(balance - upkeep);
|
||||
clan.addBb(ChatColor.AQUA + MessageFormat.format(plugin.getLang("upkeep.collected"), upkeep), false);
|
||||
} else {
|
||||
clan.disband();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package net.sacredlabyrinth.phaed.simpleclans.tasks;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.Helper;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
|
||||
import net.sacredlabyrinth.phaed.simpleclans.managers.SettingsManager;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author roinujnosde
|
||||
*/
|
||||
public class UpkeepWarningTask extends BukkitRunnable {
|
||||
|
||||
/**
|
||||
* Starts the repetitive task
|
||||
*
|
||||
*/
|
||||
public void start() {
|
||||
long delay = Helper.getDelayTo(12, 0);
|
||||
|
||||
this.runTaskTimerAsynchronously(SimpleClans.getInstance(), delay * 20, 86400 * 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* (used internally)
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
final SimpleClans plugin = SimpleClans.getInstance();
|
||||
final SettingsManager sm = plugin.getSettingsManager();
|
||||
plugin.getClanManager().getClans().forEach((clan) -> {
|
||||
if (sm.isChargeUpkeepOnlyIfMemberFeeEnabled() && !clan.isMemberFeeEnabled()) {
|
||||
return;
|
||||
}
|
||||
final double balance = clan.getBalance();
|
||||
double upkeep = sm.getClanUpkeep();
|
||||
if (sm.isMultiplyUpkeepBySize()) {
|
||||
upkeep = upkeep * clan.getSize();
|
||||
}
|
||||
if (balance < upkeep) {
|
||||
clan.addBb(MessageFormat.format(plugin.getLang("balance.is.not.enough.for.upkeep"), upkeep), false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,11 +27,11 @@ public class UUIDMigration {
|
||||
}
|
||||
|
||||
public static UUID getForcedPlayerUUID(String playerDisplayName) {
|
||||
Player OnlinePlayer = SimpleClans.getInstance().getServer().getPlayerExact(playerDisplayName);
|
||||
OfflinePlayer OfflinePlayer = SimpleClans.getInstance().getServer().getOfflinePlayer(playerDisplayName);
|
||||
Player onlinePlayer = SimpleClans.getInstance().getServer().getPlayerExact(playerDisplayName);
|
||||
OfflinePlayer offlinePlayer = SimpleClans.getInstance().getServer().getOfflinePlayer(playerDisplayName);
|
||||
|
||||
if (OnlinePlayer != null) {
|
||||
return OnlinePlayer.getUniqueId();
|
||||
if (onlinePlayer != null) {
|
||||
return onlinePlayer.getUniqueId();
|
||||
} else {
|
||||
for (ClanPlayer cp : SimpleClans.getInstance().getClanManager().getAllClanPlayers()) {
|
||||
if (cp.getName().equalsIgnoreCase(playerDisplayName)) {
|
||||
@@ -41,8 +41,8 @@ public class UUIDMigration {
|
||||
try {
|
||||
return UUIDFetcher.getUUIDOf(playerDisplayName);
|
||||
} catch (Exception ex) {
|
||||
if (OfflinePlayer != null) {
|
||||
return OfflinePlayer.getUniqueId();
|
||||
if (offlinePlayer != null) {
|
||||
return offlinePlayer.getUniqueId();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -45,6 +45,22 @@ settings:
|
||||
new-clan-verification-required: true
|
||||
allow-regroup-command: true
|
||||
allow-reset-kdr: false
|
||||
rejoin-cooldown: 60
|
||||
rejoin-cooldown-enabled: false
|
||||
kdr-grinding-prevention:
|
||||
enable-max-kills: false
|
||||
max-kills-per-victim: 10
|
||||
enable-kill-delay: false
|
||||
delay-between-kills: 5
|
||||
list:
|
||||
size: size
|
||||
kdr: kdr
|
||||
name: name
|
||||
founded: founded
|
||||
active: active
|
||||
asc: asc
|
||||
desc: desc
|
||||
default: kdr
|
||||
commands:
|
||||
more: more
|
||||
ally: ally
|
||||
@@ -73,19 +89,31 @@ economy:
|
||||
money-per-kill-kdr-multipier: 10
|
||||
purchase-reset-kdr: true
|
||||
reset-kdr-price: 10000.0
|
||||
purchase-member-fee-set: false
|
||||
member-fee-set-price: 1000.0
|
||||
member-fee-enabled: false
|
||||
max-member-fee: 200.0
|
||||
upkeep: 200.0
|
||||
upkeep-enabled: false
|
||||
multiply-upkeep-by-clan-size: false
|
||||
charge-upkeep-only-if-member-fee-enabled: true
|
||||
kill-weights:
|
||||
rival: 2.0
|
||||
civilian: 0.0
|
||||
neutral: 1.0
|
||||
deny-same-ip-kills: false
|
||||
clan:
|
||||
homebase-teleport-wait-secs: 10
|
||||
homebase-can-be-set-only-once: true
|
||||
min-size-to-set-rival: 3
|
||||
max-length: 25
|
||||
max-description-length: 120
|
||||
min-description-length: 10
|
||||
max-members: 25
|
||||
confirmation-for-promote: false
|
||||
trust-members-by-default: false
|
||||
confirmation-for-demote: false
|
||||
percentage-online-to-demote: 100.0
|
||||
ff-on-by-default: false
|
||||
min-length: 2
|
||||
min-size-to-set-ally: 3
|
||||
@@ -115,6 +143,7 @@ bb:
|
||||
accent-color: '8'
|
||||
show-on-login: true
|
||||
size: 6
|
||||
login-size: 6
|
||||
allychat:
|
||||
enable: true
|
||||
format: "&b[Ally Chat] &4<%clan%&4> <%nick-color%%player%&4> %rank%: &b%message%"
|
||||
|
||||
@@ -1,417 +0,0 @@
|
||||
create.command: "criar"
|
||||
list.command: "listar"
|
||||
profile.command: "perfil"
|
||||
roster.command: "roster" #TODO
|
||||
lookup.command: "lookup" #TODO
|
||||
leaderboard.command: "leaderboard" #TODO
|
||||
alliances.command: "aliancas"
|
||||
rivalries.command: "rivalidades"
|
||||
vitals.command: "saude"
|
||||
coords.command: "coords"
|
||||
stats.command: "estatisticas"
|
||||
ally.command: "aliado"
|
||||
rival.command: "rival"
|
||||
bb.command: "bb"
|
||||
cape.command: "capa"
|
||||
modtag.command: "mudartag"
|
||||
toggle.command: "alternar"
|
||||
invite.command: "convidar"
|
||||
kick.command: "expulsar"
|
||||
bank.command: "banco"
|
||||
trust.command: "confiar"
|
||||
untrust.command: "naoconfiar"
|
||||
promote.command: "promover"
|
||||
demote.command: "rebaixar"
|
||||
clanff.command: "clanff"
|
||||
ff.command: "ff"
|
||||
resign.command: "abandonar"
|
||||
disband.command: "debandar"
|
||||
verify.command: "verificar"
|
||||
ban.command: "banir"
|
||||
unban.command: "desbanir"
|
||||
reload.command: "recarregar"
|
||||
globalff.command: "globalff"
|
||||
kills.command: "kills"
|
||||
mostkilled.command: "maismatou"
|
||||
war.command: "guerra"
|
||||
home.command: "casa"
|
||||
setrank.command: "definirrank"
|
||||
place.command: "colocar"
|
||||
resetkdr.command: "redefinirkdr"
|
||||
usage.resetkdr: "Usage: /{0} resetkdr [all/player]" #TODO: from here, to the bottom
|
||||
usage.clan.alliances: "Usage: /{0} alliances"
|
||||
usage.ally: "Usage: /{0} ally add/remove [tag]"
|
||||
usage.ban.unban: "Usage: /{0} ban/unban [player]"
|
||||
usage.rival: "Usage: /{0} rival add/remove [tag]"
|
||||
usage.war: "Usage: /{0} war start/end [tag]"
|
||||
usage.cape.url: "Usage: /{0} cape [url]"
|
||||
usage.setrank: "Usage: /{0} setrank [player] [rank], rank can be multiple worlds and contain &f color codes"
|
||||
usage.clanff: "Usage: /{0} clanff allow/block"
|
||||
usage.0.coords: "Usage: /{0} coords"
|
||||
usage.create.tag: "Usage: /{0} create [tag] [name]"
|
||||
usage.demote.leader: "Usage: /{0} demote [leader]"
|
||||
usage.0.disband: "Usage: /{0} disband"
|
||||
usage.0.ff.allow.auto: "Usage: /{0} ff allow/auto"
|
||||
usage.0.globalff.allow.auto: "Usage: /{0} globalff allow/auto"
|
||||
usage.0.permissions.player: "Usage: /{0} permissions [clan] add/remove [permission]"
|
||||
usage.0.invite.player: "Usage: /{0} invite [player]"
|
||||
usage.kick.player: "Usage: /{0} kick [player]"
|
||||
usage.bank: "Usage: /{0} bank withdraw/deposit/status [amount]"
|
||||
usage.0.modtag.tag: "Usage: /{0} modtag [tag]"
|
||||
usage.list: "Usage: /{0} list"
|
||||
usage.lookup.tag: "Usage: /{0} lookup [tag]"
|
||||
usage.0.profile.tag: "Usage: /{0} profile [tag]"
|
||||
usage.0.promote.member: "Usage: /{0} promote <member>"
|
||||
usage.0.rivalries: "Usage: /{0} rivalries"
|
||||
usage.0.roster.tag: "Usage: /{0} roster [tag]"
|
||||
usage.0.stats: "Usage: /{0} stats"
|
||||
usage.0.trust.player: "Usage: /{0} trust [player]"
|
||||
usage.0.untrust.player: "Usage: /{0} untrust [player]"
|
||||
usage.0.verify.tag: "Usage: /{0} verify [tag]"
|
||||
usage.0.vitals: "Usage: /{0} vitals"
|
||||
usage.0.place: "Usage: /{0} place [player] [tag]"
|
||||
usage.0.leaderboard: "Usage: /{0} leaderboard"
|
||||
0.reload.1.reload.configuration: "/{0} reload{1} - Reload configuration"
|
||||
0.globalff.allow.auto.1.set.global.friendly.fire: "/{0} globalff allow/auto {1} - Set global friendly fire"
|
||||
0.place: "/{0} place [player] [tag]{1} - Place a player in a clan"
|
||||
0.ban.unban.player.1.ban.unban.a.player: "/{0} ban/unban [player]{1} - Ban/unban a player"
|
||||
0.hometp.clan.1.tp.home.a.clan: "/{0} home tp [clan]{1} - Teleport to all clans homes"
|
||||
0.disband.tag.1.disband.a.clan: "/{0} disband [tag]{1} - Disband a clan"
|
||||
0.resetkdr.1.resets.kdr: "/{0} resetkdr player/all{1} - Reset KDR of all players or just of one"
|
||||
0.resetkdr.1.resets.your.kdr: "/{0} resetkdr{1} - Reset your KDR"
|
||||
0.verify.tag.1.verify.an.unverified.clan: "/{0} verify [tag]{1} - Verify an unverified clan"
|
||||
0.verify.1.purchase.verification.of.your.clan: "/{0} verify{1} - Purchase verification of your clan"
|
||||
0.list.1.lists.all.clans: "/{0} list{1} - Lists all clans"
|
||||
0.profile.1.view.your.clan.s.profile: "/{0} profile{1} - View your clan''s profile"
|
||||
0.profile.tag.1.view.a.clan.s.profile: "/{0} profile [tag]{1} - View a clan''s profile"
|
||||
0.lookup.1.lookup.your.info: "/{0} lookup{1} - Lookup your info"
|
||||
0.lookup.player.1.lookup.a.player.s.info: "/{0} lookup [player]{1} - Lookup a player''s info"
|
||||
0.leaderboard.1.view.leaderboard: "/{0} leaderboard{1} - View leaderboard"
|
||||
0.alliances.1.view.all.clan.alliances: "/{0} alliances{1} - View all clan alliances"
|
||||
0.rivalries.1.view.all.clan.rivalries: "/{0} rivalries{1} - View all clan rivalries"
|
||||
0.roster.1.view.your.clan.s.member.list: "/{0} roster{1} - View your clan''s member list"
|
||||
0.roster.tag.1.view.a.clan.s.member.list: "/{0} roster [tag]{1} - View a clan''s member list"
|
||||
0.vitals.1.view.your.clan.member.s.vitals: "/{0} vitals{1} - View your clan member''s vitals"
|
||||
0.coords.1.view.your.clan.member.s.coordinates: "/{0} coords{1} - View your clan member''s coordinates"
|
||||
0.stats.1.view.your.clan.member.s.stats: "/{0} stats{1} - View your clan member''s stats"
|
||||
0.ally.add.remove.tag.1.add.remove.an.ally.clan: "/{0} ally add/remove [tag]{1} - Add/remove an ally clan"
|
||||
0.rival.add.remove.tag.1.add.remove.a.rival.clan: "/{0} rival add/remove [tag]{1} - Add/remove a rival clan"
|
||||
0.bb.1.display.bulletin.board: "/{0} bb{1} - Display bulletin board"
|
||||
0.bb.msg.1.add.a.message.to.the.bulletin.board: "/{0} bb [msg]{1} - Add a message to the bulletin board"
|
||||
0.modtag.tag.1.modify.the.clan.s.tag: "/{0} modtag [tag]{1} - Modify the clan''s tag"
|
||||
0.cape.url.1.change.your.clan.s.cape: "/{0} cape [url]{1} - Change your clan''s cape"
|
||||
0.invite.player.1.invite.a.player: "/{0} invite [player]{1} - Invite a player"
|
||||
0.kick.player.1.kick.a.player.from.the.clan: "/{0} kick [player]{1} - Kick a player from the clan"
|
||||
0.trust.untrust.player.1.set.trust.level1: "/{0} trust [player]{1} - Set member as trusted"
|
||||
0.trust.untrust.player.1.set.trust.level2: "/{0} untrust [player]{1} - Set member as untrusted"
|
||||
0.promote.member.1.promote.a.member.to.leader: "/{0} promote [member]{1} - Promote a member to leader"
|
||||
0.demote.leader.1.demote.a.leader.to.member: "/{0} demote [leader]{1} - Demote a leader to member"
|
||||
0.clanff.allow.block.1.toggle.clan.s.friendly.fire: "/{0} clanff allow/block{1} - Toggle clan''s friendly fire"
|
||||
0.ff.allow.auto.1.toggle.personal.friendly.fire: "/{0} ff allow/auto{1} - Toggle personal friendly fire"
|
||||
0.toggle.command: "/{0} toggle [{2}]{1} - Toggle personal settings"
|
||||
0.resign.1.resign.from.the.clan: "/{0} resign{1} - Resign from the clan"
|
||||
0.disband.1.disband.your.clan: "/{0} disband{1} - Disband your clan"
|
||||
0.trust.setrank: "/{0} setrank [player] [rank]{1} - Give a player a rank"
|
||||
0.create.tag.name.1.purchase.a.new.clan: "/{0} create [tag] [name]{1} - Purchase a new clan"
|
||||
0.create.tag.name.1.create.a.new.clan: "/{0} create [tag] [name]{1} - Create a new clan"
|
||||
0.kills: "/{0} kills{1} - View your kill counts"
|
||||
0.killsplayer: "/{0} kills [player]{1} - View a player''s kill counts"
|
||||
0.mostkilled: "/{0} mostkilled{1} - View serverwide most killed counts"
|
||||
home-menu: "/{0} home{1} - Teleport to clan home-base"
|
||||
home-set-menu: "/{0} home set{1} - Set the clan''s home base"
|
||||
home-clear-menu: "/{0} home clear{1} - Clear the clan''s home base"
|
||||
home-regroup-menu: "/{0} home regroup [me]{1} - Regroup all members to clan home-base or to you"
|
||||
example.clan.modtag.4kfo.4l: "Example: /clan modtag &4K&fo&4L"
|
||||
example.clan.create: "Example: /clan create &4Kol Knights of the Labyrinth"
|
||||
clan: "Clan"
|
||||
allies: "Allies"
|
||||
alliances: "alliances"
|
||||
coords: "coords"
|
||||
name: "Name"
|
||||
distance: "Distance"
|
||||
coords.upper: "Coords"
|
||||
world: "World"
|
||||
kdr: "KDR"
|
||||
members: "Members"
|
||||
clans.lower: "clans"
|
||||
rival: "Rival"
|
||||
civilian: "Civilian"
|
||||
neutral: "Neutral"
|
||||
free.agent: "Free Agent"
|
||||
days: "days"
|
||||
rivals: "Rivals"
|
||||
rivalries: "rivalries"
|
||||
online: "Online"
|
||||
player: "Player"
|
||||
seen: "Seen"
|
||||
leader: "leader"
|
||||
roster: "roster"
|
||||
trusted: "trusted"
|
||||
untrusted: "untrusted"
|
||||
deaths: "Deaths"
|
||||
weights: "Weights"
|
||||
stats: "stats"
|
||||
health: "Health"
|
||||
armor: "Armor"
|
||||
weapons: "Weapons"
|
||||
food: "Food"
|
||||
vitals: "vitals"
|
||||
verified: "Verified"
|
||||
unverified: "Unverified"
|
||||
profile: "profile"
|
||||
civilian.abbreviation: "Civ"
|
||||
rank: "Rank"
|
||||
leaders: "Leaders"
|
||||
none: "None"
|
||||
today: "Today"
|
||||
kills: "Kills"
|
||||
mostkilled: "Most Killed"
|
||||
killcount: "Kill Count"
|
||||
attacker: "Attacker"
|
||||
victim: "Victim"
|
||||
kill.death.ratio: "Kill/Death Ratio"
|
||||
nokillsfound: "No Kills Found"
|
||||
version.loaded: "[{0}] Version {1} loaded"
|
||||
promoted.to.leader: "{0} has been promoted to leader"
|
||||
denied.demotion: "{0} denied the demotion of {1}. Consensus failed."
|
||||
membership.invitation: "{0} has denied the membership invitation"
|
||||
joined.the.clan: "{0} has joined the clan"
|
||||
signed.off.request.cancelled: "{0} has signed off. {1} request cancelled."
|
||||
clan.deletion: "{0} denied the clan deletion. Consensus failed."
|
||||
has.been.disbanded: "Clan {0} has been disbanded"
|
||||
denied.the.promotion: "{0} denied the promotion of {1}. Consensus failed."
|
||||
demoted.back.to.member: "{0} has been demoted back to member"
|
||||
peace.agreement.denied: "The peace agreement with {0} was denied"
|
||||
denied.to.make.peace: "{0} has denied to make peace with {1}"
|
||||
broken.the.rivalry: "{0} has broken the rivalry with {1}"
|
||||
broken.the.rivalry.with: "{0} has broken the rivalry with {1}"
|
||||
the.alliance.was.denied: "The alliance with {0} was denied"
|
||||
denied.an.alliance: "{0} has denied an alliance with {1}"
|
||||
accepted.an.alliance: "{0} has accepted an alliance with {1}"
|
||||
created.an.alliance: "{0} has created an alliance with {1}"
|
||||
has.joined: "{0} has joined {1}"
|
||||
proposing.to.end.the.rivalry: "{0} is proposing to end the rivalry with {1}"
|
||||
proposing.an.alliance: "{0} is proposing an alliance with {1}"
|
||||
inviting.you.to.join: "{0} is inviting you to join {1}"
|
||||
asking.for.the.deletion: "{0} is asking for the deletion of the clan"
|
||||
asking.for.the.promotion: "{0} is asking for the promotion of {1}"
|
||||
asking.for.the.demotion: "{0} is asking for the demotion of {1}"
|
||||
accept.or.deny: "{0} or {1}"
|
||||
not.sufficient.money: "You do not have sufficient money in your account"
|
||||
account.has.been.debited: "Your account has been debited {0}"
|
||||
mysql.connection.successful: "MySQL Connection successful"
|
||||
mysql.connection.failed: "MySQL Connection failed"
|
||||
sqlite.connection.successful: "SQLite Connection successful"
|
||||
sqlite.connection.failed: " SQLite Connection failed"
|
||||
purging.player.data: "purging player''s data: {0}"
|
||||
purging.clan: "Purging clan: {0}"
|
||||
clan.players: "Clan players: {0}"
|
||||
clans: "Clans: {0}"
|
||||
banned: "You are banned from using clan commands"
|
||||
nothing.more.to.see: "Nothing more to see"
|
||||
nothing.to.deny: "Nothing to deny"
|
||||
no.leader.permissions: "You do not have leader permissions"
|
||||
you.have.already.voted: "You have already voted"
|
||||
has.voted.to.deny: "{0} has voted to deny"
|
||||
nothing.to.accept: "Nothing to accept"
|
||||
view.next.page: "Type /{0} to view next page."
|
||||
voted.to.accept: "{0} voted to accept"
|
||||
bulletin.board.header: "{0}* {1}{2} bulletin board"
|
||||
has.been.disbanded.rivalry.ended: "{0} has been disbanded. Rivalry has ended."
|
||||
has.been.disbanded.alliance.ended: "{0} has been disbanded. Alliance has ended."
|
||||
clan.disbanded: "Clan Disbanded"
|
||||
1.color.day: "1 {0}day"
|
||||
many.color.days: "{0}{1} days"
|
||||
does.not.match: "Does not match a clan command"
|
||||
simpleclans.command.failure: "SimpleClans command failure: {0}"
|
||||
insufficient.permissions: "Insufficient permissions"
|
||||
clan.is.not.verified: "Clan is not verified"
|
||||
not.a.member.of.any.clan: "You are not a member of any clan"
|
||||
minimum.to.make.alliance: "Your clan must have at least {0} players in order to make alliances"
|
||||
no.clan.matched: "No clan matched"
|
||||
cannot.ally.with.an.unverified.clan: "You cannot ally with an unverified clan"
|
||||
your.clans.are.not.allies: "Your clans are not allies"
|
||||
has.broken.the.alliance: "{0} has broken the alliance with {1}"
|
||||
at.least.one.leader.accept.the.alliance: "At least one leader of the allied must be online to accept the alliance"
|
||||
leaders.have.been.asked.for.an.alliance: "{0} leaders have been asked for an alliance"
|
||||
your.clans.are.already.allies: "Your clans are already allies"
|
||||
your.clan.cannot.create.rivals: "Your clan cannot create rivals"
|
||||
min.players.rivalries: "Your clan must have at least {0} players in order to make rivalries"
|
||||
this.player.is.already.banned: "This player is already banned"
|
||||
player.added.to.banned.list: "Player added to banned list"
|
||||
you.banned: "You have been banned from clan commands"
|
||||
cape.must.be.png: "The cape url must point to a png image"
|
||||
url.error: "The URL is retuning an error. Please verify that it is working."
|
||||
changed.the.clan.cape: "{0} has changed the clan''s cape"
|
||||
clan.wide.friendly.fire.blocked: "Clan-wide friendly-fire blocked"
|
||||
clan.wide.friendly.fire.is.allowed: "Clan-wide friendly-fire is allowed"
|
||||
only.trusted.players.can.access.clan.coords: "Only trusted players can access clan coords"
|
||||
you.are.the.only.member.online: "You are the only member online"
|
||||
your.clan.tag.cannot.be.longer.than.characters: "Your clan''s tag cannot be longer than {0} characters"
|
||||
your.clan.tag.must.be.longer.than.characters: "Your clan''s tag must be longer than {0} characters"
|
||||
your.tag.cannot.contain.the.following.colors: "Your tag cannot contain the following colors: {0}"
|
||||
your.tag.cannot.contain.color.codes: "Your tag cannot contain color codes"
|
||||
your.clan.name.cannot.be.longer.than.characters: "Your clan''s name cannot be longer than {0} characters"
|
||||
your.clan.name.must.be.longer.than.characters: "Your clan''s name must be longer than {0} characters"
|
||||
your.clan.tag.can.only.contain.letters.numbers.and.color.codes: "Your clan''s tag can only contain letters, numbers, and color codes"
|
||||
your.clan.name.cannot.contain.color.codes: "Your clan''s name cannot contain color codes"
|
||||
that.tag.name.is.disallowed: "That tag name is disallowed"
|
||||
you.must.first.resign: "You must first resign from {0}"
|
||||
clan.with.this.tag.already.exists: "A clan with this tag already exists"
|
||||
get.your.clan.verified.to.access.advanced.features: "Get your clan verified to access advanced features"
|
||||
clan.created: "Clan {0} created"
|
||||
leaders.must.be.online.to.vote.on.demotion: "All leaders other than the demoted must be online to vote on this demotion"
|
||||
demotion.vote.has.been.requested.from.all.leaders: "Demotion vote has been requested from all leaders"
|
||||
player.is.not.a.leader.of.your.clan: "The player is not a leader of your clan"
|
||||
clan.has.been.disbanded: "Clan {0} has been disbanded"
|
||||
clan.disband.vote.has.been.requested.from.all.leaders: "Clan disband vote has been requested from all leaders"
|
||||
friendy.fire.is.now.managed.by.your.clan: "Friendy-fire is now managed by your clan"
|
||||
personal.friendly.fire.is.set.to.allowed: "Personal friendly-fire is set to allowed"
|
||||
global.friendy.fire.is.now.managed.by.each.clan: "Global friendy-fire is now managed by each clan"
|
||||
global.friendy.fire.is.already.being.managed.by.each.clan: "Global friendy-fire is already being managed by each clan"
|
||||
global.friendly.fire.is.set.to.allowed: "Global friendly-fire is set to allowed"
|
||||
global.friendly.fire.is.already.being.allowed: "Global friendly-fire is already being allowed"
|
||||
no.player.matched: "No player matched"
|
||||
the.player.doesn.t.not.have.the.permissions.to.join.clans: "The player doesn''t not have the permissions to join clans"
|
||||
you.cannot.invite.yourself: "You cannot invite yourself"
|
||||
this.player.is.banned.from.using.clan.commands: "This player is banned from using clan commands"
|
||||
the.player.is.already.member.of.another.clan: "The player is already member of another clan"
|
||||
has.been.asked.to.join: "{0} has been asked to join {1}"
|
||||
you.cannot.kick.yourself: "You cannot kick yourself"
|
||||
the.player.is.not.a.member.of.your.clan: "The player is not a member of your clan"
|
||||
you.cannot.kick.another.leader: "You cannot kick another leader"
|
||||
has.been.kicked.by: "{0} has been kicked by {1}"
|
||||
no.clans.have.been.created: "No clans have been created"
|
||||
total.clans: "Total clans:"
|
||||
legend: "Legend:"
|
||||
kill.type.civilian: "Kill Type: {0}Civilian"
|
||||
no.player.data.found: "No player data found"
|
||||
kill.type.0: "Kill Type: {0}"
|
||||
s.player.info: "{0}''s player info"
|
||||
clan.0: "Clan: {0}"
|
||||
status.0: "Status: {0}"
|
||||
rank.0: "Rank: {0}"
|
||||
kdr.0: "KDR: {0}"
|
||||
deaths.0: "Deaths: {0}"
|
||||
join.date.0: "Join Date: {0}"
|
||||
last.seen.0: "Last Seen: {0}"
|
||||
past.clans.0: "Past Clans: {0}"
|
||||
inactive.0: "Inactive: {0}"
|
||||
kill.totals: "Kill Totals:"
|
||||
clan.commands: "clan commands"
|
||||
you.can.only.modify.the.color.and.case.of.the.tag: "You can only modify the color and case of the tag"
|
||||
tag.changed.to.0: "Tag changed to {0}"
|
||||
name.0: "Name: {0}"
|
||||
leaders.0: "Leaders: {0}"
|
||||
members.online.0: "Members Online: {0}"
|
||||
allies.0: "Allies: {0}"
|
||||
rivals.0: "Rivals: {0}"
|
||||
founded.0: "Founded: {0}"
|
||||
the.member.to.be.promoted.must.be.online: "The member to be promoted must be online"
|
||||
the.player.does.not.have.the.permissions.to.lead.a.clan: "The player does not have the permissions to lead a clan"
|
||||
you.cannot.promote.yourself: "You cannot promote yourself"
|
||||
all.leaders.must.be.online.to.vote.on.this.promotion: "All leaders must be online to vote on this promotion"
|
||||
the.player.is.already.a.leader: "The player is already a leader"
|
||||
configuration.reloaded: "Configuration reloaded"
|
||||
last.leader.cannot.resign.you.must.appoint.another.leader.or.disband.the.clan: "Last leader cannot resign.You must appoint another leader or disband the clan"
|
||||
0.has.resigned: "{0} has resigned"
|
||||
only.trusted.players.can.access.clan.stats: "Only trusted players can access clan stats"
|
||||
you.cannot.trust.yourself: "You cannot trust yourself"
|
||||
leaders.are.already.trusted: "Leaders are already trusted"
|
||||
this.player.is.already.trusted: "This player is already trusted"
|
||||
has.been.given.trusted.status.by: "{0} has been given trusted status by {1}"
|
||||
this.player.is.not.banned: "This player is not banned"
|
||||
player.removed.from.the.banned.list: "Player removed from the banned list"
|
||||
you.have.been.unbanned.from.clan.commands: "You have been unbanned from clan commands"
|
||||
you.cannot.untrust.yourself: "You cannot untrust yourself"
|
||||
leaders.cannot.be.untrusted: "Leaders cannot be untrusted"
|
||||
this.player.is.already.untrusted: "This player is already untrusted"
|
||||
has.been.given.untrusted.status.by: "{0} has been given untrusted status by {1}"
|
||||
the.clan.does.not.exist: "The clan does not exist"
|
||||
the.clan.is.already.verified: "The clan is already verified"
|
||||
the.clan.has.been.verified: "The clan has been verified"
|
||||
clan.0.has.been.verified: "Clan {0} has been verified!"
|
||||
only.trusted.players.can.access.clan.vitals: "Only trusted players can access clan vitals"
|
||||
total.clan.players.0: "Total clan players: {0}"
|
||||
proposing.war: "{0} is proposing to start a war with {1}"
|
||||
you.can.only.start.war.with.rivals: "You can only start war with rivals"
|
||||
leaders.have.been.asked.to.accept.the.war.request: "{0} leaders have been asked to accept the war request"
|
||||
leaders.asked.to.end.rivalry: "{0} leaders have been asked to end the war"
|
||||
proposing.to.end.the.war: "{0} is proposing to end the war with {1}"
|
||||
clans.already.at.war: "Your clans are already in war"
|
||||
clans.not.at.war: "Your clans are not at war"
|
||||
you.are.at.war: "{0} is now at war with {1}"
|
||||
denied.war.req: "{0} denied the war request sent by {1}"
|
||||
you.are.no.longer.at.war: "{0} is no longer at war with {1}"
|
||||
end.war.denied: "Request to end the war has been denied by {0}"
|
||||
denied.war.end: "{0} denied {1}''s request to end the war"
|
||||
0.war: "/{0} war{1} start/end [tag] - Start or end a war"
|
||||
has.initiated.a.rivalry: "{0} has initiated a rivalry with {1}"
|
||||
start: "start"
|
||||
end: "end"
|
||||
add: "add"
|
||||
remove: "remove"
|
||||
allow: "allow"
|
||||
block: "block"
|
||||
auto: "auto"
|
||||
war: "war"
|
||||
0.s.sword.1.2.b.bow.3.4.a.arrow: "{0}S=Sword{1}, {2}B=Bow{3}, {4}#=Arrows"
|
||||
weapon.S: "S"
|
||||
weapon.B: "B"
|
||||
weapon.A: "A"
|
||||
materials: "Materials"
|
||||
armor.h: "H"
|
||||
armor.c: "C"
|
||||
armor.l: "L"
|
||||
armor.B: "B"
|
||||
diamond: "diamond"
|
||||
gold: "gold"
|
||||
wood: "wood"
|
||||
server.announce: "Server Announce"
|
||||
clan.announce: "Clan Announce"
|
||||
leader.announce: "Leader Announce"
|
||||
hunger: "Hunger"
|
||||
stone: "Stone"
|
||||
iron: "Iron"
|
||||
the.clan.cannot.be.rivaled: "The clan cannot be rivaled"
|
||||
capeoff: "Cape toggled off"
|
||||
capeon: "Cape toggled on"
|
||||
bboff: "BB toggled off"
|
||||
bbon: "BB toggled on"
|
||||
tagoff: "Tag toggled off"
|
||||
tagon: "Tag toggled on"
|
||||
depositon: "Deposit toggled on"
|
||||
depositoff: "Deposit toggled off"
|
||||
withdrawon: "Withdraw toggled on"
|
||||
withdrawoff: "Withdraw toggled off"
|
||||
home.base.only.once: "Home base can only be set once"
|
||||
now.at.homebase: "You are now at {0}''s home base"
|
||||
hombase.set: "Clan home-base set to: {0}"
|
||||
hombase.cleared: "Clan home-base cleared"
|
||||
hombase.mod.set: "{0}''s home-base set to:"
|
||||
hombase.not.set: "Home-base not set"
|
||||
rival.limit.reached: "You have reached the rival limit. You cannot rival any more clans."
|
||||
you.moved.teleport.cancelled: "You moved, teleport cancelled"
|
||||
waiting.for.teleport.stand.still.for.0.seconds: "Waiting for teleport, stand still for {0} seconds"
|
||||
no.teleport: "You are not allowed to teleport to that location"
|
||||
on: "on"
|
||||
off: "off"
|
||||
leave: "leave"
|
||||
join: "join"
|
||||
mute: "mute"
|
||||
player.rank.changed: "Rank has been set"
|
||||
your.clans.are.already.rivals: "Your clans are already rivals"
|
||||
player.got.money: "You got {0} for killing {1} based on you KDR: {2}"
|
||||
cleared.bb: "Cleared the bulletin board"
|
||||
clan.balance: "Clan-Balance: {0}"
|
||||
bb.clan.deposit: "{0} $ were deposited"
|
||||
player.clan.deposit: "You deposited {0}"
|
||||
bb.clan.withdraw: "{0} $ were withdrawn"
|
||||
player.clan.withdraw: "You withdraw {0}"
|
||||
clan.bank.not.enough.money: "Your clans bank has not enough money"
|
||||
your.clans.are.not.rivals: "Your clans are not rivals"
|
||||
you.cannot.rival.your.own.clan: "You cannot rival your own clan"
|
||||
the.clan.members.reached.limit: "Your clan members reached limit"
|
||||
you.have.reseted.your.kdr: "You have reseted your KDR"
|
||||
you.have.reseted.0.kdr: "You have reseted {0}''s KDR"
|
||||
you.have.reseted.kdr.of.all.players: "You have reseted the KDR of all players"
|
||||
@@ -1,3 +1,4 @@
|
||||
description.command: "description"
|
||||
create.command: "create"
|
||||
list.command: "list"
|
||||
profile.command: "profile"
|
||||
@@ -18,6 +19,8 @@ toggle.command: "toggle"
|
||||
invite.command: "invite"
|
||||
kick.command: "kick"
|
||||
bank.command: "bank"
|
||||
fee.command: "fee"
|
||||
purge.command: "purge"
|
||||
trust.command: "trust"
|
||||
untrust.command: "untrust"
|
||||
promote.command: "promote"
|
||||
@@ -38,6 +41,7 @@ home.command: "home"
|
||||
setrank.command: "setrank"
|
||||
place.command: "place"
|
||||
resetkdr.command: "resetkdr"
|
||||
usage.description: "Usage: /{0} description [description]"
|
||||
usage.resetkdr: "Használat: /{0} resetkdr [all/player]"
|
||||
usage.clan.alliances: "Használat: /{0} alliances"
|
||||
usage.ally: "Használat: /{0} ally add/remove [címke]"
|
||||
@@ -57,8 +61,10 @@ usage.0.permissions.player: "Használat: /{0} permissions [klán] add/remove [jo
|
||||
usage.0.invite.player: "Használat: /{0} invite [játékos]"
|
||||
usage.kick.player: "Használat: /{0} kick [játékos]"
|
||||
usage.bank: "Használat: /{0} bank withdraw/deposit/status [mennyiség]"
|
||||
usage.fee: "Usage: /{0} fee check/set [amount]"
|
||||
usage.purge: "Usage: /{0} purge [player]"
|
||||
usage.0.modtag.tag: "Használat: /{0} modtag [címke]"
|
||||
usage.list: "Használat: /{0} list"
|
||||
usage.list: "Usage: /{0} list [name/size/kdr/founded/active] [asc/desc]"
|
||||
usage.lookup.tag: "Használat: /{0} lookup [címke]"
|
||||
usage.0.profile.tag: "Használat: /{0} profile [címke]"
|
||||
usage.0.promote.member: "Használat: /{0} promote <tag>"
|
||||
@@ -79,9 +85,10 @@ usage.0.leaderboard: "Használat: /{0} leaderboard"
|
||||
0.disband.tag.1.disband.a.clan: "/{0} disband [címke]{1} - Eltávolít egy klánt"
|
||||
0.resetkdr.1.resets.kdr: "/{0} resetkdr player/all{1} - Visszaállítsa az összes játékos KDR-jét vagy csak egy"
|
||||
0.resetkdr.1.resets.your.kdr: "/{0} resetkdr{1} - Visszaállítja KDR-t"
|
||||
0.purge.player.1.purge.a.player: "/{0} purge [player]{1} - Purge a player"
|
||||
0.verify.tag.1.verify.an.unverified.clan: "/{0} verify [címke]{1} - Ellenőrzi az ellenőrzött klánt"
|
||||
0.verify.1.purchase.verification.of.your.clan: "/{0} verify{1} - A klán megvásárlásának ellenőrzése"
|
||||
0.list.1.lists.all.clans: "/{0} list{1} - Az összes klán felsorolása"
|
||||
0.list.1.lists.all.clans: "/{0} list [name/size/kdr/founded/active] [asc/desc]{1} - Lists all clans"
|
||||
0.profile.1.view.your.clan.s.profile: "/{0} profile{1} - Megtekinti a klán profilját"
|
||||
0.profile.tag.1.view.a.clan.s.profile: "/{0} profile [címke]{1} - Klán profiljának megtekintése"
|
||||
0.lookup.1.lookup.your.info: "/{0} lookup{1} - Megkeresi az adatait"
|
||||
@@ -98,6 +105,7 @@ usage.0.leaderboard: "Használat: /{0} leaderboard"
|
||||
0.rival.add.remove.tag.1.add.remove.a.rival.clan: "/{0} rival add/remove [címke]{1} - Egy rivális klán hozzáadása/eltávolítása"
|
||||
0.bb.1.display.bulletin.board: "/{0} bb{1} - Hirdetőtábla megjelenítése"
|
||||
0.bb.msg.1.add.a.message.to.the.bulletin.board: "/{0} bb [msg]{1} - Üzenet hozzáadása a hirdetőtáblához"
|
||||
0.description.description.1.modify.the.clan.s.description: "/{0} description [description]{1} - Modify the clan''s description"
|
||||
0.modtag.tag.1.modify.the.clan.s.tag: "/{0} modtag [címke]{1} - Módosítja a klán címkéjét"
|
||||
0.cape.url.1.change.your.clan.s.cape: "/{0} cape [url]{1} - Megváltoztatja a klánodat"
|
||||
0.invite.player.1.invite.a.player: "/{0} invite [játékos]{1} - Meghív egy játékost"
|
||||
@@ -116,6 +124,8 @@ usage.0.leaderboard: "Használat: /{0} leaderboard"
|
||||
0.create.tag.name.1.create.a.new.clan: "/{0} create [címke] [name]{1} - Létrehoz egy új klánt"
|
||||
0.kills: "/{0} kills{1} - Megnézi az ölésedet"
|
||||
0.killsplayer: "/{0} kills [játékos]{1} - Megtekinti a játékos ölési számát"
|
||||
0.fee.check: "/{0} fee check {1}- Check if the fee is enabled and how much is it"
|
||||
0.fee.set: "/{0} fee set [amount]{1} - Set the clan's member fee"
|
||||
0.mostkilled: "/{0} mostkilled{1} - Megtekinti a kiszolgálón leggyakoribb ölési számokat"
|
||||
home-menu: "/{0} home{1} - Teleportálás a klán hazai bázisához"
|
||||
home-set-menu: "/{0} home set{1} - Beállítsa a klán hazai bázisát"
|
||||
@@ -260,6 +270,7 @@ you.must.first.resign: "Először lemondania a {0}"
|
||||
clan.with.this.tag.already.exists: "Ezzel a címkével már létezik egy klán"
|
||||
get.your.clan.verified.to.access.advanced.features: "Szerezd meg a klánt, hogy ellenőrizze a speciális funkciók elérését"
|
||||
clan.created: "A(z) {0} klán létrehozva"
|
||||
not.enough.leaders.online.to.vote.on.demotion: "There aren''t enough leaders online to vote on this demotion"
|
||||
leaders.must.be.online.to.vote.on.demotion: "A lefokozástól eltérő összes vezetőnek online kell lennie ahhoz, hogy szavazzon a lefokozásról"
|
||||
demotion.vote.has.been.requested.from.all.leaders: "Demotion szavazást kértek minden vezetőtől"
|
||||
player.is.not.a.leader.of.your.clan: "A játékos nem a klán egyik vezetője"
|
||||
@@ -293,6 +304,7 @@ status.0: "Állapot: {0}"
|
||||
rank.0: "Rang: {0}"
|
||||
kdr.0: "KDR: {0}"
|
||||
deaths.0: "Halálok: {0}"
|
||||
fee.0.value.1: "Fee: {0}, {1} $"
|
||||
join.date.0: "Csatlakozás dátuma: {0}"
|
||||
last.seen.0: "Utoljára látva: {0}"
|
||||
past.clans.0: "Múlt klánok: {0}"
|
||||
@@ -302,6 +314,7 @@ clan.commands: "klán parancsok"
|
||||
you.can.only.modify.the.color.and.case.of.the.tag: "Csak a címke színét és esetét módosíthatod"
|
||||
tag.changed.to.0: "A címke megváltoztatva {0}"
|
||||
name.0: "Név: {0}"
|
||||
description.0: "Description: {0}"
|
||||
leaders.0: "Vezetők: {0}"
|
||||
members.online.0: "Tagok online: {0}"
|
||||
allies.0: "Szövetségesek: {0}"
|
||||
@@ -384,6 +397,8 @@ depositon: "Letét bekapcsolva"
|
||||
depositoff: "Letét kikapcsolva"
|
||||
withdrawon: "Visszavonulás bekapcsolva"
|
||||
withdrawoff: "Visszavonulás kikapcsolva"
|
||||
feeoff: "Fee toggled off"
|
||||
feeon: "Fee toggled on"
|
||||
home.base.only.once: "A bázis csak egyszer állítható be"
|
||||
now.at.homebase: "Most a(z) {0} székhelyen tartózkodsz"
|
||||
hombase.set: "Klán bázis beállítva: {0}"
|
||||
@@ -404,6 +419,8 @@ your.clans.are.already.rivals: "A klánod már riválisok"
|
||||
player.got.money: "Megkaptad {0} a(z) {1} megöléséért KDR-ed alapján: {2}"
|
||||
cleared.bb: "Törölte a hirdetőtáblát"
|
||||
clan.balance: "Klán egyenleg: {0}"
|
||||
bb.fee.player.kicked: "{0} was kicked for not paying the fee"
|
||||
bb.fee.set: "{0} $ is the fee"
|
||||
bb.clan.deposit: "{0} $ letétbe helyezték"
|
||||
player.clan.deposit: "Letétbe helyezted {0}"
|
||||
bb.clan.withdraw: "{0} $ visszavonták"
|
||||
@@ -415,3 +432,34 @@ the.clan.members.reached.limit: "A klán tagjai elérik a határt"
|
||||
you.have.reseted.your.kdr: "Visszaállítottad KDR-t"
|
||||
you.have.reseted.0.kdr: "Visszaállítottad a(z) {0} KDR-t"
|
||||
you.have.reseted.kdr.of.all.players: "Visszaállítottad a játékosok KDR-jét"
|
||||
resign.yes: "Yes"
|
||||
resign.no: "No"
|
||||
resign.confirmation: "Are you sure you want to resign? {0}"
|
||||
resign.success: "You have successfully resigned from your clan"
|
||||
player.is.not.a.leader.of.any.clan: "The player is not a leader of any clan"
|
||||
you.cannot.demote.the.last.leader: "You cannot demote the last leader"
|
||||
player.successfully.demoted: "The player was successfully demoted"
|
||||
bb.ago: " ago "
|
||||
bb.moments: "moments"
|
||||
bb.seconds: " seconds"
|
||||
bb.minutes: " minutes"
|
||||
bb.one.minute: "1 minute"
|
||||
bb.hours: " hours"
|
||||
bb.one.hour: "1 hour"
|
||||
bb.days: " days"
|
||||
bb.one.day: "1 day"
|
||||
the.fee.is.0.and.its.current.value.is.1: "The fee is {0} and the its current value is {1} $"
|
||||
fee.enabled: "enabled"
|
||||
fee.disabled: "disabled"
|
||||
fee.set: "The fee was successfully set"
|
||||
max.fee.allowed.is.0: "Max fee allowed is {0}"
|
||||
fee.collected: "{0} $ were withdrawn for the clan fee"
|
||||
invalid.fee: "The value you inserted is not valid"
|
||||
player.purged: "The player was successfully purged"
|
||||
upkeep.collected: "{0} $ were withdrawn for the upkeep"
|
||||
balance.is.not.enough.for.upkeep: "The clan balance is not enough for paying the upkeep ({0} $), deposit the amount to avoid being disbanded"
|
||||
your.clan.description.must.be.longer.than: "Your clan description must be longer than {0} characters"
|
||||
your.clan.description.cannot.be.longer.than: "Your clan description cannot be longer than {0} characters"
|
||||
description.changed: "You have successfully changed your clan's description"
|
||||
no.description: "No description"
|
||||
the.player.must.wait.0.before.joining.your.clan.again: "This player must wait {0} minute(s) before joining your clan again"
|
||||
@@ -0,0 +1,465 @@
|
||||
description.command: "descricao"
|
||||
create.command: "criar"
|
||||
list.command: "listar"
|
||||
profile.command: "perfil"
|
||||
roster.command: "membros"
|
||||
lookup.command: "detalhes"
|
||||
leaderboard.command: "ranking"
|
||||
alliances.command: "aliancas"
|
||||
rivalries.command: "rivalidades"
|
||||
vitals.command: "saude"
|
||||
coords.command: "coordenadas"
|
||||
stats.command: "estatisticas"
|
||||
ally.command: "aliado"
|
||||
rival.command: "rival"
|
||||
bb.command: "bb"
|
||||
cape.command: "capa"
|
||||
modtag.command: "mudartag"
|
||||
toggle.command: "alternar"
|
||||
invite.command: "convidar"
|
||||
kick.command: "expulsar"
|
||||
bank.command: "banco"
|
||||
fee.command: "taxa"
|
||||
purge.command: "apagar"
|
||||
trust.command: "confiar"
|
||||
untrust.command: "naoconfiar"
|
||||
promote.command: "promover"
|
||||
demote.command: "rebaixar"
|
||||
clanff.command: "clanff"
|
||||
ff.command: "ff"
|
||||
resign.command: "abandonar"
|
||||
disband.command: "debandar"
|
||||
verify.command: "verificar"
|
||||
ban.command: "banir"
|
||||
unban.command: "desbanir"
|
||||
reload.command: "recarregar"
|
||||
globalff.command: "globalff"
|
||||
kills.command: "mortes"
|
||||
mostkilled.command: "maismatou"
|
||||
war.command: "guerra"
|
||||
home.command: "base"
|
||||
setrank.command: "definirrank"
|
||||
place.command: "colocar"
|
||||
resetkdr.command: "redefinirkdr"
|
||||
usage.description: "Uso: /{0} descricao [descrição]"
|
||||
usage.resetkdr: "Uso: /{0} redefinirkdr [all/jogador]"
|
||||
usage.clan.alliances: "Uso: /{0} aliancas"
|
||||
usage.ally: "Uso: /{0} aliado adicionar/remover [tag]"
|
||||
usage.ban.unban: "Uso: /{0} banir/desbanir [jogador]"
|
||||
usage.rival: "Uso: /{0} rival adicionar/remover [tag]"
|
||||
usage.war: "Uso: /{0} guerra iniciar/finalizar [tag]"
|
||||
usage.cape.url: "Uso: /{0} capa [url]"
|
||||
usage.setrank: "Uso: /{0} definirrank [jogador] [rank], ranks podem ser múltiplas palavras ou conter códigos de cor"
|
||||
usage.clanff: "Uso: /{0} clanff permitir/bloquear"
|
||||
usage.0.coords: "Uso: /{0} coordenadas"
|
||||
usage.create.tag: "Uso: /{0} criar [tag] [nome]"
|
||||
usage.demote.leader: "Uso: /{0} rebaixar [líder]"
|
||||
usage.0.disband: "Uso: /{0} debandar"
|
||||
usage.0.ff.allow.auto: "Uso: /{0} ff permitir/auto"
|
||||
usage.0.globalff.allow.auto: "Uso: /{0} globalff permitir/auto"
|
||||
usage.0.permissions.player: "Uso: /{0} permissions [clan] adicionar/remover [permission]"
|
||||
usage.0.invite.player: "Uso: /{0} convidar [jogador]"
|
||||
usage.kick.player: "Uso: /{0} expulsar [jogador]"
|
||||
usage.bank: "Uso: /{0} banco withdraw/deposit/status [quantidade]"
|
||||
usage.fee: "Uso: /{0} taxa check/set [quantidade]"
|
||||
usage.purge: "Uso: /{0} apagar [jogador]"
|
||||
usage.0.modtag.tag: "Uso: /{0} mudartag [tag]"
|
||||
usage.list: "Uso: /{0} listar"
|
||||
usage.lookup.tag: "Uso: /{0} detalhes [tag]"
|
||||
usage.0.profile.tag: "Uso: /{0} perfil [tag]"
|
||||
usage.0.promote.member: "Uso: /{0} promover <member>"
|
||||
usage.0.rivalries: "Uso: /{0} rivalidades"
|
||||
usage.0.roster.tag: "Uso: /{0} membros [tag]"
|
||||
usage.0.stats: "Uso: /{0} estatisticas"
|
||||
usage.0.trust.player: "Uso: /{0} confiar [jogador]"
|
||||
usage.0.untrust.player: "Uso: /{0} naoconfiar [jogador]"
|
||||
usage.0.verify.tag: "Uso: /{0} verificar [tag]"
|
||||
usage.0.vitals: "Uso: /{0} saude"
|
||||
usage.0.place: "Uso: /{0} colocar [jogador] [tag]"
|
||||
usage.0.leaderboard: "Uso: /{0} ranking"
|
||||
0.reload.1.reload.configuration: "/{0} recarregar{1} - Recarregar configuração"
|
||||
0.globalff.allow.auto.1.set.global.friendly.fire: "/{0} globalff permitir/auto {1} - Define o fogo amigo global"
|
||||
0.place: "/{0} place [jogador] [tag]{1} - Coloca um jogador em um clã"
|
||||
0.ban.unban.player.1.ban.unban.a.player: "/{0} ban/unban [jogador]{1} - Bane/desbane um jogador"
|
||||
0.hometp.clan.1.tp.home.a.clan: "/{0} base tp [clan]{1} - Teleporta para a base de um clã"
|
||||
0.disband.tag.1.disband.a.clan: "/{0} debandar [tag]{1} - Debanda um clã"
|
||||
0.resetkdr.1.resets.kdr: "/{0} redefinirkdr jogador/all{1} - Redefine o KDR de todos os jogadores ou de apenas um"
|
||||
0.resetkdr.1.resets.your.kdr: "/{0} redefinirkdr{1} - Redefine o seu KDR"
|
||||
0.purge.player.1.purge.a.player: "/{0} apagar [jogador]{1} - Apaga os dados de um jogador"
|
||||
0.verify.tag.1.verify.an.unverified.clan: "/{0} verificar [tag]{1} - Verifica um clã"
|
||||
0.verify.1.purchase.verification.of.your.clan: "/{0} verificar{1} - Compra a verifição para o seu clã"
|
||||
0.list.1.lists.all.clans: "/{0} listar [name/size/kdr/founded/active] [asc/desc]{1} - Lista todos os clãs"
|
||||
0.profile.1.view.your.clan.s.profile: "/{0} perfil{1} - Mostra o perfil do seu clã"
|
||||
0.profile.tag.1.view.a.clan.s.profile: "/{0} perfil [tag]{1} - Mostra o perfil de um clã"
|
||||
0.lookup.1.lookup.your.info: "/{0} detalhes{1} - Mostra suas informações"
|
||||
0.lookup.player.1.lookup.a.player.s.info: "/{0} detalhes [jogador]{1} - Mostra informações sobre um jogador"
|
||||
0.leaderboard.1.view.leaderboard: "/{0} ranking{1} - Mostra o ranking de jogadores"
|
||||
0.alliances.1.view.all.clan.alliances: "/{0} aliancas{1} - Mostra todas as alianças do clã"
|
||||
0.rivalries.1.view.all.clan.rivalries: "/{0} rivalidades{1} - Mostra todas as rivalidades do clã"
|
||||
0.roster.1.view.your.clan.s.member.list: "/{0} membros{1} - Mostra a lista de membros do seu clã"
|
||||
0.roster.tag.1.view.a.clan.s.member.list: "/{0} membros [tag]{1} - Mostra a lista de membros de um clã"
|
||||
0.vitals.1.view.your.clan.member.s.vitals: "/{0} saude{1} - Mostra os sinais vitais dos membros do seu clã"
|
||||
0.coords.1.view.your.clan.member.s.coordinates: "/{0} coordenadas{1} - Mostra as coordenadas dos membros do seu clã"
|
||||
0.stats.1.view.your.clan.member.s.stats: "/{0} estatisticas{1} - Mostra as estatísticas dos membros do seu clã"
|
||||
0.ally.add.remove.tag.1.add.remove.an.ally.clan: "/{0} aliado adicionar/remover [tag]{1} - Adiciona/remove um clã aliado"
|
||||
0.rival.add.remove.tag.1.add.remove.a.rival.clan: "/{0} rival adicionar/remover [tag]{1} - Adiciona/remove um clã rival"
|
||||
0.bb.1.display.bulletin.board: "/{0} bb{1} - Mostra o quadro de avisos"
|
||||
0.description.description.1.modify.the.clan.s.description: "/{0} descricao [descrição]{1} - Modifica a descrição do clã"
|
||||
0.bb.msg.1.add.a.message.to.the.bulletin.board: "/{0} bb [msg]{1} - Adiciona uma mensagem para o quadro de avisos"
|
||||
0.modtag.tag.1.modify.the.clan.s.tag: "/{0} mudartag [tag]{1} - Modifica a tag do seu clã"
|
||||
0.cape.url.1.change.your.clan.s.cape: "/{0} capa [url]{1} - Muda a capa do seu clã"
|
||||
0.invite.player.1.invite.a.player: "/{0} convidar [jogador]{1} - Convida um jogador"
|
||||
0.kick.player.1.kick.a.player.from.the.clan: "/{0} expulsar [jogador]{1} - Expulsa um jogador do clã"
|
||||
0.trust.untrust.player.1.set.trust.level1: "/{0} confiar [jogador]{1} - Marca um membro como confiável"
|
||||
0.trust.untrust.player.1.set.trust.level2: "/{0} naoconfiar [jogador]{1} - Marca um membro como não-confiável"
|
||||
0.promote.member.1.promote.a.member.to.leader: "/{0} promover [membro]{1} - Promove um membro para líder"
|
||||
0.demote.leader.1.demote.a.leader.to.member: "/{0} rebaixar [líder]{1} - Rebaixa um líder para membro"
|
||||
0.clanff.allow.block.1.toggle.clan.s.friendly.fire: "/{0} clanff permitir/bloquear{1} - Alterna o fogo amigo do clã"
|
||||
0.ff.allow.auto.1.toggle.personal.friendly.fire: "/{0} ff permitir/auto{1} - Alterna o fogo amigo pessoal"
|
||||
0.toggle.command: "/{0} alternar [{2}]{1} - Alterna opções pessoais"
|
||||
0.resign.1.resign.from.the.clan: "/{0} abandonar{1} - Abandona o seu clã"
|
||||
0.disband.1.disband.your.clan: "/{0} debandar{1} - Debanda o seu cl"
|
||||
0.trust.setrank: "/{0} definirrank [jogador] [rank]{1} - Dá um rank a um jogador"
|
||||
0.create.tag.name.1.purchase.a.new.clan: "/{0} criar [tag] [nome]{1} - Compra um novo clã"
|
||||
0.create.tag.name.1.create.a.new.clan: "/{0} criar [tag] [nome]{1} - Cria um novo clã"
|
||||
0.kills: "/{0} mortes{1} - Mostra a sua contagem de mortes"
|
||||
0.killsplayer: "/{0} mortes [jogador]{1} - Mostra a contagem de mortes de um jogador"
|
||||
0.fee.check: "/{0} taxa check {1}- Verifica se a taxa está ativada e quanto é"
|
||||
0.fee.set: "/{0} taxa set [valor]{1} - Define a taxa de membros do clã"
|
||||
0.mostkilled: "/{0} maismatou{1} - Mostra a contagem de mortes do servidor inteiro"
|
||||
home-menu: "/{0} base{1} - Teleporta para a base do clã"
|
||||
home-set-menu: "/{0} base set{1} - Define a base do clã"
|
||||
home-clear-menu: "/{0} base clear{1} - Apaga a base do clã"
|
||||
home-regroup-menu: "/{0} base regroup [me]{1} - Reagrupa todos os membros do clã para a base ou para você"
|
||||
example.clan.modtag.4kfo.4l: "Exemplo: /clan mudartag &4C&fd&4L"
|
||||
example.clan.create: "Exemplo: /clan criar &4CoL Cavaleiros do Labirinto"
|
||||
clan: "Clã"
|
||||
allies: "Aliados"
|
||||
alliances: "aliancas"
|
||||
coords: "coordenadas"
|
||||
name: "Nome"
|
||||
distance: "Distância"
|
||||
coords.upper: "Coordenadas"
|
||||
world: "Mundo"
|
||||
kdr: "KDR"
|
||||
members: "Membros"
|
||||
clans.lower: "clãs"
|
||||
rival: "Rival"
|
||||
civilian: "Civil"
|
||||
neutral: "Neutro"
|
||||
free.agent: "Agente Livre"
|
||||
days: "dias"
|
||||
rivals: "Rivais"
|
||||
rivalries: "rivalidades"
|
||||
online: "Online"
|
||||
player: "Jogador"
|
||||
seen: "Visto"
|
||||
leader: "líder"
|
||||
roster: "membros"
|
||||
trusted: "confiável"
|
||||
untrusted: "não-confiável"
|
||||
deaths: "Morreu"
|
||||
weights: "Pesos"
|
||||
stats: "estatísticas"
|
||||
health: "Vida"
|
||||
armor: "Armadura"
|
||||
weapons: "Armas"
|
||||
food: "Comida"
|
||||
vitals: "Saúde"
|
||||
verified: "Verificado"
|
||||
unverified: "Não verificado"
|
||||
profile: "perfil"
|
||||
civilian.abbreviation: "Civ"
|
||||
rank: "Rank"
|
||||
leaders: "Líderes"
|
||||
none: "Nenhum"
|
||||
today: "Hoje"
|
||||
kills: "Matou"
|
||||
mostkilled: "Mais Matou"
|
||||
killcount: "Contagem de mortes"
|
||||
attacker: "Agressor"
|
||||
victim: "Vítima"
|
||||
kill.death.ratio: "Relação entre Matar e Morrer"
|
||||
nokillsfound: "Nenhuma morte encontrada"
|
||||
version.loaded: "[{0}] Versão {1} carregada"
|
||||
promoted.to.leader: "{0} foi promovido para líder"
|
||||
denied.demotion: "{0} negou o rebaixamento de {1}. Não houve consenso."
|
||||
membership.invitation: "{0} negou o pedido para ser membro"
|
||||
joined.the.clan: "{0} entrou no clã"
|
||||
signed.off.request.cancelled: "{0} saiu. Pedido de {1} cancelado."
|
||||
clan.deletion: "{0} negou a remoção do clã. Não houve consenso."
|
||||
has.been.disbanded: "Clã {0} foi debandado"
|
||||
denied.the.promotion: "{0} negou a promoção de {1}. Não houve consenso."
|
||||
demoted.back.to.member: "{0} foi rebaixado para membro"
|
||||
peace.agreement.denied: "O acordo de paz com {0} foi negado"
|
||||
denied.to.make.peace: "{0} negou fazer paz com {1}"
|
||||
broken.the.rivalry: "{0} quebrou a rivalidade com {1}"
|
||||
broken.the.rivalry.with: "{0} quebrou a rivalidade com {1}"
|
||||
the.alliance.was.denied: "A aliança com {0} foi negada"
|
||||
denied.an.alliance: "{0} negou uma aliança com {1}"
|
||||
accepted.an.alliance: "{0} aceitou uma aliança com {1}"
|
||||
created.an.alliance: "{0} criou uma aliança com {1}"
|
||||
has.joined: "{0} entrou em {1}"
|
||||
proposing.to.end.the.rivalry: "{0} está propondo acabar com a rivalidade com {1}"
|
||||
proposing.an.alliance: "{0} está propondo uma aliança com {1}"
|
||||
inviting.you.to.join: "{0} está te convidando para ser membro de {1}"
|
||||
asking.for.the.deletion: "{0} está pedindo pela remoção do clã"
|
||||
asking.for.the.promotion: "{0} está pedindo pela promoção de {1}"
|
||||
asking.for.the.demotion: "{0} está pedindo pelo rebaixamento de {1}"
|
||||
accept.or.deny: "{0} ou {1}"
|
||||
not.sufficient.money: "Você não tem dinheiro suficiente em sua conta"
|
||||
account.has.been.debited: "{0} foram debitados de sua conta"
|
||||
mysql.connection.successful: "Conexão MySQL bem sucedida"
|
||||
mysql.connection.failed: "Conexão MySQL falhou"
|
||||
sqlite.connection.successful: "Conexão SQLite bem sucedida"
|
||||
sqlite.connection.failed: " Conexão SQLite falhou"
|
||||
purging.player.data: "apagando dados do jogador: {0}"
|
||||
purging.clan: "Apagando clã: {0}"
|
||||
clan.players: "Jogadores: {0}"
|
||||
clans: "Clãs: {0}"
|
||||
banned: "Você foi banido de usar comandos de clã"
|
||||
nothing.more.to.see: "Nada mais para ver"
|
||||
nothing.to.deny: "Nada para negar"
|
||||
no.leader.permissions: "Você não tem permissões de líder"
|
||||
you.have.already.voted: "Você já votou"
|
||||
has.voted.to.deny: "{0} votou para negar"
|
||||
nothing.to.accept: "Nada para aceitar"
|
||||
view.next.page: "Digite /{0} para ver a próxima página."
|
||||
voted.to.accept: "{0} votou para aceitar"
|
||||
bulletin.board.header: "{0}* {1}{2} quadro de avisos"
|
||||
has.been.disbanded.rivalry.ended: "{0} foi debandado. A rivalidade terminou."
|
||||
has.been.disbanded.alliance.ended: "{0} foi debandado. A aliança terminou."
|
||||
clan.disbanded: "Clã debandado"
|
||||
1.color.day: "1 {0}dia"
|
||||
many.color.days: "{0}{1} dias"
|
||||
does.not.match: "Não é um comando de clã"
|
||||
simpleclans.command.failure: "Falha no comando do SimpleClans: {0}"
|
||||
insufficient.permissions: "Permissões insuficientes"
|
||||
clan.is.not.verified: "Clã não é verificado"
|
||||
not.a.member.of.any.clan: "Você não é membro de nenhum clã"
|
||||
minimum.to.make.alliance: "Seu clã deve ter pelo menos {0} membros para fazer alianças"
|
||||
no.clan.matched: "Nenhum clã encontrado"
|
||||
cannot.ally.with.an.unverified.clan: "Você não pode fazer aliança com um clã não verificado"
|
||||
your.clans.are.not.allies: "Seus clãs não são aliados"
|
||||
has.broken.the.alliance: "{0} quebrou a aliança com {1}"
|
||||
at.least.one.leader.accept.the.alliance: "Pelo menos um líder do outro clã precisa estar online para aceitar a aliança"
|
||||
leaders.have.been.asked.for.an.alliance: "Um pedido de aliança foi enviado para os líderes de {0}"
|
||||
your.clans.are.already.allies: "Seus clãs já são aliados"
|
||||
your.clan.cannot.create.rivals: "Seu clã não pode criar rivais"
|
||||
min.players.rivalries: "Seu clã deve ter pelo menos {0} membros para fazer rivalidades"
|
||||
this.player.is.already.banned: "Este jogador já está banido"
|
||||
player.added.to.banned.list: "Jogador adicionado a lista de banidos"
|
||||
you.banned: "Você foi banido de comandos de clã"
|
||||
cape.must.be.png: "A URL da capa deve apontar para uma imagem png"
|
||||
url.error: "A URL está retornando um erro. Por favor, verifique se está funcionando."
|
||||
changed.the.clan.cape: "{0} mudou a capa do clã"
|
||||
clan.wide.friendly.fire.blocked: "Fogo amigo do clã bloqueado"
|
||||
clan.wide.friendly.fire.is.allowed: "Fogo amigo do clã permitido"
|
||||
only.trusted.players.can.access.clan.coords: "Apenas jogadores confiáveis podem acessar as coordenadas do clã"
|
||||
you.are.the.only.member.online: "Você é o único membro online"
|
||||
your.clan.tag.cannot.be.longer.than.characters: "A tag do seu clã não pode ser maior que {0} caracteres"
|
||||
your.clan.tag.must.be.longer.than.characters: "A tag do seu clã deve ser maior que {0} caracteres"
|
||||
your.tag.cannot.contain.the.following.colors: "Sua tag não pode conter as seguintes cores: {0}"
|
||||
your.tag.cannot.contain.color.codes: "Sua tag não pode conter códigos de cor"
|
||||
your.clan.name.cannot.be.longer.than.characters: "O nome do seu clã não pode ser maior que {0} caracteres"
|
||||
your.clan.name.must.be.longer.than.characters: "O nome do seu clã deve ser maior que {0} caracteres"
|
||||
your.clan.tag.can.only.contain.letters.numbers.and.color.codes: "A tag do seu clã pode conter apenas letras, números e códigos de cor"
|
||||
your.clan.name.cannot.contain.color.codes: "O nome do seu clã não pode conter códigos de cor"
|
||||
that.tag.name.is.disallowed: "Essa tag não é permitida"
|
||||
you.must.first.resign: "Você antes precisa abandonar {0}"
|
||||
clan.with.this.tag.already.exists: "Um clã com essa tag já existe"
|
||||
get.your.clan.verified.to.access.advanced.features: "Verifique o seu clã para ter acesso a funções mais avançadas"
|
||||
clan.created: "Clã {0} criado"
|
||||
not.enough.leaders.online.to.vote.on.demotion: "Não há líderes suficientes online para votar nesse rebaixamento"
|
||||
leaders.must.be.online.to.vote.on.demotion: "Todos os líderes, exceto o rebaixado, precisam estar online para votar nesse rebaixamento"
|
||||
demotion.vote.has.been.requested.from.all.leaders: "Um voto de rebaixamento foi pedido a todos os líderes"
|
||||
player.is.not.a.leader.of.your.clan: "O jogador não é um líder do seu clã"
|
||||
clan.has.been.disbanded: "Clã {0} foi debandado"
|
||||
clan.disband.vote.has.been.requested.from.all.leaders: "Um voto para debandar o clã foi pedido a todos os líderes"
|
||||
friendy.fire.is.now.managed.by.your.clan: "Fogo amigo é agora gerenciado pelo seu clã"
|
||||
personal.friendly.fire.is.set.to.allowed: "Fogo amigo pessoal foi definido como permitido"
|
||||
global.friendy.fire.is.now.managed.by.each.clan: "Fogo amigo global é agora gerenciado por cada clã"
|
||||
global.friendy.fire.is.already.being.managed.by.each.clan: "Fogo amigo global já está sendo gerenciado por cada clã"
|
||||
global.friendly.fire.is.set.to.allowed: "Fogo amigo global foi definido como permitido"
|
||||
global.friendly.fire.is.already.being.allowed: "Fogo amigo global já está permitido"
|
||||
no.player.matched: "Nenhum jogador encontrado"
|
||||
the.player.doesn.t.not.have.the.permissions.to.join.clans: "O jogador não tem permissão para entrar em clãs"
|
||||
you.cannot.invite.yourself: "Você não pode se convidar"
|
||||
this.player.is.banned.from.using.clan.commands: "Este jogador foi banido de usar comandos de clãs"
|
||||
the.player.is.already.member.of.another.clan: "Este jogador já é membro de outro clã"
|
||||
has.been.asked.to.join: "Um convite foi enviado a {0} para entrar em {1}"
|
||||
you.cannot.kick.yourself: "Você não pode se expulsar"
|
||||
the.player.is.not.a.member.of.your.clan: "O jogador não é membro do seu clã"
|
||||
you.cannot.kick.another.leader: "Você não pode expulsar outro líder"
|
||||
has.been.kicked.by: "{0} foi expulso por {1}"
|
||||
no.clans.have.been.created: "Nenhum clã foi criado"
|
||||
total.clans: "Total de clãs:"
|
||||
legend: "Legenda:"
|
||||
kill.type.civilian: "Tipo de morte: {0}Civil"
|
||||
no.player.data.found: "Nenhum dado de jogador encontrado"
|
||||
kill.type.0: "Tipo de morte: {0}"
|
||||
s.player.info: "Detalhes de {0}"
|
||||
clan.0: "Clã: {0}"
|
||||
status.0: "Status: {0}"
|
||||
rank.0: "Rank: {0}"
|
||||
kdr.0: "KDR: {0}"
|
||||
deaths.0: "Morreu: {0}"
|
||||
fee.0.value.1: "Taxa: {0}, {1} $"
|
||||
join.date.0: "Entrou: {0}"
|
||||
last.seen.0: "Visto por último: {0}"
|
||||
past.clans.0: "Clãs anteriores: {0}"
|
||||
inactive.0: "Inativo: {0}"
|
||||
kill.totals: "Matou:"
|
||||
clan.commands: "comandos de clã"
|
||||
you.can.only.modify.the.color.and.case.of.the.tag: "Você pode modificar apenas a cor ou a caixa (maiúsculo ou minúsculo) da tag"
|
||||
tag.changed.to.0: "Tag modificada para {0}"
|
||||
name.0: "Nome: {0}"
|
||||
description.0: "Descrição: {0}"
|
||||
leaders.0: "Líderes: {0}"
|
||||
members.online.0: "Membros Online: {0}"
|
||||
allies.0: "Aliados: {0}"
|
||||
rivals.0: "Rivais: {0}"
|
||||
founded.0: "Fundado: {0}"
|
||||
the.member.to.be.promoted.must.be.online: "O membro a ser promovido precisa estar online"
|
||||
the.player.does.not.have.the.permissions.to.lead.a.clan: "O jogador não tem permissões para liderar um clã"
|
||||
you.cannot.promote.yourself: "Você não pode se promover"
|
||||
all.leaders.must.be.online.to.vote.on.this.promotion: "Todos os líderes devem estar online para votar nessa promoção"
|
||||
the.player.is.already.a.leader: "O jogador já é um líder"
|
||||
configuration.reloaded: "Configuração recarregada"
|
||||
last.leader.cannot.resign.you.must.appoint.another.leader.or.disband.the.clan: "O último líder não pode abandonar. Você deve apontar outro líder ou debandar o clã"
|
||||
0.has.resigned: "{0} abandonou"
|
||||
only.trusted.players.can.access.clan.stats: "Apenas jogadores confiáveis podem acessar as estatísticas do clã"
|
||||
you.cannot.trust.yourself: "Você não pode se marcar como confiável"
|
||||
leaders.are.already.trusted: "Líderes já são confiáveis"
|
||||
this.player.is.already.trusted: "Este jogador já é confiável"
|
||||
has.been.given.trusted.status.by: "A {0} foi dado status de confiável por {1}"
|
||||
this.player.is.not.banned: "Este jogador não está banido"
|
||||
player.removed.from.the.banned.list: "Jogador removido da lista de banidos"
|
||||
you.have.been.unbanned.from.clan.commands: "Você foi desbanido de comandos de clã"
|
||||
you.cannot.untrust.yourself: "Você não pode se marcar como não-confiável"
|
||||
leaders.cannot.be.untrusted: "Líderes não podem ser não-confiáveis"
|
||||
this.player.is.already.untrusted: "Este jogador já é não-confiável"
|
||||
has.been.given.untrusted.status.by: "A {0} foi dado status de não-confiável por {1}"
|
||||
the.clan.does.not.exist: "O clã não existe"
|
||||
the.clan.is.already.verified: "O clã já é verificado"
|
||||
the.clan.has.been.verified: "O clã foi verificado"
|
||||
clan.0.has.been.verified: "O clã {0} foi verificado!"
|
||||
only.trusted.players.can.access.clan.vitals: "Apenas jogadores confiáveis podem acessar a saúde do clã"
|
||||
total.clan.players.0: "Total de jogadores: {0}"
|
||||
proposing.war: "{0} está propondo iniciar uma guerra com {1}"
|
||||
you.can.only.start.war.with.rivals: "Você pode apenas iniciar guerras com rivais"
|
||||
leaders.have.been.asked.to.accept.the.war.request: "Um pedido para iniciar uma guerra foi enviado para os líderes de {0}"
|
||||
leaders.asked.to.end.rivalry: "Um pedido para finalizar a guerra foi enviado para os líderes de {0}"
|
||||
proposing.to.end.the.war: "{0} está propondo o fim da guerra com {1}"
|
||||
clans.already.at.war: "Seus clãs já estão em guerra"
|
||||
clans.not.at.war: "Seus clãs não estão em guerra"
|
||||
you.are.at.war: "{0} está agora em guerra com {1}"
|
||||
denied.war.req: "{0} negou o pedido de guerra enviado por {1}"
|
||||
you.are.no.longer.at.war: "{0} não está mais em guerra com {1}"
|
||||
end.war.denied: "Pedido para finalizar a guerra foi negado por {0}"
|
||||
denied.war.end: "{0} negou o pedido de {1} para finalizar a guerra"
|
||||
0.war: "/{0} war{1} iniciar/finalizar [tag] - Inicia ou finaliza uma guerra"
|
||||
has.initiated.a.rivalry: "{0} iniciou uma rivalidade com {1}"
|
||||
start: "iniciar"
|
||||
end: "finalizar"
|
||||
add: "adicionar"
|
||||
remove: "remover"
|
||||
allow: "permitir"
|
||||
block: "bloquear"
|
||||
auto: "auto"
|
||||
war: "guerra"
|
||||
0.s.sword.1.2.b.bow.3.4.a.arrow: "{0}E=Espada{1}, {2}A=Arco{3}, {4}F=Flechas"
|
||||
weapon.S: "E"
|
||||
weapon.B: "A"
|
||||
weapon.A: "F"
|
||||
materials: "Materiais"
|
||||
armor.h: "E"
|
||||
armor.c: "P"
|
||||
armor.l: "C"
|
||||
armor.B: "B"
|
||||
diamond: "Diamante"
|
||||
gold: "Ouro"
|
||||
wood: "Madeira"
|
||||
server.announce: "Anúncio de Servidor"
|
||||
clan.announce: "Anúncio de Clã"
|
||||
leader.announce: "Anúncio de Líder"
|
||||
hunger: "Fome"
|
||||
stone: "Pedra"
|
||||
iron: "Ferro"
|
||||
the.clan.cannot.be.rivaled: "O clã não pdoe ser rivalizado"
|
||||
capeoff: "Cape ativado"
|
||||
capeon: "Capa ativada"
|
||||
bboff: "BB desativado"
|
||||
bbon: "BB ativado"
|
||||
tagoff: "Tag desativada"
|
||||
tagon: "Tag ativada"
|
||||
depositon: "Depósitos ativados"
|
||||
depositoff: "Depósitos desativados"
|
||||
withdrawon: "Saques ativados"
|
||||
withdrawoff: "Saques desativados"
|
||||
feeoff: "Taxa ativada"
|
||||
feeon: "Taxa desativada"
|
||||
home.base.only.once: "A base só pode ser definida uma vez"
|
||||
now.at.homebase: "Você está agora na base do clã {0}"
|
||||
hombase.set: "Base do clã definida para: {0}"
|
||||
hombase.cleared: "Base do clã apagad"
|
||||
hombase.mod.set: "Base de {0} definida para:"
|
||||
hombase.not.set: "Base não definida"
|
||||
rival.limit.reached: "Você atingiu o máximo de rivais. Você não pode rivalizar com mais clãs."
|
||||
you.moved.teleport.cancelled: "Você se mexeu, teleporte cancelado"
|
||||
waiting.for.teleport.stand.still.for.0.seconds: "Aguardando teleporte, fique parado por {0} segundos"
|
||||
no.teleport: "Você não têm permissão para teleportar para aquela localização"
|
||||
on: "ligar"
|
||||
off: "desligar"
|
||||
leave: "sair"
|
||||
join: "entrar"
|
||||
mute: "silenciar"
|
||||
player.rank.changed: "O rank foi definido"
|
||||
your.clans.are.already.rivals: "Seus clãs já são rivais"
|
||||
player.got.money: "Você ganhou {0} por matar {1} baseado no seu KDR: {2}"
|
||||
cleared.bb: "Você limpou o quadro de avisos"
|
||||
clan.balance: "Saldo do clã: {0}"
|
||||
bb.fee.player.kicked: "{0} foi expulso por não pagar a taxa"
|
||||
bb.fee.set: "A taxa é {0} $"
|
||||
bb.clan.deposit: "{0} $ foram depositados"
|
||||
player.clan.deposit: "Você depositou {0}"
|
||||
bb.clan.withdraw: "{0} $ foram sacados"
|
||||
player.clan.withdraw: "Você sacou {0}"
|
||||
clan.bank.not.enough.money: "O banco do seu clã não tem saldo suficiente"
|
||||
your.clans.are.not.rivals: "Seus clãs não são rivais"
|
||||
you.cannot.rival.your.own.clan: "Você não pode fazer rivalidade com seu próprio clã"
|
||||
the.clan.members.reached.limit: "Seu clã atingiu o limite de membros"
|
||||
you.have.reseted.your.kdr: "Você redefiniu o seu KDR"
|
||||
you.have.reseted.0.kdr: "Você redefiniu o KDR de {0}"
|
||||
you.have.reseted.kdr.of.all.players: "Você redefiniu o KDR de todos os jogadores"
|
||||
resign.yes: "Sim"
|
||||
resign.no: "Não"
|
||||
resign.confirmation: "Tem certeza de que quer abandonar o clã? {0}"
|
||||
resign.success: "Você abandonou seu clã com sucesso"
|
||||
player.is.not.a.leader.of.any.clan: "O jogador não é líder de nenhum clã"
|
||||
you.cannot.demote.the.last.leader: "Você não pode rebaixar o último líder"
|
||||
player.successfully.demoted: "O jogador foi rebaixado com sucesso"
|
||||
bb.ago: " atrás "
|
||||
bb.moments: "momentos"
|
||||
bb.seconds: " segundos"
|
||||
bb.minutes: " minutos"
|
||||
bb.one.minute: "1 minuto"
|
||||
bb.hours: " horas"
|
||||
bb.one.hour: "1 hora"
|
||||
bb.days: " dias"
|
||||
bb.one.day: "1 dia"
|
||||
the.fee.is.0.and.its.current.value.is.1: "A taxa está {0} e seu valor atual é {1} $"
|
||||
fee.enabled: "ativada"
|
||||
fee.disabled: "desativada"
|
||||
fee.set: "A taxa foi definida com sucesso"
|
||||
max.fee.allowed.is.0: "A taxa máxima permitida é {0}"
|
||||
fee.collected: "{0} $ foram sacados para a taxa do clã"
|
||||
invalid.fee: "O valor que você inseriu não é válido"
|
||||
player.purged: "Os dados do jogador foram apagados com sucesso"
|
||||
upkeep.collected: "{0} $ foram sacados para a taxa de manutenção"
|
||||
balance.is.not.enough.for.upkeep: "O saldo do clã não é suficiente para pagar a taxa de manutenção ({0} $), deposite a quantidade para evitar que seu clã seja debandado"
|
||||
your.clan.description.must.be.longer.than: "A descrição do seu clã deve ser mais longa que {0} caracteres"
|
||||
your.clan.description.cannot.be.longer.than: "A descrição do seu clã não pode ser mais longa que {0} caracteres"
|
||||
description.changed: "Você mudou com sucesso a descrição do seu clã"
|
||||
no.description: "Sem descrição"
|
||||
the.player.must.wait.0.before.joining.your.clan.again: "Este jogador deve esperar {0} minuto(s) antes de poder entrar no seu clã de novo"
|
||||
@@ -1,3 +1,4 @@
|
||||
description.command: "description"
|
||||
create.command: "创建"
|
||||
list.command: "列表"
|
||||
profile.command: "信息"
|
||||
@@ -18,6 +19,8 @@ toggle.command: "切换"
|
||||
invite.command: "邀请"
|
||||
kick.command: "移除"
|
||||
bank.command: "银行"
|
||||
fee.command: "fee"
|
||||
purge.command: "purge"
|
||||
trust.command: "信任"
|
||||
untrust.command: "取消信任"
|
||||
promote.command: "提升"
|
||||
@@ -37,6 +40,9 @@ war.command: "战争"
|
||||
home.command: "基地"
|
||||
setrank.command: "设置称号"
|
||||
place.command: "移动"
|
||||
resetkdr.command: "resetkdr"
|
||||
usage.description: "Usage: /{0} description [description]"
|
||||
usage.resetkdr: "Usage: /{0} resetkdr [all/player]"
|
||||
usage.clan.alliances: "使用: /{0} alliances"
|
||||
usage.ally: "使用: /{0} ally add/remove [标签]"
|
||||
usage.ban.unban: "使用: /{0} ban/unban [玩家]"
|
||||
@@ -55,8 +61,10 @@ usage.0.permissions.player: "使用: /{0} permissions [帮派] add/remove [权
|
||||
usage.0.invite.player: "使用: /{0} invite [玩家]"
|
||||
usage.kick.player: "使用: /{0} kick [玩家]"
|
||||
usage.bank: "使用: /{0} bank withdraw/deposit/status [数量]"
|
||||
usage.fee: "Usage: /{0} fee check/set [amount]"
|
||||
usage.purge: "Usage: /{0} purge [player]"
|
||||
usage.0.modtag.tag: "使用: /{0} modtag [标签]"
|
||||
usage.list: "使用: /{0} list"
|
||||
usage.list: "Usage: /{0} list [name/size/kdr/founded/active] [asc/desc]"
|
||||
usage.lookup.tag: "使用: /{0} lookup [标签]"
|
||||
usage.0.profile.tag: "使用: /{0} profile [标签]"
|
||||
usage.0.promote.member: "使用: /{0} promote <成员>"
|
||||
@@ -75,9 +83,12 @@ usage.0.leaderboard: "使用: /{0} leaderboard"
|
||||
0.ban.unban.player.1.ban.unban.a.player: "/{0} ban/unban [玩家]{1} - 封禁/解封一个玩家"
|
||||
0.hometp.clan.1.tp.home.a.clan: "/{0} home tp [帮派]{1} - 传送至帮派基地"
|
||||
0.disband.tag.1.disband.a.clan: "/{0} disband [标签]{1} - 解禁帮派"
|
||||
0.resetkdr.1.resets.kdr: "/{0} resetkdr player/all{1} - Reset KDR of all players or just of one"
|
||||
0.resetkdr.1.resets.your.kdr: "/{0} resetkdr{1} - Reset your KDR"
|
||||
0.purge.player.1.purge.a.player: "/{0} purge [player]{1} - Purge a player"
|
||||
0.verify.tag.1.verify.an.unverified.clan: "/{0} verify [标签]{1} - 验证一个帮派"
|
||||
0.verify.1.purchase.verification.of.your.clan: "/{0} verify{1} - 付费验证你的帮派"
|
||||
0.list.1.lists.all.clans: "/{0} list{1} - 列出所有帮派"
|
||||
0.list.1.lists.all.clans: "/{0} list [name/size/kdr/founded/active] [asc/desc]{1} - Lists all clans"
|
||||
0.profile.1.view.your.clan.s.profile: "/{0} profile{1} - 查看你的帮派的信息"
|
||||
0.profile.tag.1.view.a.clan.s.profile: "/{0} profile [标签]{1} - 查看帮派信息"
|
||||
0.lookup.1.lookup.your.info: "/{0} lookup{1} - Lookup your info"
|
||||
@@ -94,6 +105,7 @@ usage.0.leaderboard: "使用: /{0} leaderboard"
|
||||
0.rival.add.remove.tag.1.add.remove.a.rival.clan: "/{0} rival add/remove [标签]{1} - 添加/移除一个敌对帮派"
|
||||
0.bb.1.display.bulletin.board: "/{0} bb{1} - 显示公告板"
|
||||
0.bb.msg.1.add.a.message.to.the.bulletin.board: "/{0} bb [msg]{1} - 添加信息到公告板"
|
||||
0.description.description.1.modify.the.clan.s.description: "/{0} description [description]{1} - Modify the clan''s description"
|
||||
0.modtag.tag.1.modify.the.clan.s.tag: "/{0} modtag [标签]{1} - 更改帮派标签"
|
||||
0.cape.url.1.change.your.clan.s.cape: "/{0} cape [url]{1} - 更改帮派披风"
|
||||
0.invite.player.1.invite.a.player: "/{0} invite [玩家]{1} - 邀请玩家"
|
||||
@@ -112,10 +124,13 @@ usage.0.leaderboard: "使用: /{0} leaderboard"
|
||||
0.create.tag.name.1.create.a.new.clan: "/{0} create [标签] [name]{1} - 创建新的帮派"
|
||||
0.kills: "/{0} kills{1} - 查看你的击杀量"
|
||||
0.killsplayer: "/{0} kills [玩家]{1} - 查看玩家的击杀量"
|
||||
0.fee.check: "/{0} fee check {1}- Check if the fee is enabled and how much is it"
|
||||
0.fee.set: "/{0} fee set [amount]{1} - Set the clan's member fee"
|
||||
0.mostkilled: "/{0} mostkilled{1} - 查看全服死亡排名"
|
||||
home-menu: "/{0} home{1} - 传送至帮派基地"
|
||||
home-set-menu: "/{0} home set{1} - 设置帮派基地"
|
||||
home-clear-menu: "/{0} home clear{1} - 清除帮派基地"
|
||||
home-regroup-menu: "/{0} home regroup [me]{1} - Regroup all members to clan home-base or to you"
|
||||
example.clan.modtag.4kfo.4l: "示例: /clan modtag &4帅"
|
||||
example.clan.create: "示例: /clan create &4大帅比"
|
||||
clan: "帮派"
|
||||
@@ -245,15 +260,17 @@ you.are.the.only.member.online: "你是唯一在线的成员"
|
||||
your.clan.tag.cannot.be.longer.than.characters: "你的帮派的标签不能超过 {0} 字符"
|
||||
your.clan.tag.must.be.longer.than.characters: "你的帮派的标签必须超过 {0} 字符"
|
||||
your.tag.cannot.contain.the.following.colors: "帮派的标签不能含有以下颜色: {0}"
|
||||
your.tag.cannot.contain.color.codes: "Your tag cannot contain color codes"
|
||||
your.clan.name.cannot.be.longer.than.characters: "你的帮派的名称不能超过 {0} 字符"
|
||||
your.clan.name.must.be.longer.than.characters: "你的帮派的名称必须超过 {0} 字符"
|
||||
your.clan.tag.can.only.contain.letters.numbers.and.color.codes: "帮派的标签只能含有字母、数字和颜色代码
|
||||
your.clan.tag.can.only.contain.letters.numbers.and.color.codes: "帮派的标签只能含有字母、数字和颜色代码"
|
||||
your.clan.name.cannot.contain.color.codes: "帮派的名称不能含有颜色"
|
||||
that.tag.name.is.disallowed: "这个标签名不被允许"
|
||||
you.must.first.resign: "你必须先离开 {0}"
|
||||
clan.with.this.tag.already.exists: "此标签的帮派已经存在"
|
||||
get.your.clan.verified.to.access.advanced.features: "验证你的帮派以使用高级功能"
|
||||
clan.created: "帮派 {0} 创建了"
|
||||
not.enough.leaders.online.to.vote.on.demotion: "There aren''t enough leaders online to vote on this demotion"
|
||||
leaders.must.be.online.to.vote.on.demotion: "除了此降级的老大以外的所有老大必须全部在线才能降级"
|
||||
demotion.vote.has.been.requested.from.all.leaders: "所有老大都要求降级"
|
||||
player.is.not.a.leader.of.your.clan: "这个玩家不是你的帮派的老大"
|
||||
@@ -288,6 +305,7 @@ rank.0: "称号: {0}"
|
||||
kdr.0: "KD: {0}"
|
||||
deaths.0: "死亡: {0}"
|
||||
join.date.0: "加入日期: {0}"
|
||||
fee.0.value.1: "Fee: {0}, {1} $"
|
||||
last.seen.0: "最后上线: {0}"
|
||||
past.clans.0: "曾经的帮派: {0}"
|
||||
inactive.0: "不活跃: {0}"
|
||||
@@ -296,6 +314,7 @@ clan.commands: "帮派命令"
|
||||
you.can.only.modify.the.color.and.case.of.the.tag: "你只能更改标签的颜色和大小写"
|
||||
tag.changed.to.0: "标签更改为 {0}"
|
||||
name.0: "名称: {0}"
|
||||
description.0: "Description: {0}"
|
||||
leaders.0: "老大: {0}"
|
||||
members.online.0: "在线成员: {0}"
|
||||
allies.0: "联盟: {0}"
|
||||
@@ -374,6 +393,12 @@ bboff: "公告板已关闭"
|
||||
bbon: "公告板已开启"
|
||||
tagoff: "标签已关闭"
|
||||
tagon: "标签已开启"
|
||||
depositon: "Deposit toggled on"
|
||||
depositoff: "Deposit toggled off"
|
||||
withdrawon: "Withdraw toggled on"
|
||||
withdrawoff: "Withdraw toggled off"
|
||||
feeoff: "Fee toggled off"
|
||||
feeon: "Fee toggled on"
|
||||
home.base.only.once: "基地只能设置一次"
|
||||
now.at.homebase: "你现在在 {0} 的基地"
|
||||
hombase.set: "帮派基地设置为: {0}"
|
||||
@@ -394,10 +419,47 @@ your.clans.are.already.rivals: "你的帮派已经是敌对了"
|
||||
player.got.money: "你因为击杀 {1} 而获得了基于 KD: {2} 的 {0}"
|
||||
cleared.bb: "清空了公告板"
|
||||
clan.balance: "帮派经济: {0}"
|
||||
bb.fee.player.kicked: "{0} was kicked for not paying the fee"
|
||||
bb.fee.set: "{0} $ is the fee"
|
||||
bb.clan.deposit: "{0} $ 已存入"
|
||||
player.clan.deposit: "你存入了 {0}"
|
||||
bb.clan.withdraw: "{0} $ 被取出"
|
||||
player.clan.withdraw: "你取出了 {0}"
|
||||
clan.bank.not.enough.money: "你的帮派银行资金不足"
|
||||
your.clans.are.not.rivals: "你的帮派不是敌对"
|
||||
you.cannot.rival.your.own.clan: "You cannot rival your own clan"
|
||||
the.clan.members.reached.limit: "帮派成员达到上限"
|
||||
you.have.reseted.your.kdr: "You have reseted your KDR"
|
||||
you.have.reseted.0.kdr: "You have reseted {0}''s KDR"
|
||||
you.have.reseted.kdr.of.all.players: "You have reseted the KDR of all players"
|
||||
resign.yes: "Yes"
|
||||
resign.no: "No"
|
||||
resign.confirmation: "Are you sure you want to resign? {0}"
|
||||
resign.success: "You have successfully resigned from your clan"
|
||||
player.is.not.a.leader.of.any.clan: "The player is not a leader of any clan"
|
||||
you.cannot.demote.the.last.leader: "You cannot demote the last leader"
|
||||
player.successfully.demoted: "The player was successfully demoted"
|
||||
bb.ago: " ago "
|
||||
bb.moments: "moments"
|
||||
bb.seconds: " seconds"
|
||||
bb.minutes: " minutes"
|
||||
bb.one.minute: "1 minute"
|
||||
bb.hours: " hours"
|
||||
bb.one.hour: "1 hour"
|
||||
bb.days: " days"
|
||||
bb.one.day: "1 day"
|
||||
the.fee.is.0.and.its.current.value.is.1: "The fee is {0} and the its current value is {1} $"
|
||||
fee.enabled: "enabled"
|
||||
fee.disabled: "disabled"
|
||||
fee.set: "The fee was successfully set"
|
||||
max.fee.allowed.is.0: "Max fee allowed is {0}"
|
||||
fee.collected: "{0} $ were withdrawn for the clan fee"
|
||||
invalid.fee: "The value you inserted is not valid"
|
||||
player.purged: "The player was successfully purged"
|
||||
upkeep.collected: "{0} $ were withdrawn for the upkeep"
|
||||
balance.is.not.enough.for.upkeep: "The clan balance is not enough for paying the upkeep ({0} $), deposit the amount to avoid being disbanded"
|
||||
your.clan.description.must.be.longer.than: "Your clan description must be longer than {0} characters"
|
||||
your.clan.description.cannot.be.longer.than: "Your clan description cannot be longer than {0} characters"
|
||||
description.changed: "You have successfully changed your clan's description"
|
||||
no.description: "No description"
|
||||
the.player.must.wait.0.before.joining.your.clan.again: "This player must wait {0} minute(s) before joining your clan again"
|
||||
@@ -1,3 +1,4 @@
|
||||
description.command: "description"
|
||||
create.command: "create"
|
||||
list.command: "list"
|
||||
profile.command: "profile"
|
||||
@@ -18,6 +19,8 @@ toggle.command: "toggle"
|
||||
invite.command: "invite"
|
||||
kick.command: "kick"
|
||||
bank.command: "bank"
|
||||
fee.command: "fee"
|
||||
purge.command: "purge"
|
||||
trust.command: "trust"
|
||||
untrust.command: "untrust"
|
||||
promote.command: "promote"
|
||||
@@ -38,6 +41,7 @@ home.command: "home"
|
||||
setrank.command: "setrank"
|
||||
place.command: "place"
|
||||
resetkdr.command: "resetkdr"
|
||||
usage.description: "Usage: /{0} description [description]"
|
||||
usage.resetkdr: "Usage: /{0} resetkdr [all/player]"
|
||||
usage.clan.alliances: "Usage: /{0} alliances"
|
||||
usage.ally: "Usage: /{0} ally add/remove [tag]"
|
||||
@@ -57,8 +61,10 @@ usage.0.permissions.player: "Usage: /{0} permissions [clan] add/remove [permissi
|
||||
usage.0.invite.player: "Usage: /{0} invite [player]"
|
||||
usage.kick.player: "Usage: /{0} kick [player]"
|
||||
usage.bank: "Usage: /{0} bank withdraw/deposit/status [amount]"
|
||||
usage.fee: "Usage: /{0} fee check/set [amount]"
|
||||
usage.purge: "Usage: /{0} purge [player]"
|
||||
usage.0.modtag.tag: "Usage: /{0} modtag [tag]"
|
||||
usage.list: "Usage: /{0} list"
|
||||
usage.list: "Usage: /{0} list [name/size/kdr/founded/active] [asc/desc]"
|
||||
usage.lookup.tag: "Usage: /{0} lookup [tag]"
|
||||
usage.0.profile.tag: "Usage: /{0} profile [tag]"
|
||||
usage.0.promote.member: "Usage: /{0} promote <member>"
|
||||
@@ -79,9 +85,10 @@ usage.0.leaderboard: "Usage: /{0} leaderboard"
|
||||
0.disband.tag.1.disband.a.clan: "/{0} disband [tag]{1} - Disband a clan"
|
||||
0.resetkdr.1.resets.kdr: "/{0} resetkdr player/all{1} - Reset KDR of all players or just of one"
|
||||
0.resetkdr.1.resets.your.kdr: "/{0} resetkdr{1} - Reset your KDR"
|
||||
0.purge.player.1.purge.a.player: "/{0} purge [player]{1} - Purge a player"
|
||||
0.verify.tag.1.verify.an.unverified.clan: "/{0} verify [tag]{1} - Verify an unverified clan"
|
||||
0.verify.1.purchase.verification.of.your.clan: "/{0} verify{1} - Purchase verification of your clan"
|
||||
0.list.1.lists.all.clans: "/{0} list{1} - Lists all clans"
|
||||
0.list.1.lists.all.clans: "/{0} list [name/size/kdr/founded/active] [asc/desc]{1} - Lists all clans"
|
||||
0.profile.1.view.your.clan.s.profile: "/{0} profile{1} - View your clan''s profile"
|
||||
0.profile.tag.1.view.a.clan.s.profile: "/{0} profile [tag]{1} - View a clan''s profile"
|
||||
0.lookup.1.lookup.your.info: "/{0} lookup{1} - Lookup your info"
|
||||
@@ -99,6 +106,7 @@ usage.0.leaderboard: "Usage: /{0} leaderboard"
|
||||
0.bb.1.display.bulletin.board: "/{0} bb{1} - Display bulletin board"
|
||||
0.bb.msg.1.add.a.message.to.the.bulletin.board: "/{0} bb [msg]{1} - Add a message to the bulletin board"
|
||||
0.modtag.tag.1.modify.the.clan.s.tag: "/{0} modtag [tag]{1} - Modify the clan''s tag"
|
||||
0.description.description.1.modify.the.clan.s.description: "/{0} description [description]{1} - Modify the clan''s description"
|
||||
0.cape.url.1.change.your.clan.s.cape: "/{0} cape [url]{1} - Change your clan''s cape"
|
||||
0.invite.player.1.invite.a.player: "/{0} invite [player]{1} - Invite a player"
|
||||
0.kick.player.1.kick.a.player.from.the.clan: "/{0} kick [player]{1} - Kick a player from the clan"
|
||||
@@ -116,6 +124,8 @@ usage.0.leaderboard: "Usage: /{0} leaderboard"
|
||||
0.create.tag.name.1.create.a.new.clan: "/{0} create [tag] [name]{1} - Create a new clan"
|
||||
0.kills: "/{0} kills{1} - View your kill counts"
|
||||
0.killsplayer: "/{0} kills [player]{1} - View a player''s kill counts"
|
||||
0.fee.check: "/{0} fee check {1}- Check if the fee is enabled and how much is it"
|
||||
0.fee.set: "/{0} fee set [amount]{1} - Set the clan's member fee"
|
||||
0.mostkilled: "/{0} mostkilled{1} - View serverwide most killed counts"
|
||||
home-menu: "/{0} home{1} - Teleport to clan home-base"
|
||||
home-set-menu: "/{0} home set{1} - Set the clan''s home base"
|
||||
@@ -260,6 +270,7 @@ you.must.first.resign: "You must first resign from {0}"
|
||||
clan.with.this.tag.already.exists: "A clan with this tag already exists"
|
||||
get.your.clan.verified.to.access.advanced.features: "Get your clan verified to access advanced features"
|
||||
clan.created: "Clan {0} created"
|
||||
not.enough.leaders.online.to.vote.on.demotion: "There aren''t enough leaders online to vote on this demotion"
|
||||
leaders.must.be.online.to.vote.on.demotion: "All leaders other than the demoted must be online to vote on this demotion"
|
||||
demotion.vote.has.been.requested.from.all.leaders: "Demotion vote has been requested from all leaders"
|
||||
player.is.not.a.leader.of.your.clan: "The player is not a leader of your clan"
|
||||
@@ -293,6 +304,7 @@ status.0: "Status: {0}"
|
||||
rank.0: "Rank: {0}"
|
||||
kdr.0: "KDR: {0}"
|
||||
deaths.0: "Deaths: {0}"
|
||||
fee.0.value.1: "Fee: {0}, {1} $"
|
||||
join.date.0: "Join Date: {0}"
|
||||
last.seen.0: "Last Seen: {0}"
|
||||
past.clans.0: "Past Clans: {0}"
|
||||
@@ -302,6 +314,7 @@ clan.commands: "clan commands"
|
||||
you.can.only.modify.the.color.and.case.of.the.tag: "You can only modify the color and case of the tag"
|
||||
tag.changed.to.0: "Tag changed to {0}"
|
||||
name.0: "Name: {0}"
|
||||
description.0: "Description: {0}"
|
||||
leaders.0: "Leaders: {0}"
|
||||
members.online.0: "Members Online: {0}"
|
||||
allies.0: "Allies: {0}"
|
||||
@@ -384,6 +397,8 @@ depositon: "Deposit toggled on"
|
||||
depositoff: "Deposit toggled off"
|
||||
withdrawon: "Withdraw toggled on"
|
||||
withdrawoff: "Withdraw toggled off"
|
||||
feeoff: "Fee toggled off"
|
||||
feeon: "Fee toggled on"
|
||||
home.base.only.once: "Home base can only be set once"
|
||||
now.at.homebase: "You are now at {0}''s home base"
|
||||
hombase.set: "Clan home-base set to: {0}"
|
||||
@@ -404,6 +419,8 @@ your.clans.are.already.rivals: "Your clans are already rivals"
|
||||
player.got.money: "You got {0} for killing {1} based on you KDR: {2}"
|
||||
cleared.bb: "Cleared the bulletin board"
|
||||
clan.balance: "Clan-Balance: {0}"
|
||||
bb.fee.player.kicked: "{0} was kicked for not paying the fee"
|
||||
bb.fee.set: "{0} $ is the fee"
|
||||
bb.clan.deposit: "{0} $ were deposited"
|
||||
player.clan.deposit: "You deposited {0}"
|
||||
bb.clan.withdraw: "{0} $ were withdrawn"
|
||||
@@ -414,4 +431,35 @@ you.cannot.rival.your.own.clan: "You cannot rival your own clan"
|
||||
the.clan.members.reached.limit: "Your clan members reached limit"
|
||||
you.have.reseted.your.kdr: "You have reseted your KDR"
|
||||
you.have.reseted.0.kdr: "You have reseted {0}''s KDR"
|
||||
you.have.reseted.kdr.of.all.players: "You have reseted the KDR of all players"
|
||||
you.have.reseted.kdr.of.all.players: "You have reseted the KDR of all players"
|
||||
resign.yes: "Yes"
|
||||
resign.no: "No"
|
||||
resign.confirmation: "Are you sure you want to resign? {0}"
|
||||
resign.success: "You have successfully resigned from your clan"
|
||||
player.is.not.a.leader.of.any.clan: "The player is not a leader of any clan"
|
||||
you.cannot.demote.the.last.leader: "You cannot demote the last leader"
|
||||
player.successfully.demoted: "The player was successfully demoted"
|
||||
bb.ago: " ago "
|
||||
bb.moments: "moments"
|
||||
bb.seconds: " seconds"
|
||||
bb.minutes: " minutes"
|
||||
bb.one.minute: "1 minute"
|
||||
bb.hours: " hours"
|
||||
bb.one.hour: "1 hour"
|
||||
bb.days: " days"
|
||||
bb.one.day: "1 day"
|
||||
the.fee.is.0.and.its.current.value.is.1: "The fee is {0} and the its current value is {1} $"
|
||||
fee.enabled: "enabled"
|
||||
fee.disabled: "disabled"
|
||||
fee.set: "The fee was successfully set"
|
||||
max.fee.allowed.is.0: "Max fee allowed is {0}"
|
||||
fee.collected: "{0} $ were withdrawn for the clan fee"
|
||||
invalid.fee: "The value you inserted is not valid"
|
||||
player.purged: "The player was successfully purged"
|
||||
upkeep.collected: "{0} $ were withdrawn for the upkeep"
|
||||
balance.is.not.enough.for.upkeep: "The clan balance is not enough for paying the upkeep ({0} $), deposit the amount to avoid being disbanded"
|
||||
your.clan.description.must.be.longer.than: "Your clan description must be longer than {0} characters"
|
||||
your.clan.description.cannot.be.longer.than: "Your clan description cannot be longer than {0} characters"
|
||||
description.changed: "You have successfully changed your clan's description"
|
||||
no.description: "No description"
|
||||
the.player.must.wait.0.before.joining.your.clan.again: "This player must wait {0} minute(s) before joining your clan again"
|
||||
@@ -2,11 +2,18 @@ name: SimpleClans
|
||||
main: net.sacredlabyrinth.phaed.simpleclans.SimpleClans
|
||||
version: ${project.version}
|
||||
softdepend: [VanishNoPacket, Permissions, PermissionsBukkit, Vault, PermissionsEx, mChat, mChatSuite]
|
||||
api-version: '1.13'
|
||||
permissions:
|
||||
simpleclans.admin.permissions:
|
||||
description: Can grant clans permissions
|
||||
simpleclans.admin.reload:
|
||||
description: Can reload configuration
|
||||
simpleclans.admin.purge:
|
||||
description: Can purge a player
|
||||
simpleclans.admin.promote:
|
||||
description: Can promote players to clan leaders
|
||||
simpleclans.admin.demote:
|
||||
description: Can demote clan leaders to normal players
|
||||
simpleclans.admin.all-seeing-eye:
|
||||
description: Can see all clan chats
|
||||
simpleclans.admin.resetkdr:
|
||||
@@ -43,10 +50,14 @@ permissions:
|
||||
description: Can view alliances by clan
|
||||
simpleclans.anyone.rivalries:
|
||||
description: Can view rivalries by clan
|
||||
simpleclans.anyone.kdr-exempt:
|
||||
description: The player's KDR is not affected on killing/dying
|
||||
simpleclans.member.profile:
|
||||
description: Can view his own clan's profile
|
||||
simpleclans.member.roster:
|
||||
description: Can view his own clan's member list
|
||||
simpleclans.member.bypass-fee:
|
||||
description: Can bypass the member fee
|
||||
simpleclans.member.lookup:
|
||||
description: Can view his own player info
|
||||
simpleclans.member.vitals:
|
||||
@@ -89,6 +100,8 @@ permissions:
|
||||
description: Can start a rivalry with another clan
|
||||
simpleclans.leader.modtag:
|
||||
description: Can modify his clan's tag
|
||||
simpleclans.leader.description:
|
||||
description: Can modify his clan's description
|
||||
simpleclans.leader.cape:
|
||||
description: Can set his clan's cape url
|
||||
simpleclans.member.cape-toggle:
|
||||
@@ -97,12 +110,16 @@ permissions:
|
||||
description: Can view his and other's kills
|
||||
simpleclans.member.tag-toggle:
|
||||
description: Can hide his own clan tag
|
||||
simpleclans.member.fee-check:
|
||||
description: Can check his clan's fee
|
||||
simpleclans.mod.mostkilled:
|
||||
description: Can view his and other's clans mostkilled
|
||||
simpleclans.mod.keep-items:
|
||||
description: Can keep items when teleporting home
|
||||
simpleclans.mod.place:
|
||||
description: Can manually place players in clans
|
||||
simpleclans.leader.fee:
|
||||
description: Can enable and set the clan fee
|
||||
simpleclans.leader.invite:
|
||||
description: Can invite players into his clan
|
||||
simpleclans.leader.kick:
|
||||
@@ -134,6 +151,7 @@ permissions:
|
||||
simpleclans.admin.reload: true
|
||||
simpleclans.admin.all-seeing-eye: true
|
||||
simpleclans.admin.resetkdr: true
|
||||
simpleclans.admin.demote: true
|
||||
simpleclans.mod.*:
|
||||
description: Permissions for moderators
|
||||
default: op
|
||||
@@ -183,6 +201,7 @@ permissions:
|
||||
simpleclans.member.kills: true
|
||||
simpleclans.member.bank: true
|
||||
simpleclans.member.resetkdr: true
|
||||
simpleclans.member.fee-check: true
|
||||
simpleclans.leader.*:
|
||||
description: Permissions for those who can be clan leaders
|
||||
default: false
|
||||
|
||||
Reference in new issue
Block a user