From 6d8da198b4936de5bf9fe208bb53adf0962efb9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vadim=20Soud=C3=A9?= Date: Mon, 6 May 2024 14:17:30 +0200 Subject: [PATCH 1/3] Update README.md --- README.md | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 71ba2c2..66fad20 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,88 @@ Example : ## Using it -You can send these notifications using the custom command provided by the plugin (see below for help). +You can send these notifications [using the custom command provided by the plugin](https://github.com/vadim-soude/ToastNotifier?tab=readme-ov-file#The-command-approche) or [using your own plugin with this one as a dependancy](https://github.com/vadim-soude/ToastNotifier?tab=readme-ov-file#The-plugin-approche). The plugin include a queue system for the notifications, allowing you to send notification to the player and being sure that each of the notifications are display as intended and in the order in which you sent them on the player screen ! This plugin is based around vanilla features, mainly fonts and core shaders, so you will need the resource pack provided with the plugin [See the releases](https://github.com/vadim-soude/ToastNotifier/releases/). + +## The command approche + +You can send a notification from the built-in command using this simple syntaxe : +``` +/notif {"title":"Your title","first-row":"Your first line","second-row":"Your second line"} +``` +The ```` being the player that will recive the notification and the ```` being one of the images specified in the config (both of this parameters have auto-complition and suggestion). + +## The plugin approche +*This part while be dedicated to gradle only* + +Once your gradle project is setup, you are gonna edit a couple of file : + +### gradle.build + +Add the repository : +```diff +repositories { + ... ++ maven { ++ url = uri("https://maven.pkg.github.com/vadim-soude/toastnotifier") ++ credentials { ++ username = findProperty("github.username") ++ password = findProperty("github.token") ++ } ++ } + ... +} +``` +Add the dependancy : +```diff +dependencies { + ... ++ implementation 'fr.vadimsoude:toastnotifier:1.3' + ... +} +``` +### gradle.properties + +Add your github credentials +```diff ++ github.username=your-github-username-in-lower-case ++ github.token=xxxxxxxxxxxxxxx +``` +Get a token here : https://github.com/settings/tokens (You don't need to add any particular permission to it, only for authentification with Github Packages) + +**DO NOT SHARE YOUR TOKEN AND DON'T PUSH IT TO ANY GIT REPO, BE CAREFULL !** + +### plugin.yml +Add the depend mention : +```diff ++ depend: [ToastNotifier] +``` + +Add the .jar of the conresponding version of ToastNotifier in the plugin directory of your server (You can found the .jar in the pacakages section of this repo) + +And now everything should work (open an issue if you encounter any problem) you can now use the API to send a notification. + +## Plugin Example + +To send a notification you need to provide the target, the image name as defined in the config.yml of ToastNotifier, the title text, the first row text and the second row text. + +Then you need to use the ``.send()`` methode to send the notification to the player (the notification will end-up in the queue if an other notification is curently displayed). + +#### Example of a notification sent to any player that join the serveur : + +```Java +public class ListenerExample implements Listener { + @EventHandler + public void onJoinEvent(PlayerJoinEvent event) { + Notification notification = new Notification(event.getPlayer(), "purple", "Welcome !", "have fun in this", "server ."); + notification.send(); + } +} +``` + +# Have fun ! + +*Readme updated for version 1.3* From 1d40c6a8587174b5eed5b68db41f31c31b46f0c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vadim=20Soud=C3=A9?= Date: Mon, 6 May 2024 14:23:07 +0200 Subject: [PATCH 2/3] Update gradle-publish.yml --- .github/workflows/gradle-publish.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml index ee2d4d5..1637ef4 100644 --- a/.github/workflows/gradle-publish.yml +++ b/.github/workflows/gradle-publish.yml @@ -7,7 +7,9 @@ name: Gradle Package -on: [push] +on: + release: + types: [created] jobs: build: From 74cf001022ca282b011eca0f0503f7a81adf044a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vadim=20Soud=C3=A9?= Date: Mon, 6 May 2024 14:43:11 +0200 Subject: [PATCH 3/3] =?UTF-8?q?Update=20README.md=20fix=20type=20?= =?UTF-8?q?=F0=9F=A4=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 66fad20..fe072ef 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ *This plugin has been made in about 4 days as a test for Rivrs.* -ToastNotifier is a plugin that allow to send [toast like notification](https://en.wikipedia.org/wiki/Pop-up_notification) to a player screen. This notification can have a title and 2 rows of text as well as an image ! +ToastNotifier is a plugin that allow to send [toast like notification](https://en.wikipedia.org/wiki/Pop-up_notification) to a player screen. This notification can have a title and 2 rows of text, as well as an image ! Example : @@ -12,24 +12,24 @@ Example : ## Using it -You can send these notifications [using the custom command provided by the plugin](https://github.com/vadim-soude/ToastNotifier?tab=readme-ov-file#The-command-approche) or [using your own plugin with this one as a dependancy](https://github.com/vadim-soude/ToastNotifier?tab=readme-ov-file#The-plugin-approche). +You can send these notifications [using the custom command provided by the plugin](https://github.com/vadim-soude/ToastNotifier?tab=readme-ov-file#The-command-approche), or [using your own plugin with this one as a dependancy](https://github.com/vadim-soude/ToastNotifier?tab=readme-ov-file#The-plugin-approche). The plugin include a queue system for the notifications, allowing you to send notification to the player and being sure that each of the notifications are display as intended and in the order in which you sent them on the player screen ! This plugin is based around vanilla features, mainly fonts and core shaders, so you will need the resource pack provided with the plugin [See the releases](https://github.com/vadim-soude/ToastNotifier/releases/). -## The command approche +## The command approach -You can send a notification from the built-in command using this simple syntaxe : +You can send a notification from the built-in command using this simple syntax : ``` /notif {"title":"Your title","first-row":"Your first line","second-row":"Your second line"} ``` -The ```` being the player that will recive the notification and the ```` being one of the images specified in the config (both of this parameters have auto-complition and suggestion). +The ```` being the player that will receive the notification and the ```` being one of the images specified in the config (both of these parameters have auto-completion and suggestion). -## The plugin approche -*This part while be dedicated to gradle only* +## The plugin approach +*This part while be dedicated to Gradle only* -Once your gradle project is setup, you are gonna edit a couple of file : +Once your Gradle project is set up, you are going to edit a couple of file : ### gradle.build @@ -47,7 +47,7 @@ repositories { ... } ``` -Add the dependancy : +Add the dependency : ```diff dependencies { ... @@ -57,14 +57,14 @@ dependencies { ``` ### gradle.properties -Add your github credentials +Add your GitHub credentials : ```diff + github.username=your-github-username-in-lower-case + github.token=xxxxxxxxxxxxxxx ``` -Get a token here : https://github.com/settings/tokens (You don't need to add any particular permission to it, only for authentification with Github Packages) +Get a token here : https://github.com/settings/tokens (You don't need to add any particular permission to it, only for authentication with GitHub Packages) -**DO NOT SHARE YOUR TOKEN AND DON'T PUSH IT TO ANY GIT REPO, BE CAREFULL !** +**DO NOT SHARE YOUR TOKEN AND DON'T PUSH IT TO ANY GIT REPO, BE CAREFUL !** ### plugin.yml Add the depend mention : @@ -72,7 +72,7 @@ Add the depend mention : + depend: [ToastNotifier] ``` -Add the .jar of the conresponding version of ToastNotifier in the plugin directory of your server (You can found the .jar in the pacakages section of this repo) +Add the .jar of the corresponding version of ToastNotifier in the plugin directory of your server (You can found the .jar in the packages section of this repo) And now everything should work (open an issue if you encounter any problem) you can now use the API to send a notification. @@ -80,9 +80,9 @@ And now everything should work (open an issue if you encounter any problem) you To send a notification you need to provide the target, the image name as defined in the config.yml of ToastNotifier, the title text, the first row text and the second row text. -Then you need to use the ``.send()`` methode to send the notification to the player (the notification will end-up in the queue if an other notification is curently displayed). +Then, you need to use the ``.send()`` method to send the notification to the player (the notification will end-up in the queue if another notification is currently displayed). -#### Example of a notification sent to any player that join the serveur : +#### Example of a notification sent to any player that join the server : ```Java public class ListenerExample implements Listener {