From c82c051704424763c20742b616228cfe636b9f65 Mon Sep 17 00:00:00 2001 From: nea Date: Sat, 9 Sep 2023 04:50:29 +0200 Subject: Add custom textures to placed skulls --- .../mixins/MixinSkullBlockEntityRenderer.java | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/main/java/moe/nea/firmament/mixins/MixinSkullBlockEntityRenderer.java (limited to 'src/main/java/moe') diff --git a/src/main/java/moe/nea/firmament/mixins/MixinSkullBlockEntityRenderer.java b/src/main/java/moe/nea/firmament/mixins/MixinSkullBlockEntityRenderer.java new file mode 100644 index 0000000..7f54150 --- /dev/null +++ b/src/main/java/moe/nea/firmament/mixins/MixinSkullBlockEntityRenderer.java @@ -0,0 +1,25 @@ +/* + * SPDX-FileCopyrightText: 2023 Linnea Gräf + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +package moe.nea.firmament.mixins; + +import com.mojang.authlib.GameProfile; +import moe.nea.firmament.features.texturepack.CustomSkyBlockTextures; +import net.minecraft.block.SkullBlock; +import net.minecraft.client.render.RenderLayer; +import net.minecraft.client.render.block.entity.SkullBlockEntityRenderer; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(SkullBlockEntityRenderer.class) +public class MixinSkullBlockEntityRenderer { + @Inject(method = "getRenderLayer", at = @At("HEAD"), cancellable = true) + private static void onGetRenderLayer(SkullBlock.SkullType type, GameProfile profile, CallbackInfoReturnable cir) { + CustomSkyBlockTextures.INSTANCE.modifySkullTexture(type, profile, cir); + } +} -- cgit