Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arthurfiorette/sink-library
๐ A powerful and high-performance tool for building spigot plugins.
https://github.com/arthurfiorette/sink-library
bukkit bukkit-plugin java library minecraft sink spigot spigot-library spigot-mc spigot-plugin-api
Last synced: 2 months ago
JSON representation
๐ A powerful and high-performance tool for building spigot plugins.
- Host: GitHub
- URL: https://github.com/arthurfiorette/sink-library
- Owner: arthurfiorette
- License: mit
- Created: 2020-12-10T17:58:33.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-22T18:11:07.000Z (almost 2 years ago)
- Last Synced: 2024-10-07T18:23:10.367Z (3 months ago)
- Topics: bukkit, bukkit-plugin, java, library, minecraft, sink, spigot, spigot-library, spigot-mc, spigot-plugin-api
- Language: Java
- Homepage: https://arthurfiorette.github.io/sink-library/
- Size: 5.93 MB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
#
Until v5, possibly, we will have more major breaking changes. Update it carefully.
#### `Sink-library` is a powerful and high-performance tool for building spigot plugins.
```java
// /docs/examples/ReadmeExample.javapublic class ReadmeExample extends SinkPlugin {
@Override
public ComponentLoader[] components() {
// A helper method to create a component loader array based on reflection
// Can be written as `new ComponentLoader[] { () -> new MyListener(this) }`
return reflect(this, MyListener.class);
}
}// A simple class to be our listener
class MyListener implements SinkListener {// Getters and Setters...
@EventHandler
public void onPlayerJoin(final PlayerJoinEvent event) {
// On every player join event, get the player and send a message
event.getPlayer().sendMessage("Hello World!");
}
}```
### Installing
This library is hosted by **[JitPack](https://jitpack.io/#ArthurFiorette/sink-library)**.
> Replace `VERSION` with the latest
> [Github](https://github.com/ArthurFiorette/sink-library/releases) release.```xml
jitpack.io
https://jitpack.io
com.github.ArthurFiorette
sink-library
VERSION
```
```gradle
// Gradle
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}dependencies {
implementation 'com.github.ArthurFiorette:sink-library:VERSION'
}
```
### Documentation
While the documentation is not done, you can look at the [examples](/docs/examples), the
**inline documentation** present or our generated
[javadoc](https://arthurfiorette.github.io/sink-library/).
### Commons problems
#### `GenericComponentException`
This exception is thrown when you try to register a component or service, in your class
that extends SinkPlugin, which is generic. Since the ComponentManager manages its objects
with the key being their classes, two classes with different generic types would be
recognized as the same component.Here is an example of how to solve this problem with this simple component
```java
public class MyGenericClass implements BaseComponent {
...
}
```Create a new class that extends the designed class with the correct type
```java
public class MyStringClass extends MyGenericClass {}```
And then you can register the `MyStringClass` normally.
### Help needed.
If you are willing to contribute in any manner. Checking out this list can be helpful
- **Documentation** _(Urgent haha)_
- **English revision.** _(My english is really bad)_
- **Testing this code under other spigot versions**
### License
Licensed under the **MIT**. See [`LICENSE`](LICENSE) for more informations.
### Contact
See my contact information on my [github profile](https://github.com/ArthurFiorette) or
open a new issue.