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

修复定向附着方块行为判断存活方向反了

This commit is contained in:
jhqwqmc
2025-10-27 06:25:54 +08:00
parent ac01a98142
commit 2e74b1e982

View File

@@ -75,11 +75,11 @@ public class DirectionalAttachedBlockBehavior extends BukkitBlockBehavior {
if (behavior == null) return false;
Direction direction;
if (isSixDirection) {
direction = ((Direction) state.get(behavior.facingProperty)).opposite();
direction = (Direction) state.get(behavior.facingProperty);
} else {
direction = ((HorizontalDirection) state.get(behavior.facingProperty)).opposite().toDirection();
direction = ((HorizontalDirection) state.get(behavior.facingProperty)).toDirection();
}
BlockPos blockPos = LocationUtils.fromBlockPos(args[2]).relative(direction);
BlockPos blockPos = LocationUtils.fromBlockPos(args[2]).relative(direction.opposite());
Object nmsPos = LocationUtils.toBlockPos(blockPos);
Object nmsState = FastNMS.INSTANCE.method$BlockGetter$getBlockState(args[1], nmsPos);
return FastNMS.INSTANCE.method$BlockStateBase$isFaceSturdy(nmsState, args[1], nmsPos, DirectionUtils.toNMSDirection(direction), CoreReflections.instance$SupportType$FULL)