diff --git a/build.gradle.kts b/build.gradle.kts index dab03f5..0cd4af0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -26,6 +26,7 @@ allprojects { maven("https://betonquest.org/nexus/repository/betonquest/") maven("https://maven.enginehub.org/repo/") maven("https://oss.sonatype.org/content/groups/public/") + maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") maven("https://repo.codemc.org/repository/maven-public/") maven("https://jitpack.io") maven("https://repo.papermc.io/repository/maven-public/") diff --git a/gradle.properties b/gradle.properties index d508eeb..9ac195f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,8 @@ -#systemProp.socks.proxyHost=127.0.0.1 -#systemProp.socks.proxyPort=7890 -# -#systemProp.http.proxyHost=127.0.0.1 -#systemProp.http.proxyPort=7890 -# -#systemProp.https.proxyHost=127.0.0.1 -#systemProp.https.proxyPort=7890 +systemProp.socks.proxyHost=127.0.0.1 +systemProp.socks.proxyPort=7890 + +systemProp.http.proxyHost=127.0.0.1 +systemProp.http.proxyPort=7890 + +systemProp.https.proxyHost=127.0.0.1 +systemProp.https.proxyPort=7890 diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index 1c789c4..83a5551 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -16,7 +16,7 @@ dependencies { compileOnly("net.Indyuce:MMOItems-API:6.9.2-SNAPSHOT") compileOnly("pers.neige.neigeitems:NeigeItems:1.14.23") compileOnly("com.github.Archy-X:AureliumSkills:Beta1.3.21") - compileOnly("com.willfp:EcoSkills:3.8.1") + compileOnly("com.willfp:EcoSkills:3.36.1") compileOnly("com.github.Zrips:Jobs:4.17.2") compileOnly("com.github.MilkBowl:VaultAPI:1.7") compileOnly("com.comphenix.protocol:ProtocolLib:5.0.0") @@ -25,10 +25,10 @@ dependencies { implementation(project(":api")) implementation("net.kyori:adventure-api:4.14.0") - implementation("net.kyori:adventure-platform-bukkit:4.3.1") + implementation("net.kyori:adventure-platform-bukkit:4.3.3-SNAPSHOT") implementation("net.kyori:adventure-text-minimessage:4.14.0") implementation("net.kyori:adventure-text-serializer-legacy:4.14.0") - implementation("de.tr7zw:item-nbt-api:2.12.0") + implementation("de.tr7zw:item-nbt-api:2.12.2") implementation("org.bstats:bstats-bukkit:3.0.1") implementation(files("libs/BiomeAPI.jar", "libs/ProtectionLib.jar")) } diff --git a/plugin/libs/BiomeAPI.jar b/plugin/libs/BiomeAPI.jar index 470bb2c..59096aa 100644 Binary files a/plugin/libs/BiomeAPI.jar and b/plugin/libs/BiomeAPI.jar differ diff --git a/plugin/src/main/java/net/momirealms/customcrops/api/object/action/ActionBarImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/action/ActionBarImpl.java new file mode 100644 index 0000000..46a4fe7 --- /dev/null +++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/action/ActionBarImpl.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) <2022> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package net.momirealms.customcrops.api.object.action; + +import net.momirealms.customcrops.api.object.ItemMode; +import net.momirealms.customcrops.api.object.world.SimpleLocation; +import net.momirealms.customcrops.util.AdventureUtils; +import org.bukkit.entity.Player; +import org.jetbrains.annotations.Nullable; + +public record ActionBarImpl(String message, double chance) implements Action { + + @Override + public void doOn(@Nullable Player player, @Nullable SimpleLocation cropLoc, ItemMode itemMode) { + if (player == null || Math.random() > chance) return; + AdventureUtils.playerActionbar(player, + message.replace("{player}", player.getName()) + .replace("{world}", player.getWorld().getName()) + .replace("{x}", cropLoc == null ? "" : String.valueOf(cropLoc.getX())) + .replace("{y}", cropLoc == null ? "" : String.valueOf(cropLoc.getY())) + .replace("{z}", cropLoc == null ? "" : String.valueOf(cropLoc.getZ())) + ); + } +} \ No newline at end of file diff --git a/plugin/src/main/java/net/momirealms/customcrops/integration/skill/EcoSkillsImpl.java b/plugin/src/main/java/net/momirealms/customcrops/integration/skill/EcoSkillsImpl.java index 794ace1..b2dfc49 100644 --- a/plugin/src/main/java/net/momirealms/customcrops/integration/skill/EcoSkillsImpl.java +++ b/plugin/src/main/java/net/momirealms/customcrops/integration/skill/EcoSkillsImpl.java @@ -18,6 +18,7 @@ package net.momirealms.customcrops.integration.skill; import com.willfp.ecoskills.api.EcoSkillsAPI; +import com.willfp.ecoskills.skills.Skill; import com.willfp.ecoskills.skills.Skills; import net.momirealms.customcrops.integration.SkillInterface; import org.bukkit.entity.Player; @@ -26,7 +27,7 @@ public class EcoSkillsImpl implements SkillInterface { @Override public void addXp(Player player, double amount) { - EcoSkillsAPI.giveSkillXP(player, Skills.INSTANCE.getByID("farming"), amount); + EcoSkillsAPI.gainSkillXP(player, Skills.INSTANCE.getByID("farming"), amount); } @Override diff --git a/plugin/src/main/java/net/momirealms/customcrops/util/ConfigUtils.java b/plugin/src/main/java/net/momirealms/customcrops/util/ConfigUtils.java index d1fa224..05bba98 100644 --- a/plugin/src/main/java/net/momirealms/customcrops/util/ConfigUtils.java +++ b/plugin/src/main/java/net/momirealms/customcrops/util/ConfigUtils.java @@ -252,6 +252,10 @@ public class ConfigUtils { actionSec.getStringList("value").toArray(new String[0]), actionSec.getDouble("chance", 1)) ); + case "actionbar" -> actions.add(new ActionBarImpl( + actionSec.getString("value"), + actionSec.getDouble("chance", 1)) + ); case "command" -> actions.add(new CommandActionImpl( actionSec.getStringList("value").toArray(new String[0]), actionSec.getDouble("chance", 1))