-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
890 additions
and
211 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
Maintenance-API/src/main/java/eu/kennytv/maintenance/api/bungee/IMaintenanceBungee.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package eu.kennytv.maintenance.api.bungee; | ||
|
||
import eu.kennytv.maintenance.api.IMaintenance; | ||
import net.md_5.bungee.api.config.ServerInfo; | ||
|
||
/** | ||
* @author KennyTV | ||
* @since 2.5 | ||
*/ | ||
public interface IMaintenanceBungee extends IMaintenance { | ||
|
||
/** | ||
* Enables/disables maintenance mode on a proxied server. | ||
* If enabled, all non-permitted players will be kicked. | ||
* If MySQL is enabled, it will also be written into the database. | ||
* | ||
* @param maintenance true to enable, false to disable maintenance mode | ||
*/ | ||
boolean setMaintenanceToServer(ServerInfo server, boolean maintenance); | ||
|
||
/** | ||
* @return true if maintenance is currently enabled on the proxied server | ||
*/ | ||
boolean isMaintenance(ServerInfo server); | ||
|
||
/** | ||
* @return true if a start- or endtimer task is currently running regarding the proxied server | ||
*/ | ||
boolean isServerTaskRunning(ServerInfo server); | ||
} |
14 changes: 7 additions & 7 deletions
14
...maintenance/api/MaintenanceBungeeAPI.java → ...ance/api/bungee/MaintenanceBungeeAPI.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
package eu.kennytv.maintenance.api; | ||
package eu.kennytv.maintenance.api.bungee; | ||
|
||
import eu.kennytv.maintenance.api.IMaintenanceBase; | ||
import net.md_5.bungee.api.ProxyServer; | ||
import net.md_5.bungee.api.plugin.Plugin; | ||
|
||
/** | ||
* Utility class to get the {@link IMaintenance} instance for the BungeeCord version of the plugin. | ||
* Utility class to get the {@link IMaintenanceBungee} instance for the BungeeCord version of the plugin. | ||
* <p> | ||
* Only access this class if you're running the plugin on a BungeeCord server! | ||
* </p> | ||
* | ||
* @author KennyTV | ||
* @since 2.1 | ||
* @since 2.5 | ||
*/ | ||
public final class MaintenanceBungeeAPI { | ||
|
||
/** | ||
* Returns API instance of IMaintenance. | ||
* | ||
* @return {@link IMaintenance} instance | ||
* @return {@link IMaintenanceBungee} instance | ||
*/ | ||
public static IMaintenance getAPI() { | ||
public static IMaintenanceBungee getAPI() { | ||
final Plugin maintenance = ProxyServer.getInstance().getPluginManager().getPlugin("MaintenanceBungee"); | ||
if (maintenance == null) | ||
ProxyServer.getInstance().getLogger().warning("Could not get instance of MaintenanceBungee!"); | ||
|
||
return ((IMaintenanceBase) maintenance).getApi(); | ||
return (IMaintenanceBungee) ((IMaintenanceBase) maintenance).getApi(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.