mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-12-28 12:47:36 +00:00
dissc
This commit is contained in:
parent
ea60be4c48
commit
f53696aa9e
@ -11,7 +11,7 @@ public abstract class FreedomService implements Listener
|
||||
protected final Server server;
|
||||
protected final Logger logger;
|
||||
|
||||
public FreedomService()
|
||||
protected FreedomService()
|
||||
{
|
||||
plugin = TotalFreedomMod.getPlugin();
|
||||
server = plugin.getServer();
|
||||
|
@ -236,6 +236,7 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
try
|
||||
{
|
||||
final Properties props;
|
||||
final String unknown = "unknown";
|
||||
|
||||
try (InputStream in = plugin.getResource("build.properties"))
|
||||
{
|
||||
@ -243,13 +244,12 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
props.load(in);
|
||||
}
|
||||
|
||||
author = props.getProperty("buildAuthor", "unknown");
|
||||
codename = props.getProperty("buildCodeName", "unknown");
|
||||
author = props.getProperty("buildAuthor", unknown);
|
||||
codename = props.getProperty("buildCodeName", unknown);
|
||||
version = props.getProperty("buildVersion", pluginVersion);
|
||||
number = props.getProperty("buildNumber", "1");
|
||||
date = props.getProperty("buildDate", "unknown");
|
||||
// Need to do this or it will display ${git.commit.id.abbrev}
|
||||
head = props.getProperty("buildHead", "unknown").replace("${git.commit.id.abbrev}", "unknown");
|
||||
date = props.getProperty("buildDate", unknown);
|
||||
head = props.getProperty("buildHead", unknown).replace("${git.commit.id.abbrev}", unknown);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -0,0 +1,44 @@
|
||||
package me.totalfreedom.totalfreedommod.bridge;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import net.essentialsx.discord.EssentialsDiscord;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
public class EXDiscordBridge extends FreedomService
|
||||
{
|
||||
private EssentialsDiscord essentialsDiscord = null;
|
||||
|
||||
@Override
|
||||
public void onStart()
|
||||
{
|
||||
// This is completely useless, but it's here to make sure the service is loaded.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop()
|
||||
{
|
||||
essentialsDiscord = null;
|
||||
}
|
||||
|
||||
public EssentialsDiscord getEssentialsDiscord()
|
||||
{
|
||||
if (essentialsDiscord == null)
|
||||
{
|
||||
try
|
||||
{
|
||||
final Plugin xDiscord = server.getPluginManager().getPlugin("EssentialsXDiscord");
|
||||
assert xDiscord != null;
|
||||
if (xDiscord instanceof EssentialsDiscord e)
|
||||
{
|
||||
essentialsDiscord = e;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
FLog.severe(ex);
|
||||
}
|
||||
}
|
||||
return essentialsDiscord;
|
||||
}
|
||||
}
|
@ -28,11 +28,13 @@ public class EssentialsBridge extends FreedomService
|
||||
@Override
|
||||
public void onStart()
|
||||
{
|
||||
// This is completely useless, but it's here to make sure the service is loaded.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop()
|
||||
{
|
||||
essentialsPlugin = null;
|
||||
}
|
||||
|
||||
public Essentials getEssentialsPlugin()
|
||||
@ -43,9 +45,9 @@ public class EssentialsBridge extends FreedomService
|
||||
{
|
||||
final Plugin essentials = server.getPluginManager().getPlugin("Essentials");
|
||||
assert essentials != null;
|
||||
if (essentials instanceof Essentials)
|
||||
if (essentials instanceof Essentials e)
|
||||
{
|
||||
essentialsPlugin = (Essentials)essentials;
|
||||
essentialsPlugin = e;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@ -32,7 +32,7 @@ public abstract class FreedomCommand implements CommandExecutor, TabCompleter
|
||||
public static final String ONLY_IN_GAME = ChatColor.RED + "Only in-game players may execute this command!";
|
||||
public static final String NO_PERMISSION = ChatColor.RED + "You do not have permission to execute this command.";
|
||||
public static final Timer timer = new Timer();
|
||||
public static final Map<CommandSender, FreedomCommand> COOLDOWN_TIMERS = new HashMap<>();
|
||||
protected static final Map<CommandSender, FreedomCommand> COOLDOWN_TIMERS = new HashMap<>();
|
||||
protected final TotalFreedomMod plugin = TotalFreedomMod.getPlugin();
|
||||
protected final Server server = plugin.getServer();
|
||||
private final String name;
|
||||
|
@ -121,7 +121,7 @@ public class DiscordToMinecraftListener extends ListenerAdapter
|
||||
}
|
||||
}
|
||||
|
||||
FLog.info(TextComponent.toLegacyText(components), true);
|
||||
FLog.info(BaseComponent.toLegacyText(components), true);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user