1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-25 20:16:13 +01:00

Need code for switch types

This commit is contained in:
montlikadani 2018-12-25 13:03:16 +01:00
parent d9a48b5b97
commit 338e3f92f4
2 changed files with 10 additions and 6 deletions

View File

@ -51,7 +51,7 @@ public class Placeholder {
user_canjoin_$1("jobname/number"); user_canjoin_$1("jobname/number");
private String[] vars; private String[] vars;
private List<Integer> groups = new ArrayList<Integer>(); private List<Integer> groups = new ArrayList<>();
private ChatFilterRule rule = null; private ChatFilterRule rule = null;
private boolean hidden = false; private boolean hidden = false;
@ -62,7 +62,7 @@ public class Placeholder {
Matcher matcher = numericalRule.getMatcher(this.toString()); Matcher matcher = numericalRule.getMatcher(this.toString());
if (matcher != null) { if (matcher != null) {
rule = new ChatFilterRule(); rule = new ChatFilterRule();
List<String> ls = new ArrayList<String>(); List<String> ls = new ArrayList<>();
ls.add("(%" + pref + "_)" + this.toString().replaceAll("\\$\\d", "([^\"^%]*)") + "(%)"); ls.add("(%" + pref + "_)" + this.toString().replaceAll("\\$\\d", "([^\"^%]*)") + "(%)");
// For MVdWPlaceholderAPI // For MVdWPlaceholderAPI
// ls.add("(\\{" + pref + this.toString().replaceAll("\\$\\d", "([^\"^%]*)" + "(\\})")); // ls.add("(\\{" + pref + this.toString().replaceAll("\\$\\d", "([^\"^%]*)" + "(\\})"));
@ -173,7 +173,7 @@ public class Placeholder {
} }
public List<String> getComplexRegexMatchers(String text) { public List<String> getComplexRegexMatchers(String text) {
List<String> lsInLs = new ArrayList<String>(); List<String> lsInLs = new ArrayList<>();
if (!this.isComplex()) if (!this.isComplex())
return lsInLs; return lsInLs;
@ -188,7 +188,7 @@ public class Placeholder {
public List<String> getComplexValues(String text) { public List<String> getComplexValues(String text) {
List<String> lsInLs = new ArrayList<String>(); List<String> lsInLs = new ArrayList<>();
if (!this.isComplex() || text == null) if (!this.isComplex() || text == null)
return lsInLs; return lsInLs;
@ -225,7 +225,7 @@ public class Placeholder {
} }
public List<String> updatePlaceHolders(Player player, List<String> messages) { public List<String> updatePlaceHolders(Player player, List<String> messages) {
List<String> ms = new ArrayList<String>(messages); List<String> ms = new ArrayList<>(messages);
for (int i = 0, l = messages.size(); i < l; ++i) { for (int i = 0, l = messages.size(); i < l; ++i) {
ms.set(i, updatePlaceHolders(player, messages.get(i))); ms.set(i, updatePlaceHolders(player, messages.get(i)));
} }
@ -442,7 +442,7 @@ public class Placeholder {
} }
} }
List<String> values = new ArrayList<String>(); List<String> values = new ArrayList<>();
if (placeHolder.isComplex()) { if (placeHolder.isComplex()) {
values = placeHolder.getComplexValues(value); values = placeHolder.getComplexValues(value);
@ -480,6 +480,8 @@ public class Placeholder {
switch (placeHolder) { switch (placeHolder) {
case maxjobs: case maxjobs:
return String.valueOf(Jobs.getGCManager().getMaxJobs()); return String.valueOf(Jobs.getGCManager().getMaxJobs());
default:
break;
} }
return null; return null;

View File

@ -15,6 +15,8 @@ general:
mins: '&e%mins% &6perc ' mins: '&e%mins% &6perc '
secs: '&e%secs% &6másodperc ' secs: '&e%secs% &6másodperc '
invalidPage: '&cÉrvénytelen oldal' invalidPage: '&cÉrvénytelen oldal'
true: '&2Igaz'
false: '&cHamis'
admin: admin:
error: '&cHiba történt a parancsban.' error: '&cHiba történt a parancsban.'
success: '&eA parancs végrehajtásra került.' success: '&eA parancs végrehajtásra került.'