9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-26 02:19:23 +00:00

Merge pull request #361 from jhqwqmc/dev

fix(core): 修正放置家具函数默认值
This commit is contained in:
XiaoMoMi
2025-09-06 02:09:01 +08:00
committed by GitHub
3 changed files with 7 additions and 6 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

View File

@@ -88,8 +88,8 @@ public class SpawnFurnitureFunction<CTX extends Context> extends AbstractConditi
NumberProvider x = NumberProviders.fromObject(arguments.getOrDefault("x", "<arg:position.x>"));
NumberProvider y = NumberProviders.fromObject(arguments.getOrDefault("y", "<arg:position.y>"));
NumberProvider z = NumberProviders.fromObject(arguments.getOrDefault("z", "<arg:position.z>"));
NumberProvider pitch = NumberProviders.fromObject(arguments.getOrDefault("pitch", "<arg:pitch>"));
NumberProvider yaw = NumberProviders.fromObject(arguments.getOrDefault("yaw", "<arg:yaw>"));
NumberProvider pitch = NumberProviders.fromObject(arguments.getOrDefault("pitch", "<arg:position.pitch>"));
NumberProvider yaw = NumberProviders.fromObject(arguments.getOrDefault("yaw", "<arg:position.yaw>"));
AnchorType anchorType = ResourceConfigUtils.getAsEnum(arguments.get("anchor-type"), AnchorType.class, null);
boolean playSound = ResourceConfigUtils.getAsBoolean(arguments.getOrDefault("play-sound", true), "play-sound");
return new SpawnFurnitureFunction<>(furnitureId, x, y, z, pitch, yaw, anchorType, playSound, getPredicates(arguments));