mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-06-29 19:46:42 +00:00
reformat
This commit is contained in:
@ -15,28 +15,6 @@ public abstract class ModuleExecutable
|
||||
this.async = async;
|
||||
}
|
||||
|
||||
public NanoHTTPD.Response execute(final NanoHTTPD.HTTPSession session)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (async)
|
||||
{
|
||||
return getResponse(session);
|
||||
}
|
||||
|
||||
// Sync to server thread
|
||||
return Bukkit.getScheduler().callSyncMethod(TotalFreedomMod.getPlugin(), () -> getResponse(session)).get();
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
FLog.severe(ex);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public abstract NanoHTTPD.Response getResponse(NanoHTTPD.HTTPSession session);
|
||||
|
||||
public static ModuleExecutable forClass(final TotalFreedomMod plugin, Class<? extends HTTPDModule> clazz, boolean async)
|
||||
{
|
||||
final Constructor<? extends HTTPDModule> cons;
|
||||
@ -67,6 +45,28 @@ 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(TotalFreedomMod.getPlugin(), () -> getResponse(session)).get();
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
FLog.severe(ex);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public abstract NanoHTTPD.Response getResponse(NanoHTTPD.HTTPSession session);
|
||||
|
||||
public boolean isAsync()
|
||||
{
|
||||
return async;
|
||||
|
Reference in New Issue
Block a user