From 31a7b798f1eed7d129566b936a3fe7faf4f22837 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Fri, 5 Feb 2021 12:29:15 -0500 Subject: [PATCH] Remove Lombok --- bootstrap/fabric/build.gradle | 3 --- .../platform/fabric/GeyserFabricDumpInfo.java | 13 ++++++++-- .../platform/fabric/GeyserFabricMod.java | 12 ++++++--- .../fabric/GeyserFabricPermissions.java | 5 ++-- .../org/geysermc/platform/fabric/ModInfo.java | 25 ++++++++++++++----- .../mixin/client/IntegratedServerMixin.java | 1 - .../server/MinecraftDedicatedServerMixin.java | 4 +-- 7 files changed, 42 insertions(+), 21 deletions(-) diff --git a/bootstrap/fabric/build.gradle b/bootstrap/fabric/build.gradle index 72f561c7d..0e8c2d181 100644 --- a/bootstrap/fabric/build.gradle +++ b/bootstrap/fabric/build.gradle @@ -29,9 +29,6 @@ dependencies { implementation 'org.geysermc:connector:1.2.0-SNAPSHOT' shadow 'org.geysermc:connector:1.2.0-SNAPSHOT' - - compileOnly 'org.projectlombok:lombok:1.18.4' - annotationProcessor 'org.projectlombok:lombok:1.18.4' } repositories { diff --git a/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/GeyserFabricDumpInfo.java b/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/GeyserFabricDumpInfo.java index 1b9d68a9c..f6a7bf9fa 100644 --- a/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/GeyserFabricDumpInfo.java +++ b/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/GeyserFabricDumpInfo.java @@ -25,7 +25,6 @@ package org.geysermc.platform.fabric; -import lombok.Getter; import net.fabricmc.loader.api.FabricLoader; import net.fabricmc.loader.api.ModContainer; import net.minecraft.server.MinecraftServer; @@ -35,7 +34,6 @@ import org.geysermc.connector.dump.BootstrapDumpInfo; import java.util.ArrayList; import java.util.List; -@Getter public class GeyserFabricDumpInfo extends BootstrapDumpInfo { private String serverIP; @@ -57,4 +55,15 @@ public class GeyserFabricDumpInfo extends BootstrapDumpInfo { } } + public String getServerIP() { + return this.serverIP; + } + + public int getServerPort() { + return this.serverPort; + } + + public List getMods() { + return this.mods; + } } diff --git a/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/GeyserFabricMod.java b/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/GeyserFabricMod.java index 5e156cfec..3ffff5455 100644 --- a/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/GeyserFabricMod.java +++ b/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/GeyserFabricMod.java @@ -26,7 +26,6 @@ package org.geysermc.platform.fabric; import com.mojang.brigadier.builder.LiteralArgumentBuilder; -import lombok.Setter; import net.fabricmc.api.EnvType; import net.fabricmc.api.ModInitializer; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; @@ -48,20 +47,21 @@ import org.geysermc.connector.utils.FileUtils; import org.geysermc.connector.utils.LanguageUtils; import org.geysermc.platform.fabric.command.GeyserFabricCommandExecutor; import org.geysermc.platform.fabric.command.GeyserFabricCommandManager; -import org.jetbrains.annotations.Nullable; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.nio.file.Path; -import java.util.*; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.UUID; public class GeyserFabricMod implements ModInitializer, GeyserBootstrap { private static GeyserFabricMod instance; - @Setter private boolean reloading; private GeyserConnector connector; @@ -207,6 +207,10 @@ public class GeyserFabricMod implements ModInitializer, GeyserBootstrap { return this.server.getVersion(); } + public void setReloading(boolean reloading) { + this.reloading = reloading; + } + private File fileOrCopiedFromResource(File file, String name) throws IOException { if (!file.exists()) { //noinspection ResultOfMethodCallIgnored diff --git a/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/GeyserFabricPermissions.java b/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/GeyserFabricPermissions.java index 51a7cb2e4..1a446bca6 100644 --- a/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/GeyserFabricPermissions.java +++ b/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/GeyserFabricPermissions.java @@ -27,7 +27,6 @@ package org.geysermc.platform.fabric; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.Getter; /** * A class outline of the permissions.yml file @@ -35,8 +34,10 @@ import lombok.Getter; @JsonIgnoreProperties(ignoreUnknown = true) public class GeyserFabricPermissions { - @Getter @JsonProperty("commands") private String[] commands; + public String[] getCommands() { + return this.commands; + } } diff --git a/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/ModInfo.java b/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/ModInfo.java index 159678766..da753c44f 100644 --- a/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/ModInfo.java +++ b/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/ModInfo.java @@ -25,7 +25,6 @@ package org.geysermc.platform.fabric; -import lombok.Getter; import net.fabricmc.loader.api.ModContainer; import java.util.ArrayList; @@ -34,13 +33,12 @@ import java.util.List; /** * A wrapper for Fabric mod information to be presented in a Geyser dump */ -@Getter public class ModInfo { - private String name; - private String id; - private String version; - private List authors; + private final String name; + private final String id; + private final String version; + private final List authors; public ModInfo(ModContainer mod) { this.name = mod.getMetadata().getName(); @@ -50,4 +48,19 @@ public class ModInfo { this.version = mod.getMetadata().getVersion().getFriendlyString(); } + public String getName() { + return this.name; + } + + public String getId() { + return this.id; + } + + public String getVersion() { + return this.version; + } + + public List getAuthors() { + return this.authors; + } } diff --git a/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/mixin/client/IntegratedServerMixin.java b/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/mixin/client/IntegratedServerMixin.java index 5415a9d3a..0a3f17f68 100644 --- a/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/mixin/client/IntegratedServerMixin.java +++ b/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/mixin/client/IntegratedServerMixin.java @@ -32,7 +32,6 @@ import net.minecraft.server.MinecraftServer; import net.minecraft.server.integrated.IntegratedServer; import net.minecraft.text.LiteralText; import net.minecraft.world.GameMode; -import org.geysermc.connector.GeyserConnector; import org.geysermc.connector.utils.LanguageUtils; import org.geysermc.platform.fabric.GeyserFabricMod; import org.geysermc.platform.fabric.GeyserServerPortGetter; diff --git a/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/mixin/server/MinecraftDedicatedServerMixin.java b/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/mixin/server/MinecraftDedicatedServerMixin.java index eec6af74f..f5e9a121d 100644 --- a/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/mixin/server/MinecraftDedicatedServerMixin.java +++ b/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/mixin/server/MinecraftDedicatedServerMixin.java @@ -32,7 +32,6 @@ import net.minecraft.resource.ResourcePackManager; import net.minecraft.resource.ServerResourceManager; import net.minecraft.server.MinecraftServer; import net.minecraft.server.WorldGenerationProgressListenerFactory; -import net.minecraft.server.dedicated.DedicatedServer; import net.minecraft.server.dedicated.MinecraftDedicatedServer; import net.minecraft.util.UserCache; import net.minecraft.util.registry.DynamicRegistryManager; @@ -44,8 +43,7 @@ import org.spongepowered.asm.mixin.Mixin; import java.net.Proxy; @Mixin(MinecraftDedicatedServer.class) -public abstract class MinecraftDedicatedServerMixin extends MinecraftServer implements GeyserServerPortGetter -{ +public abstract class MinecraftDedicatedServerMixin extends MinecraftServer implements GeyserServerPortGetter { // Constructor to compile public MinecraftDedicatedServerMixin(Thread thread, DynamicRegistryManager.Impl impl, LevelStorage.Session session, SaveProperties saveProperties, ResourcePackManager resourcePackManager, Proxy proxy, DataFixer dataFixer, ServerResourceManager serverResourceManager, MinecraftSessionService minecraftSessionService, GameProfileRepository gameProfileRepository, UserCache userCache, WorldGenerationProgressListenerFactory worldGenerationProgressListenerFactory) { super(thread, impl, session, saveProperties, resourcePackManager, proxy, dataFixer, serverResourceManager, minecraftSessionService, gameProfileRepository, userCache, worldGenerationProgressListenerFactory);