mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-30 02:05:41 +00:00
Merge remote-tracking branch 'origin/maventravisci-nocb' into devel
This commit is contained in:
commit
3668c5e9d6
@ -1,5 +1,7 @@
|
||||
# TotalFreedomMod #
|
||||
|
||||
[![Build Status](https://travis-ci.org/Wild1145/TotalFreedomMod.svg?branch=maventravisci)](https://travis-ci.org/Wild1145/TotalFreedomMod)
|
||||
|
||||
TotalFreedomMod is a CraftBukkit server plugin designed primarily to support the [Official TotalFreedom Minecraft Server](http://totalfreedom.me/). However, you are more than welcome to adapt the source for your own server.
|
||||
|
||||
This plugin was originally coded by StevenLawson (Madgeek1450), with Jerom van der Sar (Prozza) becoming heavily involved in its development some time later. It consists of over 85 custom coded commands and a large variety of distinguishable features not included in any other plugin. The plugin has since its beginning grown immensely. Together, with the main TotalFreedom server, TotalFreedomMod has a long-standing reputation of effectiveness whilst maintaining a clear feeling of openness towards the administrators and the players themselves.
|
||||
|
84
pom.xml
84
pom.xml
@ -11,7 +11,7 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<tfm.build.version>${project.version}</tfm.build.version>
|
||||
<tfm.build.codename>Electrum</tfm.build.codename>
|
||||
<tfm.build.number>${maven.buildnumber}</tfm.build.number>
|
||||
<!-- <tfm.build.number>${maven.buildnumber}</tfm.build.number> -->
|
||||
<tfm.build.date>${maven.build.timestamp}</tfm.build.date>
|
||||
<tfm.build.author>${buildAuthor}</tfm.build.author>
|
||||
<tfm.build.head>${buildHead}</tfm.build.head>
|
||||
@ -43,67 +43,83 @@
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spigot</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
|
||||
<id>ess-repo</id>
|
||||
<url>http://repo.ess3.net</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
<!-- <repository>
|
||||
<id>elmakers-repo</id>
|
||||
<url>http://maven.elmakers.com/repository/</url>
|
||||
</repository>-->
|
||||
<repository>
|
||||
<id>sk89q-snapshots</id>
|
||||
<url>http://maven.sk89q.com/artifactory/repo</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.6</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.16.6</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-server</artifactId>
|
||||
<version>1.12</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/lib/Spigot-1.12.jar</systemPath>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.12-pre5-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.pravian</groupId>
|
||||
<artifactId>aero</artifactId>
|
||||
<version>2.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/lib/Aero-2.0.jar</systemPath>
|
||||
<groupId>com.github.Pravian</groupId>
|
||||
<artifactId>Aero</artifactId>
|
||||
<version>a0e1dc5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.totalfreedom</groupId>
|
||||
<artifactId>bukkittelnet</artifactId>
|
||||
<version>4.2</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/lib/BukkitTelnet-4.3.jar</systemPath>
|
||||
<groupId>com.github.TotalFreedom</groupId>
|
||||
<artifactId>BukkitTelnet</artifactId>
|
||||
<version>4.5-pre1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.totalfreedom</groupId>
|
||||
<artifactId>tf-worldedit</artifactId>
|
||||
<groupId>net.ess3</groupId>
|
||||
<artifactId>Essentials</artifactId>
|
||||
<version>2.13.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.TotalFreedom.TF-WorldEdit</groupId>
|
||||
<artifactId>worldedit-bukkit</artifactId>
|
||||
<version>6.1.0-TF</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/lib/TF-WorldEdit-6.1.1.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.totalfreedom</groupId>
|
||||
<artifactId>tf-essentials</artifactId>
|
||||
<version>2.0-TF</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/lib/TF-Essentials-2.1.jar</systemPath>
|
||||
<groupId>com.github.TotalFreedom.TF-WorldEdit</groupId>
|
||||
<artifactId>worldedit-core</artifactId>
|
||||
<version>6.1.0-TF</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>me.libaryaddict.disguise</groupId>
|
||||
<artifactId>LibsDisguises</artifactId>
|
||||
<version>9.0.9</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/lib/LibsDisguises-9.0.9.jar</systemPath>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -168,15 +168,15 @@ public class LoginProcess extends FreedomService
|
||||
return;
|
||||
}
|
||||
|
||||
// Whitelist
|
||||
if (plugin.si.isWhitelisted())
|
||||
{
|
||||
if (!plugin.si.getWhitelisted().contains(username.toLowerCase()))
|
||||
{
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "You are not whitelisted on this server.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
// // Whitelist
|
||||
// if (plugin.si.isWhitelisted())
|
||||
// {
|
||||
// if (!plugin.si.getWhitelisted().contains(username.toLowerCase()))
|
||||
// {
|
||||
// event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "You are not whitelisted on this server.");
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
|
@ -1,14 +1,7 @@
|
||||
package me.totalfreedom.totalfreedommod;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.minecraft.server.v1_12_R1.EntityPlayer;
|
||||
import net.minecraft.server.v1_12_R1.MinecraftServer;
|
||||
import net.minecraft.server.v1_12_R1.PropertyManager;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_12_R1.CraftServer;
|
||||
|
||||
public class ServerInterface extends FreedomService
|
||||
{
|
||||
@ -41,52 +34,52 @@ public class ServerInterface extends FreedomService
|
||||
}
|
||||
}
|
||||
|
||||
public void setOnlineMode(boolean mode)
|
||||
{
|
||||
final PropertyManager manager = getServer().getPropertyManager();
|
||||
manager.setProperty("online-mode", mode);
|
||||
manager.savePropertiesFile();
|
||||
}
|
||||
|
||||
public int purgeWhitelist()
|
||||
{
|
||||
String[] whitelisted = getServer().getPlayerList().getWhitelisted();
|
||||
int size = whitelisted.length;
|
||||
for (EntityPlayer player : getServer().getPlayerList().players)
|
||||
{
|
||||
getServer().getPlayerList().getWhitelist().remove(player.getProfile());
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
getServer().getPlayerList().getWhitelist().save();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
FLog.warning("Could not purge the whitelist!");
|
||||
FLog.warning(ex);
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
public boolean isWhitelisted()
|
||||
{
|
||||
return getServer().getPlayerList().getHasWhitelist();
|
||||
}
|
||||
|
||||
public List<?> getWhitelisted()
|
||||
{
|
||||
return Arrays.asList(getServer().getPlayerList().getWhitelisted());
|
||||
}
|
||||
|
||||
public String getVersion()
|
||||
{
|
||||
return getServer().getVersion();
|
||||
}
|
||||
|
||||
private MinecraftServer getServer()
|
||||
{
|
||||
return ((CraftServer) Bukkit.getServer()).getServer();
|
||||
}
|
||||
// public void setOnlineMode(boolean mode)
|
||||
// {
|
||||
// final PropertyManager manager = getServer().getPropertyManager();
|
||||
// manager.setProperty("online-mode", mode);
|
||||
// manager.savePropertiesFile();
|
||||
// }
|
||||
//
|
||||
// public int purgeWhitelist()
|
||||
// {
|
||||
// String[] whitelisted = getServer().getPlayerList().getWhitelisted();
|
||||
// int size = whitelisted.length;
|
||||
// for (EntityPlayer player : getServer().getPlayerList().players)
|
||||
// {
|
||||
// getServer().getPlayerList().getWhitelist().remove(player.getProfile());
|
||||
// }
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// getServer().getPlayerList().getWhitelist().save();
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// FLog.warning("Could not purge the whitelist!");
|
||||
// FLog.warning(ex);
|
||||
// }
|
||||
// return size;
|
||||
// }
|
||||
//
|
||||
// public boolean isWhitelisted()
|
||||
// {
|
||||
// return getServer().getPlayerList().getHasWhitelist();
|
||||
// }
|
||||
//
|
||||
// public List<?> getWhitelisted()
|
||||
// {
|
||||
// return Arrays.asList(getServer().getPlayerList().getWhitelisted());
|
||||
// }
|
||||
//
|
||||
// public String getVersion()
|
||||
// {
|
||||
// return getServer().getVersion();
|
||||
// }
|
||||
//
|
||||
// private MinecraftServer getServer()
|
||||
// {
|
||||
// return ((CraftServer) Bukkit.getServer()).getServer();
|
||||
// }
|
||||
|
||||
}
|
||||
|
@ -55,7 +55,8 @@ public class ServerPing extends FreedomService
|
||||
return;
|
||||
}
|
||||
|
||||
String baseMotd = ConfigEntry.SERVER_MOTD.getString().replace("%mcversion%", plugin.si.getVersion());
|
||||
// String baseMotd = ConfigEntry.SERVER_MOTD.getString().replace("%mcversion%", plugin.si.getVersion());
|
||||
String baseMotd = ConfigEntry.SERVER_MOTD.getString();
|
||||
baseMotd = baseMotd.replace("\\n", "\n");
|
||||
baseMotd = FUtil.colorize(baseMotd);
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
package me.totalfreedom.totalfreedommod.bridge;
|
||||
|
||||
import me.libraryaddict.disguise.DisallowedDisguises;
|
||||
import me.libraryaddict.disguise.LibsDisguises;
|
||||
import me.libraryaddict.disguise.DisguiseAPI;
|
||||
//import me.libraryaddict.disguise.DisallowedDisguises;
|
||||
//import me.libraryaddict.disguise.LibsDisguises;
|
||||
//import me.libraryaddict.disguise.DisguiseAPI;
|
||||
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
@ -13,7 +13,7 @@ import org.bukkit.plugin.Plugin;
|
||||
public class LibsDisguisesBridge extends FreedomService
|
||||
{
|
||||
|
||||
private LibsDisguises libsDisguisesPlugin = null;
|
||||
// private LibsDisguises libsDisguisesPlugin = null;
|
||||
|
||||
public LibsDisguisesBridge(TotalFreedomMod plugin)
|
||||
{
|
||||
@ -29,7 +29,7 @@ public class LibsDisguisesBridge extends FreedomService
|
||||
protected void onStop()
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
public LibsDisguises getLibsDisguisesPlugin()
|
||||
{
|
||||
if (libsDisguisesPlugin == null)
|
||||
@ -134,5 +134,5 @@ public class LibsDisguisesBridge extends FreedomService
|
||||
}
|
||||
|
||||
return ld.isEnabled();
|
||||
}
|
||||
}*/
|
||||
}
|
@ -2,8 +2,16 @@ package me.totalfreedom.totalfreedommod.bridge;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import me.totalfreedom.worldedit.LimitChangedEvent;
|
||||
import me.totalfreedom.worldedit.SelectionChangedEvent;
|
||||
// These imports are not in the latest releases of WorldEdit, and the new versions of WorldEdit do not build properly. This will need to be reverted once the new WorldEdit builds are building properly.
|
||||
//
|
||||
//import me.totalfreedom.worldedit.LimitChangedEvent;
|
||||
//import me.totalfreedom.worldedit.SelectionChangedEvent;
|
||||
//
|
||||
//The following two imports are a temporary measure as mentioned above.
|
||||
//
|
||||
import me.StevenLawson.worldedit.LimitChangedEvent;
|
||||
import me.StevenLawson.worldedit.SelectionChangedEvent;
|
||||
//
|
||||
import net.pravian.aero.component.PluginListener;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.libraryaddict.disguise.DisallowedDisguises;
|
||||
//import me.libraryaddict.disguise.DisallowedDisguises;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.command.Command;
|
||||
@ -15,7 +15,7 @@ public class Command_disguisetoggle extends FreedomCommand
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
{/*
|
||||
if (!plugin.ldb.isPluginEnabled())
|
||||
{
|
||||
msg(ChatColor.RED + "LibsDisguises is not enabled.");
|
||||
@ -38,5 +38,10 @@ public class Command_disguisetoggle extends FreedomCommand
|
||||
msg("Disguises are now " + (!DisallowedDisguises.disabled ? "enabled." : "disabled."));
|
||||
|
||||
return true;
|
||||
|
||||
*/
|
||||
|
||||
msg("This command has been disabled for technical reasons. Contact a developer for additional information.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
@ -44,26 +43,27 @@ public class Command_onlinemode extends FreedomCommand
|
||||
return false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
plugin.si.setOnlineMode(onlineMode);
|
||||
|
||||
if (onlineMode)
|
||||
{
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
player.kickPlayer("Server is activating \"online-mode=true\". Please reconnect.");
|
||||
}
|
||||
}
|
||||
|
||||
FUtil.adminAction(sender.getName(), "Turning player validation " + (onlineMode ? "on" : "off") + ".", true);
|
||||
|
||||
server.reload();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
FLog.severe(ex);
|
||||
}
|
||||
// try
|
||||
// {
|
||||
// plugin.si.setOnlineMode(onlineMode);
|
||||
//
|
||||
// if (onlineMode)
|
||||
// {
|
||||
// for (Player player : server.getOnlinePlayers())
|
||||
// {
|
||||
// player.kickPlayer("Server is activating \"online-mode=true\". Please reconnect.");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// FUtil.adminAction(sender.getName(), "Turning player validation " + (onlineMode ? "on" : "off") + ".", true);
|
||||
//
|
||||
// server.reload();
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// FLog.severe(ex);
|
||||
// }
|
||||
FUtil.adminAction(sender.getName(), "Online-Mode toggling is temporarily disabled.", true);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.libraryaddict.disguise.DisallowedDisguises;
|
||||
//import me.libraryaddict.disguise.DisallowedDisguises;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.command.Command;
|
||||
@ -14,7 +14,7 @@ public class Command_undisguiseall extends FreedomCommand
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
{ /*
|
||||
if (!plugin.ldb.isPluginEnabled())
|
||||
{
|
||||
msg("LibsDisguises is not enabled.");
|
||||
@ -32,5 +32,10 @@ public class Command_undisguiseall extends FreedomCommand
|
||||
plugin.ldb.undisguiseAll(false);
|
||||
|
||||
return true;
|
||||
|
||||
*/
|
||||
|
||||
msg("This command has been disabled for technical reasons. Contact a developer for additional information.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -158,8 +158,10 @@ public class Command_whitelist extends FreedomCommand
|
||||
//purge
|
||||
if (args[0].equalsIgnoreCase("purge"))
|
||||
{
|
||||
FUtil.adminAction(sender.getName(), "Removing all players from the whitelist.", false);
|
||||
msg("Removed " + plugin.si.purgeWhitelist() + " players from the whitelist.");
|
||||
// FUtil.adminAction(sender.getName(), "Removing all players from the whitelist.", false);
|
||||
// msg("Removed " + plugin.si.purgeWhitelist() + " players from the whitelist.");
|
||||
|
||||
FUtil.adminAction(sender.getName(), "Whitelist purging is temporarily disabled.", true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user