9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2026-01-04 15:41:46 +00:00
This commit is contained in:
XiaoMoMi
2024-11-25 15:27:30 +08:00
parent 99b1b0a6a3
commit d60c1d266f
6 changed files with 13 additions and 9 deletions

View File

@@ -20,6 +20,7 @@ package net.momirealms.customcrops.api.core.world;
import com.flowpowered.nbt.CompoundMap; import com.flowpowered.nbt.CompoundMap;
import com.flowpowered.nbt.CompoundTag; import com.flowpowered.nbt.CompoundTag;
import com.flowpowered.nbt.Tag; import com.flowpowered.nbt.Tag;
import com.flowpowered.nbt.stream.NBTInputStream;
import net.momirealms.customcrops.api.core.SynchronizedCompoundMap; import net.momirealms.customcrops.api.core.SynchronizedCompoundMap;
import net.momirealms.customcrops.api.core.block.CustomCropsBlock; import net.momirealms.customcrops.api.core.block.CustomCropsBlock;
import net.momirealms.customcrops.api.util.TagUtils; import net.momirealms.customcrops.api.util.TagUtils;
@@ -85,6 +86,7 @@ public class CustomCropsBlockStateImpl implements CustomCropsBlockState {
return compoundMap.equals(that.compoundMap); return compoundMap.equals(that.compoundMap);
} }
// Due to the defects of flownbt itself, hash efficiency is very low
@Override @Override
public int hashCode() { public int hashCode() {
Tag<?> id = compoundMap.get("id"); Tag<?> id = compoundMap.get("id");

View File

@@ -59,6 +59,8 @@ public class TagUtils {
} }
} }
// There is a problem with this method, which comes from flownbt itself
// This method cannot perform a deep copy of a compound nested in a list.
public static CompoundMap deepClone(CompoundMap initial) { public static CompoundMap deepClone(CompoundMap initial) {
CompoundMap clone = new CompoundMap(); CompoundMap clone = new CompoundMap();
for (Tag<?> tag : initial) { for (Tag<?> tag : initial) {

View File

@@ -8,12 +8,12 @@ dependencies {
compileOnly(project(":api")) compileOnly(project(":api"))
compileOnly(project(":common")) compileOnly(project(":common"))
compileOnly("io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT") compileOnly("io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT")
compileOnly("com.nexomc:nexo:0.1.0-dev.0") compileOnly("com.nexomc:nexo:0.1.0-dev.6")
} }
tasks.withType<JavaCompile> { tasks.withType<JavaCompile> {
options.encoding = "UTF-8" options.encoding = "UTF-8"
options.release.set(17) options.release.set(21)
} }
java { java {

View File

@@ -1,6 +1,6 @@
# Project settings # Project settings
# Rule: [major update].[feature update].[bug fix] # Rule: [major update].[feature update].[bug fix]
project_version=3.6.21 project_version=3.6.22
config_version=42 config_version=42
project_group=net.momirealms project_group=net.momirealms

View File

@@ -22,11 +22,6 @@ dependencies {
} }
implementation(project(":common")) implementation(project(":common"))
implementation(project(":compatibility")) implementation(project(":compatibility"))
implementation(project(":compatibility-oraxen-r1"))
implementation(project(":compatibility-oraxen-r2"))
implementation(project(":compatibility-nexo-r1"))
implementation(project(":compatibility-itemsadder-r1"))
implementation(project(":compatibility-crucible-r1"))
implementation(project(":compatibility-asp-r1")) implementation(project(":compatibility-asp-r1"))
implementation("net.kyori:adventure-api:${rootProject.properties["adventure_bundle_version"]}") implementation("net.kyori:adventure-api:${rootProject.properties["adventure_bundle_version"]}")
@@ -51,6 +46,11 @@ dependencies {
tasks { tasks {
shadowJar { shadowJar {
from(project(":compatibility-nexo-r1").tasks.jar.get().archiveFile)
from(project(":compatibility-oraxen-r1").tasks.jar.get().archiveFile)
from(project(":compatibility-oraxen-r2").tasks.jar.get().archiveFile)
from(project(":compatibility-itemsadder-r1").tasks.jar.get().archiveFile)
from(project(":compatibility-crucible-r1").tasks.jar.get().archiveFile)
archiveFileName = "CustomCrops-${rootProject.properties["project_version"]}.jar" archiveFileName = "CustomCrops-${rootProject.properties["project_version"]}.jar"
destinationDirectory.set(file("$rootDir/target")) destinationDirectory.set(file("$rootDir/target"))
relocate("net.kyori", "net.momirealms.customcrops.libraries") relocate("net.kyori", "net.momirealms.customcrops.libraries")

View File

@@ -8,4 +8,4 @@ include(":compatibility-oraxen-r1")
include(":compatibility-oraxen-r2") include(":compatibility-oraxen-r2")
include(":compatibility-nexo-r1") include(":compatibility-nexo-r1")
include(":compatibility-itemsadder-r1") include(":compatibility-itemsadder-r1")
include(":compatibility-crucible-r1") include(":compatibility-crucible-r1")