diff --git a/pom.xml b/pom.xml index f68f580f..cb78d56c 100644 --- a/pom.xml +++ b/pom.xml @@ -286,7 +286,7 @@ maven-jar-plugin 2.3.1 - D:\MC\Server 1.19\plugins\ + D:\MC\Server 1.20\plugins\ diff --git a/src/main/java/com/gamingmesh/jobs/Jobs.java b/src/main/java/com/gamingmesh/jobs/Jobs.java index abe5c32a..6d53931c 100644 --- a/src/main/java/com/gamingmesh/jobs/Jobs.java +++ b/src/main/java/com/gamingmesh/jobs/Jobs.java @@ -164,7 +164,7 @@ public final class Jobs extends JavaPlugin { private static boolean hasLimitedItems = false; - private static final int MAX_ENTRIES = 5; + private static final int MAX_ENTRIES = 20; public static final LinkedHashMap FASTPAYMENT = new LinkedHashMap(MAX_ENTRIES + 1, .75F, false) { protected boolean removeEldestEntry(Map.Entry eldest) { return size() > MAX_ENTRIES; diff --git a/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java b/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java index 88427c72..e3af33ad 100644 --- a/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java +++ b/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java @@ -88,6 +88,7 @@ public class Placeholder { user_archived_jobs_exp_$1("jname/number"), jtop_name_$1_$2("jname/number", "[1-15]"), + jtop_displayname_$1_$2("jname/number", "[1-15]"), jtop_level_$1_$2("jname/number", "[1-15]"), maxjobs, @@ -616,6 +617,26 @@ public class Placeholder { List list = Jobs.getJobsDAO().getTopListByJob(jo, 15); + if (list.size() < place) + return ""; + + return list.get(place - 1).getPlayerInfo().getName(); + case jtop_displayname_$1_$2: + if (values.size() < 2) + return ""; + + place = 0; + try { + place = Integer.parseInt(values.get(1)); + } catch (NumberFormatException e) { + return ""; + } + + if (place < 1) + return ""; + + list = Jobs.getJobsDAO().getTopListByJob(jo, 15); + if (list.size() < place) return ""; diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java index 12ed255e..8f2f5509 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java @@ -1838,8 +1838,9 @@ public final class JobsPaymentListener implements Listener { // either it's version 1.13+ and we're trying to strip a normal log like oak, // or it's 1.16+ and we're trying to strip a fungi like warped stem if ((Version.isCurrentEqualOrHigher(Version.v1_13_R1) && (block.getType().toString().endsWith("_LOG") || block.getType().toString().endsWith("_WOOD"))) || - (Version.isCurrentEqualOrHigher(Version.v1_16_R1) && (block.getType().toString().endsWith("_STEM") || block.getType().toString().endsWith("_HYPHAE")))) + (Version.isCurrentEqualOrHigher(Version.v1_16_R1) && (block.getType().toString().endsWith("_STEM") || block.getType().toString().endsWith("_HYPHAE")))) { Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> Jobs.action(jPlayer, new BlockActionInfo(block, ActionType.STRIPLOGS), block), 1); + } } }