Perms are still ignoring me
This commit is contained in:
parent
6808c18d5b
commit
4e2a60e625
2 changed files with 29 additions and 0 deletions
10
pom.xml
10
pom.xml
|
@ -108,6 +108,10 @@
|
|||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>vault-repo</id>
|
||||
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
|
@ -142,5 +146,11 @@
|
|||
<version>master-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.milkbowl.vault</groupId>
|
||||
<artifactId>VaultAPI</artifactId>
|
||||
<version>1.6</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -6,6 +6,7 @@ import java.nio.charset.StandardCharsets;
|
|||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import com.google.common.io.Files;
|
||||
|
@ -21,6 +22,7 @@ import buttondevteam.discordplugin.listeners.MCListener;
|
|||
import buttondevteam.discordplugin.mccommands.DiscordMCCommandBase;
|
||||
import buttondevteam.lib.TBMCCoreAPI;
|
||||
import buttondevteam.lib.chat.TBMCChatAPI;
|
||||
import net.milkbowl.vault.permission.Permission;
|
||||
import sx.blah.discord.api.*;
|
||||
import sx.blah.discord.api.events.IListener;
|
||||
import sx.blah.discord.handle.impl.events.ReadyEvent;
|
||||
|
@ -126,6 +128,7 @@ public class DiscordPlugin extends JavaPlugin implements IListener<ReadyEvent> {
|
|||
for (int i = msgs.size() - 1; i >= 10; i--) {
|
||||
genchannel.unpin(msgs.get(i));
|
||||
}
|
||||
setupProviders();
|
||||
TBMCCoreAPI.SendUnsentExceptions();
|
||||
TBMCCoreAPI.SendUnsentDebugMessages();
|
||||
} catch (Exception e) {
|
||||
|
@ -223,4 +226,20 @@ public class DiscordPlugin extends JavaPlugin implements IListener<ReadyEvent> {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Permission perms;
|
||||
|
||||
public boolean setupProviders() {
|
||||
try {
|
||||
Class.forName("net.milkbowl.vault.permission.Permission");
|
||||
Class.forName("net.milkbowl.vault.chat.Chat");
|
||||
} catch (ClassNotFoundException e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
RegisteredServiceProvider<Permission> permsProvider = Bukkit.getServer().getServicesManager()
|
||||
.getRegistration(Permission.class);
|
||||
perms = permsProvider.getProvider();
|
||||
return perms != null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue