diff --git a/build.gradle.kts b/build.gradle.kts index 1a447b9..d1f000e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ plugins { allprojects { project.group = "net.momirealms" - project.version = "3.3.1.4" + project.version = "3.3.1.5" apply() apply(plugin = "java") @@ -71,12 +71,5 @@ subprojects { tasks.javadoc.configure { options.quiet() } - - if ("api" == project.name) { - java { - withSourcesJar() - withJavadocJar() - } - } } diff --git a/gradle.properties b/gradle.properties index 7b26f39..77c8495 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,8 @@ -systemProp.socks.proxyHost=127.0.0.1 -systemProp.socks.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.http.proxyHost=127.0.0.1 +#systemProp.http.proxyPort=7890 -systemProp.https.proxyHost=127.0.0.1 -systemProp.https.proxyPort=7890 \ No newline at end of file +#systemProp.https.proxyHost=127.0.0.1 +#systemProp.https.proxyPort=7890 \ No newline at end of file diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index 2d82517..bd41598 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -28,7 +28,7 @@ dependencies { implementation("net.kyori:adventure-platform-bukkit:4.3.0") 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.11.3") + implementation("de.tr7zw:item-nbt-api:2.12.0") implementation("org.bstats:bstats-bukkit:3.0.1") implementation(files("libs/BiomeAPI.jar", "libs/ProtectionLib.jar")) } diff --git a/plugin/libs/BattlePass-4.0.6-api.jar b/plugin/libs/BattlePass-4.0.6-api.jar new file mode 100644 index 0000000..a82a625 Binary files /dev/null and b/plugin/libs/BattlePass-4.0.6-api.jar differ diff --git a/plugin/libs/BiomeAPI.jar b/plugin/libs/BiomeAPI.jar index 00c0671..470bb2c 100644 Binary files a/plugin/libs/BiomeAPI.jar and b/plugin/libs/BiomeAPI.jar differ diff --git a/plugin/libs/battle-pass-api.jar b/plugin/libs/battle-pass-api.jar deleted file mode 100644 index 608df8c..0000000 Binary files a/plugin/libs/battle-pass-api.jar and /dev/null differ diff --git a/plugin/src/main/java/net/momirealms/customcrops/CustomCrops.java b/plugin/src/main/java/net/momirealms/customcrops/CustomCrops.java index 240b05e..f784fdc 100644 --- a/plugin/src/main/java/net/momirealms/customcrops/CustomCrops.java +++ b/plugin/src/main/java/net/momirealms/customcrops/CustomCrops.java @@ -22,9 +22,11 @@ import com.comphenix.protocol.ProtocolManager; import net.kyori.adventure.platform.bukkit.BukkitAudiences; import net.momirealms.customcrops.api.CustomCropsAPIImpl; import net.momirealms.customcrops.api.CustomCropsPlugin; +import net.momirealms.customcrops.api.event.CropBreakEvent; import net.momirealms.customcrops.api.object.basic.ConfigManager; import net.momirealms.customcrops.api.object.basic.MessageManager; import net.momirealms.customcrops.api.object.crop.CropManager; +import net.momirealms.customcrops.api.object.crop.GrowingCrop; import net.momirealms.customcrops.api.object.fertilizer.FertilizerManager; import net.momirealms.customcrops.api.object.hologram.HologramManager; import net.momirealms.customcrops.api.object.pot.PotManager; @@ -32,6 +34,7 @@ import net.momirealms.customcrops.api.object.scheduler.Scheduler; import net.momirealms.customcrops.api.object.season.SeasonManager; import net.momirealms.customcrops.api.object.sprinkler.SprinklerManager; import net.momirealms.customcrops.api.object.wateringcan.WateringCanManager; +import net.momirealms.customcrops.api.object.world.SimpleLocation; import net.momirealms.customcrops.api.object.world.WorldDataManager; import net.momirealms.customcrops.command.CustomCropsCommand; import net.momirealms.customcrops.customplugin.Platform; diff --git a/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/BlackBiomeImpl.java b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/BlackBiomeImpl.java new file mode 100644 index 0000000..408aa17 --- /dev/null +++ b/plugin/src/main/java/net/momirealms/customcrops/api/object/requirement/BlackBiomeImpl.java @@ -0,0 +1,44 @@ +/* + * 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.requirement; + +import net.momirealms.biomeapi.BiomeAPI; +import net.momirealms.customcrops.api.object.action.Action; +import org.jetbrains.annotations.Nullable; + +import java.util.HashSet; + +public class BlackBiomeImpl extends AbstractRequirement implements Requirement { + + private final HashSet biomes; + + public BlackBiomeImpl(@Nullable String[] msg, @Nullable Action[] actions, HashSet biomes) { + super(msg, actions); + this.biomes = biomes; + } + + @Override + public boolean isConditionMet(CurrentState currentState) { + String currentBiome = BiomeAPI.getBiome(currentState.getLocation()); + if (!biomes.contains(currentBiome)) { + return true; + } + notMetActions(currentState); + return false; + } +} diff --git a/plugin/src/main/java/net/momirealms/customcrops/integration/quest/BattlePassCCQuest.java b/plugin/src/main/java/net/momirealms/customcrops/integration/quest/BattlePassCCQuest.java index 0a74bf2..242b66c 100644 --- a/plugin/src/main/java/net/momirealms/customcrops/integration/quest/BattlePassCCQuest.java +++ b/plugin/src/main/java/net/momirealms/customcrops/integration/quest/BattlePassCCQuest.java @@ -19,19 +19,20 @@ package net.momirealms.customcrops.integration.quest; import io.github.battlepass.BattlePlugin; import io.github.battlepass.api.events.server.PluginReloadEvent; -import io.github.battlepass.quests.service.base.ExternalQuestContainer; -import io.github.battlepass.registry.quest.QuestRegistry; +import net.advancedplugins.bp.impl.actions.ActionRegistry; +import net.advancedplugins.bp.impl.actions.external.executor.ActionQuestExecutor; import net.momirealms.customcrops.api.event.CropBreakEvent; import net.momirealms.customcrops.api.event.CropPlantEvent; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; +import org.bukkit.plugin.java.JavaPlugin; public class BattlePassCCQuest implements Listener { public static void register() { - QuestRegistry questRegistry = BattlePlugin.getApi().getQuestRegistry(); - questRegistry.hook("customcrops", CropQuest::new); + ActionRegistry actionRegistry = BattlePlugin.getPlugin().getActionRegistry(); + actionRegistry.hook("customcrops", CropQuest::new); } @EventHandler(ignoreCancelled = true) @@ -39,9 +40,9 @@ public class BattlePassCCQuest implements Listener { register(); } - private static class CropQuest extends ExternalQuestContainer { + private static class CropQuest extends ActionQuestExecutor { - public CropQuest(BattlePlugin battlePlugin) { + public CropQuest(JavaPlugin battlePlugin) { super(battlePlugin, "customcrops"); } 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 0ea609e..a6c385c 100644 --- a/plugin/src/main/java/net/momirealms/customcrops/util/ConfigUtils.java +++ b/plugin/src/main/java/net/momirealms/customcrops/util/ConfigUtils.java @@ -208,6 +208,7 @@ public class ConfigUtils { ConfigurationSection actionSec = innerSec.getConfigurationSection("actions"); switch (type) { case "biome" -> requirements.add(new BiomeImpl(msg, getActions(actionSec), new HashSet<>(innerSec.getStringList("value")))); + case "!biome" -> requirements.add(new BlackBiomeImpl(msg, getActions(actionSec), new HashSet<>(innerSec.getStringList("value")))); case "weather" -> requirements.add(new WeatherImpl(msg, getActions(actionSec), innerSec.getStringList("value").toArray(new String[0]))); case "ypos" -> requirements.add(new YPosImpl(msg, getActions(actionSec), innerSec.getStringList("value"))); case "season" -> {