mirror of
https://github.com/Aust1n46/VentureChat.git
synced 2025-05-23 02:19:05 +00:00
Add config check for Towny and Factions channel in /chwho
This commit is contained in:
parent
ea62962bd3
commit
950a74bd23
@ -76,11 +76,11 @@ public class Chwho extends MineverseCommand {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if(pluginManager.isPluginEnabled("Towny") && sender instanceof Player) {
|
||||
if(plugin.getConfig().getBoolean("enable_towny_channel") && pluginManager.isPluginEnabled("Towny") && sender instanceof Player) {
|
||||
try {
|
||||
if(channel.getName().equalsIgnoreCase("Town")) {
|
||||
Resident r = TownyUniverse.getDataSource().getResident(p.getName());
|
||||
Resident pp = TownyUniverse.getDataSource().getResident(((Player) sender).getName());
|
||||
if(channel.getName().equalsIgnoreCase("Town")) {
|
||||
if(!pp.hasTown()) {
|
||||
if(playerlist.length() + p.getName().length() > linecount) {
|
||||
playerlist += "\n";
|
||||
@ -103,6 +103,8 @@ public class Chwho extends MineverseCommand {
|
||||
}
|
||||
}
|
||||
if(channel.getName().equalsIgnoreCase("Nation")) {
|
||||
Resident r = TownyUniverse.getDataSource().getResident(p.getName());
|
||||
Resident pp = TownyUniverse.getDataSource().getResident(((Player) sender).getName());
|
||||
if(!pp.hasNation()) {
|
||||
if(playerlist.length() + p.getName().length() > linecount) {
|
||||
playerlist += "\n";
|
||||
@ -129,11 +131,11 @@ public class Chwho extends MineverseCommand {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
if(pluginManager.isPluginEnabled("Factions") && sender instanceof Player) {
|
||||
if(plugin.getConfig().getBoolean("enable_factions_channel") && pluginManager.isPluginEnabled("Factions") && sender instanceof Player) {
|
||||
try {
|
||||
if(channel.getName().equalsIgnoreCase("Faction")) {
|
||||
MPlayer mplayer = MPlayer.get(p.getPlayer());
|
||||
MPlayer mplayerp = MPlayer.get((Player) sender);
|
||||
if(channel.getName().equalsIgnoreCase("Faction")) {
|
||||
if(!mplayerp.hasFaction()) {
|
||||
if(playerlist.length() + p.getName().length() > linecount) {
|
||||
playerlist += "\n";
|
||||
|
@ -350,9 +350,9 @@ public class ChatListener implements Listener {
|
||||
}
|
||||
if(plugin.getConfig().getBoolean("enable_towny_channel") && pluginManager.isPluginEnabled("Towny")) {
|
||||
try {
|
||||
if(eventChannel.getName().equalsIgnoreCase("Town")) {
|
||||
Resident r = TownyUniverse.getDataSource().getResident(p.getName());
|
||||
Resident pp = TownyUniverse.getDataSource().getResident(mcp.getName());
|
||||
if(eventChannel.getName().equalsIgnoreCase("Town")) {
|
||||
if(!pp.hasTown()) {
|
||||
recipients.remove(p.getPlayer());
|
||||
recipientCount--;
|
||||
@ -370,6 +370,8 @@ public class ChatListener implements Listener {
|
||||
}
|
||||
}
|
||||
if(eventChannel.getName().equalsIgnoreCase("Nation")) {
|
||||
Resident r = TownyUniverse.getDataSource().getResident(p.getName());
|
||||
Resident pp = TownyUniverse.getDataSource().getResident(mcp.getName());
|
||||
if(!pp.hasNation()) {
|
||||
recipients.remove(p.getPlayer());
|
||||
recipientCount--;
|
||||
@ -394,9 +396,9 @@ public class ChatListener implements Listener {
|
||||
|
||||
if(plugin.getConfig().getBoolean("enable_factions_channel") && pluginManager.isPluginEnabled("Factions")) {
|
||||
try {
|
||||
if(eventChannel.getName().equalsIgnoreCase("Faction")) {
|
||||
MPlayer mplayer = MPlayer.get(mcp.getPlayer());
|
||||
MPlayer mplayerp = MPlayer.get(p.getPlayer());
|
||||
if(eventChannel.getName().equalsIgnoreCase("Faction")) {
|
||||
if(!mplayer.hasFaction()) {
|
||||
recipients.remove(p.getPlayer());
|
||||
recipientCount--;
|
||||
|
Loading…
x
Reference in New Issue
Block a user