Should be fine now

This commit is contained in:
Paldiu 2021-01-04 18:27:57 -06:00
parent c7b0f77910
commit 323fd1a031
2 changed files with 1 additions and 44 deletions

View File

@ -247,17 +247,4 @@ public enum ConfigEntry
{ {
return TotalFreedomMod.getPlugin().config; return TotalFreedomMod.getPlugin().config;
} }
public static ConfigEntry findConfigEntry(String name)
{
name = name.toLowerCase().replace("_", "");
for (ConfigEntry entry : values())
{
if (entry.toString().toLowerCase().replace("_", "").equals(name))
{
return entry;
}
}
return null;
}
} }

View File

@ -1,7 +1,6 @@
package me.totalfreedom.totalfreedommod.httpd; package me.totalfreedom.totalfreedommod.httpd;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.util.Objects;
import me.totalfreedom.totalfreedommod.TotalFreedomMod; import me.totalfreedom.totalfreedommod.TotalFreedomMod;
import me.totalfreedom.totalfreedommod.httpd.module.HTTPDModule; import me.totalfreedom.totalfreedommod.httpd.module.HTTPDModule;
import me.totalfreedom.totalfreedommod.util.FLog; import me.totalfreedom.totalfreedommod.util.FLog;
@ -26,14 +25,7 @@ public abstract class ModuleExecutable
} }
// Sync to server thread // Sync to server thread
return Bukkit.getScheduler().callSyncMethod(TotalFreedomMod.getPlugin(), new Callable<NanoHTTPD.Response>() return Bukkit.getScheduler().callSyncMethod(TotalFreedomMod.getPlugin(), () -> getResponse(session)).get();
{
@Override
public NanoHTTPD.Response call() throws Exception
{
return getResponse(session);
}
}).get();
} }
catch (Exception ex) catch (Exception ex)
@ -75,28 +67,6 @@ public abstract class ModuleExecutable
}; };
} }
public NanoHTTPD.Response execute(final NanoHTTPD.HTTPSession session)
{
try
{
if (async)
{
return getResponse(session);
}
// Sync to server thread
return Bukkit.getScheduler().callSyncMethod(Objects.requireNonNull(TotalFreedomMod.plugin()), () -> getResponse(session)).get();
}
catch (Exception ex)
{
FLog.severe(ex);
}
return null;
}
public abstract NanoHTTPD.Response getResponse(NanoHTTPD.HTTPSession session);
public boolean isAsync() public boolean isAsync()
{ {
return async; return async;