mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-25 01:49:30 +00:00
fix facing mirror
This commit is contained in:
@@ -61,14 +61,14 @@ public class BukkitBlockBehavior extends AbstractBlockBehavior {
|
||||
}
|
||||
});
|
||||
HARD_CODED_PROPERTY_DATA.put("facing_clockwise", (behavior, property) -> {
|
||||
if (property.valueClass() == Direction.class) {
|
||||
if (property.valueClass() == HorizontalDirection.class) {
|
||||
@SuppressWarnings("unchecked")
|
||||
Property<Direction> directionProperty = (Property<Direction>) property;
|
||||
Property<HorizontalDirection> directionProperty = (Property<HorizontalDirection>) property;
|
||||
behavior.rotateFunction = (thisBlock, blockState, rotation) ->
|
||||
blockState.with(directionProperty, rotation.rotate(blockState.get(directionProperty)))
|
||||
blockState.with(directionProperty, rotation.rotate(blockState.get(directionProperty).toDirection()).toHorizontalDirection())
|
||||
.customBlockState().handle();
|
||||
behavior.mirrorFunction = (thisBlock, blockState, mirror) -> {
|
||||
Rotation rotation = mirror.getRotation(blockState.get(directionProperty));
|
||||
Rotation rotation = mirror.getRotation(blockState.get(directionProperty).toDirection());
|
||||
return behavior.rotateFunction.rotate(thisBlock, blockState, rotation);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6038,4 +6038,16 @@ public class Reflections {
|
||||
clazz$BlockBehaviour, clazz$BlockState, clazz$BlockState, clazz$Mirror
|
||||
)
|
||||
);
|
||||
|
||||
public static final Method method$BlockStateBase$rotate = requireNonNull(
|
||||
ReflectionUtils.getMethod(
|
||||
clazz$BlockStateBase, clazz$BlockState, clazz$Rotation
|
||||
)
|
||||
);
|
||||
|
||||
public static final Method method$BlockStateBase$mirror = requireNonNull(
|
||||
ReflectionUtils.getMethod(
|
||||
clazz$BlockStateBase, clazz$BlockState, clazz$Mirror
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user