Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a377a61
start implementing bossbar
P1otrulla Sep 15, 2024
2f18f8a
refactored bossbar system
P1otrulla Sep 15, 2024
846f5af
Async -> Scheduler
P1otrulla Sep 15, 2024
88951c4
scheduler -> buildin java scheduler
P1otrulla Sep 15, 2024
a789be2
fix typo
P1otrulla Sep 15, 2024
c96a2e5
removed unused import
P1otrulla Sep 15, 2024
b630939
add notice builder for bossbar
P1otrulla Sep 15, 2024
2ea624e
GH-47 Bossbar fix (#47)
CitralFlo Oct 1, 2024
ff7006d
Fix example, add test. Make Overlay and progress optional to better m…
CitralFlo Oct 8, 2024
d5f02fc
Fix tests
CitralFlo Oct 8, 2024
2172330
Fix tests v2
CitralFlo Oct 8, 2024
7c307e6
Fix spaces and add Notice#bossBar
CitralFlo Oct 8, 2024
700c662
Update multification-cdn/src/com/eternalcode/multification/cdn/Multif…
CitralFlo Oct 8, 2024
123f342
Update multification-cdn/src/com/eternalcode/multification/cdn/Multif…
CitralFlo Oct 8, 2024
2246527
Fix spaces asked by @Rollczi
CitralFlo Oct 9, 2024
46f1ed5
Merge remote-tracking branch 'origin/boss-bar-cooking' into boss-bar-…
CitralFlo Oct 9, 2024
fac8134
Add tests for Notice#bossbar method.
CitralFlo Oct 9, 2024
5a2bcae
Fix short w/o to without
CitralFlo Oct 11, 2024
e7df484
Bump down version and remove <pride> in example which is not supporte…
CitralFlo Oct 17, 2024
dbfe28f
Add ReadMe and banner.
CitralFlo Oct 17, 2024
0ec340e
version and readme
P1otrulla Sep 15, 2024
64629d7
refactored bossbar system
P1otrulla Sep 15, 2024
2c21304
Async -> Scheduler
P1otrulla Sep 15, 2024
b3c5dfd
scheduler -> buildin java scheduler
P1otrulla Sep 15, 2024
071aaf3
add notice builder for bossbar
P1otrulla Sep 15, 2024
1b002b1
GH-47 Bossbar fix (#47)
CitralFlo Oct 1, 2024
71f29b2
Fix example, add test. Make Overlay and progress optional to better m…
CitralFlo Oct 8, 2024
7200ae6
Fix spaces and add Notice#bossBar
CitralFlo Oct 8, 2024
3ab5662
Fix spaces asked by @Rollczi
CitralFlo Oct 9, 2024
f67f14a
Bump down version and remove <pride> in example which is not supporte…
CitralFlo Oct 17, 2024
4be65a1
Add ReadMe and banner.
CitralFlo Oct 17, 2024
3bbce28
Merge remote-tracking branch 'origin/bump-down-version' into bump-dow…
CitralFlo Oct 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<div align="center">

![](/assets/readme-banner.png)
# Supports cdn and okaeri configs

[![Patreon](https://github.com/intergrav/devins-badges/v3/assets/cozy/donate/patreon-plural_vector.svg)](https://www.patreon.com/eternalcode)
[![Website](https://github.com/intergrav/devins-badges/v3/assets/cozy/documentation/website_vector.svg)](https://eternalcode.pl/)
[![Discord](https://github.com/intergrav/devins-badges/v3/assets/cozy/social/discord-plural_vector.svg)](https://discord.gg/FQ7jmGBd6c)

[![Gradle](https://github.com/intergrav/devins-badges/v3/assets/cozy/built-with/gradle_vector.svg)](https://gradle.org/)
[![Java](https://github.com/intergrav/devins-badges/v3/assets/cozy/built-with/java17_vector.svg)](https://www.java.com/)

</div>

# Introduction

Multification is a spigot-library that allows you to easily create configurable notifications and messages inside your minecraft plugin.
The library supports sending notifications via one or multiple options:
- customizable messages,
- action bar notifications,
- title and subtitle,
- boss bar notifications,
- and sounds,

messages can be sent to:
- multiple players,
- one player,
- or the console.

Your messages can also contain placeholders :P

## Setup

To use the library, you need to add the following repository and dependency to your `build.gradle` file:

```gradle
implementation("com.eternalcode:multification-bukkit:1.1.4")
implementation("com.eternalcode:multification-cdn:1.1.4")
```

Then create a new instance of the `Multification` class and use it to send notifications:

```java
public class YourMultification extends BukkitMultification<MessagesConfig> {

private final MessagesConfig messagesConfig;
private final AudienceProvider audienceProvider;
private final MiniMessage miniMessage;

public YourMultification(MessagesConfig messagesConfig, AudienceProvider audienceProvider, MiniMessage miniMessage) {
this.messagesConfig = messagesConfig;
this.audienceProvider = audienceProvider;
this.miniMessage = miniMessage;
}

@Override
protected @NotNull TranslationProvider<MessagesConfig> translationProvider() {
return locale -> this.messagesConfig;
}

@Override
protected @NotNull ComponentSerializer<Component, Component, String> serializer() {
return this.miniMessage;
}

@Override
protected @NotNull AudienceConverter<CommandSender> audienceConverter() {
return commandSender -> {
if (commandSender instanceof Player player) {
return this.audienceProvider.player(player.getUniqueId());
}

return this.audienceProvider.console();
};
}

}
```

Then on enable, you can create a new instance of the `YourMultification` class and use it to send notifications:

```java
private AudienceProvider audienceProvider = BukkitAudiences.create(this);
MiniMessage miniMessage = MiniMessage.miniMessage();

MessagesConfig messagesConfig = new MessagesConfig();
YourMultification multification = new YourMultification(messagesConfig, audienceProvider, miniMessage);
```

After that, you can use the `multification` instance to send notifications:

```java
multification.create()
.player(player.getUniqueId())
.notice(messages -> messages.yourMessage)
.send();
```

Setting up configuration is easy both in cdn and okaeri configs. To add messages to the configuration, create variable in config with class `Notice` or `BukktiNotice`. You can also use builder. After plugin deploy you can find messages in configuration file.

### To see more examples open the [example plugin module](https://github.com/EternalCodeTeam/multification/tree/master/examples/bukkit).
Binary file added assets/readme-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
object Versions {

const val ADVENTURE_PLATFORM_BUKKIT = "4.3.3"
const val ADVENTURE_API = "4.18.0-SNAPSHOT"
const val ADVENTURE_API = "4.17.0"
const val CDN = "1.14.5"

const val MOCKITO_CORE = "5.14.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class MessagesConfig {
public Notice senderGiveCommandMessage = Notice.title("<green>You have given <yellow>{amount}x {item}</yellow> to <yellow>{player}</yellow>.");
public Notice receiverGiveCommandMessage = BukkitNotice.builder()
.title("<green>You have received <yellow>{amount}x {item}</yellow> from <yellow>{player}</yellow>.")
.subtitle("<pride:gay>Remember to say thank you!</pride>")
.subtitle("<gradient:#5e4fa2:#f79459:red>Remember to say thank you!</gradient>")
.sound(Sound.ENTITY_ITEM_PICKUP)
.build();

Expand Down