mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-12-27 20:27:37 +00:00
Merge pull request #235 from speedxx/development
fix guildchat being sent to discord
This commit is contained in:
commit
e4ee3066bc
6
pom.xml
6
pom.xml
@ -237,6 +237,12 @@
|
||||
<version>1.18.10</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.speedxx</groupId>
|
||||
<artifactId>TFGuilds</artifactId>
|
||||
<version>master-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -79,7 +79,6 @@ public class ChatManager extends FreedomService
|
||||
FSync.playerMsg(player, "Message was shortened because it was too long to send.");
|
||||
}
|
||||
|
||||
|
||||
final FPlayer fPlayer = plugin.pl.getPlayerSync(player);
|
||||
if (fPlayer.isLockedUp())
|
||||
{
|
||||
@ -137,7 +136,7 @@ public class ChatManager extends FreedomService
|
||||
event.setFormat(format);
|
||||
|
||||
// Send to discord
|
||||
if (!ConfigEntry.ADMIN_ONLY_MODE.getBoolean() && !Bukkit.hasWhitelist() && !plugin.pl.getPlayer(player).isMuted())
|
||||
if (!ConfigEntry.ADMIN_ONLY_MODE.getBoolean() && !Bukkit.hasWhitelist() && !plugin.pl.getPlayer(player).isMuted() && !plugin.tfg.inGuildChat(player))
|
||||
{
|
||||
plugin.dc.messageChatChannel(plugin.dc.deformat(player.getName()) + " \u00BB " + ChatColor.stripColor(message));
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ import me.totalfreedom.totalfreedommod.bridge.BukkitTelnetBridge;
|
||||
import me.totalfreedom.totalfreedommod.bridge.CoreProtectBridge;
|
||||
import me.totalfreedom.totalfreedommod.bridge.EssentialsBridge;
|
||||
import me.totalfreedom.totalfreedommod.bridge.LibsDisguisesBridge;
|
||||
import me.totalfreedom.totalfreedommod.bridge.TFGuildsBridge;
|
||||
import me.totalfreedom.totalfreedommod.bridge.WorldEditBridge;
|
||||
import me.totalfreedom.totalfreedommod.bridge.WorldGuardBridge;
|
||||
import me.totalfreedom.totalfreedommod.caging.Cager;
|
||||
@ -134,6 +135,7 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
public SignBlocker snp;
|
||||
public EntityWiper ew;
|
||||
public Sitter st;
|
||||
|
||||
//public HubWorldRestrictions hwr;
|
||||
//
|
||||
// Bridges
|
||||
@ -141,6 +143,7 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
public EssentialsBridge esb;
|
||||
public LibsDisguisesBridge ldb;
|
||||
public CoreProtectBridge cpb;
|
||||
public TFGuildsBridge tfg;
|
||||
public WorldEditBridge web;
|
||||
public WorldGuardBridge wgb;
|
||||
|
||||
@ -254,7 +257,6 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
ae = new AutoEject();
|
||||
mo = new Monitors();
|
||||
|
||||
|
||||
mv = new MovementValidator();
|
||||
sp = new ServerPing();
|
||||
|
||||
@ -273,6 +275,7 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
cpb = new CoreProtectBridge();
|
||||
esb = new EssentialsBridge();
|
||||
ldb = new LibsDisguisesBridge();
|
||||
tfg = new TFGuildsBridge();
|
||||
web = new WorldEditBridge();
|
||||
wgb = new WorldGuardBridge();
|
||||
|
||||
@ -376,4 +379,4 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
{
|
||||
return new CleanroomChunkGenerator(id);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package me.totalfreedom.totalfreedommod.bridge;
|
||||
|
||||
import me.totalfreedom.tfguilds.Common;
|
||||
import me.totalfreedom.tfguilds.TFGuilds;
|
||||
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
public class TFGuildsBridge extends FreedomService
|
||||
{
|
||||
|
||||
private TFGuilds tfGuildsPlugin = null;
|
||||
|
||||
@Override
|
||||
public void onStart()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop()
|
||||
{
|
||||
}
|
||||
|
||||
public TFGuilds getTfGuildsPlugin()
|
||||
{
|
||||
if (tfGuildsPlugin == null)
|
||||
{
|
||||
try
|
||||
{
|
||||
final Plugin tfGuilds = server.getPluginManager().getPlugin("TFGuilds");
|
||||
if (tfGuilds != null)
|
||||
{
|
||||
if (tfGuilds instanceof TFGuilds)
|
||||
{
|
||||
tfGuildsPlugin = (TFGuilds)tfGuilds;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
FLog.severe(ex);
|
||||
}
|
||||
}
|
||||
return tfGuildsPlugin;
|
||||
}
|
||||
|
||||
public boolean inGuildChat(Player player)
|
||||
{
|
||||
return Common.IN_GUILD_CHAT.contains(player);
|
||||
}
|
||||
}
|
@ -2,6 +2,6 @@ name: TotalFreedomMod
|
||||
main: me.totalfreedom.totalfreedommod.TotalFreedomMod
|
||||
version: ${project.version}
|
||||
description: Plugin for the Total Freedom server.
|
||||
softdepend: [BukkitTelnet, Essentials, LibsDisguises, WorldEdit]
|
||||
softdepend: [BukkitTelnet, Essentials, LibsDisguises, WorldEdit, TFGuilds]
|
||||
authors: [Madgeek1450, Prozza]
|
||||
api-version: 1.15
|
||||
api-version: 1.15
|
Loading…
Reference in New Issue
Block a user