From 30122cb0a92a916b402197582b26cd649d9896c2 Mon Sep 17 00:00:00 2001 From: XiaoMoMi <972454774@qq.com> Date: Mon, 13 May 2024 04:24:54 +0800 Subject: [PATCH] 3.4.9 --- .../item/custom/AbstractCustomListener.java | 3 +- .../mechanic/item/custom/CustomProvider.java | 4 +-- build.gradle.kts | 6 ++-- plugin/build.gradle.kts | 16 ++++----- .../customcrops/CustomCropsPluginImpl.java | 4 --- .../libraries/dependencies/Dependency.java | 34 ------------------- 6 files changed, 15 insertions(+), 52 deletions(-) diff --git a/api/src/main/java/net/momirealms/customcrops/api/mechanic/item/custom/AbstractCustomListener.java b/api/src/main/java/net/momirealms/customcrops/api/mechanic/item/custom/AbstractCustomListener.java index ae7871a..5c049d3 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/mechanic/item/custom/AbstractCustomListener.java +++ b/api/src/main/java/net/momirealms/customcrops/api/mechanic/item/custom/AbstractCustomListener.java @@ -108,7 +108,8 @@ public abstract class AbstractCustomListener implements Listener { final Location location = block.getLocation(); Optional customCropsBlock = CustomCropsPlugin.get().getWorldManager().getBlockAt(SimpleLocation.of(location)); if (customCropsBlock.isPresent()) { - fallingBlock.setCancelDrop(true); + event.setCancelled(true); + block.getWorld().dropItemNaturally(block.getLocation(), new ItemStack(fallingBlock.getBlockData().getMaterial())); } } } diff --git a/api/src/main/java/net/momirealms/customcrops/api/mechanic/item/custom/CustomProvider.java b/api/src/main/java/net/momirealms/customcrops/api/mechanic/item/custom/CustomProvider.java index be829eb..c6029ea 100644 --- a/api/src/main/java/net/momirealms/customcrops/api/mechanic/item/custom/CustomProvider.java +++ b/api/src/main/java/net/momirealms/customcrops/api/mechanic/item/custom/CustomProvider.java @@ -65,7 +65,7 @@ public interface CustomProvider { Location center = LocationUtils.toCenterLocation(location); Collection entities = center.getWorld().getNearbyEntities(center, 0.5,0.51,0.5); entities.removeIf(entity -> (entity instanceof Player || entity instanceof Item)); - return entities.size() == 0; + return entities.isEmpty(); } default CRotation removeAnythingAt(Location location) { @@ -115,7 +115,7 @@ public interface CustomProvider { return type != EntityType.ITEM_FRAME && (!VersionManager.isHigherThan1_19_R3() || type != EntityType.ITEM_DISPLAY); }); - if (entities.size() == 0) return CRotation.NONE; + if (entities.isEmpty()) return CRotation.NONE; CRotation rotation; Entity first = entities.stream().findFirst().get(); if (first instanceof ItemFrame itemFrame) { diff --git a/build.gradle.kts b/build.gradle.kts index ea08a3e..91fa0de 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,18 +2,18 @@ plugins { id("org.gradle.java") id("application") id("org.gradle.maven-publish") - id("com.github.johnrengelman.shadow") version "8.1.1" + id("io.github.goooler.shadow") version "8.1.7" } allprojects { project.group = "net.momirealms" - project.version = "3.4.8.1" + project.version = "3.4.9" apply() apply(plugin = "java") apply(plugin = "application") - apply(plugin = "com.github.johnrengelman.shadow") + apply(plugin = "io.github.goooler.shadow") apply(plugin = "org.gradle.maven-publish") application { diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index c549771..4ab5912 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -45,20 +45,20 @@ dependencies { compileOnly(files("libs/zaphkiel-2.0.24.jar")) compileOnly(files("libs/mcMMO-api.jar")) compileOnly(files("libs/RealisticSeasons-api.jar")) + compileOnly("org.bstats:bstats-bukkit:3.0.2") implementation(project(":api")) implementation(project(":oraxen-legacy")) implementation(project(":oraxen-j21")) implementation(project(":legacy-api")) - compileOnly("net.kyori:adventure-api:4.17.0") - compileOnly("net.kyori:adventure-platform-bukkit:4.3.2") - compileOnly("com.github.Xiao-MoMi:AntiGriefLib:0.11") - compileOnly("com.github.Xiao-MoMi:BiomeAPI:0.6") - compileOnly("net.kyori:adventure-text-minimessage:4.17.0") - compileOnly("net.kyori:adventure-text-serializer-legacy:4.17.0") - compileOnly("de.tr7zw:item-nbt-api:2.12.4") - compileOnly("org.bstats:bstats-bukkit:3.0.2") + implementation("net.kyori:adventure-api:4.17.0") + implementation("net.kyori:adventure-platform-bukkit:4.3.2") + implementation("net.kyori:adventure-text-minimessage:4.17.0") + implementation("net.kyori:adventure-text-serializer-legacy:4.17.0") + implementation("de.tr7zw:item-nbt-api:2.12.4") + implementation("com.github.Xiao-MoMi:AntiGriefLib:0.11") + implementation("com.github.Xiao-MoMi:BiomeAPI:0.6") implementation("com.flowpowered:flow-nbt:2.0.2") implementation("com.github.luben:zstd-jni:1.5.6-2") } diff --git a/plugin/src/main/java/net/momirealms/customcrops/CustomCropsPluginImpl.java b/plugin/src/main/java/net/momirealms/customcrops/CustomCropsPluginImpl.java index 8a6b248..43b2f6d 100644 --- a/plugin/src/main/java/net/momirealms/customcrops/CustomCropsPluginImpl.java +++ b/plugin/src/main/java/net/momirealms/customcrops/CustomCropsPluginImpl.java @@ -59,12 +59,8 @@ public class CustomCropsPluginImpl extends CustomCropsPlugin { Dependency.GSON, Dependency.SLF4J_API, Dependency.SLF4J_SIMPLE, - Dependency.ADVENTURE_API, Dependency.COMMAND_API, - Dependency.NBT_API, Dependency.BOOSTED_YAML, - Dependency.BIOME_API, - Dependency.ANTI_GRIEF, Dependency.BSTATS_BASE, Dependency.BSTATS_BUKKIT ) diff --git a/plugin/src/main/java/net/momirealms/customcrops/libraries/dependencies/Dependency.java b/plugin/src/main/java/net/momirealms/customcrops/libraries/dependencies/Dependency.java index 68cf961..1fc5796 100644 --- a/plugin/src/main/java/net/momirealms/customcrops/libraries/dependencies/Dependency.java +++ b/plugin/src/main/java/net/momirealms/customcrops/libraries/dependencies/Dependency.java @@ -77,16 +77,6 @@ public enum Dependency { "boosted-yaml", Relocation.of("boostedyaml", "dev{}dejvokep{}boostedyaml") ), - ADVENTURE_API( - "com.github.Xiao-MoMi", - "Adventure-Bundle", - "4.16.0", - "jitpack", - "adventure-bundle", - Relocation.of("adventure", "net{}kyori{}adventure"), - Relocation.of("option", "net{}kyori{}option"), - Relocation.of("examination", "net{}kyori{}examination") - ), H2_DRIVER( "com.h2database", "h2", @@ -115,30 +105,6 @@ public enum Dependency { null, "slf4j-api" ), - NBT_API( - "de{}tr7zw", - "item-nbt-api", - "2.12.4", - "codemc", - "item-nbt-api", - Relocation.of("changeme", "de{}tr7zw{}changeme") - ), - ANTI_GRIEF( - "com{}github{}Xiao-MoMi", - "AntiGriefLib", - "0.11", - "jitpack", - "antigrief-lib", - Relocation.of("antigrieflib", "net{}momirealms{}antigrieflib") - ), - BIOME_API( - "com{}github{}Xiao-MoMi", - "BiomeAPI", - "0.6", - "jitpack", - "biome-api", - Relocation.of("biomeapi", "net{}momirealms{}biomeapi") - ), BSTATS_BASE( "org{}bstats", "bstats-base",