mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-06-30 03:56:42 +00:00
Many changes for TFM 5.0
Refractoring Reworked /saconfig Reworked part of the command system Removed unused config sections Refractored part of the config Fixed bugs with admin list Actually allow CONSOLE to have senior perms
This commit is contained in:
@ -56,7 +56,7 @@ public abstract class HTTPDModule
|
||||
|
||||
protected final Map<String, String> getFiles()
|
||||
{
|
||||
Map<String, String> files = new HashMap<String, String>();
|
||||
Map<String, String> files = new HashMap<>();
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -25,7 +25,7 @@ public class Module_file extends HTTPDModule
|
||||
{
|
||||
|
||||
private final File rootDir = new File(ConfigEntry.HTTPD_PUBLIC_FOLDER.getString());
|
||||
public static final Map<String, String> MIME_TYPES = new HashMap<String, String>();
|
||||
public static final Map<String, String> MIME_TYPES = new HashMap<>();
|
||||
|
||||
static
|
||||
{
|
||||
|
@ -9,7 +9,7 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import me.totalfreedom.totalfreedommod.commands.FreedomCommand;
|
||||
import me.totalfreedom.totalfreedommod.command.FreedomCommand;
|
||||
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD;
|
||||
import static me.totalfreedom.totalfreedommod.httpd.HTMLGenerationTools.heading;
|
||||
import static me.totalfreedom.totalfreedommod.httpd.HTMLGenerationTools.paragraph;
|
||||
@ -46,7 +46,7 @@ public class Module_help extends HTTPDModule
|
||||
+ "Please note that it does not include vanilla server commands."));
|
||||
|
||||
final Collection<Command> knownCommands = ((SimpleCommandMap) map).getCommands();
|
||||
final Map<String, List<Command>> commandsByPlugin = new HashMap<String, List<Command>>();
|
||||
final Map<String, List<Command>> commandsByPlugin = new HashMap<>();
|
||||
|
||||
for (Command command : knownCommands)
|
||||
{
|
||||
@ -86,7 +86,7 @@ public class Module_help extends HTTPDModule
|
||||
continue;
|
||||
}
|
||||
|
||||
Rank tfmCommandLevel = FreedomCommand.getCommand(command).getPerms().level();
|
||||
Rank tfmCommandLevel = FreedomCommand.getFrom(command).getPerms().level();
|
||||
if (lastTfmCommandLevel == null || lastTfmCommandLevel != tfmCommandLevel)
|
||||
{
|
||||
responseBody.append("</ul>\r\n").append(heading(tfmCommandLevel.getName(), 3)).append("<ul>\r\n");
|
||||
@ -142,8 +142,8 @@ public class Module_help extends HTTPDModule
|
||||
@Override
|
||||
public int compare(Command a, Command b)
|
||||
{
|
||||
FreedomCommand ca = FreedomCommand.getCommand(a);
|
||||
FreedomCommand cb = FreedomCommand.getCommand(b);
|
||||
FreedomCommand ca = FreedomCommand.getFrom(a);
|
||||
FreedomCommand cb = FreedomCommand.getFrom(b);
|
||||
|
||||
if (ca == null
|
||||
|| cb == null
|
||||
|
@ -2,6 +2,7 @@ package me.totalfreedom.totalfreedommod.httpd.module;
|
||||
|
||||
import java.io.File;
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import me.totalfreedom.totalfreedommod.banning.PermbanList;
|
||||
import me.totalfreedom.totalfreedommod.httpd.HTTPDaemon;
|
||||
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD;
|
||||
|
||||
@ -16,10 +17,10 @@ public class Module_permbans extends HTTPDModule
|
||||
@Override
|
||||
public NanoHTTPD.Response getResponse()
|
||||
{
|
||||
File permbanFile = new File(TotalFreedomMod.plugin.getDataFolder(), TotalFreedomMod.PERMBAN_FILENAME);
|
||||
File permbanFile = new File(TotalFreedomMod.plugin.getDataFolder(), PermbanList.CONFIG_FILENAME);
|
||||
if (permbanFile.exists())
|
||||
{
|
||||
return HTTPDaemon.serveFileBasic(new File(TotalFreedomMod.plugin.getDataFolder(), TotalFreedomMod.PERMBAN_FILENAME));
|
||||
return HTTPDaemon.serveFileBasic(new File(TotalFreedomMod.plugin.getDataFolder(), PermbanList.CONFIG_FILENAME));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -80,7 +80,7 @@ public class Module_schematic extends HTTPDModule
|
||||
{
|
||||
Collection<File> schematics = FileUtils.listFiles(SCHEMATIC_FOLDER, SCHEMATIC_FILTER, false);
|
||||
|
||||
final List<String> schematicsFormatted = new ArrayList<String>();
|
||||
final List<String> schematicsFormatted = new ArrayList<>();
|
||||
for (File schematic : schematics)
|
||||
{
|
||||
String filename = StringEscapeUtils.escapeHtml4(schematic.getName());
|
||||
|
Reference in New Issue
Block a user