Fix client-side init code (checked for thread groups instead of dist).

More sky compass fixes.
This commit is contained in:
Sebastian Hartte
2020-06-03 18:49:22 +02:00
parent 64651feb3c
commit 6eb2a9504a
7 changed files with 64 additions and 52 deletions
@@ -19,6 +19,7 @@
package appeng.client.render.tesr;
import appeng.client.render.FacingToRotation;
import appeng.client.render.model.SkyCompassModel;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
@@ -69,27 +70,26 @@ public class SkyCompassTESR extends TileEntityRenderer<TileSkyCompass>
BlockState blockState = te.getBlockState();
IBakedModel model = blockRenderer.getBlockModelShapes().getModel( blockState );
// FIXME: Rotation was previously handled by an auto rotating model I think, but
// FIXME: Should be handled using matrices instead
Direction forward = te.getForward();
Direction up = te.getUp();
// This ensures the needle isn't flipped by the model rotator. Since the model is symmetrical, this should
// not affect the appearance
if( forward == Direction.UP || forward == Direction.DOWN )
{
up = Direction.NORTH;
}
// Flip forward/up for rendering, the base model is facing up without any rotation
ms.push();
ms.translate(0.5D, 0.5D, 0.5D);
FacingToRotation.get(up, forward).push(ms);
ms.translate(-0.5D, -0.5D, -0.5D);
ModelDataMap modelData = new ModelDataMap.Builder()
.withInitial(SkyCompassBakedModel.ROTATION, getRotation(te))
.build();
ms.push();
// FIXME: Rotation was previously handled by an auto rotating model I think, but
// FIXME: Should be handled using matrices instead
// // Flip forward/up for rendering, the base model is facing up without any rotation
// Direction forward = exState.getValue( AEBaseTileBlock.FORWARD );
// Direction up = exState.getValue( AEBaseTileBlock.UP );
// // This ensures the needle isn't flipped by the model rotator. Since the model is symmetrical, this should
// // not affect the appearance
// if( forward == Direction.UP || forward == Direction.DOWN )
// {
// up = Direction.NORTH;
// }
// exState = exState.with( AEBaseTileBlock.FORWARD, up )
// .with( AEBaseTileBlock.UP, forward );
//
// buffer.setTranslation( x - pos.getX(), y - pos.getY(), z - pos.getZ() );
blockRenderer.getBlockModelRenderer().renderModel( ms.getLast(), buffer, null, model, 1, 1, 1, combinedLightIn, combinedOverlayIn, modelData );
ms.pop();