From 5c8a8ca3e45e845a6d1868bf57f928172ce0c08b Mon Sep 17 00:00:00 2001 From: Auxilor Date: Wed, 10 Nov 2021 19:05:49 +0000 Subject: [PATCH] Delombok 10/10 - Removed lombok dependency, cleaned up --- CONTRIBUTING.md | 9 +++----- build.gradle | 6 ----- .../core/integrations/IntegrationLoader.java | 11 ++++++++-- .../placeholder/PlaceholderEntry.java | 11 ++++++++-- .../builder/AbstractItemStackBuilder.java | 22 +++++++++++++++---- .../core/recipe/recipes/RecipePosition.java | 12 +++++++--- 6 files changed, 48 insertions(+), 23 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2cd91abf..99c6e064 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,20 +5,17 @@ - The pull request must not have any checkstyle issues. - Every method and field must have a javadoc attached. -2. Use lombok wherever possible. -- @Getter, @Setter, @UtilityClass only. - -3. Use JetBrains annotations +2. Use JetBrains annotations - Every parameter should be annotated with @NotNull or @Nullable - Use @NotNull over lombok @NonNull -4. Imports +3. Imports - No group (*) imports. - No static imports. ## Dependency Injection - eco uses Dependency Injection -- Any calls to AbstractEcoPlugin#getInstance are code smells and should never be used unless **absolutely necessary**. +- Any calls to Eco#getHandler#getEcoPlugin are code smells and should never be used unless **absolutely necessary**. - NamespacedKeys, FixedMetadataValues, Runnables, and Schedules should be managed using AbstractEcoPlugin through DI. - Any DI class should extend PluginDependent where possible. If the class extends another, then you **must** store the plugin instance in a private final variable called **plugin** with a private or protected getter. diff --git a/build.gradle b/build.gradle index f9f2621a..2fdb6f49 100644 --- a/build.gradle +++ b/build.gradle @@ -62,12 +62,6 @@ allprojects { dependencies { compileOnly 'org.jetbrains:annotations:19.0.0' - // Lombok - compileOnly 'org.projectlombok:lombok:1.18.22' - annotationProcessor 'org.projectlombok:lombok:1.18.20' - testCompileOnly 'org.projectlombok:lombok:1.18.20' - testAnnotationProcessor 'org.projectlombok:lombok:1.18.20' - // Test testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1' diff --git a/eco-api/src/main/java/com/willfp/eco/core/integrations/IntegrationLoader.java b/eco-api/src/main/java/com/willfp/eco/core/integrations/IntegrationLoader.java index fb42ace5..f23507e1 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/integrations/IntegrationLoader.java +++ b/eco-api/src/main/java/com/willfp/eco/core/integrations/IntegrationLoader.java @@ -1,6 +1,5 @@ package com.willfp.eco.core.integrations; -import lombok.Getter; import org.jetbrains.annotations.NotNull; /** @@ -17,7 +16,6 @@ public class IntegrationLoader { /** * The plugin to require to load the integration. */ - @Getter private final String pluginName; /** @@ -38,4 +36,13 @@ public class IntegrationLoader { public void load() { runnable.run(); } + + /** + * Get the plugin name. + * + * @return The plugin name. + */ + public String getPluginName() { + return this.pluginName; + } } diff --git a/eco-api/src/main/java/com/willfp/eco/core/integrations/placeholder/PlaceholderEntry.java b/eco-api/src/main/java/com/willfp/eco/core/integrations/placeholder/PlaceholderEntry.java index 609c6b9f..cc45752c 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/integrations/placeholder/PlaceholderEntry.java +++ b/eco-api/src/main/java/com/willfp/eco/core/integrations/placeholder/PlaceholderEntry.java @@ -1,6 +1,5 @@ package com.willfp.eco.core.integrations.placeholder; -import lombok.Getter; import org.apache.commons.lang.Validate; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; @@ -17,7 +16,6 @@ public class PlaceholderEntry { /** * The name of the placeholder, used in lookups. */ - @Getter private final String identifier; /** @@ -78,6 +76,15 @@ public class PlaceholderEntry { return requiresPlayer; } + /** + * Get the identifier. + * + * @return The identifier. + */ + public String getIdentifier() { + return identifier; + } + /** * Register the placeholder. */ diff --git a/eco-api/src/main/java/com/willfp/eco/core/items/builder/AbstractItemStackBuilder.java b/eco-api/src/main/java/com/willfp/eco/core/items/builder/AbstractItemStackBuilder.java index 8ab8dbea..9f2d09f5 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/items/builder/AbstractItemStackBuilder.java +++ b/eco-api/src/main/java/com/willfp/eco/core/items/builder/AbstractItemStackBuilder.java @@ -1,8 +1,6 @@ package com.willfp.eco.core.items.builder; import com.willfp.eco.util.StringUtils; -import lombok.AccessLevel; -import lombok.Getter; import org.apache.commons.lang.Validate; import org.bukkit.Material; import org.bukkit.NamespacedKey; @@ -29,13 +27,11 @@ public abstract class AbstractItemStackBuilder