SpooklyCoreAPI is a comprehensive API for managing various aspects of the Spookly system, including players, teams, game phases, events, and more. This API provides interfaces and their implementations for creating and managing complex game systems in a Minecraft environment.
- Player management (online and offline)
- Team management and display customization
- Game phase management
- Placeholder handling
- Event handling and subscription
- Database connection and operations
To use SpooklyCoreAPI in your project, add the following repository and dependency to your pom.xml:
<repositories>
<repository>
<id>spookly-repository</id>
<name>Spookly Repository</name>
<url>https://mvn.spookly.net/(releases|snapshots)</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>de.spookly</groupId>
<artifactId>SpooklyCoreAPI</artifactId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
</dependencies>
The API provides various interfaces to interact with different components of the Spookly system. Here are some examples of how to use the API:
SpooklyServer server = Spookly.getServer();
UUID playerUUID = // player's UUID
server.getOfflinePlayer(playerUUID, offlinePlayer -> {
// Perform operations with the offline player
});
SpooklyPlayer player = server.getPlayer(playerUUID);
// Perform operations with the online player
TeamManager teamManager = server.getTeamManager();
Team team = teamManager.team(playerUUID);
if (team != null) {
team.registerPlayer(player);
}
EventExecuter eventExecuter = server.getEventExecuter();
eventExecuter.register(SomeEvent.class, event -> {
// Handle the event
});
// Adding a placeholder
Placeholder placeholder = new Placeholder("<3", context -> {
Player player = context.getPlayer();
return Component.text("❤ ")
.color(NamedTextColor.RED)
.append(player.displayName());
}, PlaceholderContext.PlaceholderType.CHAT);
server.getPlaceholderManager().registerPlaceholder(placeholder);
// Resolving placeholders
Component shouldResolveIn = Component.text("<3");
PlaceholderContext context = new PlaceholderContext(source, PlaceholderContext.PlaceholderType.CHAT);
server.getPlaceholderManager().replacePlaceholder(shouldResolveIn, context);
We welcome contributions to SpooklyCoreAPI! Here's how you can contribute:
- Fork the repository.
- Create a new branch for your feature or bugfix (git checkout -b feature-name).
- Make your changes and commit them (git commit -m 'Add new feature').
- Push your changes to your fork (git push origin feature-name).
- Create a pull request with a description of your changes.
Please follow the existing code style and conventions when contributing. Ensure your code is properly documented with Javadoc comments.
If you encounter any issues or bugs, please report them on the GitHub issues page. Provide as much detail as possible, including steps to reproduce the issue and any relevant code snippets.
SpooklyCoreAPI is licensed under the MIT License. See the LICENSE file for more information.
Made with ❤️ by the Spookly Network team.