mirror of
https://github.com/SPAWNRYS-ban/FUCK-CustomDiscs.git
synced 2025-12-10 05:19:43 +05:00
38 lines
1.2 KiB
Java
38 lines
1.2 KiB
Java
package na.Navoei.customdiscsplugin;
|
|
|
|
import de.maxhenkel.voicechat.api.BukkitVoicechatService;
|
|
import org.apache.logging.log4j.LogManager;
|
|
import org.apache.logging.log4j.Logger;
|
|
import org.bukkit.plugin.java.JavaPlugin;
|
|
|
|
import javax.annotation.Nullable;
|
|
|
|
public final class CustomDiscs extends JavaPlugin {
|
|
|
|
public static final String PLUGIN_ID = "example_plugin";
|
|
public static final Logger LOGGER = LogManager.getLogger(PLUGIN_ID);
|
|
|
|
@Nullable
|
|
private ExampleVoicechatPlugin voicechatPlugin;
|
|
|
|
@Override
|
|
public void onEnable() {
|
|
BukkitVoicechatService service = getServer().getServicesManager().load(BukkitVoicechatService.class);
|
|
if (service != null) {
|
|
voicechatPlugin = new ExampleVoicechatPlugin();
|
|
service.registerPlugin(voicechatPlugin);
|
|
LOGGER.info("Successfully registered example plugin");
|
|
} else {
|
|
LOGGER.info("Failed to register example plugin");
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onDisable() {
|
|
if (voicechatPlugin != null) {
|
|
getServer().getServicesManager().unregister(voicechatPlugin);
|
|
LOGGER.info("Successfully unregistered example plugin");
|
|
}
|
|
}
|
|
}
|