9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-25 09:59:20 +00:00

fix(core): 修正错误的染色盔甲配置

This commit is contained in:
jhqwqmc
2025-09-05 17:36:01 +08:00
parent 64bfef7aa2
commit 4fd2455f9d
2 changed files with 5 additions and 4 deletions

View File

@@ -3671,11 +3671,12 @@ public final class CoreReflections {
// 1.20.5+
public static final Field field$ItemStack$CODEC = ReflectionUtils.getDeclaredField(clazz$ItemStack, "CODEC", "b");
public static final Codec<Object> instance$ItemStack$CODEC;
public static final Codec<Object> instance$ItemStack$CODEC = getItemStack$CODEC();
static {
@SuppressWarnings("unchecked")
private static Codec<Object> getItemStack$CODEC() {
try {
instance$ItemStack$CODEC = VersionHelper.isOrAbove1_20_5() ? (Codec<Object>) field$ItemStack$CODEC.get(null) : null;
return VersionHelper.isOrAbove1_20_5() ? (Codec<Object>) field$ItemStack$CODEC.get(null) : null;
} catch (ReflectiveOperationException e) {
throw new ReflectionInitException("Failed to init ItemStack$CODEC", e);
}

View File

@@ -131,7 +131,7 @@ public class ComponentBasedEquipment extends AbstractEquipment implements Suppli
return new DyeableData(ResourceConfigUtils.getAsInt(data.get("color-when-undyed"), "color-when-undyed"));
}
}
return new DyeableData(null);
return null;
}
@Override