Skip to content

Commit

Permalink
Stairs are now correctly orientated
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksilassila committed Oct 6, 2020
1 parent cbbea9c commit 9a54793
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import net.minecraft.entity.MovementType;
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemStack;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.minecraft.state.property.BooleanProperty;
import net.minecraft.state.property.DirectionProperty;
import net.minecraft.state.property.Property;
Expand Down Expand Up @@ -109,7 +110,7 @@ private boolean tryToPlaceBlock(BlockPos pos) {

Vec3d posVec = Vec3d.ofCenter(pos);

Direction schDir = getBlockDirection(state);
Direction facing = getBlockDirection(state);
int half = getBlockHalf(state);

for(Direction side : Direction.values()) {
Expand All @@ -129,6 +130,14 @@ private boolean tryToPlaceBlock(BlockPos pos) {
hitVec = hitVec.add(0, -0.25, 0);
}

if (facing != null) {
float yaw = dir.asRotation();
float pitch = client.player.pitch;

client.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookOnly(
yaw, pitch, client.player.isOnGround()));
}

((IClientPlayerInteractionManager) client.interactionManager).rightClickBlock(neighbor,
side.getOpposite(), hitVec);

Expand Down

0 comments on commit 9a54793

Please sign in to comment.