Fixed pony head textures

This commit is contained in:
Sollace 2024-12-15 19:26:23 +01:00
parent bb456f9e83
commit 1e843e56fd
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
2 changed files with 5 additions and 4 deletions

View file

@ -9,6 +9,7 @@ import net.minecraft.client.render.block.entity.SkullBlockEntityModel;
import net.minecraft.client.render.block.entity.SkullBlockEntityRenderer; import net.minecraft.client.render.block.entity.SkullBlockEntityRenderer;
import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.component.type.ProfileComponent; import net.minecraft.component.type.ProfileComponent;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
@ -36,8 +37,8 @@ abstract class MixinSkullBlockEntityRenderer implements BlockEntityRenderer<Skul
} }
} }
@Inject(method = "getRenderLayer", at = @At("HEAD"), cancellable = true) @Inject(method = "getRenderLayer(Lnet/minecraft/block/SkullBlock$SkullType;Lnet/minecraft/component/type/ProfileComponent;Lnet/minecraft/util/Identifier;)Lnet/minecraft/client/render/RenderLayer;", at = @At("HEAD"), cancellable = true)
private static void onGetRenderLayer(SkullBlock.SkullType skullType, @Nullable ProfileComponent profile, CallbackInfoReturnable<RenderLayer> info) { private static void onGetRenderLayer(SkullBlock.SkullType skullType, @Nullable ProfileComponent profile, @Nullable Identifier texture, CallbackInfoReturnable<RenderLayer> info) {
if (!info.isCancelled()) { if (!info.isCancelled()) {
RenderLayer result = PonySkullRenderer.INSTANCE.getSkullRenderLayer(skullType, profile); RenderLayer result = PonySkullRenderer.INSTANCE.getSkullRenderLayer(skullType, profile);
if (result != null) { if (result != null) {

View file

@ -3,8 +3,7 @@ package com.minelittlepony.client.render.entity.state;
import net.minecraft.block.BedBlock; import net.minecraft.block.BedBlock;
import net.minecraft.client.render.entity.state.PlayerEntityRenderState; import net.minecraft.client.render.entity.state.PlayerEntityRenderState;
import net.minecraft.client.render.item.ItemRenderState; import net.minecraft.client.render.item.ItemRenderState;
import net.minecraft.entity.EntityPose; import net.minecraft.entity.*;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.mob.AbstractPiglinEntity; import net.minecraft.entity.mob.AbstractPiglinEntity;
import net.minecraft.entity.mob.ZombifiedPiglinEntity; import net.minecraft.entity.mob.ZombifiedPiglinEntity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
@ -46,6 +45,7 @@ public class PonyRenderState extends PlayerEntityRenderState implements PonyMode
public final ItemRenderState glintlessLeftHandItemState = new ItemRenderState(); public final ItemRenderState glintlessLeftHandItemState = new ItemRenderState();
public void updateState(LivingEntity entity, PonyModel<?> model, Pony pony, ModelAttributes.Mode mode) { public void updateState(LivingEntity entity, PonyModel<?> model, Pony pony, ModelAttributes.Mode mode) {
this.equippedHeadStack = entity.getEquippedStack(EquipmentSlot.HEAD);
this.pony = pony; this.pony = pony;
attributes.updateLivingState(entity, pony, mode); attributes.updateLivingState(entity, pony, mode);
attributes.checkRainboom(entity, model, age); attributes.checkRainboom(entity, model, age);