Skip to content

Commit

Permalink
Merge pull request #5 from AlexProgrammerDE/master
Browse files Browse the repository at this point in the history
Added rainbow color
  • Loading branch information
Leeewith3Es authored Aug 11, 2020
2 parents 78fd763 + 5e7d470 commit 8e09c2a
Show file tree
Hide file tree
Showing 11 changed files with 2,232 additions and 899 deletions.
47 changes: 47 additions & 0 deletions 10.0.2/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?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>Leee.nc</groupId>
<artifactId>LeeesNC</artifactId>
<version>10.0.2</version>
<packaging>jar</packaging>

<name>LeeesNC</name>

<description>Leees Name Colour Plugin</description>
<url>http://6b6t.org</url>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>7</source>
<target>7</target>
</configuration>
</plugin>
</plugins>
</build>

<repositories>
<!-- This adds the Spigot Maven repository to the build -->
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>

<dependencies>
<!--This adds the Spigot API artifact to the build -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.15.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
28 changes: 28 additions & 0 deletions 10.0.2/src/main/java/Leee/nc/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package leee.nc;

import leee.nc.command.NCCommand;
import leee.nc.listener.Join;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;

public class Main extends JavaPlugin implements Listener {
public void onEnable() {
String prefix = ChatColor.AQUA + "[LeeesNC] " + ChatColor.WHITE;

getServer().getConsoleSender().sendMessage(prefix + "Registering events");
Bukkit.getServer().getPluginManager().registerEvents(new Join(), this);

getServer().getConsoleSender().sendMessage(prefix + "Registering command");
Bukkit.getServer().getPluginCommand("nc").setExecutor(new NCCommand());
Bukkit.getServer().getPluginCommand("nc").setTabCompleter(new NCCommand());

getServer().getConsoleSender().sendMessage(prefix + "Finished loading! :)");
}
}
945 changes: 945 additions & 0 deletions 10.0.2/src/main/java/Leee/nc/command/NCCommand.java

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions 10.0.2/src/main/java/Leee/nc/listener/Join.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package leee.nc.listener;

import leee.nc.Main;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;

public class Join implements Listener {
@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player player = e.getPlayer();
if (Main.getPlugin(Main.class).getConfig().getString(e.getPlayer().getName()) != null) {
player.setDisplayName(Main.getPlugin(Main.class).getConfig().getString(player.getName()));
}

}
}
14 changes: 14 additions & 0 deletions 10.0.2/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: LeeesNC
version: 10.0.2
main: leee.nc.Main
api-version: 1.12
authors: [Nate, Legault]
description: Leees Name Colour Plugin
website: https://www.6b6t.org
commands:
nc:
description: Change your name color.
aliases: [namecolor, namecolour]
permissions:
Leee.nc:
description: Gives access to changing name color via the /nc command
37 changes: 19 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,25 @@ A Minecraft Plugin that changes a Players name color on their command.
Usage: `/nc color or /nc format-color`
Example: `/nc bold-aqua`

|Colors |Format |
|---------------|----------------|
|`AQUA` |`BOLD` |
|`BLACK` |`ITALIC` |
|`BLUE` |`STRIKETHROUGH` |
|`DARK_AQUA` |`UNDERLINE` |
|`DARK_BLUE` | |
|`DARK_GRAY` | |
|`DARK_GREEN` | |
|`DARK_PURPLE` | |
|`DARK_RED` | |
|`GOLD` | |
|`GRAY` | |
|`GREEN` | |
|`LIGHT_PURPLE` | |
|`RED` | |
|`WHITE` | |
|`YELLOW` | |
|Colors |Format |
|----------------|----------------|
|`AQUA` |`BOLD` |
|`BLACK` |`ITALIC` |
|`BLUE` |`STRIKETHROUGH` |
|`DARK_AQUA` |`UNDERLINE` |
|`DARK_BLUE` | |
|`DARK_GRAY` | |
|`DARK_GREEN ` | |
|`DARK_PURPLE` | |
|`DARK_RED` | |
|`GOLD` | |
|`GRAY` | |
|`GREEN` | |
|`LIGHT_PURPLE` | |
|`RED` | |
|`WHITE` | |
|`YELLOW` | |
|`RAINBOW` | |

Player name format is saved in the config file via the Playername:
```
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>Leee.nc</groupId>
<artifactId>LeeesNC</artifactId>
<version>10.0.2</version>
<version>10.1.0</version>
<packaging>jar</packaging>

<name>LeeesNC</name>
Expand Down Expand Up @@ -40,7 +40,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.15.2-R0.1-SNAPSHOT</version>
<version>1.16.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
11 changes: 3 additions & 8 deletions src/main/java/Leee/nc/Main.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
package leee.nc;
package Leee.nc;

import leee.nc.command.NCCommand;
import leee.nc.listener.Join;
import Leee.nc.command.NCCommand;
import Leee.nc.listener.Join;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;

public class Main extends JavaPlugin implements Listener {
Expand Down
Loading

0 comments on commit 8e09c2a

Please sign in to comment.