-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
322c7f8
commit 901de89
Showing
10 changed files
with
65 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
winterly-common/src/main/java/ru/pinkgoosik/winterly/client/render/HatAndScarfRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package ru.pinkgoosik.winterly.client.render; | ||
|
||
import com.mojang.blaze3d.vertex.PoseStack; | ||
import com.mojang.blaze3d.vertex.VertexConsumer; | ||
import net.minecraft.client.model.HumanoidModel; | ||
import net.minecraft.client.renderer.MultiBufferSource; | ||
import net.minecraft.client.renderer.RenderType; | ||
import net.minecraft.client.renderer.texture.OverlayTexture; | ||
import net.minecraft.world.entity.LivingEntity; | ||
import ru.pinkgoosik.winterly.Winterly; | ||
import ru.pinkgoosik.winterly.client.model.WinterlyModels; | ||
|
||
public class HatAndScarfRenderer extends MobDecorationRenderer { | ||
public final String scarf; | ||
public final String hat; | ||
|
||
public HatAndScarfRenderer(String scarf, String hat) { | ||
this.scarf = scarf; | ||
this.hat = hat; | ||
} | ||
|
||
@Override | ||
public void render(HumanoidModel<?> contextModel, PoseStack matrices, MultiBufferSource vertexConsumers, int light, LivingEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) { | ||
WinterlyModels.SCARF_MODEL.scarf.copyFrom(contextModel.body); | ||
VertexConsumer vertexConsumerScarf = vertexConsumers.getBuffer(RenderType.entityCutout(Winterly.id("textures/entity/" + scarf + ".png"))); | ||
WinterlyModels.SCARF_MODEL.renderToBuffer(matrices, vertexConsumerScarf, light, OverlayTexture.NO_OVERLAY); | ||
|
||
WinterlyModels.SANTA_HAT_MODEL.hat.copyFrom(contextModel.head); | ||
VertexConsumer vertexConsumerHat = vertexConsumers.getBuffer(RenderType.entityCutout(Winterly.id("textures/entity/" + hat + ".png"))); | ||
WinterlyModels.SANTA_HAT_MODEL.renderToBuffer(matrices, vertexConsumerHat, light, OverlayTexture.NO_OVERLAY); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters