Skip to content

Commit

Permalink
First commit!
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukiiy committed Mar 31, 2024
0 parents commit 15c112b
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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".
17 changes: 17 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>me.lukiiy</groupId>
<artifactId>NiceFormat</artifactId>
<version>1.0</version>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

</project>
12 changes: 12 additions & 0 deletions src/main/java/me/lukiiy/niceformat/Chat.java
Original file line number Diff line number Diff line change
@@ -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
}
}
12 changes: 12 additions & 0 deletions src/main/java/me/lukiiy/niceformat/main.java
Original file line number Diff line number Diff line change
@@ -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() {}
}
4 changes: 4 additions & 0 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: NiceFormat
version: '${project.version}'
main: me.lukiiy.niceformat.main
author: Lukiiy

0 comments on commit 15c112b

Please sign in to comment.