Skip to content

Commit

Permalink
fix broken lombok
Browse files Browse the repository at this point in the history
  • Loading branch information
sarhatabaot committed Nov 21, 2024
1 parent eecb522 commit 2a98d99
Show file tree
Hide file tree
Showing 14 changed files with 622 additions and 42 deletions.
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ plugins {
id("java-library")
alias(libs.plugins.plugin.yml)
alias(libs.plugins.shadow)
alias(libs.plugins.lombok)
alias(libs.plugins.sonarqube)
}

Expand Down
99 changes: 99 additions & 0 deletions build.gradle.kts~
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
plugins {
id("java-library")
alias(libs.plugins.plugin.yml)
alias(libs.plugins.shadow)
alias(libs.plugins.lombok)
alias(libs.plugins.sonarqube)
}

group = "me.tychsen"
version = "1.7.6"

repositories {
mavenCentral()
maven ("https://repo.aikar.co/content/groups/aikar/")
maven ("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
maven ("https://nexus.hc.to/content/repositories/pub_releases")
maven ("https://oss.sonatype.org/content/groups/public/")
maven ("https://repo.codemc.org/repository/maven-public")
maven ("https://jitpack.io")
maven ("https://repo.rosewooddev.io/repository/public/")
maven ("https://repo.mattstudios.me/artifactory/public/")
}

dependencies {
compileOnly(libs.spigot.api)
compileOnly(libs.vault.api)
compileOnly(libs.playerpoints.api)

implementation(libs.triumph.gui)
library(libs.adventure.api)

implementation(libs.helper)
implementation(libs.nbt.api)
implementation(libs.acf)
implementation(libs.bstats)

library(libs.annotations)
}

bukkit {
name = "EnchantGUI"
version = project.version.toString()
main = "me.tychsen.enchantgui.EnchantGUIPlugin"
apiVersion = "1.17"
website = "https://github.com/sarhatabaot/EnchantGUI"
authors = listOf("Dentych", "sarhatabaot")
softDepend = listOf("Vault", "PlayerPoints")

permissions {
register("eshop.use") {
description = "Gives access to /eshop."
default = net.minecrell.pluginyml.bukkit.BukkitPluginDescription.Permission.Default.TRUE
}
register("eshop.admin") {
description = "Gives access to /eshop reload."
}
register("eshop.all") {
description = "Gives access to all enchants and all levels of the enchants."
}
register("eshop.enchanting-table") {
description = "Gives access to the right click on enchanting table feature."
}
}
}

tasks {
build {
dependsOn(shadowJar)
}

shadowJar {
minimize()
archiveFileName.set("EnchantGUI-${project.version}.jar")
archiveClassifier.set("shadow")

relocate ("org.bstats", "me.tychsen.enchantgui.util")
relocate ("co.aikar.commands", "me.tychsen.enchantgui.acf")
relocate ("co.aikar.locales", "me.tychsen.enchantgui.locales")
relocate ("de.tr7zw", "me.tychsen.enchantgui.nbt")
relocate ("com.github.sarhatabaot.kraken", "me.tychsen.enchantgui.kraken")
relocate ("dev.triumphteam", "me.tychsen.enchantgui.gui")
}
}


sonarqube {
properties {
property("sonar.projectKey", "sarhatabaot_EnchantGUI")
property("sonar.organization", "sarhatabaot-github")
property("sonar.host.url", "https://sonarcloud.io")
}
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(16))
}
}

