generic tweaks
started implementation of FightDetector
This commit is contained in:
@ -92,7 +92,12 @@ public abstract class HttpRepository extends Repository {
|
||||
|
||||
private <TResponse> ReqResp<TResponse> execute(HttpRequest request, Class<TResponse> clazz) {
|
||||
ReqResp<String> rawResponse = this.sendHttp(request);
|
||||
Main.logger().info(String.format("HTTP-Repository fired %s, response: %s", request, rawResponse));
|
||||
Main.logger().info(String.format(
|
||||
"HTTP-Repository fired %s, sending: %s, response: %s",
|
||||
request,
|
||||
request.bodyPublisher().orElse(HttpRequest.BodyPublishers.ofString("none")),
|
||||
rawResponse
|
||||
));
|
||||
return new ReqResp<>(rawResponse.status(), this.gson.fromJson(rawResponse.data(), clazz));
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package eu.mhsl.craftattack.spawn.core.api.client;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import eu.mhsl.craftattack.spawn.core.Main;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
@ -12,7 +13,9 @@ public abstract class Repository {
|
||||
|
||||
public Repository(URI basePath) {
|
||||
this.basePath = basePath;
|
||||
this.gson = new Gson();
|
||||
this.gson = new GsonBuilder()
|
||||
.serializeNulls()
|
||||
.create();
|
||||
}
|
||||
|
||||
protected void validateThread(String commandName) {
|
||||
|
Reference in New Issue
Block a user