Update rendering

This commit is contained in:
Colman Davenport 2020-10-13 00:10:23 -04:00
parent b89710237d
commit 677363f1b8
2 changed files with 3 additions and 5 deletions

View file

@ -41,8 +41,7 @@ public class SawMovementBehaviour extends BlockBreakingMovementBehaviour {
public void visitNewPosition(MovementContext context, BlockPos pos) { public void visitNewPosition(MovementContext context, BlockPos pos) {
super.visitNewPosition(context, pos); super.visitNewPosition(context, pos);
Vec3d facingVec = new Vec3d(context.state.get(SawBlock.FACING).getDirectionVec()); Vec3d facingVec = new Vec3d(context.state.get(SawBlock.FACING).getDirectionVec());
facingVec = VecHelper.rotate(facingVec, context.rotation.x, context.rotation.y, context.rotation.z); facingVec = context.rotation.apply(facingVec);
facingVec.normalize();
Direction closestToFacing = Direction.getFacingFromVector(facingVec.x, facingVec.y, facingVec.z); Direction closestToFacing = Direction.getFacingFromVector(facingVec.x, facingVec.y, facingVec.z);
if(closestToFacing.getAxis().isVertical() && context.data.contains("BreakingPos")) { if(closestToFacing.getAxis().isVertical() && context.data.contains("BreakingPos")) {

View file

@ -70,7 +70,7 @@ public class SawRenderer extends SafeTileEntityRenderer<SawTileEntity> {
if(!blockState.get(SawBlock.AXIS_ALONG_FIRST_COORDINATE)) if(!blockState.get(SawBlock.AXIS_ALONG_FIRST_COORDINATE))
MatrixStacker.of(ms).centre().rotateY(90).unCentre(); MatrixStacker.of(ms).centre().rotateY(90).unCentre();
} }
superBuffer = partial.renderOnDirectional(blockState); superBuffer = partial.renderOnDirectionalSouth(blockState);
superBuffer.light(light).renderInto(ms, buffer.getBuffer(RenderType.getCutoutMipped())); superBuffer.light(light).renderInto(ms, buffer.getBuffer(RenderType.getCutoutMipped()));
ms.pop(); ms.pop();
@ -141,8 +141,7 @@ public class SawRenderer extends SafeTileEntityRenderer<SawTileEntity> {
Direction facing = state.get(SawBlock.FACING); Direction facing = state.get(SawBlock.FACING);
Vec3d facingVec = new Vec3d(context.state.get(SawBlock.FACING).getDirectionVec()); Vec3d facingVec = new Vec3d(context.state.get(SawBlock.FACING).getDirectionVec());
facingVec = VecHelper.rotate(facingVec, context.rotation.x, context.rotation.y, context.rotation.z); facingVec = context.rotation.apply(facingVec);
facingVec.normalize();
Direction closestToFacing = Direction.getFacingFromVector(facingVec.x, facingVec.y, facingVec.z); Direction closestToFacing = Direction.getFacingFromVector(facingVec.x, facingVec.y, facingVec.z);