-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathModernSyncCommandsProvider.java
More file actions
28 lines (25 loc) · 893 Bytes
/
ModernSyncCommandsProvider.java
File metadata and controls
28 lines (25 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package net.ess3.provider.providers;
import net.ess3.provider.SyncCommandsProvider;
import net.essentialsx.providers.ProviderData;
import net.essentialsx.providers.ProviderTest;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
@ProviderData(description = "1.21.4+ Sync Commands Provider", weight = 1)
public class ModernSyncCommandsProvider implements SyncCommandsProvider {
@Override
public void syncCommands() {
for (final Player player : Bukkit.getOnlinePlayers()) {
player.updateCommands();
}
}
@ProviderTest
public static boolean test() {
try {
// There isn't a real good way to test this, but we can check if the Creaking class exists.
Class.forName("org.bukkit.entity.Creaking");
return true;
} catch (final Throwable ignored) {
return false;
}
}
}