aboutsummaryrefslogtreecommitdiff
path: root/src/compat/wildfireGender/java
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-10-26 18:37:15 +0200
committerLinnea Gräf <nea@nea.moe>2024-10-26 18:37:15 +0200
commit928f6a45017df8aeb467e6879b350ade89c73d9a (patch)
tree3577f376246315c7805a85cc189c5da73bdaf3f6 /src/compat/wildfireGender/java
parent4308a09f8929da42cab420d7254c0981d74bd651 (diff)
downloadFirmament-928f6a45017df8aeb467e6879b350ade89c73d9a.tar.gz
Firmament-928f6a45017df8aeb467e6879b350ade89c73d9a.tar.bz2
Firmament-928f6a45017df8aeb467e6879b350ade89c73d9a.zip
Isolate Wildfire Female Gender Mod Support
[no changelog]
Diffstat (limited to 'src/compat/wildfireGender/java')
-rw-r--r--src/compat/wildfireGender/java/moe/nea/firmament/mixins/compat/wildfiregender/PatchArmorTexturesInGenderMod.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/compat/wildfireGender/java/moe/nea/firmament/mixins/compat/wildfiregender/PatchArmorTexturesInGenderMod.java b/src/compat/wildfireGender/java/moe/nea/firmament/mixins/compat/wildfiregender/PatchArmorTexturesInGenderMod.java
new file mode 100644
index 0000000..723af59
--- /dev/null
+++ b/src/compat/wildfireGender/java/moe/nea/firmament/mixins/compat/wildfiregender/PatchArmorTexturesInGenderMod.java
@@ -0,0 +1,37 @@
+package moe.nea.firmament.mixins.compat.wildfiregender;
+
+import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
+import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
+import com.llamalad7.mixinextras.sugar.Local;
+import com.wildfire.render.GenderArmorLayer;
+import moe.nea.firmament.features.texturepack.CustomGlobalArmorOverrides;
+import net.minecraft.item.ArmorItem;
+import net.minecraft.item.ArmorMaterial;
+import net.minecraft.item.ItemStack;
+import net.minecraft.registry.entry.RegistryEntry;
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.Pseudo;
+import org.spongepowered.asm.mixin.injection.At;
+
+@Mixin(GenderArmorLayer.class)
+@Pseudo
+public class PatchArmorTexturesInGenderMod {
+ @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/ArmorItem;getMaterial()Lnet/minecraft/registry/entry/RegistryEntry;"))
+ private RegistryEntry<ArmorMaterial> replaceArmorMaterial(ArmorItem instance, Operation<RegistryEntry<ArmorMaterial>> original, @Local ItemStack chestplate) {
+ var entry = original.call(instance);
+ var overrides = CustomGlobalArmorOverrides.overrideArmor(chestplate);
+ if (overrides == null)
+ return entry;
+ var material = entry.value();
+ return RegistryEntry.of(new ArmorMaterial(
+ material.defense(),
+ material.enchantability(),
+ material.equipSound(),
+ material.repairIngredient(),
+ overrides,
+ material.toughness(),
+ material.knockbackResistance()
+ ));
+ }
+}