Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

Awesome Lists containing this project

README

        







๐Ÿ’งโšก๐ŸŒŠ
Sink Library









Forks
Issues
Stars
License
Jitpack
Github Actions

#




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.java

public 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.