mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-30 16:28:00 +01:00
Fix model offsets when scaled
This commit is contained in:
parent
6ffe1f5e58
commit
3b6ad3d094
3 changed files with 2 additions and 6 deletions
|
@ -128,8 +128,6 @@ public class ItemTraitsTooltipRenderer implements Text, OrderedText, TooltipComp
|
||||||
String count = value > 99 ? "99+" : Math.round(value) == value ? (int)value + "" : ((Math.round(value * 10) / 10F) + "");
|
String count = value > 99 ? "99+" : Math.round(value) == value ? (int)value + "" : ((Math.round(value * 10) / 10F) + "");
|
||||||
|
|
||||||
VertexConsumerProvider.Immediate immediate = MinecraftClient.getInstance().getBufferBuilders().getEffectVertexConsumers();
|
VertexConsumerProvider.Immediate immediate = MinecraftClient.getInstance().getBufferBuilders().getEffectVertexConsumers();
|
||||||
// TODO: Before 1.21 was using tessellator's buffer but we can't get it without calling begin()
|
|
||||||
//VertexConsumerProvider.immediate(Tessellator.getInstance().getBuffer());
|
|
||||||
textRenderer.draw(count, 0, 0, 16777215, true, matrices.peek().getPositionMatrix(), immediate, TextLayerType.SEE_THROUGH, 0, 15728880);
|
textRenderer.draw(count, 0, 0, 16777215, true, matrices.peek().getPositionMatrix(), immediate, TextLayerType.SEE_THROUGH, 0, 15728880);
|
||||||
immediate.draw();
|
immediate.draw();
|
||||||
matrices.pop();
|
matrices.pop();
|
||||||
|
|
|
@ -43,8 +43,7 @@ public class FriendlyCreeperEntityRenderer extends MobEntityRenderer<FriendlyCre
|
||||||
protected void setupTransforms(FriendlyCreeperEntity entity, MatrixStack matrices, float animationProgress, float bodyYaw, float tickDelta, float scale) {
|
protected void setupTransforms(FriendlyCreeperEntity entity, MatrixStack matrices, float animationProgress, float bodyYaw, float tickDelta, float scale) {
|
||||||
super.setupTransforms(entity, matrices, animationProgress, bodyYaw, tickDelta, scale);
|
super.setupTransforms(entity, matrices, animationProgress, bodyYaw, tickDelta, scale);
|
||||||
if (entity.isSitting()) {
|
if (entity.isSitting()) {
|
||||||
// TODO: Check if creepers are offset correctly
|
matrices.translate(0, -0.25, 0);
|
||||||
matrices.translate(0, -0.25 * scale, 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,8 +42,7 @@ public class SpellbookEntityRenderer extends LivingEntityRenderer<SpellbookEntit
|
||||||
super.setupTransforms(entity, matrices, animationProgress, bodyYaw + 90, tickDelta, scale);
|
super.setupTransforms(entity, matrices, animationProgress, bodyYaw + 90, tickDelta, scale);
|
||||||
|
|
||||||
if (entity.isOpen()) {
|
if (entity.isOpen()) {
|
||||||
// TODO: Check that this is correct for extreme scales
|
matrices.translate(-1.25F, -0.35F, 0);
|
||||||
matrices.translate(-1.25F * scale, -0.35F * scale, 0);
|
|
||||||
|
|
||||||
float floatPosition = MathHelper.sin((animationProgress + entity.getId()) / 20) * 0.04F;
|
float floatPosition = MathHelper.sin((animationProgress + entity.getId()) / 20) * 0.04F;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue