@@ -51,6 +51,7 @@ public Requirement(@NotNull Plugin plugin, @NotNull String name, @NotNull String
5151
5252 /**
5353 * Get the plugin that provides this requirement.
54+ *
5455 * @return plugin that provides this requirement
5556 */
5657 @ Override
@@ -60,6 +61,7 @@ public Requirement(@NotNull Plugin plugin, @NotNull String name, @NotNull String
6061
6162 /**
6263 * Get the required value.
64+ *
6365 * @return example: 4 hoppers placed
6466 */
6567 @ Override
@@ -69,6 +71,7 @@ public final float getRequired() {
6971
7072 /**
7173 * Get the progress percentage.
74+ *
7275 * @param memberHolder land or nation
7376 * @return example: 50 because 2/4 required hoppers placed
7477 */
@@ -80,6 +83,7 @@ public String getProgressDisplay(@NotNull MemberHolder memberHolder) {
8083
8184 /**
8285 * Get the progress in a numerical value.
86+ *
8387 * @param memberHolder land or nation
8488 * @return numerical progress
8589 */
@@ -88,8 +92,17 @@ public final float getProgress(@NotNull MemberHolder memberHolder) {
8892 return (getValue (memberHolder ) / required ) * 100 ;
8993 }
9094
95+ public final boolean shouldRecalculateLevel (float previousValue , float currentValue ) {
96+ if (previousValue < required ) {
97+ return currentValue >= required ;
98+ } else {
99+ return currentValue < required ;
100+ }
101+ }
102+
91103 /**
92104 * Check if this land or nation already fullfills this requirement.
105+ *
93106 * @param memberHolder land or nation
94107 * @return true, if the land or nation already fullfills this requirement
95108 */
@@ -100,6 +113,7 @@ public boolean matches(@NotNull MemberHolder memberHolder) {
100113
101114 /**
102115 * Get the description of this requirement.
116+ *
103117 * @return used for menus
104118 */
105119 @ Override
@@ -109,6 +123,7 @@ public boolean matches(@NotNull MemberHolder memberHolder) {
109123
110124 /**
111125 * Get the unique name of this requirement. For display name, use {@link #getTitle()} instead.
126+ *
112127 * @return unique name
113128 */
114129 @ Override
@@ -119,6 +134,7 @@ public final String getName() {
119134
120135 /**
121136 * Get the title of this requirement.
137+ *
122138 * @return might include parsed color
123139 */
124140 @ Override
0 commit comments