9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-28 03:19:15 +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.CompoundTag;
import com.flowpowered.nbt.Tag;
import com.flowpowered.nbt.stream.NBTInputStream;
import net.momirealms.customcrops.api.core.SynchronizedCompoundMap;
import net.momirealms.customcrops.api.core.block.CustomCropsBlock;
import net.momirealms.customcrops.api.util.TagUtils;
@@ -85,6 +86,7 @@ public class CustomCropsBlockStateImpl implements CustomCropsBlockState {
return compoundMap.equals(that.compoundMap);
}
// Due to the defects of flownbt itself, hash efficiency is very low
@Override
public int hashCode() {
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) {
CompoundMap clone = new CompoundMap();
for (Tag<?> tag : initial) {