Skip to content

Commit

Permalink
Pass float as arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Edivad99 committed Sep 25, 2023
1 parent c81293c commit 0028574
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ public void render(
var signalAspect = blockEntity.getPrimarySignalAspect().getDisplayAspect();
poseStack.pushPose();
{
poseStack.translate(0.0D, 0.19D, 0.0D);
poseStack.translate(0, 0.19F, 0);
this.renderSignalAspect(
poseStack, bufferSource, packedLight, packedOverlay, signalAspect, direction);
}
poseStack.popPose();

poseStack.pushPose();
{
poseStack.translate(0.0D, -0.19D, 0.0D);
poseStack.translate(0, -0.19F, 0);
signalAspect = blockEntity.getSecondarySignalAspect().getDisplayAspect();
this.renderSignalAspect(
poseStack, bufferSource, packedLight, packedOverlay, signalAspect, direction);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void render(RitualBlockEntity blockEntity, float partialTick, PoseStack p
MultiBufferSource bufferSource, int packedLight, int packedOverlay) {
poseStack.pushPose();
var yOffset = blockEntity.getYOffset(partialTick);
poseStack.translate(0.5, 0.95 + yOffset, 0.5);
poseStack.translate(0.5F, 0.95F + yOffset, 0.5F);

var yaw = blockEntity.getRotationYaw(partialTick);
poseStack.mulPose(Axis.YP.rotation(yaw));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void renderBody(T cart, float partialTicks, PoseStack poseStack,
var displayOffset = cart.getDisplayOffset();
var scale = 0.75F;
poseStack.scale(scale, scale, scale);
poseStack.translate(-0.5D, (displayOffset - 8.0F) / 16.0F, -0.5D);
poseStack.translate(-0.5F, (displayOffset - 8.0F) / 16.0F, -0.5F);

this.renderContents(cart, partialTicks, poseStack, renderTypeBuffer, packedLight, red, green,
blue, alpha);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void render(T cart, float yaw, float partialTicks,
if (cart instanceof Directional directional) {
directional.setRenderYaw(yaw);
}
poseStack.translate(0.0D, 0.375D, 0.0D);
poseStack.translate(0, 0.375F, 0);

if (cart.hasCustomName() && !Seasons.GHOST_TRAIN.equals(cart.getCustomName().getString())
&& !Seasons.POLAR_EXPRESS.equals(cart.getCustomName().getString())) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/mods/railcraft/client/util/RenderUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static void renderBlockHoverText(BlockPos blockPos, Component text,
&& ((BlockHitResult) minecraft.hitResult).getBlockPos().equals(blockPos)) {
poseStack.pushPose();
{
poseStack.translate(0.5D, 1.5D, 0.5D);
poseStack.translate(0.5F, 1.5F, 0.5F);
renderWorldText(minecraft.font, text, poseStack, bufferSource, packedLight);
}
poseStack.popPose();
Expand Down

0 comments on commit 0028574

Please sign in to comment.