Skip to content

Commit

Permalink
Another skinshuffle fuckery
Browse files Browse the repository at this point in the history
Fixes #103
  • Loading branch information
dima-dencep committed Jul 30, 2024
1 parent d15e499 commit 5af0624
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@

package org.redlance.dima_dencep.mods.rrls.mixins.workaround;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.entity.EntityRenderDispatcher;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.world.entity.Entity;
import org.redlance.dima_dencep.mods.rrls.ConfigExpectPlatform;
import org.redlance.dima_dencep.mods.rrls.Rrls;
Expand All @@ -28,6 +31,25 @@ public class EntityRenderDispatcherMixin {
@Unique
private static final Minecraft RRLS$MINECRAFT = Minecraft.getInstance();

@WrapOperation(
method = "render",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/renderer/entity/EntityRenderDispatcher;getRenderer(Lnet/minecraft/world/entity/Entity;)Lnet/minecraft/client/renderer/entity/EntityRenderer;"
)
)
public <T extends Entity> EntityRenderer<? super T> rrls$workaroundEntityCrash(EntityRenderDispatcher instance, T entityrenderer, Operation<EntityRenderer<? super T>> original) {
try {
return original.call(instance, entityrenderer);
} catch (Throwable th) {
if (ConfigExpectPlatform.hideType().forceClose() && RRLS$MINECRAFT.level == null) {
return null;
}

throw th;
}
}

@Inject(
method = "render",
at = @At(
Expand Down

0 comments on commit 5af0624

Please sign in to comment.