...
 
Commits (2)
Changelog
=========
v2.1 (2019/07/15)
-----------------
* Added persistent map of player status
* Added message if player is already enabled/disabled
* Added command aliases: `bgt`, `bukkitgreentext`
* Re-write command parser to be more efficient
v2.0 (2019/07/05)
-----------------
* Initial (re-)release
......@@ -67,7 +67,6 @@ when I debug my subpar code.
### Some to-do
* Make HashMap of player toggle persistent (via YAML file?)
* Separate exceptions for orangetext and greentext
* Toggle orangetext separately from greentext
* Support for reply reference (`>>31337`) and board reference (`>>>/out/`)
......
......@@ -6,7 +6,7 @@
<name>BukkitGreentext</name>
<description>Add 4chan-style quoting to Minecraft server chat</description>
<version>2.0</version>
<version>2.1</version>
<url>http://www.gitlab.com/ssterling/bukkitgreentext/</url>
<properties>
......
......@@ -96,8 +96,9 @@ public class BgtCommandExecutor implements CommandExecutor
} else {
/* `is_global' is already false */
target_player = plugin.getServer().getPlayer(args[1]);
/* Player is either offline or invalid; exit */
if (target_player == null) {
/* Player is either offline or invalid; exit */
sender.sendMessage("Player " + args[1] + " is nonexistent or offline.");
return true;
}
......@@ -126,6 +127,12 @@ public class BgtCommandExecutor implements CommandExecutor
return true;
}
/* Player already has status set to value; ignore */
if (plugin.playerIsEnabled(player) == arg_enabled) {
sender.sendMessage(ChatColor.GREEN + ">greentext" + ChatColor.RESET + " already " + enabled_disabled + ".");
return true;
}
/* Method `playerSetEnabled()' already logs to the console,
* so only pretty-print to players */
if (is_player) {
......@@ -143,6 +150,17 @@ public class BgtCommandExecutor implements CommandExecutor
return true;
}
/* Player already has status set to value; ignore */
if (plugin.playerIsEnabled(target_player) == arg_enabled) {
/* Again, to keep consistency with the uncoloured console messages */
if (is_player) {
sender.sendMessage(ChatColor.GREEN + ">greentext" + ChatColor.RESET + " already " + enabled_disabled + " for player " + target_player.getName() + ".");
} else {
sender.sendMessage("Greentext already " + enabled_disabled + " for player " + target_player.getName());
}
return true;
}
/* Method `globalSetEnabled()' already logs to the console,
* so only pretty-print to players */
if (is_player) {
......@@ -160,6 +178,17 @@ public class BgtCommandExecutor implements CommandExecutor
return true;
}
/* Player already has status set to value; ignore */
if (plugin.globalIsEnabled() == arg_enabled) {
/* Yet again, to keep consistency with the uncoloured console messages */
if (is_player) {
sender.sendMessage(ChatColor.GREEN + ">greentext" + ChatColor.RESET + " already " + enabled_disabled + " globally.");
} else {
sender.sendMessage("Greentext already " + enabled_disabled + " globally");
}
return true;
}
/* Method `globalSetEnabled()' already logs to the console,
* so only pretty-print to players */
if (is_player) {
......
name: BukkitGreentext
author: ssterling
version: 2.0
version: 2.1
description: Add 4chan-style quoting to Minecraft server chat
website: http://www.gitlab.com/ssterling/bukkitgreentext/
......