errorLogger, boolean logErrors) {
- JsonObjectBuilder builder = new JsonObjectBuilder();
- builder.appendField("chartId", chartId);
- try {
- JsonObjectBuilder.JsonObject data = getChartData();
- if (data == null) {
- // If the data is null we don't send the chart.
- return null;
- }
- builder.appendField("data", data);
- } catch (Throwable t) {
- if (logErrors) {
- errorLogger.accept("Failed to get data for custom chart with id " + chartId, t);
- }
- return null;
- }
- return builder.build();
- }
-
- protected abstract JsonObjectBuilder.JsonObject getChartData() throws Exception;
-}
diff --git a/fabric/src/main/java/ac/grim/grimac/platform/fabric/utils/metrics/JsonObjectBuilder.java b/fabric/src/main/java/ac/grim/grimac/platform/fabric/utils/metrics/JsonObjectBuilder.java
deleted file mode 100644
index f9ca5d763..000000000
--- a/fabric/src/main/java/ac/grim/grimac/platform/fabric/utils/metrics/JsonObjectBuilder.java
+++ /dev/null
@@ -1,210 +0,0 @@
-package ac.grim.grimac.platform.fabric.utils.metrics;
-
-import java.util.Arrays;
-import java.util.stream.Collectors;
-
-/**
- * An extremely simple JSON builder.
- *
- * While this class is neither feature-rich nor the most performant one, it's sufficient enough
- * for its use-case.
- */
-public class JsonObjectBuilder {
-
- private StringBuilder builder = new StringBuilder();
-
- private boolean hasAtLeastOneField = false;
-
- public JsonObjectBuilder() {
- builder.append("{");
- }
-
- /**
- * Escapes the given string like stated in https://www.ietf.org/rfc/rfc4627.txt.
- *
- *
This method escapes only the necessary characters '"', '\'. and '\u0000' - '\u001F'.
- * Compact escapes are not used (e.g., '\n' is escaped as "\u000a" and not as "\n").
- *
- * @param value The value to escape.
- * @return The escaped value.
- */
- private static String escape(String value) {
- final StringBuilder builder = new StringBuilder();
- for (int i = 0; i < value.length(); i++) {
- char c = value.charAt(i);
- if (c == '"') {
- builder.append("\\\"");
- } else if (c == '\\') {
- builder.append("\\\\");
- } else if (c <= '\u000F') {
- builder.append("\\u000").append(Integer.toHexString(c));
- } else if (c <= '\u001F') {
- builder.append("\\u00").append(Integer.toHexString(c));
- } else {
- builder.append(c);
- }
- }
- return builder.toString();
- }
-
- /**
- * Appends a null field to the JSON.
- *
- * @param key The key of the field.
- * @return A reference to this object.
- */
- public JsonObjectBuilder appendNull(String key) {
- appendFieldUnescaped(key, "null");
- return this;
- }
-
- /**
- * Appends a string field to the JSON.
- *
- * @param key The key of the field.
- * @param value The value of the field.
- * @return A reference to this object.
- */
- public JsonObjectBuilder appendField(String key, String value) {
- if (value == null) {
- throw new IllegalArgumentException("JSON value must not be null");
- }
- appendFieldUnescaped(key, "\"" + escape(value) + "\"");
- return this;
- }
-
- /**
- * Appends an integer field to the JSON.
- *
- * @param key The key of the field.
- * @param value The value of the field.
- * @return A reference to this object.
- */
- public JsonObjectBuilder appendField(String key, int value) {
- appendFieldUnescaped(key, String.valueOf(value));
- return this;
- }
-
- /**
- * Appends an object to the JSON.
- *
- * @param key The key of the field.
- * @param object The object.
- * @return A reference to this object.
- */
- public JsonObjectBuilder appendField(String key, JsonObject object) {
- if (object == null) {
- throw new IllegalArgumentException("JSON object must not be null");
- }
- appendFieldUnescaped(key, object.toString());
- return this;
- }
-
- /**
- * Appends a string array to the JSON.
- *
- * @param key The key of the field.
- * @param values The string array.
- * @return A reference to this object.
- */
- public JsonObjectBuilder appendField(String key, String[] values) {
- if (values == null) {
- throw new IllegalArgumentException("JSON values must not be null");
- }
- String escapedValues =
- Arrays.stream(values)
- .map(value -> "\"" + escape(value) + "\"")
- .collect(Collectors.joining(","));
- appendFieldUnescaped(key, "[" + escapedValues + "]");
- return this;
- }
-
- /**
- * Appends an integer array to the JSON.
- *
- * @param key The key of the field.
- * @param values The integer array.
- * @return A reference to this object.
- */
- public JsonObjectBuilder appendField(String key, int[] values) {
- if (values == null) {
- throw new IllegalArgumentException("JSON values must not be null");
- }
- String escapedValues =
- Arrays.stream(values).mapToObj(String::valueOf).collect(Collectors.joining(","));
- appendFieldUnescaped(key, "[" + escapedValues + "]");
- return this;
- }
-
- /**
- * Appends an object array to the JSON.
- *
- * @param key The key of the field.
- * @param values The integer array.
- * @return A reference to this object.
- */
- public JsonObjectBuilder appendField(String key, JsonObject[] values) {
- if (values == null) {
- throw new IllegalArgumentException("JSON values must not be null");
- }
- String escapedValues =
- Arrays.stream(values).map(JsonObject::toString).collect(Collectors.joining(","));
- appendFieldUnescaped(key, "[" + escapedValues + "]");
- return this;
- }
-
- /**
- * Appends a field to the object.
- *
- * @param key The key of the field.
- * @param escapedValue The escaped value of the field.
- */
- private void appendFieldUnescaped(String key, String escapedValue) {
- if (builder == null) {
- throw new IllegalStateException("JSON has already been built");
- }
- if (key == null) {
- throw new IllegalArgumentException("JSON key must not be null");
- }
- if (hasAtLeastOneField) {
- builder.append(",");
- }
- builder.append("\"").append(escape(key)).append("\":").append(escapedValue);
- hasAtLeastOneField = true;
- }
-
- /**
- * Builds the JSON string and invalidates this builder.
- *
- * @return The built JSON string.
- */
- public JsonObject build() {
- if (builder == null) {
- throw new IllegalStateException("JSON has already been built");
- }
- JsonObject object = new JsonObject(builder.append("}").toString());
- builder = null;
- return object;
- }
-
- /**
- * A super simple representation of a JSON object.
- *
- *
This class only exists to make methods of the {@link JsonObjectBuilder} type-safe and not
- * allow a raw string inputs for methods like {@link JsonObjectBuilder#appendField(String,
- * JsonObject)}.
- */
- public static class JsonObject {
-
- private final String value;
-
- private JsonObject(String value) {
- this.value = value;
- }
-
- @Override
- public String toString() {
- return value;
- }
- }
-}
diff --git a/fabric/src/main/java/ac/grim/grimac/platform/fabric/utils/metrics/Metrics.java b/fabric/src/main/java/ac/grim/grimac/platform/fabric/utils/metrics/Metrics.java
deleted file mode 100644
index b628bb4dd..000000000
--- a/fabric/src/main/java/ac/grim/grimac/platform/fabric/utils/metrics/Metrics.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package ac.grim.grimac.platform.fabric.utils.metrics;
-
-public interface Metrics {
-
- void shutdown();
-}
diff --git a/fabric/src/main/java/ac/grim/grimac/platform/fabric/utils/metrics/MetricsBase.java b/fabric/src/main/java/ac/grim/grimac/platform/fabric/utils/metrics/MetricsBase.java
deleted file mode 100644
index c765101ff..000000000
--- a/fabric/src/main/java/ac/grim/grimac/platform/fabric/utils/metrics/MetricsBase.java
+++ /dev/null
@@ -1,278 +0,0 @@
-package ac.grim.grimac.platform.fabric.utils.metrics;
-
-import org.jetbrains.annotations.NotNull;
-
-import javax.net.ssl.HttpsURLConnection;
-import java.io.BufferedReader;
-import java.io.ByteArrayOutputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.nio.charset.StandardCharsets;
-import java.util.HashSet;
-import java.util.Objects;
-import java.util.Set;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-import java.util.function.BiConsumer;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-import java.util.zip.GZIPOutputStream;
-
-public class MetricsBase {
-
- /**
- * The version of the Metrics class.
- */
- public static final String METRICS_VERSION = "3.1.0";
-
- private static final String REPORT_URL = "https://bStats.org/api/v2/data/%s";
-
- private final ScheduledExecutorService scheduler;
-
- private final String platform;
-
- private final String serverUuid;
-
- private final int serviceId;
-
- private final Consumer appendPlatformDataConsumer;
-
- private final Consumer appendServiceDataConsumer;
-
- private final Consumer submitTaskConsumer;
-
- private final Supplier checkServiceEnabledSupplier;
-
- private final BiConsumer errorLogger;
-
- private final Consumer infoLogger;
-
- private final boolean logErrors;
-
- private final boolean logSentData;
-
- private final boolean logResponseStatusText;
-
- private final Set customCharts = new HashSet<>();
-
- private final boolean enabled;
-
- /**
- * Creates a new MetricsBase class instance.
- *
- * @param platform The platform of the service.
- * @param serviceId The id of the service.
- * @param serverUuid The server uuid.
- * @param enabled Whether or not data sending is enabled.
- * @param appendPlatformDataConsumer A consumer that receives a {@code JsonObjectBuilder} and
- * appends all platform-specific data.
- * @param appendServiceDataConsumer A consumer that receives a {@code JsonObjectBuilder} and
- * appends all service-specific data.
- * @param submitTaskConsumer A consumer that takes a runnable with the submit task. This can be
- * used to delegate the data collection to a another thread to prevent errors caused by
- * concurrency. Can be {@code null}.
- * @param checkServiceEnabledSupplier A supplier to check if the service is still enabled.
- * @param errorLogger A consumer that accepts log message and an error.
- * @param infoLogger A consumer that accepts info log messages.
- * @param logErrors Whether or not errors should be logged.
- * @param logSentData Whether or not the sent data should be logged.
- * @param logResponseStatusText Whether or not the response status text should be logged.
- * @param skipRelocateCheck Whether or not the relocate check should be skipped.
- */
- public MetricsBase(
- String platform,
- String serverUuid,
- int serviceId,
- boolean enabled,
- Consumer appendPlatformDataConsumer,
- Consumer appendServiceDataConsumer,
- Consumer submitTaskConsumer,
- Supplier checkServiceEnabledSupplier,
- BiConsumer errorLogger,
- Consumer infoLogger,
- boolean logErrors,
- boolean logSentData,
- boolean logResponseStatusText,
- boolean skipRelocateCheck) {
- this.scheduler = getScheduledThreadPoolExecutor();
- this.platform = platform;
- this.serverUuid = serverUuid;
- this.serviceId = serviceId;
- this.enabled = enabled;
- this.appendPlatformDataConsumer = appendPlatformDataConsumer;
- this.appendServiceDataConsumer = appendServiceDataConsumer;
- this.submitTaskConsumer = submitTaskConsumer;
- this.checkServiceEnabledSupplier = checkServiceEnabledSupplier;
- this.errorLogger = errorLogger;
- this.infoLogger = infoLogger;
- this.logErrors = logErrors;
- this.logSentData = logSentData;
- this.logResponseStatusText = logResponseStatusText;
- if (!skipRelocateCheck) {
- checkRelocation();
- }
- if (enabled) {
- // WARNING: Removing the option to opt-out will get your plugin banned from
- // bStats
- startSubmitting();
- }
- }
-
- private static @NotNull ScheduledThreadPoolExecutor getScheduledThreadPoolExecutor() {
- ScheduledThreadPoolExecutor scheduler =
- new ScheduledThreadPoolExecutor(
- 1,
- task -> {
- Thread thread = new Thread(task, "bStats-Metrics");
- thread.setDaemon(true);
- return thread;
- });
- // We want delayed tasks (non-periodic) that will execute in the future to be
- // cancelled when the scheduler is shutdown.
- // Otherwise, we risk preventing the server from shutting down even when
- // MetricsBase#shutdown() is called
- scheduler.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
- return scheduler;
- }
-
- /**
- * Gzips the given string.
- *
- * @param str The string to gzip.
- * @return The gzipped string.
- */
- private static byte[] compress(final String str) throws IOException {
- if (str == null) {
- return null;
- }
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
- try (GZIPOutputStream gzip = new GZIPOutputStream(outputStream)) {
- gzip.write(str.getBytes(StandardCharsets.UTF_8));
- }
- return outputStream.toByteArray();
- }
-
- public void addCustomChart(CustomChart chart) {
- this.customCharts.add(chart);
- }
-
- public void shutdown() {
- scheduler.shutdown();
- }
-
- private void startSubmitting() {
- final Runnable submitTask =
- () -> {
- if (!enabled || !checkServiceEnabledSupplier.get()) {
- // Submitting data or service is disabled
- scheduler.shutdown();
- return;
- }
- if (submitTaskConsumer != null) {
- submitTaskConsumer.accept(this::submitData);
- } else {
- this.submitData();
- }
- };
- // Many servers tend to restart at a fixed time at xx:00 which causes an uneven
- // distribution of requests on the
- // bStats backend. To circumvent this problem, we introduce some randomness into
- // the initial and second delay.
- // WARNING: You must not modify and part of this Metrics class, including the
- // submit delay or frequency!
- // WARNING: Modifying this code will get your plugin banned on bStats. Just
- // don't do it!
- long initialDelay = (long) (1000 * 60 * (3 + Math.random() * 3));
- long secondDelay = (long) (1000 * 60 * (Math.random() * 30));
- scheduler.schedule(submitTask, initialDelay, TimeUnit.MILLISECONDS);
- scheduler.scheduleAtFixedRate(
- submitTask, initialDelay + secondDelay, 1000 * 60 * 30, TimeUnit.MILLISECONDS);
- }
-
- private void submitData() {
- final JsonObjectBuilder baseJsonBuilder = new JsonObjectBuilder();
- appendPlatformDataConsumer.accept(baseJsonBuilder);
- final JsonObjectBuilder serviceJsonBuilder = new JsonObjectBuilder();
- appendServiceDataConsumer.accept(serviceJsonBuilder);
- JsonObjectBuilder.JsonObject[] chartData =
- customCharts.stream()
- .map(customChart -> customChart.getRequestJsonObject(errorLogger, logErrors))
- .filter(Objects::nonNull)
- .toArray(JsonObjectBuilder.JsonObject[]::new);
- serviceJsonBuilder.appendField("id", serviceId);
- serviceJsonBuilder.appendField("customCharts", chartData);
- baseJsonBuilder.appendField("service", serviceJsonBuilder.build());
- baseJsonBuilder.appendField("serverUUID", serverUuid);
- baseJsonBuilder.appendField("metricsVersion", METRICS_VERSION);
- JsonObjectBuilder.JsonObject data = baseJsonBuilder.build();
- scheduler.execute(
- () -> {
- try {
- // Send the data
- sendData(data);
- } catch (Exception e) {
- // Something went wrong! :(
- if (logErrors) {
- errorLogger.accept("Could not submit bStats metrics data", e);
- }
- }
- });
- }
-
- private void sendData(JsonObjectBuilder.JsonObject data) throws Exception {
- if (logSentData) {
- infoLogger.accept("Sent bStats metrics data: " + data.toString());
- }
- String url = String.format(REPORT_URL, platform);
- HttpsURLConnection connection = (HttpsURLConnection) new URL(url).openConnection();
- // Compress the data to save bandwidth
- byte[] compressedData = compress(data.toString());
- connection.setRequestMethod("POST");
- connection.addRequestProperty("Accept", "application/json");
- connection.addRequestProperty("Connection", "close");
- connection.addRequestProperty("Content-Encoding", "gzip");
- connection.addRequestProperty("Content-Length", String.valueOf(compressedData.length));
- connection.setRequestProperty("Content-Type", "application/json");
- connection.setRequestProperty("User-Agent", "Metrics-Service/1");
- connection.setDoOutput(true);
- try (DataOutputStream outputStream = new DataOutputStream(connection.getOutputStream())) {
- outputStream.write(compressedData);
- }
- StringBuilder builder = new StringBuilder();
- try (BufferedReader bufferedReader =
- new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
- String line;
- while ((line = bufferedReader.readLine()) != null) {
- builder.append(line);
- }
- }
- if (logResponseStatusText) {
- infoLogger.accept("Sent data to bStats and received response: " + builder);
- }
- }
-
- /**
- * Checks that the class was properly relocated.
- */
- private void checkRelocation() {
- // You can use the property to disable the check in your test environment
- if (System.getProperty("bstats.relocatecheck") == null
- || !System.getProperty("bstats.relocatecheck").equals("false")) {
- // Maven's Relocate is clever and changes strings, too. So we have to use this
- // little "trick" ... :D
- final String defaultPackage =
- new String(new byte[]{'o', 'r', 'g', '.', 'b', 's', 't', 'a', 't', 's'});
- final String examplePackage =
- new String(new byte[]{'y', 'o', 'u', 'r', '.', 'p', 'a', 'c', 'k', 'a', 'g', 'e'});
- // We want to make sure no one just copy & pastes the example and uses the wrong
- // package names
- if (MetricsBase.class.getPackage().getName().startsWith(defaultPackage)
- || MetricsBase.class.getPackage().getName().startsWith(examplePackage)) {
- throw new IllegalStateException("bStats Metrics class has not been relocated correctly!");
- }
- }
- }
-}
diff --git a/fabric/src/main/java/ac/grim/grimac/platform/fabric/utils/metrics/MetricsFabric.java b/fabric/src/main/java/ac/grim/grimac/platform/fabric/utils/metrics/MetricsFabric.java
deleted file mode 100644
index 294d203a0..000000000
--- a/fabric/src/main/java/ac/grim/grimac/platform/fabric/utils/metrics/MetricsFabric.java
+++ /dev/null
@@ -1,110 +0,0 @@
-package ac.grim.grimac.platform.fabric.utils.metrics;
-
-/*
- * This Metrics class was auto-generated and can be copied into your project if you are
- * not using a build tool like Gradle or Maven for dependency management.
- *
- * IMPORTANT: You are not allowed to modify this class, except changing the package.
- *
- * Disallowed modifications include but are not limited to:
- * - Remove the option for users to opt-out
- * - Change the frequency for data submission
- * - Obfuscate the code (every obfuscator should allow you to make an exception for specific files)
- * - Reformat the code (if you use a linter, add an exception)
- *
- * Violations will result in a ban of your plugin and account from bStats.
- */
-
-import ac.grim.grimac.GrimAPI;
-import ac.grim.grimac.api.plugin.GrimPlugin;
-import ac.grim.grimac.platform.fabric.GrimACFabricLoaderPlugin;
-import net.fabricmc.loader.api.FabricLoader;
-
-import java.util.logging.Level;
-
-public class MetricsFabric implements Metrics {
-
- private final MetricsBase metricsBase;
-
- /**
- * Creates a new Metrics instance.
- *
- * @param serviceId The id of the service. It can be found at What is my plugin id?
- */
- public MetricsFabric(GrimPlugin plugin, int serviceId) {
- // Get the config file
- BStatsConfig.Config config = BStatsConfig.loadConfig();
-
- // Load the data
- boolean enabled = config.enabled;
- String serverUUID = config.serverUuid;
- boolean logErrors = config.logFailedRequests;
- boolean logSentData = config.logSentData;
- boolean logResponseStatusText = config.logResponseStatusText;
-
- metricsBase =
- new // See https://github.com/Bastian/bstats-metrics/pull/126
- // See https://github.com/Bastian/bstats-metrics/pull/126
- // See https://github.com/Bastian/bstats-metrics/pull/126
- // See https://github.com/Bastian/bstats-metrics/pull/126
- // See https://github.com/Bastian/bstats-metrics/pull/126
- // See https://github.com/Bastian/bstats-metrics/pull/126
- // See https://github.com/Bastian/bstats-metrics/pull/126
- MetricsBase(
- "fabric",
- serverUUID,
- serviceId,
- enabled,
- this::appendPlatformData,
- this::appendServiceData,
- submitDataTask -> GrimAPI.INSTANCE.getScheduler().getAsyncScheduler().runNow(plugin, submitDataTask),
- () -> true,
- (message, error) -> plugin.getLogger().log(Level.WARNING, message, error),
- (message) -> plugin.getLogger().log(Level.INFO, message),
- logErrors,
- logSentData,
- logResponseStatusText,
- false);
- }
-
- /**
- * Shuts down the underlying scheduler service.
- */
- public void shutdown() {
- metricsBase.shutdown();
- }
-
- /**
- * Adds a custom chart.
- *
- * @param chart The chart to add.
- */
- public void addCustomChart(CustomChart chart) {
- metricsBase.addCustomChart(chart);
- }
-
- private void appendPlatformData(JsonObjectBuilder builder) {
- builder.appendField("playerAmount", getPlayerAmount());
- builder.appendField("onlineMode", GrimACFabricLoaderPlugin.FABRIC_SERVER.usesAuthentication() ? 0 : 1);
- builder.appendField("bukkitVersion", GrimAPI.INSTANCE.getPlatformServer().getPlatformImplementationString());
- builder.appendField("bukkitName", "Fabric");
- builder.appendField("javaVersion", System.getProperty("java.version"));
- builder.appendField("osName", System.getProperty("os.name"));
- builder.appendField("osArch", System.getProperty("os.arch"));
- builder.appendField("osVersion", System.getProperty("os.version"));
- builder.appendField("coreCount", Runtime.getRuntime().availableProcessors());
- }
-
- private void appendServiceData(JsonObjectBuilder builder) {
- builder.appendField("pluginVersion", FabricLoader.getInstance().getModContainer("grimac").get().getMetadata().getVersion().getFriendlyString());
- }
-
- private int getPlayerAmount() {
- if (GrimACFabricLoaderPlugin.FABRIC_SERVER.isRunning()) {
- return GrimACFabricLoaderPlugin.FABRIC_SERVER.getPlayerCount();
- } else {
- return 0;
- }
- }
-}
diff --git a/fabric/src/main/java/ac/grim/grimac/platform/fabric/utils/thread/FabricFutureUtil.java b/fabric/src/main/java/ac/grim/grimac/platform/fabric/utils/thread/FabricFutureUtil.java
deleted file mode 100644
index af4019258..000000000
--- a/fabric/src/main/java/ac/grim/grimac/platform/fabric/utils/thread/FabricFutureUtil.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package ac.grim.grimac.platform.fabric.utils.thread;
-
-import ac.grim.grimac.GrimAPI;
-
-import java.util.concurrent.CompletableFuture;
-import java.util.function.Supplier;
-
-public class FabricFutureUtil {
- public static CompletableFuture supplySync(Supplier entityTeleportSupplier) {
- CompletableFuture ret = new CompletableFuture<>();
- GrimAPI.INSTANCE.getScheduler().getGlobalRegionScheduler().run(GrimAPI.INSTANCE.getGrimPlugin(),
- () -> ret.complete(entityTeleportSupplier.get()));
- return ret;
- }
-}
diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json
deleted file mode 100644
index 9f19d528a..000000000
--- a/fabric/src/main/resources/fabric.mod.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "schemaVersion": 1,
- "id": "grimac",
- "version": "${version}",
- "name": "GrimAC",
- "description": "Libre simulation anticheat designed for 1.21 with 1.8-1.21 support, powered by PacketEvents 2.0.",
- "authors": [
- "GrimAC"
- ],
- "license": "GPLv3",
- "environment": "server",
- "entrypoints": {
- "main": [
- "ac.grim.grimac.platform.fabric.GrimACFabricEntryPoint"
- ],
- "preLaunch": [
- "ac.grim.grimac.platform.fabric.GrimACFabricEntryPoint"
- ]
- },
- "mixins": [
- "grimac.mixins.json"
- ],
- "accessWidener": "grimac.accesswidener",
- "depends": {
- "fabricloader": "\u003e\u003d0.16",
- "fabric-lifecycle-events-v1": "*",
- "cloud": "*",
- "packetevents": "*"
- }
-}
diff --git a/fabric/src/main/resources/grimac.accesswidener b/fabric/src/main/resources/grimac.accesswidener
deleted file mode 100644
index c7014617b..000000000
--- a/fabric/src/main/resources/grimac.accesswidener
+++ /dev/null
@@ -1,5 +0,0 @@
-accessWidener v2 named
-accessible field net/minecraft/server/level/ServerLevel serverLevelData Lnet/minecraft/world/level/storage/ServerLevelData;
-accessible field net/minecraft/commands/CommandSourceStack source Lnet/minecraft/commands/CommandSource;
-accessible field net/minecraft/world/entity/player/Player inventory Lnet/minecraft/world/entity/player/Inventory;
-accessible field net/minecraft/world/entity/Entity level Lnet/minecraft/world/level/Level; # Required in newer versions, even though public in older ones
diff --git a/fabric/src/main/resources/grimac.mixins.json b/fabric/src/main/resources/grimac.mixins.json
deleted file mode 100644
index 65f52ec6d..000000000
--- a/fabric/src/main/resources/grimac.mixins.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "required": true,
- "minVersion": "0.8",
- "package": "ac.grim.grimac.platform.fabric.mixins",
- "compatibilityLevel": "JAVA_17",
- "mixins": [
- "LevelChunkMixin",
- "ServerLevelMixin",
- "ServerPlayerMixin"
- ],
- "injectors": {
- "defaultRequire": 1
- }
-}
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 2e1113280..d4081da47 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
diff --git a/gradlew.bat b/gradlew.bat
index c4bdd3ab8..e509b2dd8 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -1,93 +1,93 @@
-@rem
-@rem Copyright 2015 the original author or authors.
-@rem
-@rem Licensed under the Apache License, Version 2.0 (the "License");
-@rem you may not use this file except in compliance with the License.
-@rem You may obtain a copy of the License at
-@rem
-@rem https://www.apache.org/licenses/LICENSE-2.0
-@rem
-@rem Unless required by applicable law or agreed to in writing, software
-@rem distributed under the License is distributed on an "AS IS" BASIS,
-@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@rem See the License for the specific language governing permissions and
-@rem limitations under the License.
-@rem
-@rem SPDX-License-Identifier: Apache-2.0
-@rem
-
-@if "%DEBUG%"=="" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-set DIRNAME=%~dp0
-if "%DIRNAME%"=="" set DIRNAME=.
-@rem This is normally unused
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Resolve any "." and ".." in APP_HOME to make it shorter.
-for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if %ERRORLEVEL% equ 0 goto execute
-
-echo. 1>&2
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
-echo. 1>&2
-echo Please set the JAVA_HOME variable in your environment to match the 1>&2
-echo location of your Java installation. 1>&2
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto execute
-
-echo. 1>&2
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
-echo. 1>&2
-echo Please set the JAVA_HOME variable in your environment to match the 1>&2
-echo location of your Java installation. 1>&2
-
-goto fail
-
-:execute
-@rem Setup the command line
-
-
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
-
-:end
-@rem End local scope for the variables with windows NT shell
-if %ERRORLEVEL% equ 0 goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-set EXIT_CODE=%ERRORLEVEL%
-if %EXIT_CODE% equ 0 set EXIT_CODE=1
-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
-exit /b %EXIT_CODE%
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+@rem SPDX-License-Identifier: Apache-2.0
+@rem
+
+@if "%DEBUG%"=="" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%"=="" set DIRNAME=.
+@rem This is normally unused
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if %ERRORLEVEL% equ 0 goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if %ERRORLEVEL% equ 0 goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/settings.gradle.kts b/settings.gradle.kts
index 849c206de..2f3e35d93 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -12,20 +12,6 @@ dependencyResolutionManagement {
pluginManagement {
repositories {
- // For the Fabric Loom plugin
- exclusiveContent {
- forRepository {
- maven {
- name = "FabricMC"
- url = uri("https://maven.fabricmc.net/")
- }
- }
- filter {
- includeModule("fabric-loom", "fabric-loom.gradle.plugin")
- includeGroupByRegex("net.fabricmc.*")
- }
- }
-
gradlePluginPortal()
}
}
@@ -60,12 +46,6 @@ if (gradle.startParameter.isBuildScan) {
}
}
-rootProject.name = "grimac"
+rootProject.name = "LightningGrim"
include("common")
include("bukkit")
-include("fabric")
-include(":fabric:mc1161")
-include(":fabric:mc1171")
-include(":fabric:mc1194")
-include(":fabric:mc1205")
-include(":fabric:mc1216")