From 15c112ba998f35f129820ee651be947b13512192 Mon Sep 17 00:00:00 2001 From: Lukiiy <102190774+Lukiiy@users.noreply.github.com> Date: Sun, 31 Mar 2024 17:10:43 -0300 Subject: [PATCH] First commit! --- README.md | 6 ++++++ pom.xml | 17 +++++++++++++++++ src/main/java/me/lukiiy/niceformat/Chat.java | 12 ++++++++++++ src/main/java/me/lukiiy/niceformat/main.java | 12 ++++++++++++ src/main/resources/plugin.yml | 4 ++++ 5 files changed, 51 insertions(+) create mode 100644 README.md create mode 100644 pom.xml create mode 100644 src/main/java/me/lukiiy/niceformat/Chat.java create mode 100644 src/main/java/me/lukiiy/niceformat/main.java create mode 100644 src/main/resources/plugin.yml diff --git a/README.md b/README.md new file mode 100644 index 0000000..98bba40 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# NiceFormat + +> Minecraft Beta 1.7.3 (CraftBukkit) Plugin +--- + +a plugin that enables chatcolors (&) in chat and formats the chat to "Player: Message". diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..0a76b53 --- /dev/null +++ b/pom.xml @@ -0,0 +1,17 @@ + + + 4.0.0 + + me.lukiiy + NiceFormat + 1.0 + + + 8 + 8 + UTF-8 + + + \ No newline at end of file diff --git a/src/main/java/me/lukiiy/niceformat/Chat.java b/src/main/java/me/lukiiy/niceformat/Chat.java new file mode 100644 index 0000000..0d85449 --- /dev/null +++ b/src/main/java/me/lukiiy/niceformat/Chat.java @@ -0,0 +1,12 @@ +package me.lukiiy.niceformat; + +import org.bukkit.event.player.PlayerChatEvent; +import org.bukkit.event.player.PlayerListener; + +public class Chat extends PlayerListener { + + public void onPlayerChat(PlayerChatEvent e) { + e.setMessage(e.getMessage().replace('&', 'ยง')); // Chat Colr + e.setFormat("%1$s: %2$s"); // Format + } +} diff --git a/src/main/java/me/lukiiy/niceformat/main.java b/src/main/java/me/lukiiy/niceformat/main.java new file mode 100644 index 0000000..7eef173 --- /dev/null +++ b/src/main/java/me/lukiiy/niceformat/main.java @@ -0,0 +1,12 @@ +package me.lukiiy.niceformat; + +import org.bukkit.event.Event; +import org.bukkit.plugin.java.JavaPlugin; + +public class main extends JavaPlugin { + @Override + public void onEnable() {getServer().getPluginManager().registerEvent(Event.Type.PLAYER_CHAT, new Chat(), Event.Priority.Lowest, this);} + + @Override + public void onDisable() {} +} \ No newline at end of file diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml new file mode 100644 index 0000000..45ee434 --- /dev/null +++ b/src/main/resources/plugin.yml @@ -0,0 +1,4 @@ +name: NiceFormat +version: '${project.version}' +main: me.lukiiy.niceformat.main +author: Lukiiy \ No newline at end of file