1 change: 0 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ dependencyResolutionManagement {
versionCatalogs {
create("libs") {
plugin("shadow", "com.github.johnrengelman.shadow").version("8.1.1")
plugin("lombok", "io.freefair.lombok").version("8.11")
plugin("plugin-yml", "net.minecrell.plugin-yml.bukkit").version("0.6.0")
plugin("sonarqube", "org.sonarqube").version("6.0.0.5145")

Expand Down
23 changes: 23 additions & 0 deletions settings.gradle.kts~
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
rootProject.name = "EnchantGUI"

dependencyResolutionManagement {
versionCatalogs {
create("libs") {
plugin("shadow", "com.github.johnrengelman.shadow").version("8.1.1")
plugin("lombok", "io.freefair.lombok").version("8.11")
plugin("plugin-yml", "net.minecrell.plugin-yml.bukkit").version("0.6.0")
plugin("sonarqube", "org.sonarqube").version("6.0.0.5145")

library("spigot-api", "org.spigotmc:spigot-api:1.17-R0.1-SNAPSHOT")
library("vault-api", "com.github.MilkBowl:VaultAPI:1.7.1")
library("playerpoints-api", "org.black_ixx:playerpoints:3.2.7")
library("triumph-gui", "dev.triumphteam:triumph-gui:3.1.10")
library("adventure-api", "net.kyori:adventure-api:4.17.0")
library("nbt-api", "de.tr7zw:item-nbt-api:2.14.0")
library("acf", "co.aikar:acf-paper:0.5.1-SNAPSHOT")
library("bstats", "org.bstats:bstats-bukkit:3.1.0")
library("annotations", "org.jetbrains:annotations:26.0.1")
library("helper", "com.github.sarhatabaot:KrakenCore:1.6.3")
}
}
}
38 changes: 24 additions & 14 deletions src/main/java/me/tychsen/enchantgui/EnchantGUIPlugin.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package me.tychsen.enchantgui;

import co.aikar.commands.PaperCommandManager;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import me.tychsen.enchantgui.commands.ShopCommand;
import me.tychsen.enchantgui.config.EShopConfig;
import me.tychsen.enchantgui.config.Enchants;
Expand All @@ -22,20 +19,13 @@
import java.util.UUID;

public class EnchantGUIPlugin extends JavaPlugin {
@Setter (AccessLevel.PRIVATE) @Getter
private static EnchantGUIPlugin instance;

@Getter @Setter
private ShopMenu shopMenu;

@Getter @Setter (AccessLevel.PRIVATE)
private static Set<UUID> toggleRightClickPlayers = new HashSet<>();
private final Set<UUID> toggleRightClickPlayers = new HashSet<>();

private ShopMenu shopMenu;
private EShopConfig config;
@Getter
private LocalizationManager lm;

@Getter
private PlayerPointsAPI ppApi;

@Override
Expand All @@ -44,7 +34,6 @@ public void onEnable() {
config = new EShopConfig();
lm = new LocalizationManager();


this.shopMenu = new ShopMenu(new Enchants());
// Register event manager
getServer().getPluginManager().registerEvents(new EventManager(),this);
Expand All @@ -65,7 +54,6 @@ public void onEnable() {
@Override
public void onDisable() {
setInstance(null);
setToggleRightClickPlayers(null);
getLogger().info(() -> getName() + " " + getDescription().getVersion() + " disabled!");
}

Expand Down Expand Up @@ -95,5 +83,27 @@ public EShopConfig getMainConfig() {
return config;
}

public static EnchantGUIPlugin getInstance() {
return instance;
}

public static void setInstance(EnchantGUIPlugin instance) {
EnchantGUIPlugin.instance = instance;
}

public LocalizationManager getLm() {
return lm;
}

public Set<UUID> getToggleRightClickPlayers() {
return toggleRightClickPlayers;
}

public PlayerPointsAPI getPpApi() {
return ppApi;
}

public ShopMenu getShopMenu() {
return shopMenu;
}
}
15 changes: 5 additions & 10 deletions src/main/java/me/tychsen/enchantgui/commands/ShopCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
import co.aikar.commands.annotation.*;
import com.github.sarhatabaot.kraken.core.chat.ChatUtil;
import me.tychsen.enchantgui.EnchantGUIPlugin;
import me.tychsen.enchantgui.config.Enchants;
import me.tychsen.enchantgui.localization.LocalizationManager;
import me.tychsen.enchantgui.menu.ShopMenu;
import me.tychsen.enchantgui.permissions.EShopPermissionSys;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
Expand All @@ -17,19 +15,16 @@
@Description("Command for the EnchantGUI plugin.")
public class ShopCommand extends BaseCommand {
private final String prefix;
private final ShopMenu shopMenu;

private final LocalizationManager lm = EnchantGUIPlugin.getInstance().getLm();

public ShopCommand() {
this.prefix = lm.getLanguageString("prefix");
this.shopMenu = new ShopMenu(new Enchants());
}


@Default
public void onGui(final Player player) {
shopMenu.showMainMenu(player);
EnchantGUIPlugin.getInstance().getShopMenu().showMainMenu(player);
}

@Subcommand("toggle")
Expand All @@ -40,11 +35,11 @@ public void onToggle(final Player player) {
return;
}

if (EnchantGUIPlugin.getToggleRightClickPlayers().contains(player.getUniqueId())) {
EnchantGUIPlugin.getToggleRightClickPlayers().remove(player.getUniqueId());
if (EnchantGUIPlugin.getInstance().getToggleRightClickPlayers().contains(player.getUniqueId())) {
EnchantGUIPlugin.getInstance().getToggleRightClickPlayers().remove(player.getUniqueId());
tell(player, lm.getLanguageString("toggle-on"));
} else {
EnchantGUIPlugin.getToggleRightClickPlayers().add(player.getUniqueId());
EnchantGUIPlugin.getInstance().getToggleRightClickPlayers().add(player.getUniqueId());
tell(player, lm.getLanguageString("toggle-off"));
}
}
Expand All @@ -55,7 +50,7 @@ public void onToggle(final Player player) {
public void onReload(final CommandSender player) {
EnchantGUIPlugin.getInstance().onReload();
EnchantGUIPlugin.getInstance().getLm().reload(player);
this.shopMenu.reload();
EnchantGUIPlugin.getInstance().getShopMenu().reload();
EnchantGUIPlugin.getInstance()
.getLogger()
.info(() -> "%s %s using: %s".formatted(getName(),
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/me/tychsen/enchantgui/config/EShopConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.github.sarhatabaot.kraken.core.chat.ChatUtil;
import com.github.sarhatabaot.kraken.core.config.ConfigFile;
import lombok.Setter;
import me.tychsen.enchantgui.EnchantGUIPlugin;
import me.tychsen.enchantgui.economy.*;
import org.bukkit.Material;
Expand All @@ -14,7 +13,6 @@

public class EShopConfig extends ConfigFile<EnchantGUIPlugin> {

@Setter
private static PaymentStrategy economy;

public EShopConfig() {
Expand Down Expand Up @@ -120,4 +118,7 @@ public String getLanguage() {
return config.getString("language", "en");
}

public static void setEconomy(PaymentStrategy economy) {
EShopConfig.economy = economy;
}
}
Loading

0 comments on commit 2a98d99

Please sign in to comment.