diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c6cfe5..4e561b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Rat's Mischief 2.0.1 - 1.19.2 ------------------------------------------------------ - Fixed a server crash caused by the MialeeMisc library +- Fixed Rat Master Armour slim arms not being slim ------------------------------------------------------ Rat's Mischief 2.0 - 1.19.2 diff --git a/build.gradle b/build.gradle index 5e63076..aaaf584 100644 --- a/build.gradle +++ b/build.gradle @@ -84,9 +84,6 @@ dependencies { // mialee misc modImplementation include("xyz.amymialee:mialeemisc:${project.mialeemisc_version}") - // elegant armor - modLocalImplementation("xyz.amymialee:elegantarmour:${project.elegantarmour_version}") { transitive = false } - // ok zoomer // runtimeOnly("com.github.EnnuiL:OkZoomer:1.19.2-SNAPSHOT") diff --git a/gradle.properties b/gradle.properties index 7117410..516d90e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,7 +25,7 @@ cca_version=5.0.2 carpet_version=1.19.1-1.4.83+v220727 geckolib_version=geckolib-quilt-1.19:3.1.41 mixin_extras_version=0.2.0-beta.4 -mialeemisc_version=1.0.38 +mialeemisc_version=1.0.39 pal_version = 1.6.0 requiem_version = 2.0.0-beta.16.stripped automatone_version = 0.9.0 diff --git a/src/main/java/ladysnake/ratsmischief/common/compat/CompatManager.java b/src/main/java/ladysnake/ratsmischief/common/compat/CompatManager.java deleted file mode 100644 index 0a316d1..0000000 --- a/src/main/java/ladysnake/ratsmischief/common/compat/CompatManager.java +++ /dev/null @@ -1,14 +0,0 @@ -package ladysnake.ratsmischief.common.compat; - -import net.minecraft.entity.EquipmentSlot; -import net.minecraft.entity.LivingEntity; -import org.quiltmc.loader.api.QuiltLoader; - -public class CompatManager { - public static boolean shouldRenderArmour(EquipmentSlot slot, LivingEntity livingEntity) { - if (QuiltLoader.isModLoaded("elegantarmour")) { - return ElegantArmourCompat.shouldRenderArmour(slot, livingEntity); - } - return true; - } -} diff --git a/src/main/java/ladysnake/ratsmischief/common/compat/ElegantArmourCompat.java b/src/main/java/ladysnake/ratsmischief/common/compat/ElegantArmourCompat.java deleted file mode 100644 index 3f0ee5c..0000000 --- a/src/main/java/ladysnake/ratsmischief/common/compat/ElegantArmourCompat.java +++ /dev/null @@ -1,14 +0,0 @@ -package ladysnake.ratsmischief.common.compat; - -import net.minecraft.entity.EquipmentSlot; -import net.minecraft.entity.LivingEntity; -import xyz.amymialee.elegantarmour.util.IEleganttable; - -public class ElegantArmourCompat { - public static boolean shouldRenderArmour(EquipmentSlot slot, LivingEntity livingEntity) { - if (livingEntity instanceof IEleganttable eleganttable) { - return !eleganttable.isElegantPartEnabled(slot); - } - return true; - } -} diff --git a/src/main/java/ladysnake/ratsmischief/common/util/EntityRendererWrapper.java b/src/main/java/ladysnake/ratsmischief/common/util/EntityRendererWrapper.java index 3929de8..1797f03 100644 --- a/src/main/java/ladysnake/ratsmischief/common/util/EntityRendererWrapper.java +++ b/src/main/java/ladysnake/ratsmischief/common/util/EntityRendererWrapper.java @@ -3,5 +3,5 @@ import net.minecraft.client.render.entity.EntityRendererFactory; public interface EntityRendererWrapper { - EntityRendererFactory.Context getContext(); + EntityRendererFactory.Context mischief$getContext(); } diff --git a/src/main/java/ladysnake/ratsmischief/common/util/PlayerEntityRendererWrapper.java b/src/main/java/ladysnake/ratsmischief/common/util/PlayerEntityRendererWrapper.java index 2ba92fd..af785f5 100644 --- a/src/main/java/ladysnake/ratsmischief/common/util/PlayerEntityRendererWrapper.java +++ b/src/main/java/ladysnake/ratsmischief/common/util/PlayerEntityRendererWrapper.java @@ -1,5 +1,5 @@ package ladysnake.ratsmischief.common.util; public interface PlayerEntityRendererWrapper { - boolean isSlim(); + boolean mischief$isSlim(); } diff --git a/src/main/java/ladysnake/ratsmischief/mixin/client/ArmorFeatureRendererMixin.java b/src/main/java/ladysnake/ratsmischief/mixin/client/ArmorFeatureRendererMixin.java index a89f45c..1193b58 100644 --- a/src/main/java/ladysnake/ratsmischief/mixin/client/ArmorFeatureRendererMixin.java +++ b/src/main/java/ladysnake/ratsmischief/mixin/client/ArmorFeatureRendererMixin.java @@ -7,7 +7,6 @@ import ladysnake.ratsmischief.common.item.RatMasterArmorItem; import ladysnake.ratsmischief.common.item.RatMasterCloakItem; import ladysnake.ratsmischief.common.item.RatMasterHoodItem; -import ladysnake.ratsmischief.common.item.RatMasterMaskItem; import ladysnake.ratsmischief.common.util.EntityRendererWrapper; import ladysnake.ratsmischief.common.util.PlayerEntityRendererWrapper; import net.minecraft.client.render.OverlayTexture; @@ -35,16 +34,11 @@ @Mixin(ArmorFeatureRenderer.class) public abstract class ArmorFeatureRendererMixin, A extends BipedEntityModel> extends FeatureRenderer { - @Unique - private static final Map ARMOR_TEXTURE_CACHE = Maps.newHashMap(); - @Unique - private static final Map SLIM_ARMOR_TEXTURE_CACHE = Maps.newHashMap(); - @Unique - private PlayerEntityModel leggingsModel; - @Unique - private PlayerEntityModel bodyModel; - @Unique - private boolean slim = false; + @Unique private static final Map ARMOR_TEXTURE_CACHE = Maps.newHashMap(); + @Unique private static final Map SLIM_ARMOR_TEXTURE_CACHE = Maps.newHashMap(); + @Unique private PlayerEntityModel leggingsModel; + @Unique private PlayerEntityModel bodyModel; + @Unique private boolean slim; public ArmorFeatureRendererMixin(FeatureRendererContext context) { super(context); @@ -54,10 +48,10 @@ public ArmorFeatureRendererMixin(FeatureRendererContext context) { private void mischief$init(FeatureRendererContext context, A leggingsModel, A bodyModel, CallbackInfo ci) { if (context instanceof EntityRendererWrapper wrapper) { if (context instanceof PlayerEntityRendererWrapper playerWrapper) { - this.slim = playerWrapper.isSlim(); + this.slim = playerWrapper.mischief$isSlim(); } - this.leggingsModel = new PlayerEntityModel<>(wrapper.getContext().getPart(RatsMischiefClient.RAT_MASTER_ARMOR_INNER_LAYER), false); - this.bodyModel = new PlayerEntityModel<>(wrapper.getContext().getPart(this.slim ? RatsMischiefClient.RAT_MASTER_ARMOR_OUTER_LAYER_SLIM : RatsMischiefClient.RAT_MASTER_ARMOR_OUTER_LAYER), this.slim); + this.leggingsModel = new PlayerEntityModel<>(wrapper.mischief$getContext().getPart(RatsMischiefClient.RAT_MASTER_ARMOR_INNER_LAYER), this.slim); + this.bodyModel = new PlayerEntityModel<>(wrapper.mischief$getContext().getPart(this.slim ? RatsMischiefClient.RAT_MASTER_ARMOR_OUTER_LAYER_SLIM : RatsMischiefClient.RAT_MASTER_ARMOR_OUTER_LAYER), this.slim); } } @@ -67,10 +61,6 @@ public ArmorFeatureRendererMixin(FeatureRendererContext context) { if (itemStack.getItem() instanceof RatMasterArmorItem) { this.renderRatArmor(matrices, vertexConsumers, entity, armorSlot, light); ci.cancel(); - return; - } - if (armorSlot == EquipmentSlot.HEAD && RatMasterMaskItem.isWearingMask(entity)) { - ci.cancel(); } } diff --git a/src/main/java/ladysnake/ratsmischief/mixin/client/EntityRendererMixin.java b/src/main/java/ladysnake/ratsmischief/mixin/client/EntityRendererMixin.java index 0107aa9..b07d7f1 100644 --- a/src/main/java/ladysnake/ratsmischief/mixin/client/EntityRendererMixin.java +++ b/src/main/java/ladysnake/ratsmischief/mixin/client/EntityRendererMixin.java @@ -33,7 +33,7 @@ public class EntityRendererMixin implements EntityRendererWrap } @Override - public EntityRendererFactory.Context getContext() { + public EntityRendererFactory.Context mischief$getContext() { return this.context; } } diff --git a/src/main/java/ladysnake/ratsmischief/mixin/client/PlayerEntityRendererMixin.java b/src/main/java/ladysnake/ratsmischief/mixin/client/PlayerEntityRendererMixin.java index 0ad1663..7df7846 100644 --- a/src/main/java/ladysnake/ratsmischief/mixin/client/PlayerEntityRendererMixin.java +++ b/src/main/java/ladysnake/ratsmischief/mixin/client/PlayerEntityRendererMixin.java @@ -22,7 +22,7 @@ @Mixin(PlayerEntityRenderer.class) public abstract class PlayerEntityRendererMixin extends LivingEntityRenderer> implements PlayerEntityRendererWrapper { @Unique - private boolean isSlim = false; + private boolean isSlim = true; public PlayerEntityRendererMixin(EntityRendererFactory.Context ctx, PlayerEntityModel model, float shadowRadius) { super(ctx, model, shadowRadius); @@ -36,7 +36,7 @@ public PlayerEntityRendererMixin(EntityRendererFactory.Context ctx, PlayerEntity } } - @Inject(method = "", at = @At("TAIL")) + @Inject(method = "", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/entity/PlayerEntityRenderer;addFeature(Lnet/minecraft/client/render/entity/feature/FeatureRenderer;)Z", ordinal = 0)) private void mischief$masterArmor(EntityRendererFactory.Context ctx, boolean slim, CallbackInfo ci) { this.isSlim = slim; } @@ -57,7 +57,7 @@ public PlayerEntityRendererMixin(EntityRendererFactory.Context ctx, PlayerEntity } @Override - public boolean isSlim() { + public boolean mischief$isSlim() { return this.isSlim; } } diff --git a/src/main/java/ladysnake/ratsmischief/mixin/compat/ElegantArmour$SlimArmorFeatureRendererMixin.java b/src/main/java/ladysnake/ratsmischief/mixin/compat/ElegantArmour$SlimArmorFeatureRendererMixin.java deleted file mode 100644 index 1b26878..0000000 --- a/src/main/java/ladysnake/ratsmischief/mixin/compat/ElegantArmour$SlimArmorFeatureRendererMixin.java +++ /dev/null @@ -1,29 +0,0 @@ -package ladysnake.ratsmischief.mixin.compat; - -import ladysnake.ratsmischief.common.item.RatMasterMaskItem; -import net.minecraft.client.render.VertexConsumerProvider; -import net.minecraft.client.render.entity.feature.FeatureRenderer; -import net.minecraft.client.render.entity.feature.FeatureRendererContext; -import net.minecraft.client.render.entity.model.BipedEntityModel; -import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.entity.EquipmentSlot; -import net.minecraft.entity.LivingEntity; -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.CallbackInfo; -import xyz.amymialee.elegantarmour.client.SlimArmorFeatureRenderer; - -@Mixin(SlimArmorFeatureRenderer.class) -public abstract class ElegantArmour$SlimArmorFeatureRendererMixin, A extends BipedEntityModel> extends FeatureRenderer { - public ElegantArmour$SlimArmorFeatureRendererMixin(FeatureRendererContext context) { - super(context); - } - - @Inject(method = "renderArmor", at = @At("HEAD"), cancellable = true) - private void amarite$hideHelmet(MatrixStack matrices, VertexConsumerProvider vertexConsumers, T entity, EquipmentSlot armorSlot, int light, CallbackInfo ci) { - if (armorSlot == EquipmentSlot.HEAD && RatMasterMaskItem.isWearingMask(entity)) { - ci.cancel(); - } - } -} diff --git a/src/main/resources/quilt.mod.json b/src/main/resources/quilt.mod.json index b96e5be..227d04d 100644 --- a/src/main/resources/quilt.mod.json +++ b/src/main/resources/quilt.mod.json @@ -11,7 +11,8 @@ "doctor4t": "Owner", "Arathain": "Artist", "Luxintrus": "Artist", - "Pyrofab": "Contributor" + "Pyrofab": "Contributor", + "AmyMialee": "Programmer" }, "icon": "assets/ratsmischief/icon.png" }, diff --git a/src/main/resources/ratsmischief.mixins.json b/src/main/resources/ratsmischief.mixins.json index 485f574..fcbd298 100644 --- a/src/main/resources/ratsmischief.mixins.json +++ b/src/main/resources/ratsmischief.mixins.json @@ -24,8 +24,7 @@ "client.HeadFeatureRendererMixin", "client.HeldItemRendererMixin", "client.ItemEntityRendererMixin", - "client.PlayerEntityRendererMixin", - "compat.ElegantArmour$SlimArmorFeatureRendererMixin" + "client.PlayerEntityRendererMixin" ], "injectors": { "defaultRequire": 1