Improve support for mypet
This commit is contained in:
parent
1672fccced
commit
66276fbf47
|
|
@ -60,7 +60,7 @@ public class AFKDetector extends JavaPlugin implements Listener {
|
|||
getCommand("afkcheck").setExecutor(new AFKCheckCommand(this));
|
||||
getCommand("reloadafkdetector").setExecutor(new ReloadCommand(this));
|
||||
new AFKCheckTimer(this).init();
|
||||
myPetEnabled = getServer().getPluginManager().isPluginEnabled("MyPet");
|
||||
myPetEnabled = getServer().getPluginManager().getPlugin("MyPet") != null;
|
||||
} catch (Throwable t) {
|
||||
getLogger().severe("An error has occured while loading AFKDetector");
|
||||
if (!(t instanceof ExceptionInInitializerError)) {
|
||||
|
|
|
|||
|
|
@ -97,7 +97,9 @@ public class AFKPlayer {
|
|||
}
|
||||
|
||||
public void setAFK(Player player) {
|
||||
sendPetAway();
|
||||
if (AFKDetector.myPetEnabled)
|
||||
sendPetAway();
|
||||
|
||||
bossBar.setTitle(afkKickSoon);
|
||||
bossBar.setColor(BarColor.RED);
|
||||
player.setAfk(true);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user