Compare commits

...

6 Commits

Author SHA1 Message Date
Andre601
0ba5e5dd89 Move check to before expansions.remove and remove redundant check in unregisterAll 2024-07-07 22:05:58 +02:00
Andre601
9689eec3ab Add expansion is external + persistent = true check to unregisterAll method loop. 2024-07-07 21:37:09 +02:00
Andre601
19fca16653 Update Adventure-platform-bukkit to 4.3.2 2024-07-07 21:23:55 +02:00
PiggyPiglet
98082398fc Target java release 8 for compilation 2024-07-04 17:46:04 +08:00
PiggyPiglet
c66806ecf8 Merge pull request #1067 from PlaceholderAPI/feat/1.21
feat: initial work on 1.21
2024-07-04 17:26:16 +08:00
Andre_601
c97f5aa5a6 Bump download stats 2024-06-18 22:45:15 +02:00
4 changed files with 20 additions and 5 deletions

View File

@@ -32,7 +32,7 @@
Support for specific plugins are provided either by the plugin itself or through expansions. The expansions may be downloaded in-game through the PAPI Expansion Cloud. There are currently over 240+ expansions that support a wide variety of plugins, such as Essentials, Factions, LuckPerms, and Vault.
PlaceholderAPI has been downloaded over 1,000,000 times and has been used concurrently on over 40,000 servers, which makes it a must-have for a server of any type or scale.
PlaceholderAPI has been downloaded over 1,600,000 times and has been used concurrently on over 40,000 servers, which makes it a must-have for a server of any type or scale.
## Contribute
If you would like to contribute towards PlaceholderAPI should you take a look at our [Contributing file][contributing] for the ins and outs on how you can do that and what you need to keep in mind.

View File

@@ -71,6 +71,7 @@ tasks {
withType<JavaCompile> {
options.encoding = "UTF-8"
options.release = 8
}
withType<Javadoc> {

View File

@@ -110,7 +110,12 @@ public abstract class PlaceholderExpansion extends PlaceholderHook {
* command is used
*
* @return if this expansion should persist through placeholder reloads
*
* @deprecated PlaceholderExpansions registered through their {@link #register()} and not through
* {@link me.clip.placeholderapi.expansion.manager.LocalExpansionManager#register(Class)}
* will be considered internal now and not be unregistered during Plugin reloads.
*/
@Deprecated
public boolean persist() {
return false;
}

View File

@@ -46,6 +46,7 @@ import me.clip.placeholderapi.expansion.Cacheable;
import me.clip.placeholderapi.expansion.Cleanable;
import me.clip.placeholderapi.expansion.Configurable;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import me.clip.placeholderapi.expansion.PlaceholderExpansion.Type;
import me.clip.placeholderapi.expansion.Taskable;
import me.clip.placeholderapi.expansion.VersionSpecific;
import me.clip.placeholderapi.expansion.cloud.CloudExpansion;
@@ -264,6 +265,9 @@ public final class LocalExpansionManager implements Listener {
if (expansion instanceof VersionSpecific) {
VersionSpecific nms = (VersionSpecific) expansion;
Msg.warn("Nag Author(s) %s of expansion %s about their usage of the deprecated "
+ "VersionSpecific interface!", expansion.getAuthor(), expansion.getIdentifier());
Msg.warn("They should switch to a new method of determining the Server version.");
if (!nms.isCompatibleWith(PlaceholderAPIPlugin.getServerVersion())) {
Msg.warn("Your server version is incompatible with expansion %s %s",
expansion.getIdentifier(), expansion.getVersion());
@@ -320,6 +324,15 @@ public final class LocalExpansionManager implements Listener {
@ApiStatus.Internal
public boolean unregister(@NotNull final PlaceholderExpansion expansion) {
if (expansion.getExpansionType() == Type.INTERNAL || expansion.persist()) {
if (expansion.getExpansionType() == Type.EXTERNAL && expansion.persist()) {
Msg.warn("Nag Author(s) %s about their external expansion %s having persist set to true",
expansion.getAuthor(), expansion.getIdentifier());
}
return true;
}
if (expansions.remove(expansion.getIdentifier().toLowerCase(Locale.ROOT)) == null) {
return false;
}
@@ -393,10 +406,6 @@ public final class LocalExpansionManager implements Listener {
private void unregisterAll() {
for (final PlaceholderExpansion expansion : Sets.newHashSet(expansions.values())) {
if (expansion.persist()) {
continue;
}
expansion.unregister();
}
}