code reformat

This commit is contained in:
Badbird5907
2023-06-20 18:50:47 -04:00
parent e0744cb736
commit 48421ce291
8 changed files with 185 additions and 196 deletions

View File

@@ -33,7 +33,7 @@ public class MCLogs {
====== TERMINATOR PLUS DEBUG INFO ======
""";
public static String postInfo() throws IOException {
public static String postInfo() throws IOException {
String serverVersion = Bukkit.getVersion();
String pluginVersion = TerminatorPlus.getVersion();
String serverSoftware = Bukkit.getName();
@@ -46,8 +46,8 @@ public class MCLogs {
return pasteText(info);
}
private static String pasteText(String text) throws IOException {
URL url = new URL("https://api.mclo.gs/1/log"); // application/x-www-form-urlencoded
private static String pasteText(String text) throws IOException {
URL url = new URL("https://api.mclo.gs/1/log"); // application/x-www-form-urlencoded
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
@@ -60,5 +60,5 @@ public class MCLogs {
String response = new BufferedReader(new InputStreamReader(connection.getInputStream())).readLine();
JsonObject json = JsonParser.parseString(response).getAsJsonObject();
return json.get("url").getAsString();
}
}
}

View File

@@ -10,6 +10,7 @@ import java.util.List;
public class NMSUtils {
private static String itemsByIdFieldName;
static {
// find a private final field in SynchedEntityData that is an Int2ObjectMap<SynchedEntityData.DataItem>
Class<SynchedEntityData> clazz = SynchedEntityData.class;
@@ -24,6 +25,7 @@ public class NMSUtils {
throw new RuntimeException("Could not find itemsById field in SynchedEntityData");
}
}
public static List<SynchedEntityData.DataValue<?>> getEntityData(SynchedEntityData synchedEntityData) {
Int2ObjectMap<SynchedEntityData.DataItem> map = null;
try {
@@ -35,7 +37,7 @@ public class NMSUtils {
}
List<SynchedEntityData.DataValue<?>> entityData = new ArrayList<>();
for (SynchedEntityData.DataItem<?> dataItem : map.values()) {
entityData.add(dataItem .value());
entityData.add(dataItem.value());
}
return entityData;
}