9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-21 07:49:18 +00:00

apply pwt; fix compilation issues

This commit is contained in:
NONPLAYT
2025-04-26 00:54:56 +03:00
parent f3de39d91d
commit bcb0ff5e8d
6 changed files with 210 additions and 552 deletions

View File

@@ -45,7 +45,7 @@ public final class GeneralUtils {
for (StructureTemplate.JigsawBlockInfo structureBlockInfo : list) {
int key = 0;
if (structureBlockInfo.info().nbt() != null) {
key = getIntMicroOptimised(structureBlockInfo.info().nbt(), "selection_priority");
key = structureBlockInfo.info().nbt().getIntOr("selection_priority", 0);
}
buckets.computeIfAbsent(key, k -> new ArrayList<>()).add(structureBlockInfo);
@@ -73,12 +73,8 @@ public final class GeneralUtils {
}
}
public static int getIntMicroOptimised(@NotNull CompoundTag tag, String key) {
return tag.get(key) instanceof NumericTag numericTag ? numericTag.getAsInt() : 0;
}
public static @NotNull String getStringMicroOptimised(@NotNull CompoundTag tag, String key) {
return tag.get(key) instanceof StringTag stringTag ? stringTag.getAsString() : "";
return tag.get(key) instanceof StringTag stringTag ? stringTag.value() : "";
}
public static <T> void copyAll(@NotNull List<T> src, List<T> dest) {