aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/moe/nea/firmament/mixins/custommodels/PatchHeadFeatureRenderer.java
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-11-03 01:24:24 +0100
committerLinnea Gräf <nea@nea.moe>2024-11-03 01:24:24 +0100
commite2677d6ee5c3f74d5f547ca48bf6641f047a2a1e (patch)
treefecc0322e48a399df7697da11adfb022d5641a6c /src/main/java/moe/nea/firmament/mixins/custommodels/PatchHeadFeatureRenderer.java
parent646843ba3b960ac48f9866b3640438d3cc1dafc4 (diff)
downloadFirmament-e2677d6ee5c3f74d5f547ca48bf6641f047a2a1e.tar.gz
Firmament-e2677d6ee5c3f74d5f547ca48bf6641f047a2a1e.tar.bz2
Firmament-e2677d6ee5c3f74d5f547ca48bf6641f047a2a1e.zip
1.21.3 WIP
Diffstat (limited to 'src/main/java/moe/nea/firmament/mixins/custommodels/PatchHeadFeatureRenderer.java')
-rw-r--r--src/main/java/moe/nea/firmament/mixins/custommodels/PatchHeadFeatureRenderer.java45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/main/java/moe/nea/firmament/mixins/custommodels/PatchHeadFeatureRenderer.java b/src/main/java/moe/nea/firmament/mixins/custommodels/PatchHeadFeatureRenderer.java
deleted file mode 100644
index 610a106..0000000
--- a/src/main/java/moe/nea/firmament/mixins/custommodels/PatchHeadFeatureRenderer.java
+++ /dev/null
@@ -1,45 +0,0 @@
-
-package moe.nea.firmament.mixins.custommodels;
-
-import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
-import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
-import com.llamalad7.mixinextras.sugar.Local;
-import moe.nea.firmament.features.texturepack.BakedModelExtra;
-import net.minecraft.block.AbstractSkullBlock;
-import net.minecraft.block.Block;
-import net.minecraft.block.Blocks;
-import net.minecraft.client.render.entity.feature.HeadFeatureRenderer;
-import net.minecraft.client.render.entity.model.EntityModel;
-import net.minecraft.client.render.item.HeldItemRenderer;
-import net.minecraft.entity.LivingEntity;
-import net.minecraft.item.BlockItem;
-import net.minecraft.item.ItemStack;
-import org.spongepowered.asm.mixin.Final;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.Shadow;
-import org.spongepowered.asm.mixin.injection.At;
-
-@Mixin(HeadFeatureRenderer.class)
-public class PatchHeadFeatureRenderer<T extends LivingEntity, M extends EntityModel<T>> {
-
- @Shadow
- @Final
- private HeldItemRenderer heldItemRenderer;
-
- @WrapOperation(method = "render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;ILnet/minecraft/entity/LivingEntity;FFFFFF)V",
- at = @At(value = "INVOKE", target = "Lnet/minecraft/item/BlockItem;getBlock()Lnet/minecraft/block/Block;"))
- private Block replaceSkull(BlockItem instance, Operation<Block> original, @Local ItemStack itemStack, @Local(argsOnly = true) T entity) {
- var oldBlock = original.call(instance);
- if (oldBlock instanceof AbstractSkullBlock) {
- var bakedModel = this.heldItemRenderer.itemRenderer
- .getModel(itemStack, entity.getWorld(), entity, 0);
- if (bakedModel instanceof BakedModelExtra extra && extra.getHeadModel_firmament() != null)
- return Blocks.ENCHANTING_TABLE; // Any non skull block. Let's choose the enchanting table because it is very distinct.
- }
- return oldBlock;
- }
-
-
-
-
-}