diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml index fee9040..5566f38 100644 --- a/.github/workflows/gradle-build.yml +++ b/.github/workflows/gradle-build.yml @@ -25,9 +25,15 @@ jobs: server-id: lagassist settings-path: ${{ github.workspace }} - name: Setup Gradle - uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 - - name: Build with Gradle + uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 + + - name: Build with Gradle 1.20.4 + run: MC_VERSION=1.20.4 ./gradlew build + - name: Build with Gradle 1.20.6 + run: MC_VERSION=1.20.6 ./gradlew build + - name: Build with Gradle Latest run: ./gradlew build + - name: Upload artifacts uses: actions/upload-artifact@v4 with: diff --git a/.idea/modules.xml b/.idea/modules.xml index eed1159..593c58c 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -3,6 +3,7 @@ + \ No newline at end of file diff --git a/.idea/modules/lagassist.main.iml b/.idea/modules/lagassist.main.iml index bbeeb3e..746f1fd 100644 --- a/.idea/modules/lagassist.main.iml +++ b/.idea/modules/lagassist.main.iml @@ -11,4 +11,8 @@ + + + + \ No newline at end of file diff --git a/.idea/modules/org.alvindimas05.lagassist.lagassist.main.iml b/.idea/modules/org.alvindimas05.lagassist.lagassist.main.iml new file mode 100644 index 0000000..bbeeb3e --- /dev/null +++ b/.idea/modules/org.alvindimas05.lagassist.lagassist.main.iml @@ -0,0 +1,14 @@ + + + + + + + PAPER + ADVENTURE + + 1 + + + + \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 6762555..d157899 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,8 +10,15 @@ repositories { maven("https://repo.maven.apache.org/maven2/") } + +var minecraftVersion = "1.21" + +task("minecraftVersion") { + minecraftVersion = System.getenv("MC_VERSION") ?: "1.21" +} + group = "org.alvindimas05.lagassist" -version = "2.30.1" +version = "2.31-$minecraftVersion" description = "LagAssist" java { @@ -20,8 +27,9 @@ java { } } + dependencies { - compileOnly("io.papermc.paper:paper-api:1.21-R0.1-SNAPSHOT") + compileOnly("io.papermc.paper:paper-api:$minecraftVersion-R0.1-SNAPSHOT") compileOnly("net.milkbowl.vault:VaultAPI:1.7") implementation("io.netty:netty-all:4.1.111.Final") @@ -32,4 +40,4 @@ dependencies { tasks.withType { options.encoding = "UTF-8" -} \ No newline at end of file +} diff --git a/src/main/java/org/alvindimas05/lagassist/gui/DataGUI.java b/src/main/java/org/alvindimas05/lagassist/gui/DataGUI.java index 59071c1..7e8cdad 100644 --- a/src/main/java/org/alvindimas05/lagassist/gui/DataGUI.java +++ b/src/main/java/org/alvindimas05/lagassist/gui/DataGUI.java @@ -189,7 +189,7 @@ public static void setShine(ItemStack s, boolean shining) { ItemMeta smeta = s.getItemMeta(); if (shining) { - smeta.addEnchant(Enchantment.UNBREAKING, 1, true); + smeta.addEnchant(Enchantment.MENDING, 1, true); smeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES); } diff --git a/src/main/java/org/alvindimas05/lagassist/microfeatures/AdvertRunner.java b/src/main/java/org/alvindimas05/lagassist/microfeatures/AdvertRunner.java deleted file mode 100644 index 8651c26..0000000 --- a/src/main/java/org/alvindimas05/lagassist/microfeatures/AdvertRunner.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.alvindimas05.lagassist.microfeatures; - -import org.alvindimas05.lagassist.Data; -import org.alvindimas05.lagassist.Main; -import org.alvindimas05.lagassist.utils.Chat; -import org.bukkit.Bukkit; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerJoinEvent; -import org.bukkit.plugin.messaging.PluginMessageListener; - -public class AdvertRunner implements Listener, PluginMessageListener { - - public AdvertRunner() { - Bukkit.getServer().getMessenger().registerOutgoingPluginChannel(Main.p, "BungeeCord"); - Bukkit.getServer().getMessenger().registerIncomingPluginChannel(Main.p, "BungeeCord", this); - } - - @EventHandler - public void onJoin(PlayerJoinEvent e) { - Player p = e.getPlayer(); - - if (!Data.isAdvertising()) { - return; - } - - if (!p.isOp()) { - return; - } - - if (Bukkit.spigot().getSpigotConfig().getBoolean("bungeecord")) { - p.sendPluginMessage(Main.p, "BungeeCord", new byte[1]); - } else { - // TODO: FINSIH non-lousy advertising - // sendAdvertising(null, 1); - } - - } - - @Override - public void onPluginMessageReceived(String channel, Player player, byte[] message) { - // TODO Auto-generated method stub - - } - - private static void sendAdvertising(Player p, int players) { - if (players < 75) { - return; - } - - String plan = players > 300 ? "§f§lPLATINUM" : players > 100 ? "§6§lGOLD" : "§7§lSILVER"; - - String ad = "§2§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛§f§l ENTRYRISE §2§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛" - + "\n\n" - + " §a✸ §7We have noticed that your server is popular. Hooray!\n" - + " §a✸ §7Entryrise, the team behind LagAssist, provides system\n" - + " §a✸ §7administration and server management services for\n" - + " §a✸ §7servers, including enterprise networks with thousands of concurrent players.\n\n" - + " §a✸ §7The " + plan + "§7 plan should be ideal for your usecase.\n\n"; - - - ad = ad + " §a✸ §7Click here for more info or to disable the ad." - + "§2§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛"; - - final String adf = ad; - - Bukkit.getScheduler().runTaskLaterAsynchronously(Main.p, () -> { - p.spigot().sendMessage(Chat.genHoverAndLinkComponent(adf + "", "https://www.entryrise.com", "Use /lagassist advertising to disable this message from showing")); - }, 60); - } - -} diff --git a/src/main/java/org/alvindimas05/lagassist/minebench/Approximate.java b/src/main/java/org/alvindimas05/lagassist/minebench/Approximate.java index 362d165..030b2ac 100644 --- a/src/main/java/org/alvindimas05/lagassist/minebench/Approximate.java +++ b/src/main/java/org/alvindimas05/lagassist/minebench/Approximate.java @@ -127,7 +127,8 @@ public void run() { cs.sendMessage(" §2✸ §fCPU Score (SINGLE): §e" + br.getStringifiedSth()); cs.sendMessage(" §2✸ §fCPU Score (MULTI): §e" + br.getStringifiedMth()); } else { - cs.sendMessage(" §cThere was an error getting the full benchmark results."); + cs.sendMessage(" §eBenchmark feature coming soon!"); + // cs.sendMessage(" §cThere was an error getting the full benchmark results."); } cs.sendMessage(""); cs.sendMessage(" §2✸ §fDownload Speed: §e" + MIBDL + " Mib/s (" + MBDL + "MB/s)"); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 859c50e..7792bb0 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: LagAssist authors: [Stefatorus, EntryRise, alvindimas05] -version: 2.30.0 +version: 2.31 api-version: 1.13 description: LagAssist is an advanced anti-lag solution that allows server owners find and remove lag using multiple advanced and efficient methods. main: org.alvindimas05.lagassist.Main