commit f431bd6da83e11fa3ece439c59831c4386074d90 Author: Minecon724 Date: Thu Nov 14 18:25:30 2024 +0100 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ff6309 --- /dev/null +++ b/.gitignore @@ -0,0 +1,38 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### IntelliJ IDEA ### +.idea/modules.xml +.idea/jarRepositories.xml +.idea/compiler.xml +.idea/libraries/ +*.iws +*.iml +*.ipr + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..aa00ffa --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..7ace097 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..10ede66 --- /dev/null +++ b/pom.xml @@ -0,0 +1,41 @@ + + + 4.0.0 + + eu.m724 + mutils + 1.0-SNAPSHOT + + + 21 + 21 + UTF-8 + + + + + + src/main/resources + true + + + + + + + spigot-repo + https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + + + + + + org.spigotmc + spigot-api + 1.21.1-R0.1-SNAPSHOT + provided + + + \ No newline at end of file diff --git a/src/main/java/eu/m724/utils/UtilsPlugin.java b/src/main/java/eu/m724/utils/UtilsPlugin.java new file mode 100644 index 0000000..2bc98f9 --- /dev/null +++ b/src/main/java/eu/m724/utils/UtilsPlugin.java @@ -0,0 +1,6 @@ +package eu.m724.utils; + +import org.bukkit.plugin.java.JavaPlugin; + +public class UtilsPlugin extends JavaPlugin { +} diff --git a/src/main/java/eu/m724/utils/notification/Notification.java b/src/main/java/eu/m724/utils/notification/Notification.java new file mode 100644 index 0000000..61e8c9f --- /dev/null +++ b/src/main/java/eu/m724/utils/notification/Notification.java @@ -0,0 +1,29 @@ +package eu.m724.utils.notification; + +import net.md_5.bungee.api.chat.BaseComponent; + +/** + * + * @param namespace the namespace of the notification, + * @param lingering + * @param duration + * @param content + */ +public record Notification( + String namespace, + boolean lingering, + int duration, + BaseComponent[] content +) { + + public enum Priority { + /** Notification will be visible in an unobtrusive way */ + BACKGROUND, + /** Notification will pop up as a subtitle for a short time */ + NORMAL, + /** Notification will pop up as a subtitle for a short time and remain in the action bar for some more */ + HIGH, + /** Notification will pop up as a subtitle in a flashy way for some time, along with a ALERT title */ + ALERT + } +} diff --git a/src/main/java/eu/m724/utils/notification/NotificationManager.java b/src/main/java/eu/m724/utils/notification/NotificationManager.java new file mode 100644 index 0000000..44b09cc --- /dev/null +++ b/src/main/java/eu/m724/utils/notification/NotificationManager.java @@ -0,0 +1,14 @@ +package eu.m724.utils.notification; + +import org.bukkit.entity.Player; + +import java.util.HashSet; +import java.util.Set; + +public class NotificationManager { + private final Set players = new HashSet<>(); + + public void showNotification(Player player, Notification notification) { + + } +} diff --git a/src/main/java/eu/m724/utils/notification/NotifiedPlayer.java b/src/main/java/eu/m724/utils/notification/NotifiedPlayer.java new file mode 100644 index 0000000..43c143b --- /dev/null +++ b/src/main/java/eu/m724/utils/notification/NotifiedPlayer.java @@ -0,0 +1,23 @@ +package eu.m724.utils.notification; + +import org.bukkit.entity.Player; + +import java.time.Instant; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +public class NotifiedPlayer { + private final Player player; + + // displayed notifications and when + private final Map notifications = new HashMap<>(); + + public NotifiedPlayer(Player player) { + this.player = player; + } + + public Player getPlayer() { + return player; + } +} diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml new file mode 100644 index 0000000..563adbd --- /dev/null +++ b/src/main/resources/plugin.yml @@ -0,0 +1,5 @@ +name: mUtils724 +version: ${project.version} + +main: eu.m724.utils.UtilsPlugin +api-version: 1.21.1 \ No newline at end of file