HTTPS
https://git.nageyqma.icu/nageyqma/odin_next.git
SSH
git@git.nageyqma.icu:nageyqma/odin_next.git
HTTPS 链接可直接 git clone;推送代码请使用 SSH。
1234567891011121314151617181920212223242526272829303132
package com.odtheking.mixin.mixins;
import com.odtheking.odin.features.impl.render.HidePlayers;
import com.odtheking.odin.features.impl.render.RenderOptimizer;
import net.minecraft.client.renderer.culling.Frustum;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.decoration.ArmorStand;
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.CallbackInfoReturnable;
@Mixin(EntityRenderer.class)
public abstract class EntityRendererMixin<T extends Entity> {
@Inject(method = "shouldRender", at = @At("HEAD"), cancellable = true)
private void onRender(T entity, Frustum culler, double camX, double camY, double camZ, float partialTicks, CallbackInfoReturnable<Boolean> cir) {
if (!HidePlayers.shouldRenderPlayer(entity)) cir.setReturnValue(false);
if (RenderOptimizer.hideEntityDeathAnimation() && entity instanceof LivingEntity livingEntity && livingEntity.isDeadOrDying())
cir.setReturnValue(false);
if (RenderOptimizer.hideDyingEntityArmorStand() && entity instanceof ArmorStand armorStand) {
Entity self = armorStand.level().getEntity(armorStand.getId() - 1);
if (self instanceof LivingEntity livingEntity && livingEntity.isDeadOrDying()) cir.setReturnValue(false);
}
}
}