diff --git a/README.md b/README.md index 0e802ba..652499f 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ You can download a copy at [Modrinth](https://modrinth.com/plugin/catchball) - GriefPrevention - Lands - RedProtect +- SimpleClaimSystem - MythicMobs - PlaceholderAPI diff --git a/build.gradle.kts b/build.gradle.kts index 3fe71b6..9e9b53c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,13 +2,13 @@ plugins { java `java-library` `maven-publish` - kotlin("jvm") version "1.8.0" + kotlin("jvm") version "2.1.20" id("com.gradleup.shadow") version "8.3.5" id("xyz.jpenilla.run-paper") version "2.3.1" } group = "com.github.nutt1101" -version = "2.0.3" +version = "2.0.4" description = "CatchBall" java.sourceCompatibility = JavaVersion.VERSION_21 @@ -56,19 +56,15 @@ repositories { dependencies { api("org.bstats:bstats-bukkit:3.1.0") - api("com.github.Paulem79:Spigot-UpdateChecker:3cfb265fb8") - api("de.tr7zw:item-nbt-api:2.14.1") + api("com.jeff_media:SpigotUpdateChecker:3.0.4") + api("de.tr7zw:item-nbt-api:2.15.0") api("cn.handyplus.lib.adapter:FoliaLib:1.1.5") compileOnly("org.spigotmc:spigot-api:1.20.5-R0.1-SNAPSHOT") - compileOnly("io.lumine:Mythic-Dist:5.7.1") - compileOnly("com.sk89q.worldguard:worldguard-bukkit:7.0.12") + compileOnly("io.lumine:Mythic-Dist:5.8.2") + compileOnly("com.sk89q.worldguard:worldguard-bukkit:7.0.13") compileOnly("com.github.TechFortress:GriefPrevention:17.0.0") - compileOnly("com.github.angeschossen:LandsAPI:7.8.5") - implementation("com.github.Xyness:SimpleClaimSystem:1.11") { - attributes { - attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 22) - } - } + compileOnly("com.github.angeschossen:LandsAPI:7.13.1") + compileOnly(files("./libs/SimpleClaimSystem-1.11.6.2.jar")) compileOnly("me.clip:placeholderapi:2.11.6") compileOnly ("io.github.fabiozumbi12.RedProtect:RedProtect-Core:8.1.2"){ exclude(group = "*")} // Core is not needed but allow access to all region methods compileOnly ("io.github.fabiozumbi12.RedProtect:RedProtect-Spigot:8.1.2"){ exclude(group = "*")} @@ -105,7 +101,8 @@ tasks { minimize() - relocate("com.jeff_media.updatechecker", "org.milkteamc.autotreechop.libs.updatechecker") + relocate("com.jeff_media.updatechecker", "tw.maoyue.catchball.libs.updatechecker") + relocate("de.tr7zw.changeme.nbtapi", "tw.maoyue.catchball.libs.nbtapi") } } @@ -115,7 +112,7 @@ tasks.jar { } tasks.runServer { - minecraftVersion("1.21.3") + minecraftVersion("1.21.4") } runPaper.folia.registerTask() diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8cbb2d3..8cb4e1e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,16 +3,16 @@ [versions] br-net-fabiozumbi12-redprotect-redprotect-core = "7.7.3" -br-net-fabiozumbi12-redprotect-redprotect-spigot = "LATEST" -com-github-angeschossen-landsapi = "7.8.5" +br-net-fabiozumbi12-redprotect-redprotect-spigot = "7.7.3" +com-github-angeschossen-landsapi = "7.13.1" com-github-techfortress-griefprevention = "17.0.0" -com-github-xyness-simpleclaimsystem = "1.10.0.4" +com-github-xyness-simpleclaimsystem = "1.12.0.10" com-jeff-media-spigotupdatechecker = "3.0.3" -com-sk89q-worldguard-worldguard-bukkit = "7.0.10" -de-tr7zw-item-nbt-api = "2.13.3-SNAPSHOT" -io-lumine-mythic-dist = "5.7.1" +com-sk89q-worldguard-worldguard-bukkit = "7.0.13" +de-tr7zw-item-nbt-api = "2.14.2-SNAPSHOT" +io-lumine-mythic-dist = "5.8.2" me-clip-placeholderapi = "2.11.6" -org-bstats-bstats-bukkit = "3.0.3" +org-bstats-bstats-bukkit = "3.1.0" org-spigotmc-spigot-api = "1.20.5-R0.1-SNAPSHOT" res-residence = "5.1.4.3" diff --git a/src/main/java/com/github/nutt1101/CatchBall.java b/src/main/java/com/github/nutt1101/CatchBall.java index 42ee32a..9929bab 100644 --- a/src/main/java/com/github/nutt1101/CatchBall.java +++ b/src/main/java/com/github/nutt1101/CatchBall.java @@ -1,7 +1,5 @@ package com.github.nutt1101; -import java.util.logging.Level; - import cn.handyplus.lib.adapter.HandySchedulerUtil; import com.github.nutt1101.command.Command; import com.github.nutt1101.command.TabComplete; @@ -17,10 +15,10 @@ import org.bukkit.plugin.Plugin; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; -import java.util.Arrays; -import java.util.List; -public class CatchBall extends JavaPlugin{ +import java.util.logging.Level; + +public class CatchBall extends JavaPlugin { private FileConfiguration config = this.getConfig(); public static Plugin plugin; diff --git a/src/main/java/com/github/nutt1101/ConfigSetting.java b/src/main/java/com/github/nutt1101/ConfigSetting.java index 9aac434..6253321 100644 --- a/src/main/java/com/github/nutt1101/ConfigSetting.java +++ b/src/main/java/com/github/nutt1101/ConfigSetting.java @@ -39,6 +39,8 @@ public class ConfigSetting { public static boolean ShowParticles; public static String CustomParticles; public static double catchFailRate; + public static int customModelData; + public static int ballCustomModelData; public static boolean UseRes; public static boolean UseGF; public static boolean UseLands; @@ -93,6 +95,12 @@ public static void checkConfig() { CustomParticles = config.isSet("CustomParticles") ? config.getString("CustomParticles") : "CLOUD"; catchFailRate = !config.isSet("catchFailRate") ? config.getDouble("catchFailRate") : 0.1; + customModelData = !config.isSet("customModelData") ? config.getInt("customModelData") + : 0; + + ballCustomModelData = !config.isSet("ballCustomModelData") ? config.getInt("ballCustomModelData") + : 0; + try { TranslationFileReader.init(); diff --git a/src/main/java/com/github/nutt1101/items/Ball.java b/src/main/java/com/github/nutt1101/items/Ball.java index 512b141..30eb89b 100644 --- a/src/main/java/com/github/nutt1101/items/Ball.java +++ b/src/main/java/com/github/nutt1101/items/Ball.java @@ -12,6 +12,8 @@ import org.bukkit.inventory.meta.ItemMeta; import net.md_5.bungee.api.ChatColor; +import static com.github.nutt1101.ConfigSetting.customModelData; + public class Ball { public static ItemStack makeBall() { @@ -26,6 +28,10 @@ public static ItemStack makeBall() { translateAlternateColorCodes('&', lore)). collect(Collectors.toList())); + if(customModelData != 0) { + meta.setCustomModelData(customModelData); + } + catchball.setItemMeta(meta); return catchball; diff --git a/src/main/java/com/github/nutt1101/items/GoldEgg.java b/src/main/java/com/github/nutt1101/items/GoldEgg.java index cf7ac46..ae1b337 100644 --- a/src/main/java/com/github/nutt1101/items/GoldEgg.java +++ b/src/main/java/com/github/nutt1101/items/GoldEgg.java @@ -13,6 +13,9 @@ import net.md_5.bungee.api.ChatColor; +import static com.github.nutt1101.ConfigSetting.ballCustomModelData; +import static com.github.nutt1101.ConfigSetting.customModelData; + public class GoldEgg { public static ItemStack makeGoldEgg() { @@ -27,6 +30,10 @@ public static ItemStack makeGoldEgg() { translateAlternateColorCodes('&', lore).replace("{PERCENT}", String.valueOf(ConfigSetting. chickenDropGoldEggChance))).collect(Collectors.toList())); + if(ballCustomModelData != 0) { + meta.setCustomModelData(ballCustomModelData); + } + goldEgg.setItemMeta(meta); return goldEgg; diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index d9f2897..fbac725 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -1,6 +1,8 @@ # Some of the content has been relocated to the locale folder within the configuration file. # Discord: https://discord.gg/uQ4UXANnP2 # GitHub: https://github.com/MagicTeaMC/CatchBall +# Modrinth: https://modrinth.com/plugin/catchball +# Latest config.yml: https://github.com/MagicTeaMC/CatchBall2/blob/release/src/main/resources/config.yml # Locale, Current support: # en(English), zh_tw(繁體中文_臺灣) @@ -78,3 +80,9 @@ UseMM: true CatchableEntity: - SHEEP + +# If you have to custom item, you can change this to your want. +# Set to 0 can disable it. +# Never change it if you don't know what is this. +customModelData: 0 +ballCustomModelData: 0 \ No newline at end of file