-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into mv-teleport-fix
- Loading branch information
Showing
126 changed files
with
1,883 additions
and
1,079 deletions.
There are no files selected for viewing
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
40 changes: 40 additions & 0 deletions
40
MiniGamesBox API/src/main/java/plugily/projects/minigamesbox/api/IPluginMain.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,40 @@ | ||
package plugily.projects.minigamesbox.api; | ||
|
||
import org.bukkit.configuration.file.FileConfiguration; | ||
import plugily.projects.minigamesbox.api.arena.IPluginArenaRegistry; | ||
import plugily.projects.minigamesbox.api.handlers.language.ILanguageManager; | ||
import plugily.projects.minigamesbox.api.kit.IKitRegistry; | ||
import plugily.projects.minigamesbox.api.preferences.IConfigPreferences; | ||
import plugily.projects.minigamesbox.api.user.IUserManager; | ||
import plugily.projects.minigamesbox.api.utils.misc.IDebugger; | ||
|
||
/** | ||
* @author Lagggpixel | ||
* @since April 24, 2024 | ||
*/ | ||
public interface IPluginMain { | ||
|
||
FileConfiguration getConfig(); | ||
|
||
String getName(); | ||
|
||
IDebugger getDebugger(); | ||
|
||
IConfigPreferences getConfigPreferences(); | ||
|
||
IUserManager getUserManager(); | ||
|
||
String getPluginNamePrefix(); | ||
|
||
String getPluginNamePrefixLong(); | ||
|
||
String getCommandAdminPrefix(); | ||
|
||
String getCommandAdminPrefixLong(); | ||
|
||
IPluginArenaRegistry getArenaRegistry(); | ||
|
||
IKitRegistry getKitRegistry(); | ||
|
||
ILanguageManager getLanguageManager(); | ||
} |
25 changes: 25 additions & 0 deletions
25
MiniGamesBox API/src/main/java/plugily/projects/minigamesbox/api/arena/IArenaState.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,25 @@ | ||
package plugily.projects.minigamesbox.api.arena; | ||
|
||
/** | ||
* @author Lagggpixel | ||
* @since April 24, 2024 | ||
*/ | ||
public enum IArenaState { | ||
|
||
WAITING_FOR_PLAYERS("Waiting"), | ||
STARTING("Starting"), | ||
FULL_GAME("Full-Game"), | ||
IN_GAME("In-Game"), | ||
ENDING("Ending"), | ||
RESTARTING("Restarting"); | ||
|
||
private final String formattedName; | ||
|
||
IArenaState(String formattedName) { | ||
this.formattedName = formattedName; | ||
} | ||
|
||
public String getFormattedName() { | ||
return formattedName; | ||
} | ||
} |
175 changes: 175 additions & 0 deletions
175
MiniGamesBox API/src/main/java/plugily/projects/minigamesbox/api/arena/IPluginArena.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,175 @@ | ||
package plugily.projects.minigamesbox.api.arena; | ||
|
||
import org.bukkit.Location; | ||
import org.bukkit.entity.Player; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
import plugily.projects.minigamesbox.api.IPluginMain; | ||
import plugily.projects.minigamesbox.api.arena.managers.IBossbarManager; | ||
import plugily.projects.minigamesbox.api.arena.managers.IPluginMapRestorerManager; | ||
import plugily.projects.minigamesbox.api.arena.managers.IPluginScoreboardManager; | ||
import plugily.projects.minigamesbox.api.events.game.PlugilyGameStateChangeEvent; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
|
||
/** | ||
* @author Lagggpixel | ||
* @since April 24, 2024 | ||
*/ | ||
public interface IPluginArena { | ||
|
||
/** | ||
* Returns whether option value is true or false | ||
* | ||
* @param name option to get value from | ||
* @return true or false based on user configuration | ||
*/ | ||
Integer getArenaOption(String name); | ||
|
||
boolean isReady(); | ||
|
||
void setReady(boolean ready); | ||
|
||
void setForceStart(boolean forceStart); | ||
|
||
/** | ||
* Returns boss bar of the game. | ||
* Please use doBarAction if possible | ||
* | ||
* @return game boss bar manager | ||
* @see IBossbarManager | ||
*/ | ||
IBossbarManager getBossbarManager(); | ||
|
||
/** | ||
* Get arena identifier used to get arenas by string. | ||
* | ||
* @return arena name | ||
* @see IPluginArenaRegistry#getArena(String) | ||
*/ | ||
String getId(); | ||
|
||
int getMinimumPlayers(); | ||
|
||
/** | ||
* Get arena map name. | ||
* | ||
* @return arena map name, <b>it's not arena id</b> | ||
* @see #getId() | ||
*/ | ||
String getMapName(); | ||
|
||
/** | ||
* Set arena map name. | ||
* | ||
* @param mapName new map name, [b]it's not arena id[/b] | ||
*/ | ||
void setMapName(String mapName); | ||
|
||
/** | ||
* Get timer of arena. | ||
* | ||
* @return timer of lobby time / time to next wave | ||
*/ | ||
int getTimer(); | ||
|
||
/** | ||
* Modify game timer. | ||
* | ||
* @param timer timer of lobby / time to next wave | ||
*/ | ||
void setTimer(int timer); | ||
|
||
/** | ||
* Modify game timer. | ||
* | ||
* @param timer timer of lobby / time to next wave | ||
* @param forceArenaTimer should the timer be forced | ||
*/ | ||
void setTimer(int timer, boolean forceArenaTimer); | ||
|
||
int getMaximumPlayers(); | ||
|
||
IPluginMapRestorerManager getMapRestorerManager(); | ||
|
||
/** | ||
* Gets the current arena state | ||
* @return The current arena state | ||
*/ | ||
@NotNull IArenaState getArenaState(); | ||
|
||
/** | ||
* Set game state of arena. | ||
* Calls VillageGameStateChangeEvent | ||
* | ||
* @param ArenaState new game state of arena | ||
* @param forceArenaState should it force the arenaState? | ||
* @see IArenaState | ||
* @see PlugilyGameStateChangeEvent | ||
*/ | ||
void setArenaState(@NotNull IArenaState ArenaState, boolean forceArenaState); | ||
|
||
/** | ||
* Set game state of arena. | ||
* Calls VillageGameStateChangeEvent | ||
* | ||
* @param ArenaState new game state of arena | ||
* @see IArenaState | ||
* @see PlugilyGameStateChangeEvent | ||
*/ | ||
void setArenaState(@NotNull IArenaState ArenaState); | ||
|
||
|
||
/** | ||
* Gets all the players in the arena | ||
* @return a set containing all the players | ||
*/ | ||
@NotNull Set<Player> getPlayers(); | ||
|
||
/** | ||
* Get spectator location of arena. | ||
* | ||
* @return end location of arena | ||
*/ | ||
@Nullable Location getSpectatorLocation(); | ||
|
||
/** | ||
* Set spectator location of arena. | ||
* | ||
* @param spectatorLoc new end location of arena | ||
*/ | ||
void setSpectatorLocation(Location spectatorLoc); | ||
|
||
Location getLobbyLocation(); | ||
|
||
void setLobbyLocation(Location loc); | ||
|
||
Location getStartLocation(); | ||
|
||
void setStartLocation(Location location); | ||
|
||
void teleportToEndLocation(Player player); | ||
|
||
Location getEndLocation(); | ||
|
||
Location getLocation(GameLocation gameLocation); | ||
|
||
IPluginScoreboardManager getScoreboardManager(); | ||
|
||
@NotNull List<Player> getPlayersLeft(); | ||
|
||
/** | ||
* Returns the plugin main class | ||
* @return plugin main | ||
*/ | ||
IPluginMain getPlugin(); | ||
|
||
enum IBarAction { | ||
ADD, REMOVE; | ||
} | ||
|
||
enum GameLocation { | ||
START, LOBBY, END, SPECTATOR | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
...esBox API/src/main/java/plugily/projects/minigamesbox/api/arena/IPluginArenaRegistry.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,59 @@ | ||
package plugily.projects.minigamesbox.api.arena; | ||
|
||
import org.bukkit.World; | ||
import org.bukkit.entity.Player; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author Lagggpixel | ||
* @since April 24, 2024 | ||
*/ | ||
public interface IPluginArenaRegistry { | ||
/** | ||
* Checks if player is in any arena | ||
* | ||
* @param player player to check | ||
* @return true when player is in arena, false if otherwise | ||
*/ | ||
boolean isInArena(@NotNull Player player); | ||
|
||
/** | ||
* Returns arena where the player is | ||
* | ||
* @param player target player | ||
* @return Arena or null if not playing | ||
* @see #isInArena(Player) to check if player is playing | ||
*/ | ||
@Nullable IPluginArena getArena(Player player); | ||
|
||
/** | ||
* Returns arena based by ID | ||
* | ||
* @param id name of arena | ||
* @return Arena or null if not found | ||
*/ | ||
@Nullable IPluginArena getArena(String id); | ||
|
||
int getArenaPlayersOnline(); | ||
|
||
void registerArena(IPluginArena arena); | ||
|
||
void unregisterArena(IPluginArena arena); | ||
|
||
void registerArenas(); | ||
|
||
void registerArena(String key); | ||
|
||
@NotNull List<IPluginArena> getArenas(); | ||
|
||
List<World> getArenaIngameWorlds(); | ||
|
||
List<World> getArenaWorlds(); | ||
|
||
void shuffleBungeeArena(); | ||
|
||
int getBungeeArena(); | ||
} |
20 changes: 20 additions & 0 deletions
20
...x API/src/main/java/plugily/projects/minigamesbox/api/arena/managers/IBossbarManager.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,20 @@ | ||
package plugily.projects.minigamesbox.api.arena.managers; | ||
|
||
import org.bukkit.entity.Player; | ||
import plugily.projects.minigamesbox.api.arena.IPluginArena; | ||
|
||
/** | ||
* @author Lagggpixel | ||
* @since April 24, 2024 | ||
*/ | ||
public interface IBossbarManager { | ||
void bossBarUpdate(); | ||
|
||
/** | ||
* Executes boss bar action for arena | ||
* | ||
* @param action add or remove a player from boss bar | ||
* @param player player | ||
*/ | ||
void doBarAction(IPluginArena.IBarAction action, Player player); | ||
} |
9 changes: 9 additions & 0 deletions
9
...main/java/plugily/projects/minigamesbox/api/arena/managers/IPluginMapRestorerManager.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,9 @@ | ||
package plugily.projects.minigamesbox.api.arena.managers; | ||
|
||
/** | ||
* @author Lagggpixel | ||
* @since April 24, 2024 | ||
*/ | ||
public interface IPluginMapRestorerManager { | ||
void fullyRestoreArena(); | ||
} |
Oops, something went wrong.