Renamed TownyChat.java back to Chat.java

This commit is contained in:
Articdive committed 2018-02-23 19:47:38 +01:00
1 parent 31590588a5
commit f3d71d300e
15 files changed
+50 -54

No files matched your search

@@ -28,14 +28,14 @@ import java.util.HashMap;
import java.util.List;
/**
* TownyChat plugin to manage all Towny chat
* Chat plugin to manage all Towny chat
*
* Website: http://code.google.com/a/eclipselabs.org/p/towny/
*
* @author ElgarL
*/
public class TownyChat extends JavaPlugin {
public class Chat extends JavaPlugin {
private TownyChatPlayerListener TownyPlayerListener;
private ChannelsHolder channels;
@@ -74,7 +74,7 @@ public class TownyChat extends JavaPlugin {
* register the task.
*/
getLogger().severe("Could not schedule onLoadedTask.");
getLogger().severe("disabling TownyChat");
getLogger().severe("disabling Chat");
pm.disablePlugin(this);
return;
}
@@ -144,7 +144,7 @@ public class TownyChat extends JavaPlugin {
test = pm.getPlugin("HeroicDeath");
if (test != null) {
heroicDeathListener = new HeroicDeathForwarder(irc);
getLogger().info("[TownyChat] Found and attempting to relay Heroic Death messages to craftIRC.");
getLogger().info("[Chat] Found and attempting to relay Heroic Death messages to craftIRC.");
}
}
@@ -1,6 +1,6 @@
package com.palmergames.bukkit.TownyChat.Command;
import com.palmergames.bukkit.TownyChat.TownyChat;
import com.palmergames.bukkit.TownyChat.Chat;
import com.palmergames.bukkit.TownyChat.channels.Channel;
import com.palmergames.bukkit.TownyChat.channels.channelTypes;
import com.palmergames.bukkit.TownyChat.util.TownyUtil;
@@ -25,7 +25,7 @@ import java.util.Map;
public class ChannelCommand extends BaseCommand implements CommandExecutor {
private static TownyChat plugin;
private static Chat plugin;
private static final List<String> channel_help = new ArrayList<String>();
static {
@@ -41,7 +41,7 @@ public class ChannelCommand extends BaseCommand implements CommandExecutor {
}
public ChannelCommand(TownyChat instance) {
public ChannelCommand(Chat instance) {
plugin = instance;
}
@@ -1,6 +1,6 @@
package com.palmergames.bukkit.TownyChat.Command;
import com.palmergames.bukkit.TownyChat.TownyChat;
import com.palmergames.bukkit.TownyChat.Chat;
import com.palmergames.bukkit.towny.TownyMessaging;
import com.palmergames.bukkit.towny.TownySettings;
import com.palmergames.bukkit.towny.command.BaseCommand;
@@ -17,7 +17,7 @@ import java.util.List;
*/
public class TownyChatCommand extends BaseCommand implements CommandExecutor {
private TownyChat plugin;
private Chat plugin;
private static final List<String> townychat_help = new ArrayList<String>();
static {
@@ -27,7 +27,7 @@ public class TownyChatCommand extends BaseCommand implements CommandExecutor {
townychat_help.add(ChatTools.formatCommand("", "/townychat", "reload", ""));
}
public TownyChatCommand(TownyChat instance) {
public TownyChatCommand(Chat instance) {
this.plugin = instance;
}
@@ -1,6 +1,6 @@
package com.palmergames.bukkit.TownyChat.Command.commandobjects;
import com.palmergames.bukkit.TownyChat.TownyChat;
import com.palmergames.bukkit.TownyChat.Chat;
import com.palmergames.bukkit.TownyChat.channels.Channel;
import com.palmergames.bukkit.TownyChat.channels.channelTypes;
import com.palmergames.bukkit.TownyChat.util.TownyUtil;
@@ -13,9 +13,9 @@ import org.bukkit.entity.Player;
public class ChannelJoinAliasCommand extends BukkitCommand {
public Channel channel;
public TownyChat plugin;
public Chat plugin;
public ChannelJoinAliasCommand(String name, Channel channel, TownyChat plugin) {
public ChannelJoinAliasCommand(String name, Channel channel, Chat plugin) {
super(name);
this.channel = channel;
this.plugin = plugin;
@@ -52,10 +52,10 @@ import com.palmergames.bukkit.towny.Towny;
public class CraftIRCHandler extends BasePoint implements CommandEndPoint {
Towny towny;
TownyChat plugin;
Chat plugin;
CraftIRC irc;
public CraftIRCHandler(TownyChat plugin, CraftIRC irc, String tag) {
public CraftIRCHandler(Chat plugin, CraftIRC irc, String tag) {
this.irc = irc;
this.plugin = plugin;
@@ -5,7 +5,7 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import com.palmergames.bukkit.TownyChat.TownyChat;
import com.palmergames.bukkit.TownyChat.Chat;
import org.bukkit.entity.Player;
import com.palmergames.bukkit.towny.object.TownyUniverse;
@@ -16,14 +16,14 @@ import com.palmergames.bukkit.towny.object.TownyUniverse;
*/
public class ChannelsHolder {
private TownyChat plugin;
private Chat plugin;
private Channel defaultChan = null;
/** Constructor
*
* @param plugin
*/
public ChannelsHolder(TownyChat plugin) {
public ChannelsHolder(Chat plugin) {
super();
this.plugin = plugin;
}
@@ -5,13 +5,13 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import com.palmergames.bukkit.TownyChat.Chat;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.dynmap.DynmapAPI;
import com.earth2me.essentials.User;
import com.palmergames.bukkit.TownyChat.TownyChat;
import com.palmergames.bukkit.TownyChat.CraftIRCHandler;
import com.palmergames.bukkit.TownyChat.TownyChatFormatter;
import com.palmergames.bukkit.TownyChat.config.ChatSettings;
@@ -28,9 +28,9 @@ import com.palmergames.bukkit.util.Colors;
public class StandardChannel extends Channel {
private TownyChat plugin;
private Chat plugin;
public StandardChannel(TownyChat instance, String name) {
public StandardChannel(Chat instance, String name) {
super(name);
this.plugin = instance;
}
@@ -32,7 +32,7 @@ public class ChatSettings extends tag_formats {
/**
*
* @param filepath - Location of chatconfig.yml.
* @param version - TownyChat version from plugin.yml.
* @param version - Chat version from plugin.yml.
* @return
* @throws IOException
*/
@@ -44,9 +44,9 @@ public class ChatSettings extends tag_formats {
// read the config.yml into memory
ChatSettings.chatConfig = new CommentedConfiguration(file);
if (!chatConfig.load()) {
Bukkit.getLogger().severe("[TownyChat] Failed to load ChatConfig!");
Bukkit.getLogger().severe("[TownyChat] Please check that the file passes a YAML Parser test:");
Bukkit.getLogger().severe("[TownyChat] Online YAML Parser: https://yaml-online-parser.appspot.com/");
Bukkit.getLogger().severe("[Chat] Failed to load ChatConfig!");
Bukkit.getLogger().severe("[Chat] Please check that the file passes a YAML Parser test:");
Bukkit.getLogger().severe("[Chat] Online YAML Parser: https://yaml-online-parser.appspot.com/");
return false;
}
setDefaults(version, file);
@@ -132,7 +132,7 @@ public class ChatSettings extends tag_formats {
}
private static void sendError(String msg) {
System.out.println("[TownyChat] Error could not read " + msg);
System.out.println("[Chat] Error could not read " + msg);
}
private static boolean perWorld() {
@@ -5,9 +5,9 @@ import java.util.Arrays;
import java.util.List;
import java.util.Map;
import com.palmergames.bukkit.TownyChat.Chat;
import org.bukkit.Bukkit;
import com.palmergames.bukkit.TownyChat.TownyChat;
import com.palmergames.bukkit.TownyChat.channels.Channel;
import com.palmergames.bukkit.TownyChat.channels.StandardChannel;
import com.palmergames.bukkit.TownyChat.channels.channelFormats;
@@ -18,13 +18,13 @@ import com.palmergames.bukkit.TownyChat.util.FileMgmt;
public class ConfigurationHandler {
private TownyChat plugin;
private Chat plugin;
/** Constructor
*
* @param plugin
*/
public ConfigurationHandler(TownyChat plugin) {
public ConfigurationHandler(Chat plugin) {
super();
this.plugin = plugin;
}
@@ -48,9 +48,9 @@ public class ConfigurationHandler {
try {
file = FileMgmt.getFile(filename, defaultRes, null);
} catch (Exception e) {
Bukkit.getLogger().severe("[TownyChat] Failed to load Channels.yml!");
Bukkit.getLogger().severe("[TownyChat] Please check that the file passes a YAML Parser test:");
Bukkit.getLogger().severe("[TownyChat] Online YAML Parser: https://yaml-online-parser.appspot.com/");
Bukkit.getLogger().severe("[Chat] Failed to load Channels.yml!");
Bukkit.getLogger().severe("[Chat] Please check that the file passes a YAML Parser test:");
Bukkit.getLogger().severe("[Chat] Online YAML Parser: https://yaml-online-parser.appspot.com/");
return false;
}
if (file != null) {
@@ -51,7 +51,7 @@ public class AsyncChatHookEvent extends Event {
}
/*
* Informs TownyChat if the event was changed or not
* Informs Chat if the event was changed or not
*/
public void setChanged(boolean changed) {
this.changed = changed;
@@ -2,7 +2,7 @@ package com.palmergames.bukkit.TownyChat.listener;
import java.util.WeakHashMap;
import com.palmergames.bukkit.TownyChat.TownyChat;
import com.palmergames.bukkit.TownyChat.Chat;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
@@ -10,7 +10,6 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
@@ -20,22 +19,19 @@ import com.palmergames.bukkit.TownyChat.channels.Channel;
import com.palmergames.bukkit.TownyChat.channels.channelTypes;
import com.palmergames.bukkit.TownyChat.config.ChatSettings;
import com.palmergames.bukkit.TownyChat.tasks.onPlayerJoinTask;
import com.palmergames.bukkit.TownyChat.util.TownyUtil;
import com.palmergames.bukkit.TownyChat.TownyChatFormatter;
import com.palmergames.bukkit.towny.exceptions.NotRegisteredException;
import com.palmergames.bukkit.towny.exceptions.TownyException;
import com.palmergames.bukkit.towny.object.Resident;
import com.palmergames.bukkit.towny.object.TownyUniverse;
import com.palmergames.bukkit.util.Colors;
import com.palmergames.util.StringMgmt;
public class TownyChatPlayerListener implements Listener {
private TownyChat plugin;
private Chat plugin;
private WeakHashMap<Player, Long> SpamTime = new WeakHashMap<Player, Long>();
public WeakHashMap<Player, String> directedChat = new WeakHashMap<Player, String>();
public TownyChatPlayerListener(TownyChat instance) {
public TownyChatPlayerListener(Chat instance) {
this.plugin = instance;
}
@@ -152,7 +148,7 @@ public class TownyChatPlayerListener implements Listener {
return;
}
/*
* Channel TownyChat mode set
* Channel Chat mode set
* Process the chat
*/
channel.chatProcess(event);
@@ -1,6 +1,6 @@
package com.palmergames.bukkit.TownyChat.tasks;
import com.palmergames.bukkit.TownyChat.TownyChat;
import com.palmergames.bukkit.TownyChat.Chat;
import com.palmergames.bukkit.towny.Towny;
/*
@@ -11,10 +11,10 @@ import com.palmergames.bukkit.towny.Towny;
public class onLoadedTask implements Runnable {
TownyChat plugin;
Chat plugin;
Towny towny;
public onLoadedTask(TownyChat plugin) {
public onLoadedTask(Chat plugin) {
super();
this.plugin = plugin;
this.towny = plugin.getTowny();
@@ -27,12 +27,12 @@ public class onLoadedTask implements Runnable {
// Setup our config here as we now have Towny loaded.
if (this.towny.isError() || (!plugin.getConfigurationHandler().loadConfig(plugin.getChannelsPath(), "ChatConfig.yml"))) {
plugin.getLogger().severe("Disabling TownyChat");
plugin.getLogger().severe("Disabling Chat");
plugin.getServer().getPluginManager().disablePlugin(plugin);
return;
}
plugin.getLogger().info("-******* TownyChat enabled *******-");
plugin.getLogger().info("-******* Chat enabled *******-");
plugin.registerPermissions();
plugin.registerEvents();
}
@@ -1,6 +1,6 @@
package com.palmergames.bukkit.TownyChat.tasks;
import com.palmergames.bukkit.TownyChat.TownyChat;
import com.palmergames.bukkit.TownyChat.Chat;
import org.bukkit.entity.Player;
import com.palmergames.bukkit.TownyChat.channels.Channel;
@@ -14,12 +14,12 @@ import com.palmergames.bukkit.towny.Towny;
public class onPlayerJoinTask implements Runnable {
TownyChat plugin;
Chat plugin;
Towny towny;
Player player;
String mode;
public onPlayerJoinTask(TownyChat plugin, Player player, Channel defaultChannel) {
public onPlayerJoinTask(Chat plugin, Player player, Channel defaultChannel) {
super();
this.plugin = plugin;
this.towny = plugin.getTowny();
@@ -13,7 +13,7 @@ import java.io.StringWriter;
import java.io.Writer;
import java.util.Map;
import com.palmergames.bukkit.TownyChat.TownyChat;
import com.palmergames.bukkit.TownyChat.Chat;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.SafeConstructor;
import org.yaml.snakeyaml.reader.UnicodeReader;
@@ -61,7 +61,7 @@ public class FileMgmt {
return null;
}
@SuppressWarnings("unchecked")
public static Map<String, Object> getFile(String filepath, String resource, TownyChat plugin) {
public static Map<String, Object> getFile(String filepath, String resource, Chat plugin) {
try {
File f = new File(filepath);
+3 -3
View File
@@ -1,5 +1,5 @@
name: TownyChat
main: com.palmergames.bukkit.TownyChat.TownyChat
name: Chat
main: com.palmergames.bukkit.Chat.Chat
version: 0.52
author: ElgarL, Shade, phrstbrn
website: http://towny.palmergames.com/towny/townychat/
@@ -10,7 +10,7 @@ softdepend: [Towny, CraftIRC]
############################################################
# +------------------------------------------------------+ #
# | TownyChat commands | #
# | Chat commands | #
# +------------------------------------------------------+ #
############################################################
commands: