aboutsummaryrefslogtreecommitdiff
path: root/defaults/src/main/java/shcm/shsupercm/fabric
diff options
context:
space:
mode:
authorSHsuperCM <shsupercm@gmail.com>2022-03-25 11:07:59 +0300
committerSHsuperCM <shsupercm@gmail.com>2022-03-25 11:07:59 +0300
commit162f9b7cf8ae24c950673a32e695e59e4e807f39 (patch)
treea57618720226faba4a3d85eda5958e26436d8da0 /defaults/src/main/java/shcm/shsupercm/fabric
parentd03a3dfe8971611c2601fc989334c9f2ce5ea613 (diff)
downloadCITResewn-162f9b7cf8ae24c950673a32e695e59e4e807f39.tar.gz
CITResewn-162f9b7cf8ae24c950673a32e695e59e4e807f39.tar.bz2
CITResewn-162f9b7cf8ae24c950673a32e695e59e4e807f39.zip
Fixed cape elytra texture replacing CIT elytra
Fixes #121
Diffstat (limited to 'defaults/src/main/java/shcm/shsupercm/fabric')
-rw-r--r--defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/types/elytra/ElytraFeatureRendererMixin.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/types/elytra/ElytraFeatureRendererMixin.java b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/types/elytra/ElytraFeatureRendererMixin.java
index 0772adf..efde76f 100644
--- a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/types/elytra/ElytraFeatureRendererMixin.java
+++ b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/mixin/types/elytra/ElytraFeatureRendererMixin.java
@@ -8,12 +8,10 @@ import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.util.Identifier;
-import org.spongepowered.asm.mixin.Final;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.Mutable;
-import org.spongepowered.asm.mixin.Shadow;
+import org.spongepowered.asm.mixin.*;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
+import org.spongepowered.asm.mixin.injection.ModifyVariable;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import shcm.shsupercm.fabric.citresewn.cit.CIT;
import shcm.shsupercm.fabric.citresewn.cit.CITContext;
@@ -39,4 +37,12 @@ public class ElytraFeatureRendererMixin {
CIT<TypeElytra> cit = CONTAINER.getCIT(new CITContext(equippedStack, livingEntity.getWorld(), livingEntity));
SKIN = cit == null ? citresewn$ORIGINAL_SKIN : cit.type.texture;
}
+
+ /**
+ * Fix cape elytra skin replacing cit elytra.
+ */
+ @ModifyVariable(method = "render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;ILnet/minecraft/entity/LivingEntity;FFFFFF)V", at = @At(value = "STORE"))
+ public Identifier citresewn$overrideCapeElytra(Identifier used) {
+ return SKIN != citresewn$ORIGINAL_SKIN && SKIN != used ? SKIN : used;
+ }
} \ No newline at end of file