Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
fix smys crash 1.9.4
Browse files Browse the repository at this point in the history
  • Loading branch information
MicrocontrollersDev committed Jul 2, 2024
1 parent 43091fa commit 17f046d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ org.gradle.parallel=true
polyfrost.defaults.loom=3

# Mod Properties
mod_version=1.9.3
mod_version=1.9.4
maven_group=dev.microcontrollers.overlaytweaks
archives_base_name=overlaytweaks
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ private void cancelShieldRendering(ItemStack stack, ModelTransformationMode mode
//#if MC < 1.21
//$$ @ModifyArgs(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelPart;render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;IIFFFF)V"))
//$$ private void changeShieldColorAndTransparency(Args args, ItemStack stack, ModelTransformationMode mode, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) {
//$$ if (MinecraftClient.getInstance().player == null) return;
//$$ ClientPlayerEntity player = MinecraftClient.getInstance().player;
//$$ assert player != null;
//$$ float cooldown = player.getItemCooldownManager().getCooldownProgress(Items.SHIELD, 0);
//$$ // We want this to only change shields that are being held so it doesn't affect containers/dropped items, as well as first person only.
//$$ if (mode == ModelTransformationMode.FIRST_PERSON_LEFT_HAND || mode == ModelTransformationMode.FIRST_PERSON_RIGHT_HAND
Expand Down Expand Up @@ -82,9 +82,8 @@ private void cancelShieldRendering(ItemStack stack, ModelTransformationMode mode
//#if MC >= 1.21
@WrapOperation(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelPart;render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;II)V"))
private void changeShieldColorAndTransparencyPre(ModelPart instance, MatrixStack matrices, VertexConsumer vertices, int light, int overlay, Operation<Void> original, @Local(argsOnly = true) LocalRef<ModelTransformationMode> mode) {
ClientPlayerEntity player = MinecraftClient.getInstance().player;
assert player != null;
float cooldown = player.getItemCooldownManager().getCooldownProgress(Items.SHIELD, 0);
if (MinecraftClient.getInstance().player == null) return;
float cooldown = MinecraftClient.getInstance().player.getItemCooldownManager().getCooldownProgress(Items.SHIELD, 0);
if (mode.get() == ModelTransformationMode.FIRST_PERSON_LEFT_HAND || mode.get() == ModelTransformationMode.FIRST_PERSON_RIGHT_HAND
&& OverlayTweaksConfig.CONFIG.instance().customShieldOpacity != 0) {
float alpha = OverlayTweaksConfig.CONFIG.instance().customShieldOpacity / 100;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ public class LivingEntityRendererMixin<T extends LivingEntity> {
private RenderLayer transparentEntityRenderLayer(EntityModel model, Identifier texture, Operation<RenderLayer> original) {
// let's not set this unless we absolutely have to
// TODO: fix pig saddles
assert MinecraftClient.getInstance().player != null;
if (MinecraftClient.getInstance().player.hasVehicle() &&
if (MinecraftClient.getInstance().player != null && MinecraftClient.getInstance().player.hasVehicle() &&
((OverlayTweaksConfig.CONFIG.instance().horseOpacity != 100 && texture.toString().contains("horse")) ||
(OverlayTweaksConfig.CONFIG.instance().pigOpacity != 100 && texture.toString().contains("pig")) ||
(OverlayTweaksConfig.CONFIG.instance().striderOpacity != 100 && texture.toString().contains("strider")) ||
Expand Down

0 comments on commit 17f046d

Please sign in to comment.