chore(history): squash 10 commit(s) from 2026-07-31
- feat: Фаза 1 ребрендинг combatant → lovisual + восстановление config - refactor: Фаза 2 — выкинуть Runtime/JarReplacement, заменить на Lifecycle - refactor: Фаза 3.5 — удалить читерские модули, ESP под легит - refactor: Фаза 3 — разбить Renderer2D (3379→2150 фасад + 14 хелперов ≤200) - refactor: Фаза 3 — разбить BetterChatRenderer (2870→210 фасад + 21 хелпер ≤200) - refactor: Фаза 3 — разбить UnifiedSettingRenderer (2798→208 фасад + 24 хелпера ≤200) - refactor: Фаза 3 — разбить ClickGuiRenderer (1887→542 фасад + 15 хелперов ≤200) - refactor: Фаза 3 — разбить NameTags (1791→438 фасад + 11 хелперов ≤200) - refactor: Фаза 3 — разбить TargetHud (1655→340 фасад + 11 хелперов ≤200) - refactor: Фаза 3 — разбить ESP (1538→269 фасад + 11 хелперов ≤200)
This commit is contained in:
parent
8084ac50b3
commit
52d87368c9
1595 changed files with 35857 additions and 51145 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -32,10 +32,10 @@ public class AbstractClientPlayerMixin {
|
|||
|
||||
|
||||
@Unique
|
||||
private boolean combatant$wasUsing = false;
|
||||
private boolean lovisual$wasUsing = false;
|
||||
|
||||
@Inject(method = "getFieldOfViewModifier", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$overrideFovMultiplier(boolean changingFov, float fovEffectScale,
|
||||
private void lovisual$overrideFovMultiplier(boolean changingFov, float fovEffectScale,
|
||||
CallbackInfoReturnable<Float> cir) {
|
||||
FovControl module = Modules.get(FovControl.class);
|
||||
if (module == null || !module.isEnabled()) return;
|
||||
|
|
@ -90,12 +90,12 @@ public class AbstractClientPlayerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "tick", at = @At("TAIL"))
|
||||
private void combatant$trackEat(CallbackInfo ci) {
|
||||
private void lovisual$trackEat(CallbackInfo ci) {
|
||||
AbstractClientPlayer p = (AbstractClientPlayer) (Object) this;
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
|
||||
if (mc.player == null || p == mc.player) {
|
||||
combatant$wasUsing = p.isUsingItem();
|
||||
lovisual$wasUsing = p.isUsingItem();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -103,18 +103,18 @@ public class AbstractClientPlayerMixin {
|
|||
|
||||
PvpCooldowns mod = Modules.get(PvpCooldowns.class);
|
||||
if (mod == null || !mod.isSystemEnabled() || !PvpTargetState.isTargetInPvp(p.getUUID())) {
|
||||
combatant$wasUsing = using;
|
||||
lovisual$wasUsing = using;
|
||||
return;
|
||||
}
|
||||
|
||||
if (using && !combatant$wasUsing) {
|
||||
if (using && !lovisual$wasUsing) {
|
||||
ItemStack stack = p.getUseItem();
|
||||
if (!stack.isEmpty() && CooldownRegistry.isTracked(stack.getItem())) {
|
||||
OpponentCooldownManager.recordUse(p.getUUID(), stack.getItem());
|
||||
}
|
||||
}
|
||||
|
||||
combatant$wasUsing = using;
|
||||
lovisual$wasUsing = using;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -12,18 +12,12 @@ 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 dev.loki.lovisual.features.module.Modules;
|
||||
import dev.loki.lovisual.features.module.modules.movement.InventoryMove;
|
||||
|
||||
@Mixin(AbstractContainerScreen.class)
|
||||
public abstract class AbstractContainerScreenMixin {
|
||||
|
||||
@Inject(method = "onClose", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$inventoryMove$deferClose(CallbackInfo ci) {
|
||||
InventoryMove module = Modules.get(InventoryMove.class);
|
||||
if (module == null || !module.isEnabled()) return;
|
||||
if (module.shouldCancelHandledScreenClose((AbstractContainerScreen<?>) (Object) this)) {
|
||||
ci.cancel();
|
||||
}
|
||||
private void lovisual$inventoryMove$deferClose(CallbackInfo ci) {
|
||||
// InventoryMove module removed; keep hook for compatibility.
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -19,7 +19,7 @@ import dev.loki.lovisual.features.gui.hud.nondraggable.impl.BetterButtons;
|
|||
public abstract class AbstractSelectionListMixin {
|
||||
|
||||
@Inject(method = "enableScissor(Lnet/minecraft/client/gui/GuiGraphicsExtractor;)V", at = @At("HEAD"))
|
||||
private void combatant$pushScissor(GuiGraphicsExtractor context, CallbackInfo ci) {
|
||||
private void lovisual$pushScissor(GuiGraphicsExtractor context, CallbackInfo ci) {
|
||||
AbstractSelectionList<?> self = (AbstractSelectionList<?>) (Object) this;
|
||||
BetterButtons.pushScissorContext(self.getX(), self.getY(), self.getRight(), self.getBottom());
|
||||
}
|
||||
|
|
@ -28,7 +28,7 @@ public abstract class AbstractSelectionListMixin {
|
|||
method = "extractWidgetRenderState(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IIF)V",
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphicsExtractor;disableScissor()V")
|
||||
)
|
||||
private void combatant$popScissor(GuiGraphicsExtractor context, int mouseX, int mouseY, float deltaTicks, CallbackInfo ci) {
|
||||
private void lovisual$popScissor(GuiGraphicsExtractor context, int mouseX, int mouseY, float deltaTicks, CallbackInfo ci) {
|
||||
BetterButtons.popScissorContext();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -24,7 +24,7 @@ import dev.loki.lovisual.mixins.accessors.SliderWidgetAccessor;
|
|||
public abstract class AbstractSliderButtonMixin {
|
||||
|
||||
@Inject(method = "extractWidgetRenderState(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IIF)V", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$renderWidget(GuiGraphicsExtractor ctx, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
private void lovisual$renderWidget(GuiGraphicsExtractor ctx, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
BetterButtons buttons = BetterButtons.get();
|
||||
if (buttons == null || !buttons.useUiButtons()) return;
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
|
|
@ -33,10 +33,10 @@ public abstract class AbstractSliderButtonMixin {
|
|||
AbstractWidget widget = self;
|
||||
|
||||
boolean hovered = widget.isMouseOver(mouseX, mouseY);
|
||||
boolean dragging = ((SliderWidgetAccessor) self).combatant$isDragging();
|
||||
boolean dragging = ((SliderWidgetAccessor) self).lovisual$isDragging();
|
||||
float hover = BetterButtons.updateHover(widget, hovered || dragging);
|
||||
|
||||
double value = ((SliderWidgetAccessor) self).combatant$getValue();
|
||||
double value = ((SliderWidgetAccessor) self).lovisual$getValue();
|
||||
BetterButtons.enqueueSlider(widget, (float) value, dragging, hover);
|
||||
if (hovered) {
|
||||
BetterButtons.captureTooltip(widget, mouseX, mouseY);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -19,35 +19,35 @@ import dev.loki.lovisual.mixininterface.IRoundedHitbox;
|
|||
public abstract class AbstractWidgetMixin implements IRoundedHitbox {
|
||||
|
||||
@Unique
|
||||
private float combatant$roundedRadius = 0.0f;
|
||||
private float lovisual$roundedRadius = 0.0f;
|
||||
@Unique
|
||||
private boolean combatant$roundedEnabled = false;
|
||||
private boolean lovisual$roundedEnabled = false;
|
||||
|
||||
@Override
|
||||
public void combatant$setRoundedHitbox(float radius) {
|
||||
combatant$roundedRadius = Math.max(0.0f, radius);
|
||||
combatant$roundedEnabled = combatant$roundedRadius > 0.0f;
|
||||
public void lovisual$setRoundedHitbox(float radius) {
|
||||
lovisual$roundedRadius = Math.max(0.0f, radius);
|
||||
lovisual$roundedEnabled = lovisual$roundedRadius > 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void combatant$clearRoundedHitbox() {
|
||||
combatant$roundedRadius = 0.0f;
|
||||
combatant$roundedEnabled = false;
|
||||
public void lovisual$clearRoundedHitbox() {
|
||||
lovisual$roundedRadius = 0.0f;
|
||||
lovisual$roundedEnabled = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float combatant$getRoundedHitbox() {
|
||||
return combatant$roundedRadius;
|
||||
public float lovisual$getRoundedHitbox() {
|
||||
return lovisual$roundedRadius;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean combatant$useRoundedHitbox() {
|
||||
return combatant$roundedEnabled;
|
||||
public boolean lovisual$useRoundedHitbox() {
|
||||
return lovisual$roundedEnabled;
|
||||
}
|
||||
|
||||
@Inject(method = "isMouseOver(DD)Z", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$isMouseOverRounded(double mouseX, double mouseY, CallbackInfoReturnable<Boolean> cir) {
|
||||
if (!combatant$roundedEnabled) return;
|
||||
private void lovisual$isMouseOverRounded(double mouseX, double mouseY, CallbackInfoReturnable<Boolean> cir) {
|
||||
if (!lovisual$roundedEnabled) return;
|
||||
|
||||
AbstractWidget self = (AbstractWidget) (Object) this;
|
||||
float x = self.getX();
|
||||
|
|
@ -60,7 +60,7 @@ public abstract class AbstractWidgetMixin implements IRoundedHitbox {
|
|||
return;
|
||||
}
|
||||
|
||||
float r = Math.min(combatant$roundedRadius, Math.min(w, h) * 0.5f);
|
||||
float r = Math.min(lovisual$roundedRadius, Math.min(w, h) * 0.5f);
|
||||
if (r <= 0.0f) {
|
||||
cir.setReturnValue(true);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -24,7 +24,7 @@ import dev.loki.lovisual.features.module.modules.visuals.WorldTweaks;
|
|||
public class AtmosphericFogEnvironmentMixin {
|
||||
|
||||
@Inject(method = "setupFog", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$noDimensionFog(FogData data,
|
||||
private void lovisual$noDimensionFog(FogData data,
|
||||
Camera camera,
|
||||
ClientLevel world,
|
||||
float viewDistance,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -21,51 +21,51 @@ import java.util.Arrays;
|
|||
@Mixin(SubmitNodeCollection.class)
|
||||
public abstract class BatchingRenderCommandQueueMixin {
|
||||
@Unique
|
||||
private static final int COMBATANT_VIEW_FADE_DITHER_MARK = 0x00010001;
|
||||
private static final int LOVISUAL_VIEW_FADE_DITHER_MARK = 0x00010001;
|
||||
@Unique
|
||||
private static final int COMBATANT_VIEW_FADE_A2C_MARK = 0x00010100;
|
||||
private static final int LOVISUAL_VIEW_FADE_A2C_MARK = 0x00010100;
|
||||
|
||||
@Unique
|
||||
private static int combatant$markViewObstructionFade(int argb, float alpha, boolean msaaActive) {
|
||||
int rgb = (argb & 0x00FEFEFE) | (msaaActive ? COMBATANT_VIEW_FADE_A2C_MARK : COMBATANT_VIEW_FADE_DITHER_MARK);
|
||||
private static int lovisual$markViewObstructionFade(int argb, float alpha, boolean msaaActive) {
|
||||
int rgb = (argb & 0x00FEFEFE) | (msaaActive ? LOVISUAL_VIEW_FADE_A2C_MARK : LOVISUAL_VIEW_FADE_DITHER_MARK);
|
||||
int alphaByte = Math.round(255.0f * Mth.clamp(alpha, 0.0f, 1.0f));
|
||||
return rgb | ((alphaByte & 0xFF) << 24);
|
||||
}
|
||||
|
||||
@Unique
|
||||
private static boolean combatant$shouldApplyViewObstructionFade() {
|
||||
private static boolean lovisual$shouldApplyViewObstructionFade() {
|
||||
return ViewObstructionFadeContext.isActive() && ViewObstructionFadeContext.alpha() < 0.99f;
|
||||
}
|
||||
|
||||
@Unique
|
||||
private static int combatant$applyFadeToArgb(int color) {
|
||||
private static int lovisual$applyFadeToArgb(int color) {
|
||||
int baseColor = color == -1 ? 0xFFFFFFFF : ((color & 0x00FFFFFF) | 0xFF000000);
|
||||
return combatant$markViewObstructionFade(baseColor, ViewObstructionFadeContext.alpha(), MsaaWorldTarget.isActive());
|
||||
return lovisual$markViewObstructionFade(baseColor, ViewObstructionFadeContext.alpha(), MsaaWorldTarget.isActive());
|
||||
}
|
||||
|
||||
@ModifyVariable(method = "submitModel", at = @At("HEAD"), argsOnly = true, index = 7)
|
||||
private int combatant$applyViewObstructionFadeAlpha(int tintedColor) {
|
||||
if (!combatant$shouldApplyViewObstructionFade()) {
|
||||
private int lovisual$applyViewObstructionFadeAlpha(int tintedColor) {
|
||||
if (!lovisual$shouldApplyViewObstructionFade()) {
|
||||
return tintedColor;
|
||||
}
|
||||
return combatant$applyFadeToArgb(tintedColor);
|
||||
return lovisual$applyFadeToArgb(tintedColor);
|
||||
}
|
||||
|
||||
@ModifyVariable(method = "submitItem", at = @At("HEAD"), argsOnly = true, index = 6)
|
||||
private int[] combatant$applyViewObstructionFadeAlphaToItemTints(int[] tints) {
|
||||
if (!combatant$shouldApplyViewObstructionFade()) {
|
||||
private int[] lovisual$applyViewObstructionFadeAlphaToItemTints(int[] tints) {
|
||||
if (!lovisual$shouldApplyViewObstructionFade()) {
|
||||
return tints;
|
||||
}
|
||||
|
||||
int sentinel = combatant$applyFadeToArgb(-1);
|
||||
int sentinel = lovisual$applyFadeToArgb(-1);
|
||||
if (tints == null || tints.length == 0) {
|
||||
return new int[]{sentinel};
|
||||
}
|
||||
|
||||
int[] faded = Arrays.copyOf(tints, tints.length);
|
||||
faded[0] = combatant$applyFadeToArgb(faded[0]);
|
||||
faded[0] = lovisual$applyFadeToArgb(faded[0]);
|
||||
for (int i = 1; i < faded.length; i++) {
|
||||
faded[i] = combatant$applyFadeToArgb(faded[i]);
|
||||
faded[i] = lovisual$applyFadeToArgb(faded[i]);
|
||||
}
|
||||
return faded;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
* Portions derived from ThunderHack Recode, copyright (c) 2023-2024 Pan4ur & 06ED.
|
||||
* Upstream: https://github.com/Pan4ur/ThunderHack-Recode
|
||||
|
|
@ -29,7 +29,7 @@ public abstract class BlockCollisionSpliteratorMixin {
|
|||
target = "Lnet/minecraft/world/level/BlockGetter;getBlockState(Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/level/block/state/BlockState;"
|
||||
)
|
||||
)
|
||||
private BlockState combatant$collisionHook(BlockGetter instance, BlockPos blockPos) {
|
||||
private BlockState lovisual$collisionHook(BlockGetter instance, BlockPos blockPos) {
|
||||
BlockState state = instance.getBlockState(blockPos);
|
||||
if (!Events.BUS.hasListeners(EventCollision.class)) {
|
||||
return state;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -11,12 +11,12 @@ 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 dev.loki.lovisual.render.engine.core.CombatantRenderSystem;
|
||||
import dev.loki.lovisual.render.engine.core.LoVisualRenderSystem;
|
||||
|
||||
@Mixin(targets = "com.mojang.blaze3d.opengl.DirectStateAccess$Emulated")
|
||||
public abstract class BufferManagerDefaultBufferManagerMixin {
|
||||
@Inject(method = "bindFrameBufferTextures", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$setupFramebuffer(int framebuffer,
|
||||
private void lovisual$setupFramebuffer(int framebuffer,
|
||||
int[] colorAttachments,
|
||||
int[] colorMipLevels,
|
||||
int depthAttachment,
|
||||
|
|
@ -29,7 +29,7 @@ public abstract class BufferManagerDefaultBufferManagerMixin {
|
|||
|
||||
int colorAttachment = colorAttachments[0];
|
||||
int mipLevel = colorMipLevels != null && colorMipLevels.length > 0 ? colorMipLevels[0] : depthMipLevel;
|
||||
if (CombatantRenderSystem.rhi().msaa().setupFramebuffer(framebuffer, colorAttachment, depthAttachment, mipLevel, bindTarget)) {
|
||||
if (LoVisualRenderSystem.rhi().msaa().setupFramebuffer(framebuffer, colorAttachment, depthAttachment, mipLevel, bindTarget)) {
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -23,7 +23,7 @@ import dev.loki.lovisual.features.gui.hud.nondraggable.impl.BetterButtons;
|
|||
public abstract class ButtonWidgetTextMixin {
|
||||
|
||||
@Inject(method = "extractContents(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IIF)V", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$drawIcon(GuiGraphicsExtractor ctx, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
private void lovisual$drawIcon(GuiGraphicsExtractor ctx, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
BetterButtons buttons = BetterButtons.get();
|
||||
if (buttons == null || !buttons.useUiButtons()) return;
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -45,14 +45,14 @@ public abstract class CameraMixin {
|
|||
private Entity entity;
|
||||
|
||||
@Unique
|
||||
private static float combatant$getGameFov() {
|
||||
private static float lovisual$getGameFov() {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc == null) return 70.0f;
|
||||
return mc.options.fov().get();
|
||||
}
|
||||
|
||||
@Unique
|
||||
private static float combatant$getFovEffectScale() {
|
||||
private static float lovisual$getFovEffectScale() {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc == null) return 1.0f;
|
||||
return mc.options.fovEffectScale().get().floatValue();
|
||||
|
|
@ -62,7 +62,7 @@ public abstract class CameraMixin {
|
|||
protected abstract void move(float surge, float heave, float sway);
|
||||
|
||||
@Inject(method = "getMaxZoom(F)F", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$disableCameraCollision(float desiredDistance, CallbackInfoReturnable<Float> cir) {
|
||||
private void lovisual$disableCameraCollision(float desiredDistance, CallbackInfoReturnable<Float> cir) {
|
||||
CameraClip mod = Modules.get(CameraClip.class);
|
||||
if (mod != null && mod.isEnabled() && isThirdPerson()) {
|
||||
// Skip collision shortening and apply distance multiplier
|
||||
|
|
@ -72,7 +72,7 @@ public abstract class CameraMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "update", at = @At("TAIL"))
|
||||
private void combatant$applyCameraOffsets(DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
private void lovisual$applyCameraOffsets(DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
CameraClip mod = Modules.get(CameraClip.class);
|
||||
if (mod == null || !mod.isEnabled() || !isThirdPerson()) return;
|
||||
|
||||
|
|
@ -87,12 +87,12 @@ public abstract class CameraMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "calculateFov", at = @At("RETURN"), cancellable = true)
|
||||
private void combatant$adjustCalculatedFov(float tickDelta, CallbackInfoReturnable<Float> cir) {
|
||||
cir.setReturnValue(combatant$adjustFovValue(cir.getReturnValue()));
|
||||
private void lovisual$adjustCalculatedFov(float tickDelta, CallbackInfoReturnable<Float> cir) {
|
||||
cir.setReturnValue(lovisual$adjustFovValue(cir.getReturnValue()));
|
||||
}
|
||||
|
||||
@Unique
|
||||
private float combatant$adjustFovValue(float fov) {
|
||||
private float lovisual$adjustFovValue(float fov) {
|
||||
FovControl module = Modules.get(FovControl.class);
|
||||
Zoom zoom = Modules.get(Zoom.class);
|
||||
|
||||
|
|
@ -101,7 +101,7 @@ public abstract class CameraMixin {
|
|||
if (!hasFovControl && !hasZoom) return fov;
|
||||
|
||||
if (hasFovControl && module.useCustomFov()) {
|
||||
float base = combatant$getGameFov();
|
||||
float base = lovisual$getGameFov();
|
||||
float custom = module.getCustomFov();
|
||||
if (base > 0.01f) {
|
||||
fov = fov * (custom / base);
|
||||
|
|
@ -113,7 +113,7 @@ public abstract class CameraMixin {
|
|||
if (hasFovControl && module.disableFluidFov()) {
|
||||
FogType type = ((Camera) (Object) this).getFluidInCamera();
|
||||
if (type == FogType.WATER || type == FogType.LAVA) {
|
||||
float effectScale = combatant$getFovEffectScale();
|
||||
float effectScale = lovisual$getFovEffectScale();
|
||||
float factor = Mth.lerp(effectScale, 1.0f, 0.85714287f);
|
||||
if (factor > 0.0001f) {
|
||||
fov /= factor;
|
||||
|
|
@ -149,10 +149,10 @@ public abstract class CameraMixin {
|
|||
public abstract Matrix4f getViewRotationMatrix(Matrix4f matrix);
|
||||
|
||||
@Invoker("createProjectionMatrixForCulling")
|
||||
protected abstract Matrix4f combatant$createProjectionMatrixForCulling();
|
||||
protected abstract Matrix4f lovisual$createProjectionMatrixForCulling();
|
||||
|
||||
@Invoker("prepareCullFrustum")
|
||||
protected abstract void combatant$prepareCullFrustum(Matrix4fc viewMatrix, Matrix4f projectionMatrix, Vec3 cameraPos);
|
||||
protected abstract void lovisual$prepareCullFrustum(Matrix4fc viewMatrix, Matrix4f projectionMatrix, Vec3 cameraPos);
|
||||
|
||||
@Inject(method = "update", at = @At("TAIL"))
|
||||
private void freecam$override(
|
||||
|
|
@ -175,11 +175,11 @@ public abstract class CameraMixin {
|
|||
fc.syncCameraEntity(fc.camPos, fc.camPosPrev);
|
||||
|
||||
this.setPosition(p);
|
||||
this.combatant$prepareCullFrustum(this.getViewRotationMatrix(new Matrix4f()), this.combatant$createProjectionMatrixForCulling(), p);
|
||||
this.lovisual$prepareCullFrustum(this.getViewRotationMatrix(new Matrix4f()), this.lovisual$createProjectionMatrixForCulling(), p);
|
||||
}
|
||||
|
||||
@Inject(method = "extractRenderState", at = @At("TAIL"))
|
||||
private void combatant$freecamExtractRenderState(CameraRenderState renderState, float tickDelta, CallbackInfo ci) {
|
||||
private void lovisual$freecamExtractRenderState(CameraRenderState renderState, float tickDelta, CallbackInfo ci) {
|
||||
Freecam fc = Modules.get(Freecam.class);
|
||||
if (fc == null || !fc.isEnabled() || fc.camEntity == null) return;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -25,7 +25,7 @@ import dev.loki.lovisual.features.gui.chat.BetterChatStoreManager;
|
|||
import dev.loki.lovisual.features.gui.hud.draggable.impl.BetterChat;
|
||||
import dev.loki.lovisual.features.module.Modules;
|
||||
import dev.loki.lovisual.features.module.modules.misc.MessageFilter;
|
||||
import dev.loki.lovisual.runtime.RuntimeGate;
|
||||
import dev.loki.lovisual.Lifecycle;
|
||||
|
||||
@Mixin(ChatComponent.class)
|
||||
public class ChatComponentMixin {
|
||||
|
|
@ -35,12 +35,12 @@ public class ChatComponentMixin {
|
|||
at = @At("HEAD"),
|
||||
cancellable = true
|
||||
)
|
||||
private void combatant$filterChatFull(Component message,
|
||||
private void lovisual$filterChatFull(Component message,
|
||||
MessageSignature signatureData,
|
||||
GuiMessageSource source,
|
||||
GuiMessageTag indicator,
|
||||
CallbackInfo ci) {
|
||||
if (!RuntimeGate.canRunHud()) return;
|
||||
if (!Lifecycle.canRunHud()) return;
|
||||
MessageFilter messageFilter = Modules.get(MessageFilter.class);
|
||||
if (messageFilter != null && messageFilter.shouldHideChat(message)) {
|
||||
ci.cancel();
|
||||
|
|
@ -52,15 +52,15 @@ public class ChatComponentMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "logChatMessage(Lnet/minecraft/client/multiplayer/chat/GuiMessage;)V", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$commands$suppressClientLog(GuiMessage message, CallbackInfo ci) {
|
||||
private void lovisual$commands$suppressClientLog(GuiMessage message, CallbackInfo ci) {
|
||||
if (message != null && CommandOutput.isLoVisualMessage(message.content())) {
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "clearMessages(Z)V", at = @At("TAIL"))
|
||||
private void combatant$betterChat$clear(boolean clearHistory, CallbackInfo ci) {
|
||||
if (!RuntimeGate.canRunHud()) return;
|
||||
private void lovisual$betterChat$clear(boolean clearHistory, CallbackInfo ci) {
|
||||
if (!Lifecycle.canRunHud()) return;
|
||||
if (!BetterChat.isActive()) return;
|
||||
// Never wipe BetterChat store on vanilla clear; just persist to disk.
|
||||
BetterChatStoreManager.flushActive();
|
||||
|
|
@ -68,7 +68,7 @@ public class ChatComponentMixin {
|
|||
|
||||
@Inject(method = "extractRenderState(Lnet/minecraft/client/gui/GuiGraphicsExtractor;Lnet/minecraft/client/gui/Font;IIILnet/minecraft/client/gui/components/ChatComponent$DisplayMode;Z)V",
|
||||
at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$betterChat$hideVanilla(GuiGraphicsExtractor context,
|
||||
private void lovisual$betterChat$hideVanilla(GuiGraphicsExtractor context,
|
||||
Font textRenderer,
|
||||
int currentTick,
|
||||
int mouseX,
|
||||
|
|
@ -76,7 +76,7 @@ public class ChatComponentMixin {
|
|||
DisplayMode displayMode,
|
||||
boolean inChat,
|
||||
CallbackInfo ci) {
|
||||
if (!RuntimeGate.canRunHud()) return;
|
||||
if (!Lifecycle.canRunHud()) return;
|
||||
if (!BetterChat.isActive()) return;
|
||||
BetterChat cfg = BetterChat.get();
|
||||
if (cfg != null && cfg.hideVanilla()) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -25,14 +25,14 @@ import dev.loki.lovisual.features.command.CommandManager;
|
|||
import dev.loki.lovisual.features.gui.chat.BetterChatRenderer;
|
||||
import dev.loki.lovisual.features.gui.hud.draggable.impl.BetterChat;
|
||||
import dev.loki.lovisual.mixins.accessors.ChatScreenSuggestorAccessor;
|
||||
import dev.loki.lovisual.runtime.RuntimeGate;
|
||||
import dev.loki.lovisual.Lifecycle;
|
||||
|
||||
@Mixin(ChatScreen.class)
|
||||
public class ChatScreenMixin {
|
||||
|
||||
@Inject(method = "extractRenderState(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IIF)V", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$betterChat$render(GuiGraphicsExtractor context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
if (!RuntimeGate.canRunHud()) return;
|
||||
private void lovisual$betterChat$render(GuiGraphicsExtractor context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
if (!Lifecycle.canRunHud()) return;
|
||||
if (BetterChat.isActive()) {
|
||||
BetterChat cfg = BetterChat.get();
|
||||
if (cfg != null && cfg.hideVanilla()) {
|
||||
|
|
@ -50,34 +50,34 @@ public class ChatScreenMixin {
|
|||
target = "Lnet/minecraft/client/gui/components/ChatComponent;captureClickableText(Lnet/minecraft/client/gui/ActiveTextCollector;IILnet/minecraft/client/gui/components/ChatComponent$DisplayMode;)V"
|
||||
)
|
||||
)
|
||||
private void combatant$betterChat$disableVanillaChatClickHitbox(ChatComponent chatHud,
|
||||
private void lovisual$betterChat$disableVanillaChatClickHitbox(ChatComponent chatHud,
|
||||
ActiveTextCollector textConsumer,
|
||||
int windowHeight,
|
||||
int currentTick,
|
||||
DisplayMode displayMode) {
|
||||
if (combatant$betterChat$shouldHideVanillaChat()) {
|
||||
if (lovisual$betterChat$shouldHideVanillaChat()) {
|
||||
return;
|
||||
}
|
||||
chatHud.captureClickableText(textConsumer, windowHeight, currentTick, displayMode);
|
||||
}
|
||||
|
||||
@Inject(method = "mouseScrolled(DDDD)Z", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$betterChat$disableVanillaChatScroll(double mouseX,
|
||||
private void lovisual$betterChat$disableVanillaChatScroll(double mouseX,
|
||||
double mouseY,
|
||||
double horizontalAmount,
|
||||
double verticalAmount,
|
||||
CallbackInfoReturnable<Boolean> cir) {
|
||||
if (combatant$betterChat$shouldHideVanillaChat()) {
|
||||
if (lovisual$betterChat$shouldHideVanillaChat()) {
|
||||
cir.setReturnValue(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "keyPressed(Lnet/minecraft/client/input/KeyEvent;)Z", at = @At("HEAD"))
|
||||
private void combatant$betterChat$allowEscape(KeyEvent input, CallbackInfoReturnable<Boolean> cir) {
|
||||
if (!RuntimeGate.canRunHud()) return;
|
||||
private void lovisual$betterChat$allowEscape(KeyEvent input, CallbackInfoReturnable<Boolean> cir) {
|
||||
if (!Lifecycle.canRunHud()) return;
|
||||
if (!BetterChat.isActive()) return;
|
||||
if (!input.isEscape()) return;
|
||||
CommandSuggestions suggestor = ((ChatScreenSuggestorAccessor) this).getCombatant$suggestor();
|
||||
CommandSuggestions suggestor = ((ChatScreenSuggestorAccessor) this).getLoVisual$suggestor();
|
||||
if (suggestor != null) {
|
||||
suggestor.setAllowSuggestions(false);
|
||||
suggestor.hide();
|
||||
|
|
@ -85,16 +85,16 @@ public class ChatScreenMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "handleChatInput(Ljava/lang/String;Z)V", at = @At("HEAD"), cancellable = true, require = 0)
|
||||
private void combatant$commands$sendMessage(String message, boolean addToHistory, CallbackInfo ci) {
|
||||
if (!RuntimeGate.canRunClientLogic()) return;
|
||||
private void lovisual$commands$sendMessage(String message, boolean addToHistory, CallbackInfo ci) {
|
||||
if (!Lifecycle.isActive()) return;
|
||||
if (CommandManager.handle(message)) {
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@Unique
|
||||
private boolean combatant$betterChat$shouldHideVanillaChat() {
|
||||
if (!RuntimeGate.canRunHud()) return false;
|
||||
private boolean lovisual$betterChat$shouldHideVanillaChat() {
|
||||
if (!Lifecycle.canRunHud()) return false;
|
||||
if (!BetterChat.isActive()) return false;
|
||||
BetterChat cfg = BetterChat.get();
|
||||
return cfg != null && cfg.hideVanilla();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -22,7 +22,7 @@ import dev.loki.lovisual.features.module.modules.visuals.WorldTweaks;
|
|||
public abstract class ClientClockManagerMixin {
|
||||
|
||||
@Inject(method = "getTotalTicks", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$overrideRenderClock(Holder<WorldClock> clock, CallbackInfoReturnable<Long> cir) {
|
||||
private void lovisual$overrideRenderClock(Holder<WorldClock> clock, CallbackInfoReturnable<Long> cir) {
|
||||
if (clock == null || !clock.is(WorldClocks.OVERWORLD)) return;
|
||||
|
||||
WorldTweaks worldTweaks = Modules.get(WorldTweaks.class);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -18,8 +18,6 @@ import org.spongepowered.asm.mixin.Shadow;
|
|||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import dev.loki.lovisual.features.module.Modules;
|
||||
import dev.loki.lovisual.features.module.modules.movement.Flight;
|
||||
|
||||
@Mixin(ClientCommonPacketListenerImpl.class)
|
||||
public abstract class ClientCommonPacketListenerImplMixin {
|
||||
|
|
@ -29,16 +27,7 @@ public abstract class ClientCommonPacketListenerImplMixin {
|
|||
protected Connection connection;
|
||||
|
||||
@Inject(method = "send(Lnet/minecraft/network/protocol/Packet;)V", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$flightSendPacket(Packet<?> packet, CallbackInfo ci) {
|
||||
if (!((Object) this instanceof ClientPacketListener)) return;
|
||||
if (!(packet instanceof ServerboundMovePlayerPacket move)) return;
|
||||
Flight flight = Modules.get(Flight.class);
|
||||
if (flight == null || !flight.isEnabled()) return;
|
||||
|
||||
ServerboundMovePlayerPacket replacement = flight.onSendMovePacket(move);
|
||||
if (replacement != null && replacement != move) {
|
||||
ci.cancel();
|
||||
connection.send(replacement);
|
||||
}
|
||||
private void lovisual$flightSendPacket(Packet<?> packet, CallbackInfo ci) {
|
||||
// Flight module removed; no move-packet override remains.
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -26,7 +26,7 @@ import dev.loki.lovisual.util.block.BlockObservationHub;
|
|||
public abstract class ClientLevelMixin {
|
||||
|
||||
@Inject(method = "setServerVerifiedBlockState", at = @At("TAIL"))
|
||||
private void combatant$recordBlockUpdate(BlockPos pos, BlockState state, @Block.UpdateFlags int flags, CallbackInfo ci) {
|
||||
private void lovisual$recordBlockUpdate(BlockPos pos, BlockState state, @Block.UpdateFlags int flags, CallbackInfo ci) {
|
||||
BlockObservationHub.observeWorldUpdate(pos, state);
|
||||
}
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ public abstract class ClientLevelMixin {
|
|||
at = @At("HEAD"),
|
||||
cancellable = true
|
||||
)
|
||||
private void combatant$noRenderEatParticles(
|
||||
private void lovisual$noRenderEatParticles(
|
||||
ParticleOptions effect,
|
||||
boolean force,
|
||||
boolean canSpawnOnMinimal,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -28,7 +28,6 @@ import dev.loki.lovisual.events.impl.PvpTabEvent;
|
|||
import dev.loki.lovisual.features.module.Modules;
|
||||
import dev.loki.lovisual.features.module.modules.combat.PvpCooldowns;
|
||||
import dev.loki.lovisual.features.module.modules.misc.NoSound;
|
||||
import dev.loki.lovisual.features.module.modules.movement.Flight;
|
||||
import dev.loki.lovisual.features.module.modules.visuals.SoundESP;
|
||||
import dev.loki.lovisual.features.module.modules.visuals.TotemFX;
|
||||
import dev.loki.lovisual.features.module.modules.visuals.WorldTweaks;
|
||||
|
|
@ -58,16 +57,12 @@ public abstract class ClientPacketListenerMixin {
|
|||
Pattern.compile("Пинг:\\s*(\\d+)");
|
||||
|
||||
@Inject(method = "handlePlayerAbilities", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$flightAbilities(ClientboundPlayerAbilitiesPacket packet, CallbackInfo ci) {
|
||||
Flight flight = Modules.get(Flight.class);
|
||||
if (flight == null || !flight.isEnabled()) return;
|
||||
if (flight.onReceiveAbilities(packet)) {
|
||||
ci.cancel();
|
||||
}
|
||||
private void lovisual$flightAbilities(ClientboundPlayerAbilitiesPacket packet, CallbackInfo ci) {
|
||||
// Flight module removed; no abilities override remains.
|
||||
}
|
||||
|
||||
@Inject(method = "handleTabListCustomisation", at = @At("TAIL"))
|
||||
private void combatant$captureTab(ClientboundTabListPacket packet, CallbackInfo ci) {
|
||||
private void lovisual$captureTab(ClientboundTabListPacket packet, CallbackInfo ci) {
|
||||
String header = packet.header() == null ? "" : packet.header().getString();
|
||||
String footer = packet.footer() == null ? "" : packet.footer().getString();
|
||||
ServerDumpUtil.dumpTabText("HEADER", packet.header());
|
||||
|
|
@ -95,7 +90,7 @@ public abstract class ClientPacketListenerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "handleSoundEvent", at = @At("HEAD"))
|
||||
private void combatant$onChorus(ClientboundSoundPacket packet, CallbackInfo ci) {
|
||||
private void lovisual$onChorus(ClientboundSoundPacket packet, CallbackInfo ci) {
|
||||
// Opponent cooldown tracking disabled (legacy system).
|
||||
/*
|
||||
if (!CooldownsState.shouldTrackOpponents()) return;
|
||||
|
|
@ -116,7 +111,7 @@ public abstract class ClientPacketListenerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "handlePlayerChat", at = @At("HEAD"))
|
||||
private void combatant$pvpChatMessage(ClientboundPlayerChatPacket packet, CallbackInfo ci) {
|
||||
private void lovisual$pvpChatMessage(ClientboundPlayerChatPacket packet, CallbackInfo ci) {
|
||||
String msg = packet == null ? null : packet.body().content();
|
||||
if (msg == null || msg.isBlank()) return;
|
||||
if (Events.BUS.hasListeners(PvpChatEvent.class)) {
|
||||
|
|
@ -125,7 +120,7 @@ public abstract class ClientPacketListenerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "handleRemoveEntities", at = @At("TAIL"))
|
||||
private void combatant$onEntitiesDestroy(ClientboundRemoveEntitiesPacket packet, CallbackInfo ci) {
|
||||
private void lovisual$onEntitiesDestroy(ClientboundRemoveEntitiesPacket packet, CallbackInfo ci) {
|
||||
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
ClientLevel world = mc.level;
|
||||
|
|
@ -141,7 +136,7 @@ public abstract class ClientPacketListenerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "handleAddEntity", at = @At("TAIL"))
|
||||
private void combatant$onEntitySpawn(ClientboundAddEntityPacket packet, CallbackInfo ci) {
|
||||
private void lovisual$onEntitySpawn(ClientboundAddEntityPacket packet, CallbackInfo ci) {
|
||||
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
ClientLevel world = mc.level;
|
||||
|
|
@ -156,7 +151,7 @@ public abstract class ClientPacketListenerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "handlePlayerInfoUpdate", at = @At("TAIL"))
|
||||
private void combatant$onPlayerList(ClientboundPlayerInfoUpdatePacket packet, CallbackInfo ci) {
|
||||
private void lovisual$onPlayerList(ClientboundPlayerInfoUpdatePacket packet, CallbackInfo ci) {
|
||||
|
||||
var actions = packet.actions();
|
||||
boolean listedAffects = actions.contains(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LISTED)
|
||||
|
|
@ -184,7 +179,7 @@ public abstract class ClientPacketListenerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "handlePlayerInfoRemove", at = @At("TAIL"))
|
||||
private void combatant$onPlayerRemove(ClientboundPlayerInfoRemovePacket packet, CallbackInfo ci) {
|
||||
private void lovisual$onPlayerRemove(ClientboundPlayerInfoRemovePacket packet, CallbackInfo ci) {
|
||||
|
||||
for (UUID id : packet.profileIds()) {
|
||||
|
||||
|
|
@ -197,12 +192,12 @@ public abstract class ClientPacketListenerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "handleSetTime", at = @At("HEAD"))
|
||||
private void combatant$captureServerTime(ClientboundSetTimePacket packet, CallbackInfo ci) {
|
||||
private void lovisual$captureServerTime(ClientboundSetTimePacket packet, CallbackInfo ci) {
|
||||
WorldTweaks.setServerTimeOfDay(packet.gameTime());
|
||||
}
|
||||
|
||||
@Inject(method = "handleTabListCustomisation", at = @At("TAIL"))
|
||||
private void combatant$onTab(ClientboundTabListPacket packet, CallbackInfo ci) {
|
||||
private void lovisual$onTab(ClientboundTabListPacket packet, CallbackInfo ci) {
|
||||
parse(packet.header());
|
||||
}
|
||||
|
||||
|
|
@ -231,31 +226,31 @@ public abstract class ClientPacketListenerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "handleContainerSetSlot", at = @At("HEAD"))
|
||||
private void combatant$debugSlotUpdate(ClientboundContainerSetSlotPacket packet, CallbackInfo ci) {
|
||||
private void lovisual$debugSlotUpdate(ClientboundContainerSetSlotPacket packet, CallbackInfo ci) {
|
||||
// PvP cooldown confirmation disabled (legacy system).
|
||||
/*
|
||||
int syncId = packet.getSyncId();
|
||||
int slot = packet.getSlot();
|
||||
ItemStack stack = packet.getStack();
|
||||
|
||||
//System.out.println("[Combatant][DEBUG] Packet slot update: syncId=" + syncId + " slot=" + slot + " item=" + stack.getItem() + " x" + stack.getCount());
|
||||
//System.out.println("[LoVisual][DEBUG] Packet slot update: syncId=" + syncId + " slot=" + slot + " item=" + stack.getItem() + " x" + stack.getCount());
|
||||
|
||||
var pending = CooldownsState.PENDING.consumeIfConfirmed(slot, stack.getCount());
|
||||
if (pending != null) {
|
||||
//System.out.println("[Combatant][DEBUG] Confirmed use of " + pending.item() + " (count decreased from " + pending.count() + " to " + stack.getCount() + ")");
|
||||
//System.out.println("[LoVisual][DEBUG] Confirmed use of " + pending.item() + " (count decreased from " + pending.count() + " to " + stack.getCount() + ")");
|
||||
CooldownsState.MANAGER.commitConfirmedUse(pending.item(), pending.startedAtMs());
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@Inject(method = "handleContainerContent", at = @At("HEAD"))
|
||||
private void combatant$debugFullInventory(ClientboundContainerSetContentPacket packet, CallbackInfo ci) {
|
||||
private void lovisual$debugFullInventory(ClientboundContainerSetContentPacket packet, CallbackInfo ci) {
|
||||
// PvP cooldown confirmation disabled (legacy system).
|
||||
/*
|
||||
int syncId = packet.syncId();
|
||||
List<ItemStack> contents = packet.contents();
|
||||
|
||||
//System.out.println("[Combatant][DEBUG] Full inventory syncId=" + syncId + ", size=" + contents.size());
|
||||
//System.out.println("[LoVisual][DEBUG] Full inventory syncId=" + syncId + ", size=" + contents.size());
|
||||
|
||||
for (int i = 0; i < contents.size(); i++) {
|
||||
ItemStack stack = contents.get(i);
|
||||
|
|
@ -263,7 +258,7 @@ public abstract class ClientPacketListenerMixin {
|
|||
|
||||
var pending = CooldownsState.PENDING.consumeIfConfirmed(i, stack.getCount());
|
||||
if (pending != null) {
|
||||
//System.out.println("[Combatant][DEBUG] Confirmed (FULL INV) " + pending.item() + " slot=" + i + " count=" + stack.getCount());
|
||||
//System.out.println("[LoVisual][DEBUG] Confirmed (FULL INV) " + pending.item() + " slot=" + i + " count=" + stack.getCount());
|
||||
CooldownsState.MANAGER.commitConfirmedUse(pending.item(), pending.startedAtMs());
|
||||
}
|
||||
}
|
||||
|
|
@ -271,7 +266,7 @@ public abstract class ClientPacketListenerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "handleSoundEvent", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$filterSound(ClientboundSoundPacket packet, CallbackInfo ci) {
|
||||
private void lovisual$filterSound(ClientboundSoundPacket packet, CallbackInfo ci) {
|
||||
NoSound module = Modules.get(NoSound.class);
|
||||
if (module == null || !module.isEnabled()) return;
|
||||
if (packet == null || packet.getSound() == null) return;
|
||||
|
|
@ -282,7 +277,7 @@ public abstract class ClientPacketListenerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "handleSoundEntityEvent", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$filterSoundFromEntity(ClientboundSoundEntityPacket packet, CallbackInfo ci) {
|
||||
private void lovisual$filterSoundFromEntity(ClientboundSoundEntityPacket packet, CallbackInfo ci) {
|
||||
NoSound module = Modules.get(NoSound.class);
|
||||
if (module == null || !module.isEnabled()) return;
|
||||
if (packet == null || packet.getSound() == null) return;
|
||||
|
|
@ -293,7 +288,7 @@ public abstract class ClientPacketListenerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "handleParticleEvent", at = @At("HEAD"))
|
||||
private void combatant$heuristicParticle(ClientboundLevelParticlesPacket packet, CallbackInfo ci) {
|
||||
private void lovisual$heuristicParticle(ClientboundLevelParticlesPacket packet, CallbackInfo ci) {
|
||||
var p = packet.getParticle();
|
||||
// Log raw particles once per hook for diagnostics
|
||||
DebugLog.info("Particle packet type=%s pos=%.2f %.2f %.2f count=%d",
|
||||
|
|
@ -304,7 +299,7 @@ public abstract class ClientPacketListenerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "handleSoundEvent", at = @At("HEAD"))
|
||||
private void combatant$onPearl(ClientboundSoundPacket packet, CallbackInfo ci) {
|
||||
private void lovisual$onPearl(ClientboundSoundPacket packet, CallbackInfo ci) {
|
||||
// Opponent cooldown tracking disabled (legacy system).
|
||||
/*
|
||||
if (!CooldownsState.shouldTrackOpponents()) return;
|
||||
|
|
@ -325,7 +320,7 @@ public abstract class ClientPacketListenerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "handleSoundEvent", at = @At("HEAD"))
|
||||
private void combatant$onPlaySound(ClientboundSoundPacket packet, CallbackInfo ci) {
|
||||
private void lovisual$onPlaySound(ClientboundSoundPacket packet, CallbackInfo ci) {
|
||||
SoundESP esp = Modules.get(SoundESP.class);
|
||||
if (esp == null || !esp.isEnabled()) return;
|
||||
if (packet == null || packet.getSound() == null) return;
|
||||
|
|
@ -334,7 +329,7 @@ public abstract class ClientPacketListenerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "handleSoundEntityEvent", at = @At("HEAD"))
|
||||
private void combatant$onPlaySoundFromEntity(ClientboundSoundEntityPacket packet, CallbackInfo ci) {
|
||||
private void lovisual$onPlaySoundFromEntity(ClientboundSoundEntityPacket packet, CallbackInfo ci) {
|
||||
SoundESP esp = Modules.get(SoundESP.class);
|
||||
if (esp == null || !esp.isEnabled()) return;
|
||||
if (packet == null || packet.getSound() == null) return;
|
||||
|
|
@ -348,7 +343,7 @@ public abstract class ClientPacketListenerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "handleUpdateMobEffect", at = @At("HEAD"))
|
||||
private void combatant$logStatusEffect(ClientboundUpdateMobEffectPacket packet, CallbackInfo ci) {
|
||||
private void lovisual$logStatusEffect(ClientboundUpdateMobEffectPacket packet, CallbackInfo ci) {
|
||||
DebugLog.server("Packet: add/refresh effect eid=%d effect=%s amp=%d dur=%d particles=%s icon=%s ambient=%s keepFading=%s",
|
||||
packet.getEntityId(),
|
||||
packet.getEffect().unwrapKey().map(k -> k.identifier().toString()).orElse("unknown"),
|
||||
|
|
@ -362,7 +357,7 @@ public abstract class ClientPacketListenerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "handleRemoveMobEffect", at = @At("HEAD"))
|
||||
private void combatant$logRemove(ClientboundRemoveMobEffectPacket packet, CallbackInfo ci) {
|
||||
private void lovisual$logRemove(ClientboundRemoveMobEffectPacket packet, CallbackInfo ci) {
|
||||
DebugLog.server("Packet: remove effect eid=%d (%s) effect=%s",
|
||||
packet.entityId(),
|
||||
resolveName(packet.entityId()),
|
||||
|
|
@ -380,7 +375,7 @@ public abstract class ClientPacketListenerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "handleSoundEvent", at = @At("HEAD"))
|
||||
private void combatant$onTotemSound(ClientboundSoundPacket packet, CallbackInfo ci) {
|
||||
private void lovisual$onTotemSound(ClientboundSoundPacket packet, CallbackInfo ci) {
|
||||
// Opponent cooldown tracking disabled (legacy system).
|
||||
/*
|
||||
if (!CooldownsState.shouldTrackOpponents()) return;
|
||||
|
|
@ -401,7 +396,7 @@ public abstract class ClientPacketListenerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "handleEntityEvent", at = @At("HEAD"))
|
||||
private void combatant$onTotemStatus(ClientboundEntityEventPacket packet, CallbackInfo ci) {
|
||||
private void lovisual$onTotemStatus(ClientboundEntityEventPacket packet, CallbackInfo ci) {
|
||||
if (packet.getEventId() == 35) { // 35 = сработал тотем бессмертия
|
||||
ClientPacketListener handler = (ClientPacketListener) (Object) this;
|
||||
Minecraft client = Minecraft.getInstance();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -20,7 +20,7 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import dev.loki.lovisual.render.engine.core.CombatantRenderSystem;
|
||||
import dev.loki.lovisual.render.engine.core.LoVisualRenderSystem;
|
||||
import dev.loki.lovisual.render.engine.rhi.scissor.GlobalScissorState;
|
||||
import dev.loki.lovisual.util.logging.DebugLog;
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ import java.util.function.Supplier;
|
|||
@Mixin(CommandEncoder.class)
|
||||
public abstract class CommandEncoderMixin {
|
||||
@Unique
|
||||
private static String combatant$label(Supplier<String> label) {
|
||||
private static String lovisual$label(Supplier<String> label) {
|
||||
try {
|
||||
return label != null ? label.get() : "<null-label>";
|
||||
} catch (Throwable t) {
|
||||
|
|
@ -41,7 +41,7 @@ public abstract class CommandEncoderMixin {
|
|||
}
|
||||
|
||||
@Unique
|
||||
private static @Nullable GpuTextureView combatant$firstColorView(
|
||||
private static @Nullable GpuTextureView lovisual$firstColorView(
|
||||
List<RenderPassDescriptor.Attachment<Optional<Vector4fc>>> colorAttachments
|
||||
) {
|
||||
if (colorAttachments == null) {
|
||||
|
|
@ -56,7 +56,7 @@ public abstract class CommandEncoderMixin {
|
|||
}
|
||||
|
||||
@Unique
|
||||
private static @Nullable GpuTextureView combatant$depthView(
|
||||
private static @Nullable GpuTextureView lovisual$depthView(
|
||||
@Nullable RenderPassDescriptor.Attachment<OptionalDouble> depthAttachment
|
||||
) {
|
||||
return depthAttachment == null ? null : depthAttachment.textureView();
|
||||
|
|
@ -64,7 +64,7 @@ public abstract class CommandEncoderMixin {
|
|||
|
||||
|
||||
@Unique
|
||||
private static boolean combatant$isVulkanBackend() {
|
||||
private static boolean lovisual$isVulkanBackend() {
|
||||
try {
|
||||
if (RenderSystem.getDevice() == null || RenderSystem.getDevice().getDeviceInfo() == null) return false;
|
||||
String backendName = RenderSystem.getDevice().getDeviceInfo().backendName();
|
||||
|
|
@ -75,7 +75,7 @@ public abstract class CommandEncoderMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "createRenderPass(Lcom/mojang/blaze3d/systems/RenderPassDescriptor;)Lcom/mojang/blaze3d/systems/RenderPass;", at = @At("RETURN"))
|
||||
private void combatant$onCreateRenderPass(
|
||||
private void lovisual$onCreateRenderPass(
|
||||
RenderPassDescriptor descriptor,
|
||||
CallbackInfoReturnable<RenderPass> cir
|
||||
) {
|
||||
|
|
@ -86,27 +86,27 @@ public abstract class CommandEncoderMixin {
|
|||
try {
|
||||
GlobalScissorState.applyTo(pass, descriptor.renderArea);
|
||||
} catch (Throwable t) {
|
||||
DebugLog.error("[Scissor] render pass scissor hook failed for %s", t, combatant$label(descriptor.label()));
|
||||
DebugLog.error("[Scissor] render pass scissor hook failed for %s", t, lovisual$label(descriptor.label()));
|
||||
}
|
||||
|
||||
try {
|
||||
CombatantRenderSystem.rhi().shapeClip().beginRenderPass(
|
||||
combatant$label(descriptor.label()),
|
||||
combatant$firstColorView(descriptor.colorAttachments()),
|
||||
combatant$depthView(descriptor.depthAttachment())
|
||||
LoVisualRenderSystem.rhi().shapeClip().beginRenderPass(
|
||||
lovisual$label(descriptor.label()),
|
||||
lovisual$firstColorView(descriptor.colorAttachments()),
|
||||
lovisual$depthView(descriptor.depthAttachment())
|
||||
);
|
||||
} catch (Throwable t) {
|
||||
DebugLog.error("[ShapeClip] beginRenderPass hook failed for %s", t, combatant$label(descriptor.label()));
|
||||
DebugLog.error("[ShapeClip] beginRenderPass hook failed for %s", t, lovisual$label(descriptor.label()));
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "submitRenderPass", at = @At("HEAD"))
|
||||
private void combatant$resetRhiRenderPassState(CallbackInfo ci) {
|
||||
if (combatant$isVulkanBackend()) {
|
||||
private void lovisual$resetRhiRenderPassState(CallbackInfo ci) {
|
||||
if (lovisual$isVulkanBackend()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
CombatantRenderSystem.rhi().pipelineState().resetRenderPassState();
|
||||
LoVisualRenderSystem.rhi().pipelineState().resetRenderPassState();
|
||||
} catch (Throwable t) {
|
||||
DebugLog.error("[ShapeClip/GL] render pass reset hook failed", t);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -33,14 +33,14 @@ public class ConnectionMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "genericsFtw", at = @At("HEAD"), cancellable = true)
|
||||
private static <T extends PacketListener> void combatant$onHandlePacket(Packet<T> packet, PacketListener listener, CallbackInfo ci) {
|
||||
private static <T extends PacketListener> void lovisual$onHandlePacket(Packet<T> packet, PacketListener listener, CallbackInfo ci) {
|
||||
if (BlinkManager.isSilentlyHandlingPackets()) return;
|
||||
if (!Events.BUS.hasListeners(PacketEvent.Receive.class)) return;
|
||||
if (packet instanceof ClientboundBundlePacket packs) {
|
||||
ci.cancel();
|
||||
for (Packet<?> p : packs.subPackets()) {
|
||||
try {
|
||||
combatant$handlePacketUnchecked(p, listener);
|
||||
lovisual$handlePacketUnchecked(p, listener);
|
||||
} catch (RunningOnDifferentThreadException ignored) {
|
||||
}
|
||||
}
|
||||
|
|
@ -55,12 +55,12 @@ public class ConnectionMixin {
|
|||
|
||||
@Unique
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
private static void combatant$handlePacketUnchecked(Packet<?> packet, PacketListener listener) {
|
||||
private static void lovisual$handlePacketUnchecked(Packet<?> packet, PacketListener listener) {
|
||||
ConnectionMixin.genericsFtw((Packet) packet, listener);
|
||||
}
|
||||
|
||||
@Inject(method = "genericsFtw", at = @At("TAIL"))
|
||||
private static <T extends PacketListener> void combatant$onHandlePacketPost(Packet<T> packet, PacketListener listener, CallbackInfo ci) {
|
||||
private static <T extends PacketListener> void lovisual$onHandlePacketPost(Packet<T> packet, PacketListener listener, CallbackInfo ci) {
|
||||
if (BlinkManager.isSilentlyHandlingPackets()) return;
|
||||
if (!Events.BUS.hasListeners(PacketEvent.ReceivePost.class)) return;
|
||||
if (packet instanceof ClientboundBundlePacket packs) {
|
||||
|
|
@ -75,7 +75,7 @@ public class ConnectionMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "send(Lnet/minecraft/network/protocol/Packet;)V", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$onSendPacketPre(Packet<?> packet, CallbackInfo ci) {
|
||||
private void lovisual$onSendPacketPre(Packet<?> packet, CallbackInfo ci) {
|
||||
if (BlinkManager.isSilentlyHandlingPackets()) return;
|
||||
if (!Events.BUS.hasListeners(PacketEvent.Send.class)) return;
|
||||
PacketEvent.Send event = new PacketEvent.Send(packet);
|
||||
|
|
@ -86,7 +86,7 @@ public class ConnectionMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "send(Lnet/minecraft/network/protocol/Packet;)V", at = @At("RETURN"))
|
||||
private void combatant$onSendPacketPost(Packet<?> packet, CallbackInfo ci) {
|
||||
private void lovisual$onSendPacketPost(Packet<?> packet, CallbackInfo ci) {
|
||||
if (BlinkManager.isSilentlyHandlingPackets()) return;
|
||||
if (!Events.BUS.hasListeners(PacketEvent.SendPost.class)) return;
|
||||
PacketEvent.SendPost event = new PacketEvent.SendPost(packet);
|
||||
|
|
@ -94,7 +94,7 @@ public class ConnectionMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "configurePacketHandler", at = @At("HEAD"))
|
||||
private void combatant$installProxyHandler(ChannelPipeline pipeline, CallbackInfo ci) {
|
||||
private void lovisual$installProxyHandler(ChannelPipeline pipeline, CallbackInfo ci) {
|
||||
ProxyNettyInstaller.install(pipeline);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -16,17 +16,17 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import dev.loki.lovisual.features.gui.hud.nondraggable.impl.CustomBar;
|
||||
import dev.loki.lovisual.runtime.RuntimeGate;
|
||||
import dev.loki.lovisual.Lifecycle;
|
||||
|
||||
@Mixin(ContextualBar.class)
|
||||
public interface ContextualBarMixin {
|
||||
|
||||
@Inject(method = "extractExperienceLevel", at = @At("HEAD"), cancellable = true)
|
||||
private static void combatant$drawExperienceLevel(GuiGraphicsExtractor context,
|
||||
private static void lovisual$drawExperienceLevel(GuiGraphicsExtractor context,
|
||||
Font textRenderer,
|
||||
int level,
|
||||
CallbackInfo ci) {
|
||||
if (!RuntimeGate.canRunHud()) return;
|
||||
if (!Lifecycle.canRunHud()) return;
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc == null || mc.player == null) return;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -25,7 +25,7 @@ import dev.loki.lovisual.mixins.accessors.CyclingButtonWidgetAccessor;
|
|||
public abstract class CycleButtonMixin<T> {
|
||||
|
||||
@Inject(method = "extractContents(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IIF)V", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$drawIcon(GuiGraphicsExtractor ctx, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
private void lovisual$drawIcon(GuiGraphicsExtractor ctx, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
BetterButtons buttons = BetterButtons.get();
|
||||
if (buttons == null || !buttons.useUiButtons()) return;
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
|
|
@ -37,11 +37,11 @@ public abstract class CycleButtonMixin<T> {
|
|||
float hover = BetterButtons.updateHover(widget, hovered, mouseX, mouseY);
|
||||
|
||||
CyclingButtonWidgetAccessor<T> accessor = (CyclingButtonWidgetAccessor<T>) self;
|
||||
Identifier icon = accessor.combatant$getIcon() != null
|
||||
? accessor.combatant$getIcon().apply(self, self.getValue())
|
||||
Identifier icon = accessor.lovisual$getIcon() != null
|
||||
? accessor.lovisual$getIcon().apply(self, self.getValue())
|
||||
: null;
|
||||
|
||||
boolean showLabel = accessor.combatant$getLabelType() != CycleButton.DisplayState.HIDE;
|
||||
boolean showLabel = accessor.lovisual$getLabelType() != CycleButton.DisplayState.HIDE;
|
||||
BetterButtons.enqueueCyclingButton(self, icon, showLabel, hover, widget.isActive(), widget.isFocused());
|
||||
if (hovered) {
|
||||
BetterButtons.captureTooltip(widget, mouseX, mouseY);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -12,12 +12,11 @@ import org.spongepowered.asm.mixin.Mixin;
|
|||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||
import dev.loki.lovisual.config.MainConfig;
|
||||
import dev.loki.lovisual.render.engine.core.CombatantRenderSystem;
|
||||
import dev.loki.lovisual.render.engine.core.LoVisualRenderSystem;
|
||||
import dev.loki.lovisual.render.engine.debug.RenderThread2DDebugRenderer;
|
||||
import dev.loki.lovisual.render.engine.msaa.MsaaWorldTarget;
|
||||
import dev.loki.lovisual.render.engine.renderer.Renderer2D;
|
||||
import dev.loki.lovisual.render.engine.text.FontDebugStats;
|
||||
import dev.loki.lovisual.runtime.RuntimeGate;
|
||||
import dev.loki.lovisual.util.logging.DebugMode;
|
||||
import dev.loki.lovisual.util.wav.WavDebugStats;
|
||||
|
||||
|
|
@ -35,13 +34,13 @@ public abstract class DebugHudMixin {
|
|||
),
|
||||
index = 1
|
||||
)
|
||||
private List<String> combatant$addEngineInfo(List<String> list) {
|
||||
if (RuntimeGate.isPanic() || list == null) return list;
|
||||
private List<String> lovisual$addEngineInfo(List<String> list) {
|
||||
if (list == null) return list;
|
||||
DebugMode debugMode = MainConfig.get().getDebugMode();
|
||||
if (debugMode != DebugMode.ALL && debugMode != DebugMode.RENDER_THREAD) return list;
|
||||
|
||||
int samples = MainConfig.get().getMsaa3dSamples();
|
||||
boolean supported = CombatantRenderSystem.rhi().msaa().supported();
|
||||
boolean supported = LoVisualRenderSystem.rhi().msaa().supported();
|
||||
MsaaWorldTarget.DebugStatus msaaStatus = MsaaWorldTarget.debugStatus();
|
||||
String msaa;
|
||||
if (samples <= 1) {
|
||||
|
|
@ -62,7 +61,7 @@ public abstract class DebugHudMixin {
|
|||
}
|
||||
|
||||
List<String> out = new ArrayList<>(list.size() + 20);
|
||||
out.add("§cCombatant Engine");
|
||||
out.add("§cLoVisual Engine");
|
||||
out.add("status:§aok");
|
||||
out.add(msaa);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -29,8 +29,8 @@ public abstract class DynamicUniformStorageMixin {
|
|||
target = "Lorg/slf4j/Logger;info(Ljava/lang/String;[Ljava/lang/Object;)V"
|
||||
)
|
||||
)
|
||||
private void combatant$redirectResizeLog(Logger logger, String format, Object[] args) {
|
||||
if (label != null && label.startsWith("Combatant")) {
|
||||
private void lovisual$redirectResizeLog(Logger logger, String format, Object[] args) {
|
||||
if (label != null && label.startsWith("LoVisual")) {
|
||||
String message = "Resizing " + args[0]
|
||||
+ ", capacity limit of " + args[1]
|
||||
+ " reached during a single frame. New capacity will be " + args[2] + ".";
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -27,8 +27,6 @@ import dev.loki.lovisual.events.impl.PlayerStepEvent;
|
|||
import dev.loki.lovisual.events.impl.PlayerStepSuccessEvent;
|
||||
import dev.loki.lovisual.events.impl.PlayerVelocityStrafe;
|
||||
import dev.loki.lovisual.features.module.Modules;
|
||||
import dev.loki.lovisual.features.module.modules.movement.NoPush;
|
||||
import dev.loki.lovisual.features.module.modules.movement.NoStun;
|
||||
import dev.loki.lovisual.mixininterface.IEntity;
|
||||
import dev.loki.lovisual.mixins.accessors.EntityAccessor;
|
||||
import dev.loki.lovisual.mixins.accessors.EntityInvoker;
|
||||
|
|
@ -50,11 +48,11 @@ public abstract class EntityMixin implements IEntity {
|
|||
@Shadow
|
||||
public double zOld;
|
||||
@Unique
|
||||
private MoverType combatant$lastMoveType = MoverType.SELF;
|
||||
private MoverType lovisual$lastMoveType = MoverType.SELF;
|
||||
@Unique
|
||||
private Vec3 combatant$stepBeforePos = Vec3.ZERO;
|
||||
private Vec3 lovisual$stepBeforePos = Vec3.ZERO;
|
||||
@Unique
|
||||
private Vec3 combatant$stepRequestedMovement = Vec3.ZERO;
|
||||
private Vec3 lovisual$stepRequestedMovement = Vec3.ZERO;
|
||||
|
||||
@Unique
|
||||
@Override
|
||||
|
|
@ -64,41 +62,41 @@ public abstract class EntityMixin implements IEntity {
|
|||
|
||||
@Unique
|
||||
@Override
|
||||
public List<TrailPoint> combatant$getTrails() {
|
||||
public List<TrailPoint> lovisual$getTrails() {
|
||||
return trails;
|
||||
}
|
||||
|
||||
@Inject(method = "move", at = @At("HEAD"))
|
||||
private void combatant$cacheMoveType(MoverType type, Vec3 movement, CallbackInfo ci) {
|
||||
combatant$lastMoveType = type;
|
||||
private void lovisual$cacheMoveType(MoverType type, Vec3 movement, CallbackInfo ci) {
|
||||
lovisual$lastMoveType = type;
|
||||
Entity self = (Entity) (Object) this;
|
||||
if (self instanceof LocalPlayer) {
|
||||
combatant$stepBeforePos = self.position();
|
||||
combatant$stepRequestedMovement = movement;
|
||||
lovisual$stepBeforePos = self.position();
|
||||
lovisual$stepRequestedMovement = movement;
|
||||
}
|
||||
}
|
||||
|
||||
@ModifyVariable(method = "move", at = @At("HEAD"), argsOnly = true, index = 2)
|
||||
private Vec3 combatant$onMove(Vec3 movement) {
|
||||
private Vec3 lovisual$onMove(Vec3 movement) {
|
||||
Entity self = (Entity) (Object) this;
|
||||
if (!(self instanceof LocalPlayer)) return movement;
|
||||
if (!Events.BUS.hasListeners(PlayerMoveEvent.class)) return movement;
|
||||
|
||||
PlayerMoveEvent event = new PlayerMoveEvent(combatant$lastMoveType, movement);
|
||||
PlayerMoveEvent event = new PlayerMoveEvent(lovisual$lastMoveType, movement);
|
||||
Events.BUS.post(event);
|
||||
Vec3 out = event.getMovement();
|
||||
return out != null ? out : movement;
|
||||
}
|
||||
|
||||
@Inject(method = "move", at = @At("RETURN"))
|
||||
private void combatant$onMoveReturn(MoverType type, Vec3 movement, CallbackInfo ci) {
|
||||
private void lovisual$onMoveReturn(MoverType type, Vec3 movement, CallbackInfo ci) {
|
||||
Entity self = (Entity) (Object) this;
|
||||
if (!(self instanceof LocalPlayer)) return;
|
||||
if (!Events.BUS.hasListeners(PlayerStepSuccessEvent.class)) return;
|
||||
|
||||
Vec3 before = combatant$stepBeforePos;
|
||||
Vec3 before = lovisual$stepBeforePos;
|
||||
Vec3 after = self.position();
|
||||
Vec3 requested = combatant$stepRequestedMovement;
|
||||
Vec3 requested = lovisual$stepRequestedMovement;
|
||||
double yDelta = after.y - before.y;
|
||||
double horizontalRequested = Math.hypot(requested.x, requested.z);
|
||||
if (yDelta <= 0.5 || horizontalRequested <= 1.0E-5) return;
|
||||
|
|
@ -107,7 +105,7 @@ public abstract class EntityMixin implements IEntity {
|
|||
}
|
||||
|
||||
@ModifyReturnValue(method = "maxUpStep", at = @At("RETURN"))
|
||||
private float combatant$modifyStepHeight(float original) {
|
||||
private float lovisual$modifyStepHeight(float original) {
|
||||
Entity self = (Entity) (Object) this;
|
||||
if (!(self instanceof LocalPlayer)) return original;
|
||||
if (!Events.BUS.hasListeners(PlayerStepEvent.class)) return original;
|
||||
|
|
@ -124,9 +122,9 @@ public abstract class EntityMixin implements IEntity {
|
|||
target = "Lnet/minecraft/world/entity/Entity;getInputVector(Lnet/minecraft/world/phys/Vec3;FF)Lnet/minecraft/world/phys/Vec3;"
|
||||
)
|
||||
)
|
||||
private Vec3 combatant$velocityStrafe(Vec3 movementInput, float speed, float yaw) {
|
||||
private Vec3 lovisual$velocityStrafe(Vec3 movementInput, float speed, float yaw) {
|
||||
Entity self = (Entity) (Object) this;
|
||||
Vec3 vanilla = EntityInvoker.combatant$movementInputToVelocity(movementInput, speed, yaw);
|
||||
Vec3 vanilla = EntityInvoker.lovisual$movementInputToVelocity(movementInput, speed, yaw);
|
||||
if (!(self instanceof LocalPlayer)) return vanilla;
|
||||
if (!Events.BUS.hasListeners(PlayerVelocityStrafe.class)) return vanilla;
|
||||
|
||||
|
|
@ -141,7 +139,7 @@ public abstract class EntityMixin implements IEntity {
|
|||
ordinal = 0,
|
||||
argsOnly = true
|
||||
)
|
||||
private float combatant$rotationVectorPitch(float pitch) {
|
||||
private float lovisual$rotationVectorPitch(float pitch) {
|
||||
if (!((Object) this instanceof LocalPlayer)) {
|
||||
return pitch;
|
||||
}
|
||||
|
|
@ -158,32 +156,14 @@ public abstract class EntityMixin implements IEntity {
|
|||
target = "Lnet/minecraft/world/entity/Entity;push(DDD)V"
|
||||
)
|
||||
)
|
||||
private void combatant$cancelEntityPush(Entity instance, double x, double y, double z) {
|
||||
NoPush noPush = Modules.get(NoPush.class);
|
||||
if (noPush == null || !noPush.off("players")) {
|
||||
instance.push(x, y, z);
|
||||
}
|
||||
private void lovisual$cancelEntityPush(Entity instance, double x, double y, double z) {
|
||||
// NoPush module removed; keep vanilla entity pushing.
|
||||
instance.push(x, y, z);
|
||||
}
|
||||
|
||||
@Inject(method = "makeStuckInBlock", at = @At("HEAD"), cancellable = true)
|
||||
private void nostun$cancelSlowMovement(BlockState state, Vec3 multiplier, CallbackInfo ci) {
|
||||
Entity self = (Entity) (Object) this;
|
||||
if (!(self instanceof LocalPlayer)) return;
|
||||
|
||||
NoStun ns = Modules.get(NoStun.class);
|
||||
if (ns == null || !ns.isEnabled()) return;
|
||||
|
||||
Vec3 override = ns.getSlowMovementOverride(state, multiplier);
|
||||
if (override != null && self instanceof EntityAccessor accessor) {
|
||||
self.resetFallDistance();
|
||||
accessor.combatant$setMovementMultiplier(override);
|
||||
ci.cancel();
|
||||
return;
|
||||
}
|
||||
|
||||
if (ns.shouldCancelSlowMovement(state)) {
|
||||
ci.cancel();
|
||||
}
|
||||
// NoStun module removed; no slow-movement override remains.
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -23,7 +23,7 @@ public abstract class EquipmentLayerRendererMixin {
|
|||
method = "renderLayers(Lnet/minecraft/client/resources/model/EquipmentClientInfo$LayerType;Lnet/minecraft/resources/ResourceKey;Lnet/minecraft/client/model/Model;Ljava/lang/Object;Lnet/minecraft/world/item/ItemStack;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;ILnet/minecraft/resources/Identifier;II)V",
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/rendertype/RenderTypes;armorCutoutNoCull(Lnet/minecraft/resources/Identifier;)Lnet/minecraft/client/renderer/rendertype/RenderType;")
|
||||
)
|
||||
private RenderType combatant$useTranslucentArmorWhenViewFaded(Identifier texture) {
|
||||
private RenderType lovisual$useTranslucentArmorWhenViewFaded(Identifier texture) {
|
||||
if (IrisRuntime.isRenderingShadowPass()) {
|
||||
return RenderTypes.armorCutoutNoCull(texture);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -16,14 +16,14 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import dev.loki.lovisual.features.gui.hud.nondraggable.impl.CustomBar;
|
||||
import dev.loki.lovisual.runtime.RuntimeGate;
|
||||
import dev.loki.lovisual.Lifecycle;
|
||||
|
||||
@Mixin(ExperienceBar.class)
|
||||
public abstract class ExperienceBarMixin {
|
||||
|
||||
@Inject(method = "extractBackground", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$renderXpBar(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
if (!RuntimeGate.canRunHud()) return;
|
||||
private void lovisual$renderXpBar(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
if (!Lifecycle.canRunHud()) return;
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc == null || mc.player == null) return;
|
||||
|
||||
|
|
@ -36,8 +36,8 @@ public abstract class ExperienceBarMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "extractRenderState", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$renderXpAddons(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
if (!RuntimeGate.canRunHud()) return;
|
||||
private void lovisual$renderXpAddons(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
if (!Lifecycle.canRunHud()) return;
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc == null || mc.player == null) return;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -43,7 +43,7 @@ public abstract class FireworkRocketEntityMixin {
|
|||
target = "Lnet/minecraft/world/entity/LivingEntity;getLookAngle()Lnet/minecraft/world/phys/Vec3;"
|
||||
)
|
||||
)
|
||||
private Vec3 combatant$fireworkMoveRotation(LivingEntity instance, Operation<Vec3> original) {
|
||||
private Vec3 lovisual$fireworkMoveRotation(LivingEntity instance, Operation<Vec3> original) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc == null || attachedToEntity != mc.player) {
|
||||
return original.call(instance);
|
||||
|
|
@ -60,7 +60,7 @@ public abstract class FireworkRocketEntityMixin {
|
|||
ordinal = 0
|
||||
)
|
||||
)
|
||||
private Vec3 combatant$fireworkVelocityHook(LivingEntity instance, Operation<Vec3> original) {
|
||||
private Vec3 lovisual$fireworkVelocityHook(LivingEntity instance, Operation<Vec3> original) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
Vec3 velocity = original.call(instance);
|
||||
if (mc == null || attachedToEntity != mc.player || !Events.BUS.hasListeners(FireworkEvent.class)) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
* Portions derived from ThunderHack Recode, copyright (c) 2023-2024 Pan4ur & 06ED.
|
||||
* Upstream: https://github.com/Pan4ur/ThunderHack-Recode
|
||||
|
|
@ -20,8 +20,6 @@ import org.spongepowered.asm.mixin.Shadow;
|
|||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import dev.loki.lovisual.features.module.Modules;
|
||||
import dev.loki.lovisual.features.module.modules.movement.NoPush;
|
||||
|
||||
import static net.minecraft.world.level.material.FlowingFluid.FALLING;
|
||||
|
||||
|
|
@ -32,24 +30,7 @@ public abstract class FlowingFluidMixin {
|
|||
protected abstract boolean isSolidFace(BlockGetter world, BlockPos pos, Direction direction);
|
||||
|
||||
@Inject(method = "getFlow", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$getVelocity(BlockGetter world, BlockPos pos, FluidState state, CallbackInfoReturnable<Vec3> cir) {
|
||||
NoPush np = Modules.get(NoPush.class);
|
||||
if (np == null || !np.liquidsEnabled()) return;
|
||||
|
||||
double d = 0.0;
|
||||
double e = 0.0;
|
||||
BlockPos.MutableBlockPos mutable = new BlockPos.MutableBlockPos();
|
||||
Vec3 vec3d = new Vec3(d, 0.0, e);
|
||||
if (state.getValue(FALLING)) {
|
||||
for (Direction direction2 : Direction.Plane.HORIZONTAL) {
|
||||
mutable.setWithOffset(pos, direction2);
|
||||
if (!this.isSolidFace(world, mutable, direction2) && !this.isSolidFace(world, mutable.above(), direction2)) {
|
||||
continue;
|
||||
}
|
||||
vec3d = vec3d.normalize().add(0.0, -6.0, 0.0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
cir.setReturnValue(vec3d.normalize());
|
||||
private void lovisual$getVelocity(BlockGetter world, BlockPos pos, FluidState state, CallbackInfoReturnable<Vec3> cir) {
|
||||
// NoPush module removed; no fluid velocity override remains.
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -29,7 +29,7 @@ public class FogRendererMixin {
|
|||
at = @At("HEAD"),
|
||||
argsOnly = true,
|
||||
index = 2)
|
||||
private int combatant$disableDistanceFog(int value) {
|
||||
private int lovisual$disableDistanceFog(int value) {
|
||||
WorldTweaks module = Modules.get(WorldTweaks.class);
|
||||
if (module == null || !module.isFogControlEnabled()) return value;
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
|
|
@ -61,7 +61,7 @@ public class FogRendererMixin {
|
|||
at = @At("RETURN"),
|
||||
cancellable = true
|
||||
)
|
||||
private void combatant$modifyFogColor(Camera camera,
|
||||
private void lovisual$modifyFogColor(Camera camera,
|
||||
float tickDelta,
|
||||
ClientLevel world,
|
||||
int viewDistance,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -24,7 +24,7 @@ public abstract class FontManagerMixin {
|
|||
target = "Lorg/slf4j/Logger;warn(Ljava/lang/String;[Ljava/lang/Object;)V"
|
||||
)
|
||||
)
|
||||
private static void combatant$maybeSuppressFontLoadWarn(
|
||||
private static void lovisual$maybeSuppressFontLoadWarn(
|
||||
Logger logger,
|
||||
String format,
|
||||
Object[] args
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -52,15 +52,15 @@ import dev.loki.lovisual.features.module.modules.visuals.*;
|
|||
import dev.loki.lovisual.mixins.accessors.GameRendererAccessor;
|
||||
import dev.loki.lovisual.mixins.accessors.LocalPlayerAccessor;
|
||||
import dev.loki.lovisual.render.engine.RenderState;
|
||||
import dev.loki.lovisual.render.engine.core.CombatantRenderSystem;
|
||||
import dev.loki.lovisual.render.engine.core.CombatantWorldMatrices;
|
||||
import dev.loki.lovisual.render.engine.core.LoVisualRenderSystem;
|
||||
import dev.loki.lovisual.render.engine.core.LoVisualWorldMatrices;
|
||||
import dev.loki.lovisual.render.engine.core.RenderPhase;
|
||||
import dev.loki.lovisual.render.engine.core.RenderPhaseScope;
|
||||
import dev.loki.lovisual.render.engine.depth.WorldSceneDepth;
|
||||
// import dev.loki.lovisual.render.engine.debug.RenderThread2DDebugRenderer; // disabled: debug probes are manual-only
|
||||
import dev.loki.lovisual.render.engine.msaa.MsaaWorldTarget;
|
||||
import dev.loki.lovisual.config.MainConfig;
|
||||
import dev.loki.lovisual.render.engine.pipeline.CombatantRenderPipelines;
|
||||
import dev.loki.lovisual.render.engine.pipeline.LoVisualRenderPipelines;
|
||||
import dev.loki.lovisual.render.engine.postprocess.PostProcessManager;
|
||||
import dev.loki.lovisual.render.engine.postprocess.MenuBackgroundRenderer;
|
||||
import dev.loki.lovisual.render.engine.profiler.ProfilerPhase;
|
||||
|
|
@ -70,8 +70,8 @@ import dev.loki.lovisual.render.engine.renderer.MeshRenderer;
|
|||
import dev.loki.lovisual.render.engine.renderer.Renderer2D;
|
||||
import dev.loki.lovisual.render.engine.renderer.Renderer3D;
|
||||
import dev.loki.lovisual.render.engine.text.TextRenderer;
|
||||
import dev.loki.lovisual.render.engine.visuals.CombatantVisuals;
|
||||
import dev.loki.lovisual.render.iris.IrisCombatantFrameHooks;
|
||||
import dev.loki.lovisual.render.engine.visuals.LoVisualVisuals;
|
||||
import dev.loki.lovisual.render.iris.IrisLoVisualFrameHooks;
|
||||
import dev.loki.lovisual.render.iris.IrisFinalizedSceneRenderer;
|
||||
import dev.loki.lovisual.render.iris.IrisCompatibilityGuards;
|
||||
import dev.loki.lovisual.render.iris.IrisRuntime;
|
||||
|
|
@ -81,17 +81,17 @@ import dev.loki.lovisual.util.logging.DebugLog;
|
|||
public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
||||
|
||||
@Unique
|
||||
private static final boolean COMBATANT_DEBUG_PRIMITIVE = false;
|
||||
private static final boolean LOVISUAL_DEBUG_PRIMITIVE = false;
|
||||
@Unique
|
||||
private static final boolean COMBATANT_DEBUG_CLIP_SPACE = false;
|
||||
private static final boolean LOVISUAL_DEBUG_CLIP_SPACE = false;
|
||||
@Unique
|
||||
private static final long COMBATANT_DEBUG_INTERVAL_MS = 2000L;
|
||||
private static final long LOVISUAL_DEBUG_INTERVAL_MS = 2000L;
|
||||
@Unique
|
||||
private static long COMBATANT_DEBUG_LAST_MS;
|
||||
private static long LOVISUAL_DEBUG_LAST_MS;
|
||||
@Unique
|
||||
private final PoseStack combatant$matrices = new PoseStack();
|
||||
private final PoseStack lovisual$matrices = new PoseStack();
|
||||
@Unique
|
||||
private final PoseStack combatant$postMatrices = new PoseStack();
|
||||
private final PoseStack lovisual$postMatrices = new PoseStack();
|
||||
@Shadow
|
||||
@Final
|
||||
private Minecraft minecraft;
|
||||
|
|
@ -106,16 +106,16 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
@Shadow
|
||||
private float spinningEffectSpeed;
|
||||
@Unique
|
||||
private Renderer3D combatant$renderer;
|
||||
private Renderer3D lovisual$renderer;
|
||||
@Unique
|
||||
private Renderer3D combatant$depthRenderer;
|
||||
private Renderer3D lovisual$depthRenderer;
|
||||
@Unique
|
||||
private Renderer3D combatant$postRenderer;
|
||||
private Renderer3D lovisual$postRenderer;
|
||||
@Unique
|
||||
private Renderer3D combatant$postDepthRenderer;
|
||||
private Renderer3D lovisual$postDepthRenderer;
|
||||
|
||||
@Unique
|
||||
private static void combatant$drawDebugCube(Renderer3D rdr,
|
||||
private static void lovisual$drawDebugCube(Renderer3D rdr,
|
||||
double x1, double y1, double z1,
|
||||
double x2, double y2, double z2) {
|
||||
rdr.line(x1, y1, z1, x2, y1, z1, 255, 0, 0, 255);
|
||||
|
|
@ -148,7 +148,7 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
protected abstract void bobHurt(CameraRenderState cameraRenderState, PoseStack matrices);
|
||||
|
||||
@Unique
|
||||
private static boolean combatant$needsResolvedMainDepth() {
|
||||
private static boolean lovisual$needsResolvedMainDepth() {
|
||||
ReimaginedVisual module = Modules.get(ReimaginedVisual.class);
|
||||
if (module == null) return false;
|
||||
if (module.needsResolvedMainDepthCapture()) return true;
|
||||
|
|
@ -156,19 +156,19 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
}
|
||||
|
||||
@Inject(method = "tick", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$skipTickWithoutPlayer(CallbackInfo ci) {
|
||||
private void lovisual$skipTickWithoutPlayer(CallbackInfo ci) {
|
||||
if (minecraft != null && minecraft.level != null && minecraft.player == null) {
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "extract(Lnet/minecraft/client/DeltaTracker;Z)V", at = @At("HEAD"))
|
||||
private void combatant$beginDeferred2DExtract(DeltaTracker tickCounter, boolean tick, CallbackInfo ci) {
|
||||
private void lovisual$beginDeferred2DExtract(DeltaTracker tickCounter, boolean tick, CallbackInfo ci) {
|
||||
Renderer2D.beginDeferredExtractFrame();
|
||||
}
|
||||
|
||||
@Inject(method = "extract(Lnet/minecraft/client/DeltaTracker;Z)V", at = @At("TAIL"))
|
||||
private void combatant$endDeferred2DExtract(DeltaTracker tickCounter, boolean tick, CallbackInfo ci) {
|
||||
private void lovisual$endDeferred2DExtract(DeltaTracker tickCounter, boolean tick, CallbackInfo ci) {
|
||||
Renderer2D.endDeferredExtractFrame();
|
||||
}
|
||||
|
||||
|
|
@ -179,7 +179,7 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
target = "Lnet/minecraft/client/renderer/GameRenderer;bobView(Lnet/minecraft/client/renderer/state/level/CameraRenderState;Lcom/mojang/blaze3d/vertex/PoseStack;)V"
|
||||
)
|
||||
)
|
||||
private void combatant$viewModel$replaceHandBobbing(GameRenderer instance,
|
||||
private void lovisual$viewModel$replaceHandBobbing(GameRenderer instance,
|
||||
CameraRenderState cameraRenderState,
|
||||
PoseStack matrices,
|
||||
CameraRenderState originalCameraRenderState,
|
||||
|
|
@ -201,7 +201,7 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
}
|
||||
|
||||
@Inject(method = "extractCamera", at = @At("TAIL"))
|
||||
private void combatant$modifyAspect(DeltaTracker tickCounter, float tickDelta, float fov, CallbackInfo ci) {
|
||||
private void lovisual$modifyAspect(DeltaTracker tickCounter, float tickDelta, float fov, CallbackInfo ci) {
|
||||
|
||||
AspectRatio ar = Modules.get(AspectRatio.class);
|
||||
if (ar == null || !ar.isEnabled()) {
|
||||
|
|
@ -221,16 +221,16 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
}
|
||||
|
||||
@Inject(method = "extractCamera", at = @At("TAIL"))
|
||||
private void combatant$captureProjectionFor2DOverlays(DeltaTracker tickCounter, float tickDelta, float fov, CallbackInfo ci) {
|
||||
private void lovisual$captureProjectionFor2DOverlays(DeltaTracker tickCounter, float tickDelta, float fov, CallbackInfo ci) {
|
||||
if (gameRenderState == null || gameRenderState.levelRenderState == null) return;
|
||||
CameraRenderState cameraRenderState = gameRenderState.levelRenderState.cameraRenderState;
|
||||
if (cameraRenderState == null || cameraRenderState.viewRotationMatrix == null || cameraRenderState.projectionMatrix == null) return;
|
||||
|
||||
PoseStack effectMatrices = new PoseStack();
|
||||
Matrix4f renderProjection = combatant$buildWorldProjection(fov, effectMatrices, tickDelta);
|
||||
Matrix4f renderProjection = lovisual$buildWorldProjection(fov, effectMatrices, tickDelta);
|
||||
AspectRatio.applyToProjection(renderProjection);
|
||||
Matrix4f screenProjection = new Matrix4f(cameraRenderState.projectionMatrix);
|
||||
CombatantWorldMatrices.capture(
|
||||
LoVisualWorldMatrices.capture(
|
||||
cameraRenderState.viewRotationMatrix,
|
||||
renderProjection,
|
||||
screenProjection,
|
||||
|
|
@ -239,7 +239,7 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
}
|
||||
|
||||
@Inject(method = "mainRenderTarget", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$overrideWorldFramebuffer(CallbackInfoReturnable<com.mojang.blaze3d.pipeline.RenderTarget> cir) {
|
||||
private void lovisual$overrideWorldFramebuffer(CallbackInfoReturnable<com.mojang.blaze3d.pipeline.RenderTarget> cir) {
|
||||
com.mojang.blaze3d.pipeline.RenderTarget msaa = MsaaWorldTarget.getFramebufferOverride();
|
||||
if (msaa != null) {
|
||||
cir.setReturnValue(msaa);
|
||||
|
|
@ -247,20 +247,20 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
}
|
||||
|
||||
@Unique
|
||||
private void combatant$renderWorldEngine(DeltaTracker tickCounter) {
|
||||
private void lovisual$renderWorldEngine(DeltaTracker tickCounter) {
|
||||
try (ProfilerPhase.Scope phaseScope = ProfilerPhase.scope("3d:world");
|
||||
TracyGpuProfiler.Scope gpuScope = TracyGpuProfiler.beginZone("3d:world")) {
|
||||
float tickDelta = tickCounter.getGameTimeDeltaPartialTick(true);
|
||||
float fov = mainCamera.getFov();
|
||||
Matrix4f capturedPosition = CombatantWorldMatrices.positionMatrix();
|
||||
Matrix4f capturedProjection = CombatantWorldMatrices.renderProjectionMatrix();
|
||||
Matrix4f capturedPosition = LoVisualWorldMatrices.positionMatrix();
|
||||
Matrix4f capturedProjection = LoVisualWorldMatrices.renderProjectionMatrix();
|
||||
boolean useCapturedMatrices = capturedPosition != null && capturedProjection != null;
|
||||
Matrix4f position = useCapturedMatrices
|
||||
? capturedPosition
|
||||
: new Matrix4f().rotation(mainCamera.rotation().conjugate(new org.joml.Quaternionf()));
|
||||
RenderState.rendering3D = true;
|
||||
RenderState.tickDelta = tickDelta;
|
||||
Vec3 capturedCameraPos = CombatantWorldMatrices.cameraPosition();
|
||||
Vec3 capturedCameraPos = LoVisualWorldMatrices.cameraPosition();
|
||||
RenderState.cameraPos = capturedCameraPos != null ? capturedCameraPos : mainCamera.position();
|
||||
RenderState.cameraRotation.set(mainCamera.rotation());
|
||||
RenderState.cameraYaw = mainCamera.yRot();
|
||||
|
|
@ -275,7 +275,7 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
? mainCamera.getCapturedFrustum()
|
||||
: null;
|
||||
|
||||
if (COMBATANT_DEBUG_CLIP_SPACE) {
|
||||
if (LOVISUAL_DEBUG_CLIP_SPACE) {
|
||||
var mv = com.mojang.blaze3d.systems.RenderSystem.getModelViewStack();
|
||||
mv.pushMatrix();
|
||||
mv.identity();
|
||||
|
|
@ -283,76 +283,76 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
MeshRenderer.setProjection(new Matrix4f().identity());
|
||||
RenderState.rendering3D = false;
|
||||
|
||||
if (combatant$renderer == null) {
|
||||
combatant$renderer = new Renderer3D(
|
||||
CombatantRenderPipelines.WORLD_COLORED_LINES,
|
||||
CombatantRenderPipelines.WORLD_COLORED
|
||||
if (lovisual$renderer == null) {
|
||||
lovisual$renderer = new Renderer3D(
|
||||
LoVisualRenderPipelines.WORLD_COLORED_LINES,
|
||||
LoVisualRenderPipelines.WORLD_COLORED
|
||||
);
|
||||
}
|
||||
|
||||
combatant$renderer.begin();
|
||||
lovisual$renderer.begin();
|
||||
|
||||
// Clip-space square + diagonals (NDC)
|
||||
combatant$renderer.line(-0.8, -0.8, 0.0, 0.8, -0.8, 0.0, 255, 0, 0, 255);
|
||||
combatant$renderer.line(0.8, -0.8, 0.0, 0.8, 0.8, 0.0, 0, 255, 0, 255);
|
||||
combatant$renderer.line(0.8, 0.8, 0.0, -0.8, 0.8, 0.0, 0, 0, 255, 255);
|
||||
combatant$renderer.line(-0.8, 0.8, 0.0, -0.8, -0.8, 0.0, 255, 255, 0, 255);
|
||||
combatant$renderer.line(-0.8, -0.8, 0.0, 0.8, 0.8, 0.0, 255, 0, 255, 255);
|
||||
combatant$renderer.line(0.8, -0.8, 0.0, -0.8, 0.8, 0.0, 0, 255, 255, 255);
|
||||
lovisual$renderer.line(-0.8, -0.8, 0.0, 0.8, -0.8, 0.0, 255, 0, 0, 255);
|
||||
lovisual$renderer.line(0.8, -0.8, 0.0, 0.8, 0.8, 0.0, 0, 255, 0, 255);
|
||||
lovisual$renderer.line(0.8, 0.8, 0.0, -0.8, 0.8, 0.0, 0, 0, 255, 255);
|
||||
lovisual$renderer.line(-0.8, 0.8, 0.0, -0.8, -0.8, 0.0, 255, 255, 0, 255);
|
||||
lovisual$renderer.line(-0.8, -0.8, 0.0, 0.8, 0.8, 0.0, 255, 0, 255, 255);
|
||||
lovisual$renderer.line(0.8, -0.8, 0.0, -0.8, 0.8, 0.0, 0, 255, 255, 255);
|
||||
|
||||
combatant$renderer.render(new PoseStack());
|
||||
lovisual$renderer.render(new PoseStack());
|
||||
|
||||
mv.popMatrix();
|
||||
RenderState.rendering3D = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (combatant$renderer == null) {
|
||||
combatant$renderer = new Renderer3D(
|
||||
CombatantRenderPipelines.WORLD_COLORED_LINES,
|
||||
CombatantRenderPipelines.WORLD_COLORED
|
||||
if (lovisual$renderer == null) {
|
||||
lovisual$renderer = new Renderer3D(
|
||||
LoVisualRenderPipelines.WORLD_COLORED_LINES,
|
||||
LoVisualRenderPipelines.WORLD_COLORED
|
||||
);
|
||||
}
|
||||
|
||||
if (combatant$depthRenderer == null) {
|
||||
combatant$depthRenderer = new Renderer3D(
|
||||
CombatantRenderPipelines.WORLD_COLORED_LINES_DEPTH,
|
||||
CombatantRenderPipelines.WORLD_COLORED_DEPTH
|
||||
if (lovisual$depthRenderer == null) {
|
||||
lovisual$depthRenderer = new Renderer3D(
|
||||
LoVisualRenderPipelines.WORLD_COLORED_LINES_DEPTH,
|
||||
LoVisualRenderPipelines.WORLD_COLORED_DEPTH
|
||||
);
|
||||
}
|
||||
|
||||
var mv = com.mojang.blaze3d.systems.RenderSystem.getModelViewStack();
|
||||
mv.pushMatrix();
|
||||
if (IrisCombatantFrameHooks.isRenderingAfterIrisFinalization()) {
|
||||
if (IrisLoVisualFrameHooks.isRenderingAfterIrisFinalization()) {
|
||||
mv.identity();
|
||||
}
|
||||
mv.mul(position);
|
||||
combatant$matrices.pushPose();
|
||||
lovisual$matrices.pushPose();
|
||||
Matrix4f projection = useCapturedMatrices
|
||||
? capturedProjection
|
||||
: combatant$buildWorldProjection(fov, combatant$matrices, tickDelta);
|
||||
: lovisual$buildWorldProjection(fov, lovisual$matrices, tickDelta);
|
||||
MeshRenderer.setProjection(projection);
|
||||
CombatantRenderSystem.beginFrame(
|
||||
LoVisualRenderSystem.beginFrame(
|
||||
tickDelta,
|
||||
tickCounter.getGameTimeDeltaTicks(),
|
||||
tickCounter.getRealtimeDeltaTicks(),
|
||||
projection,
|
||||
new Matrix4f(mv)
|
||||
);
|
||||
try (RenderPhaseScope combatant$beforeTranslucentPhase = CombatantRenderSystem.phase(RenderPhase.WORLD_BEFORE_TRANSLUCENT)) {
|
||||
try (RenderPhaseScope lovisual$beforeTranslucentPhase = LoVisualRenderSystem.phase(RenderPhase.WORLD_BEFORE_TRANSLUCENT)) {
|
||||
RenderState.worldProjection.set(projection);
|
||||
RenderState.frustum = new Frustum(position, projection);
|
||||
RenderState.frustum.prepare(RenderState.cameraPos.x, RenderState.cameraPos.y, RenderState.cameraPos.z);
|
||||
|
||||
if (!useCapturedMatrices) {
|
||||
Matrix4f inverseBob = new Matrix4f(combatant$matrices.last().pose()).invert();
|
||||
Matrix4f inverseBob = new Matrix4f(lovisual$matrices.last().pose()).invert();
|
||||
mv.mul(inverseBob);
|
||||
}
|
||||
|
||||
combatant$renderer.begin();
|
||||
combatant$depthRenderer.begin();
|
||||
lovisual$renderer.begin();
|
||||
lovisual$depthRenderer.begin();
|
||||
|
||||
if (COMBATANT_DEBUG_PRIMITIVE) {
|
||||
if (LOVISUAL_DEBUG_PRIMITIVE) {
|
||||
Vec3 camPos = mainCamera.position();
|
||||
float yaw = mainCamera.yRot() * ((float) Math.PI / 180.0f);
|
||||
float pitch = mainCamera.xRot() * ((float) Math.PI / 180.0f);
|
||||
|
|
@ -371,18 +371,18 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
double ox2 = 1.0, oy2 = 1.0, oz2 = 1.0;
|
||||
|
||||
// Wire cube (no depth) and depth variant
|
||||
Renderer3D[] targets = new Renderer3D[]{combatant$renderer, combatant$depthRenderer};
|
||||
Renderer3D[] targets = new Renderer3D[]{lovisual$renderer, lovisual$depthRenderer};
|
||||
for (Renderer3D rdr : targets) {
|
||||
combatant$drawDebugCube(rdr, x1, y1, z1, x2, y2, z2);
|
||||
combatant$drawDebugCube(rdr, ox1, oy1, oz1, ox2, oy2, oz2);
|
||||
lovisual$drawDebugCube(rdr, x1, y1, z1, x2, y2, z2);
|
||||
lovisual$drawDebugCube(rdr, ox1, oy1, oz1, ox2, oy2, oz2);
|
||||
}
|
||||
|
||||
long now = System.currentTimeMillis();
|
||||
if (now - COMBATANT_DEBUG_LAST_MS >= COMBATANT_DEBUG_INTERVAL_MS) {
|
||||
COMBATANT_DEBUG_LAST_MS = now;
|
||||
if (now - LOVISUAL_DEBUG_LAST_MS >= LOVISUAL_DEBUG_INTERVAL_MS) {
|
||||
LOVISUAL_DEBUG_LAST_MS = now;
|
||||
Matrix4f mvMat = com.mojang.blaze3d.systems.RenderSystem.getModelViewMatrixCopy();
|
||||
DebugLog.renderThread(
|
||||
"[Combatant] Debug diag: cam=" + camPos
|
||||
"[LoVisual] Debug diag: cam=" + camPos
|
||||
+ " proj=[" + projection.m00() + "," + projection.m11() + "," + projection.m22() + "," + projection.m33() + "]"
|
||||
+ " mv=[" + mvMat.m30() + "," + mvMat.m31() + "," + mvMat.m32() + "]"
|
||||
);
|
||||
|
|
@ -391,39 +391,39 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
|
||||
try (ProfilerPhase.Scope phase = ProfilerPhase.scope("3d:modules_before_translucent");
|
||||
RenderProfiler3D.Section ignored = RenderProfiler3D.section("modules_before_translucent")) {
|
||||
ModuleManager.renderWorldEngine(WorldPhase.BEFORE_TRANSLUCENT, combatant$renderer, combatant$depthRenderer, tickDelta);
|
||||
ModuleManager.renderWorldEngine(WorldPhase.BEFORE_TRANSLUCENT, lovisual$renderer, lovisual$depthRenderer, tickDelta);
|
||||
AddonRenderPipelineManager.render3D(LoVisualRenderStage.WORLD_BEFORE_TRANSLUCENT,
|
||||
WorldPhase.BEFORE_TRANSLUCENT, combatant$renderer, combatant$depthRenderer, combatant$matrices, tickDelta);
|
||||
WorldPhase.BEFORE_TRANSLUCENT, lovisual$renderer, lovisual$depthRenderer, lovisual$matrices, tickDelta);
|
||||
}
|
||||
|
||||
try (ProfilerPhase.Scope phase = ProfilerPhase.scope("3d:flush_before_translucent");
|
||||
TracyGpuProfiler.Scope gpuFlush = TracyGpuProfiler.beginZone("3d:flush_before_translucent");
|
||||
RenderProfiler3D.Section ignored = RenderProfiler3D.section("flush_before_translucent")) {
|
||||
combatant$renderer.render(combatant$matrices);
|
||||
combatant$depthRenderer.render(combatant$matrices);
|
||||
lovisual$renderer.render(lovisual$matrices);
|
||||
lovisual$depthRenderer.render(lovisual$matrices);
|
||||
}
|
||||
}
|
||||
|
||||
// Start a new batch for END_MAIN so overlays render above grass.
|
||||
combatant$renderer.begin();
|
||||
combatant$depthRenderer.begin();
|
||||
lovisual$renderer.begin();
|
||||
lovisual$depthRenderer.begin();
|
||||
|
||||
try (RenderPhaseScope combatant$afterTranslucentPhase = CombatantRenderSystem.phase(RenderPhase.WORLD_AFTER_TRANSLUCENT)) {
|
||||
try (RenderPhaseScope lovisual$afterTranslucentPhase = LoVisualRenderSystem.phase(RenderPhase.WORLD_AFTER_TRANSLUCENT)) {
|
||||
try (ProfilerPhase.Scope phase = ProfilerPhase.scope("3d:modules_end_main");
|
||||
RenderProfiler3D.Section ignored = RenderProfiler3D.section("modules_end_main")) {
|
||||
ModuleManager.renderWorldEngine(WorldPhase.END_MAIN, combatant$renderer, combatant$depthRenderer, tickDelta);
|
||||
ModuleManager.renderWorldEngine(WorldPhase.END_MAIN, lovisual$renderer, lovisual$depthRenderer, tickDelta);
|
||||
AddonRenderPipelineManager.render3D(LoVisualRenderStage.WORLD_END_MAIN,
|
||||
WorldPhase.END_MAIN, combatant$renderer, combatant$depthRenderer, combatant$matrices, tickDelta);
|
||||
WorldPhase.END_MAIN, lovisual$renderer, lovisual$depthRenderer, lovisual$matrices, tickDelta);
|
||||
}
|
||||
|
||||
try (ProfilerPhase.Scope phase = ProfilerPhase.scope("3d:flush_end_main");
|
||||
TracyGpuProfiler.Scope gpuFlush = TracyGpuProfiler.beginZone("3d:flush_end_main");
|
||||
RenderProfiler3D.Section ignored = RenderProfiler3D.section("flush_end_main")) {
|
||||
combatant$renderer.render(combatant$matrices);
|
||||
combatant$depthRenderer.render(combatant$matrices);
|
||||
lovisual$renderer.render(lovisual$matrices);
|
||||
lovisual$depthRenderer.render(lovisual$matrices);
|
||||
}
|
||||
}
|
||||
combatant$matrices.popPose();
|
||||
lovisual$matrices.popPose();
|
||||
mv.popMatrix();
|
||||
RenderState.rendering3D = false;
|
||||
}
|
||||
|
|
@ -431,16 +431,16 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
|
||||
|
||||
@Inject(method = "renderLevel", at = @At("HEAD"))
|
||||
private void combatant$beginWorldMsaa(DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
IrisCombatantFrameHooks.beginRenderLevel(tickCounter);
|
||||
CombatantWorldMatrices.reset();
|
||||
private void lovisual$beginWorldMsaa(DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
IrisLoVisualFrameHooks.beginRenderLevel(tickCounter);
|
||||
LoVisualWorldMatrices.reset();
|
||||
int samples = MainConfig.get().getMsaa3dSamples();
|
||||
MsaaWorldTarget.begin(minecraft, samples, combatant$needsResolvedMainDepth());
|
||||
MsaaWorldTarget.begin(minecraft, samples, lovisual$needsResolvedMainDepth());
|
||||
}
|
||||
|
||||
@Inject(method = "renderLevel", at = @At("RETURN"))
|
||||
private void combatant$endIrisFrameHooks(DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
IrisCombatantFrameHooks.endRenderLevel(tickCounter);
|
||||
private void lovisual$endIrisFrameHooks(DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
IrisLoVisualFrameHooks.endRenderLevel(tickCounter);
|
||||
}
|
||||
|
||||
@WrapOperation(
|
||||
|
|
@ -450,7 +450,7 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
target = "Lnet/minecraft/client/renderer/ProjectionMatrixBuffer;getBuffer(Lorg/joml/Matrix4f;)Lcom/mojang/blaze3d/buffers/GpuBufferSlice;"
|
||||
)
|
||||
)
|
||||
private GpuBufferSlice combatant$captureFullWorldMatrices(ProjectionMatrixBuffer instance,
|
||||
private GpuBufferSlice lovisual$captureFullWorldMatrices(ProjectionMatrixBuffer instance,
|
||||
Matrix4f renderProjectionMatrix,
|
||||
Operation<GpuBufferSlice> original) {
|
||||
if (renderProjectionMatrix != null
|
||||
|
|
@ -460,7 +460,7 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
&& gameRenderState.levelRenderState.cameraRenderState.viewRotationMatrix != null
|
||||
&& gameRenderState.levelRenderState.cameraRenderState.projectionMatrix != null) {
|
||||
CameraRenderState cameraRenderState = gameRenderState.levelRenderState.cameraRenderState;
|
||||
CombatantWorldMatrices.capture(
|
||||
LoVisualWorldMatrices.capture(
|
||||
cameraRenderState.viewRotationMatrix,
|
||||
renderProjectionMatrix,
|
||||
cameraRenderState.projectionMatrix,
|
||||
|
|
@ -479,21 +479,21 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
shift = At.Shift.AFTER
|
||||
)
|
||||
)
|
||||
private void combatant$postProcess(DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
private void lovisual$postProcess(DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
if (IrisRuntime.isShaderpackRendererActive()
|
||||
&& IrisCompatibilityGuards.deferIrisFinalizationForSecondHandScene()) {
|
||||
return;
|
||||
}
|
||||
combatant$renderPreHandPostProcess(tickCounter);
|
||||
lovisual$renderPreHandPostProcess(tickCounter);
|
||||
}
|
||||
|
||||
@Unique
|
||||
private void combatant$renderPreHandPostProcess(DeltaTracker tickCounter) {
|
||||
private void lovisual$renderPreHandPostProcess(DeltaTracker tickCounter) {
|
||||
ProfilerPhase.begin("3d:post_pre_hand");
|
||||
try (TracyGpuProfiler.Scope gpuScope = TracyGpuProfiler.beginZone("3d:post_pre_hand")) {
|
||||
if (minecraft != null) {
|
||||
boolean needsResolvedDepth = !IrisRuntime.isShaderpackRendererActive()
|
||||
&& combatant$needsResolvedMainDepth();
|
||||
&& lovisual$needsResolvedMainDepth();
|
||||
boolean capturedMsaaDepth = needsResolvedDepth
|
||||
&& MsaaWorldTarget.isActive()
|
||||
&& WorldSceneDepth.captureResolvedMain(MsaaWorldTarget.getMsaaFramebuffer());
|
||||
|
|
@ -501,37 +501,37 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
if (needsResolvedDepth && !capturedMsaaDepth) {
|
||||
WorldSceneDepth.captureResolvedMain(minecraft.gameRenderer.mainRenderTarget());
|
||||
}
|
||||
CombatantVisuals.renderWorldBase(minecraft, tickCounter.getGameTimeDeltaPartialTick(true));
|
||||
LoVisualVisuals.renderWorldBase(minecraft, tickCounter.getGameTimeDeltaPartialTick(true));
|
||||
}
|
||||
try (RenderPhaseScope combatant$postPreHandPhase = CombatantRenderSystem.phase(RenderPhase.WORLD_POST_PRE_HAND)) {
|
||||
try (RenderPhaseScope lovisual$postPreHandPhase = LoVisualRenderSystem.phase(RenderPhase.WORLD_POST_PRE_HAND)) {
|
||||
PostProcessManager.renderAll(PostProcessPass.Phase.PRE_HAND,
|
||||
tickCounter.getGameTimeDeltaPartialTick(true));
|
||||
combatant$renderCombatantWorldAfterPreHandPostProcess(tickCounter);
|
||||
lovisual$renderLoVisualWorldAfterPreHandPostProcess(tickCounter);
|
||||
}
|
||||
}
|
||||
ProfilerPhase.end("3d:post_pre_hand");
|
||||
}
|
||||
|
||||
@Unique
|
||||
private void combatant$renderCombatantWorldAfterPreHandPostProcess(DeltaTracker tickCounter) {
|
||||
private void lovisual$renderLoVisualWorldAfterPreHandPostProcess(DeltaTracker tickCounter) {
|
||||
if (minecraft == null) {
|
||||
combatant$renderWorldEngine(tickCounter);
|
||||
combatant$renderPostProcessWorld(tickCounter);
|
||||
lovisual$renderWorldEngine(tickCounter);
|
||||
lovisual$renderPostProcessWorld(tickCounter);
|
||||
return;
|
||||
}
|
||||
|
||||
MsaaWorldTarget.begin(minecraft, MainConfig.get().getMsaa3dSamples(), false, true);
|
||||
try {
|
||||
combatant$renderWorldEngine(tickCounter);
|
||||
combatant$renderPostProcessWorld(tickCounter);
|
||||
lovisual$renderWorldEngine(tickCounter);
|
||||
lovisual$renderPostProcessWorld(tickCounter);
|
||||
} finally {
|
||||
MsaaWorldTarget.resolveToMain(minecraft);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void combatant$renderAfterIrisFinalization(DeltaTracker tickCounter) {
|
||||
combatant$renderPreHandPostProcess(tickCounter);
|
||||
public void lovisual$renderAfterIrisFinalization(DeltaTracker tickCounter) {
|
||||
lovisual$renderPreHandPostProcess(tickCounter);
|
||||
}
|
||||
|
||||
@Inject(
|
||||
|
|
@ -542,13 +542,13 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
shift = At.Shift.AFTER
|
||||
)
|
||||
)
|
||||
private void combatant$postProcessAfterHand(DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
private void lovisual$postProcessAfterHand(DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
ProfilerPhase.begin("3d:post_after_hand");
|
||||
try (TracyGpuProfiler.Scope gpuScope = TracyGpuProfiler.beginZone("3d:post_after_hand")) {
|
||||
if (minecraft != null) {
|
||||
MsaaWorldTarget.resolveToMain(minecraft);
|
||||
}
|
||||
try (RenderPhaseScope combatant$postHandPhase = CombatantRenderSystem.phase(RenderPhase.WORLD_POST_HAND)) {
|
||||
try (RenderPhaseScope lovisual$postHandPhase = LoVisualRenderSystem.phase(RenderPhase.WORLD_POST_HAND)) {
|
||||
PostProcessManager.renderAll(PostProcessPass.Phase.POST_HAND,
|
||||
tickCounter.getGameTimeDeltaPartialTick(true));
|
||||
}
|
||||
|
|
@ -557,13 +557,13 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
}
|
||||
|
||||
@Unique
|
||||
private void combatant$renderPostProcessWorld(DeltaTracker tickCounter) {
|
||||
private void lovisual$renderPostProcessWorld(DeltaTracker tickCounter) {
|
||||
try (ProfilerPhase.Scope phaseScope = ProfilerPhase.scope("3d:world_post");
|
||||
TracyGpuProfiler.Scope gpuScope = TracyGpuProfiler.beginZone("3d:world_post")) {
|
||||
float tickDelta = tickCounter.getGameTimeDeltaPartialTick(true);
|
||||
float fov = mainCamera.getFov();
|
||||
Matrix4f capturedPosition = CombatantWorldMatrices.positionMatrix();
|
||||
Matrix4f capturedProjection = CombatantWorldMatrices.renderProjectionMatrix();
|
||||
Matrix4f capturedPosition = LoVisualWorldMatrices.positionMatrix();
|
||||
Matrix4f capturedProjection = LoVisualWorldMatrices.renderProjectionMatrix();
|
||||
boolean useCapturedMatrices = capturedPosition != null && capturedProjection != null;
|
||||
Matrix4f position = useCapturedMatrices
|
||||
? capturedPosition
|
||||
|
|
@ -571,90 +571,90 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
|
||||
RenderState.rendering3D = true;
|
||||
RenderState.tickDelta = tickDelta;
|
||||
Vec3 capturedCameraPos = CombatantWorldMatrices.cameraPosition();
|
||||
Vec3 capturedCameraPos = LoVisualWorldMatrices.cameraPosition();
|
||||
RenderState.cameraPos = capturedCameraPos != null ? capturedCameraPos : mainCamera.position();
|
||||
RenderState.cameraRotation.set(mainCamera.rotation());
|
||||
RenderState.cameraYaw = mainCamera.yRot();
|
||||
RenderState.cameraPitch = mainCamera.xRot();
|
||||
|
||||
if (combatant$postRenderer == null) {
|
||||
combatant$postRenderer = new Renderer3D(
|
||||
CombatantRenderPipelines.WORLD_COLORED_LINES,
|
||||
CombatantRenderPipelines.WORLD_COLORED
|
||||
if (lovisual$postRenderer == null) {
|
||||
lovisual$postRenderer = new Renderer3D(
|
||||
LoVisualRenderPipelines.WORLD_COLORED_LINES,
|
||||
LoVisualRenderPipelines.WORLD_COLORED
|
||||
);
|
||||
}
|
||||
|
||||
if (combatant$postDepthRenderer == null) {
|
||||
combatant$postDepthRenderer = new Renderer3D(
|
||||
CombatantRenderPipelines.WORLD_COLORED_LINES_DEPTH,
|
||||
CombatantRenderPipelines.WORLD_COLORED_DEPTH
|
||||
if (lovisual$postDepthRenderer == null) {
|
||||
lovisual$postDepthRenderer = new Renderer3D(
|
||||
LoVisualRenderPipelines.WORLD_COLORED_LINES_DEPTH,
|
||||
LoVisualRenderPipelines.WORLD_COLORED_DEPTH
|
||||
);
|
||||
}
|
||||
|
||||
var mv = com.mojang.blaze3d.systems.RenderSystem.getModelViewStack();
|
||||
mv.pushMatrix();
|
||||
if (IrisCombatantFrameHooks.isRenderingAfterIrisFinalization()) {
|
||||
if (IrisLoVisualFrameHooks.isRenderingAfterIrisFinalization()) {
|
||||
mv.identity();
|
||||
}
|
||||
mv.mul(position);
|
||||
combatant$postMatrices.pushPose();
|
||||
lovisual$postMatrices.pushPose();
|
||||
Matrix4f projection = useCapturedMatrices
|
||||
? capturedProjection
|
||||
: combatant$buildWorldProjection(fov, combatant$postMatrices, tickDelta);
|
||||
: lovisual$buildWorldProjection(fov, lovisual$postMatrices, tickDelta);
|
||||
MeshRenderer.setProjection(projection);
|
||||
CombatantRenderSystem.beginFrame(
|
||||
LoVisualRenderSystem.beginFrame(
|
||||
tickDelta,
|
||||
tickCounter.getGameTimeDeltaTicks(),
|
||||
tickCounter.getRealtimeDeltaTicks(),
|
||||
projection,
|
||||
new Matrix4f(mv)
|
||||
);
|
||||
try (RenderPhaseScope combatant$postWorldPhase = CombatantRenderSystem.phase(RenderPhase.WORLD_POST_PRE_HAND)) {
|
||||
try (RenderPhaseScope lovisual$postWorldPhase = LoVisualRenderSystem.phase(RenderPhase.WORLD_POST_PRE_HAND)) {
|
||||
RenderState.worldProjection.set(projection);
|
||||
RenderState.frustum = new Frustum(position, projection);
|
||||
RenderState.frustum.prepare(RenderState.cameraPos.x, RenderState.cameraPos.y, RenderState.cameraPos.z);
|
||||
|
||||
if (!useCapturedMatrices) {
|
||||
Matrix4f inverseBob = new Matrix4f(combatant$postMatrices.last().pose()).invert();
|
||||
Matrix4f inverseBob = new Matrix4f(lovisual$postMatrices.last().pose()).invert();
|
||||
mv.mul(inverseBob);
|
||||
}
|
||||
|
||||
combatant$postRenderer.begin();
|
||||
combatant$postDepthRenderer.begin();
|
||||
lovisual$postRenderer.begin();
|
||||
lovisual$postDepthRenderer.begin();
|
||||
|
||||
try (ProfilerPhase.Scope phase = ProfilerPhase.scope("3d:post_modules");
|
||||
RenderProfiler3D.Section ignored = RenderProfiler3D.section("modules")) {
|
||||
ModuleManager.renderWorldEngine(WorldPhase.AFTER_POST_PROCESS, combatant$postRenderer, combatant$postDepthRenderer, tickDelta);
|
||||
ModuleManager.renderWorldEngine(WorldPhase.AFTER_POST_PROCESS, lovisual$postRenderer, lovisual$postDepthRenderer, tickDelta);
|
||||
AddonRenderPipelineManager.render3D(LoVisualRenderStage.WORLD_POST_PROCESS,
|
||||
WorldPhase.AFTER_POST_PROCESS, combatant$postRenderer, combatant$postDepthRenderer, combatant$postMatrices, tickDelta);
|
||||
WorldPhase.AFTER_POST_PROCESS, lovisual$postRenderer, lovisual$postDepthRenderer, lovisual$postMatrices, tickDelta);
|
||||
}
|
||||
|
||||
try (ProfilerPhase.Scope phase = ProfilerPhase.scope("3d:post_flush");
|
||||
TracyGpuProfiler.Scope gpuFlush = TracyGpuProfiler.beginZone("3d:post_flush");
|
||||
RenderProfiler3D.Section ignored = RenderProfiler3D.section("flush")) {
|
||||
combatant$postRenderer.render(combatant$postMatrices);
|
||||
combatant$postDepthRenderer.render(combatant$postMatrices);
|
||||
lovisual$postRenderer.render(lovisual$postMatrices);
|
||||
lovisual$postDepthRenderer.render(lovisual$postMatrices);
|
||||
}
|
||||
}
|
||||
combatant$postMatrices.popPose();
|
||||
lovisual$postMatrices.popPose();
|
||||
mv.popMatrix();
|
||||
RenderState.rendering3D = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Unique
|
||||
private Matrix4f combatant$buildWorldProjection(float fov, PoseStack viewEffectMatrices, float tickDelta) {
|
||||
private Matrix4f lovisual$buildWorldProjection(float fov, PoseStack viewEffectMatrices, float tickDelta) {
|
||||
CameraRenderState cameraRenderState = new CameraRenderState();
|
||||
mainCamera.extractRenderState(cameraRenderState, fov);
|
||||
Matrix4f projection = new Matrix4f(cameraRenderState.projectionMatrix);
|
||||
combatant$applyViewEffectMatrices(viewEffectMatrices, tickDelta);
|
||||
lovisual$applyViewEffectMatrices(viewEffectMatrices, tickDelta);
|
||||
projection.mul(viewEffectMatrices.last().pose());
|
||||
combatant$applyNauseaProjection(projection, tickDelta);
|
||||
lovisual$applyNauseaProjection(projection, tickDelta);
|
||||
return projection;
|
||||
}
|
||||
|
||||
@Unique
|
||||
private void combatant$applyViewEffectMatrices(PoseStack matrices, float cameraTickProgress) {
|
||||
private void lovisual$applyViewEffectMatrices(PoseStack matrices, float cameraTickProgress) {
|
||||
NoRender noRender = Modules.get(NoRender.class);
|
||||
CameraRenderState cameraRenderState = new CameraRenderState();
|
||||
mainCamera.extractRenderState(cameraRenderState, mainCamera.getFov());
|
||||
|
|
@ -671,7 +671,7 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
}
|
||||
|
||||
@Unique
|
||||
private void combatant$applyNauseaProjection(Matrix4f projection, float tickDelta) {
|
||||
private void lovisual$applyNauseaProjection(Matrix4f projection, float tickDelta) {
|
||||
LocalPlayer player = minecraft.player;
|
||||
if (player == null) return;
|
||||
|
||||
|
|
@ -682,8 +682,8 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
if (player instanceof LocalPlayerAccessor accessor) {
|
||||
nauseaIntensity = Mth.lerp(
|
||||
tickDelta,
|
||||
accessor.combatant$getLastNauseaIntensity(),
|
||||
accessor.combatant$getNauseaIntensity()
|
||||
accessor.lovisual$getLastNauseaIntensity(),
|
||||
accessor.lovisual$getNauseaIntensity()
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -715,7 +715,7 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
target = "Lnet/minecraft/client/renderer/feature/FeatureRenderDispatcher;renderAllFeatures(Lnet/minecraft/client/renderer/SubmitNodeStorage;)V"
|
||||
)
|
||||
)
|
||||
private void combatant$renderChamsHandPreparedFrame(FeatureRenderDispatcher dispatcher,
|
||||
private void lovisual$renderChamsHandPreparedFrame(FeatureRenderDispatcher dispatcher,
|
||||
SubmitNodeStorage storage,
|
||||
Operation<Void> original,
|
||||
CameraRenderState cameraRenderState,
|
||||
|
|
@ -729,7 +729,7 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
}
|
||||
|
||||
@Inject(method = "render(Lnet/minecraft/client/DeltaTracker;Z)V", at = @At("TAIL"))
|
||||
private void combatant$flushQueuedButtons(DeltaTracker tickCounter, boolean tick, CallbackInfo ci) {
|
||||
private void lovisual$flushQueuedButtons(DeltaTracker tickCounter, boolean tick, CallbackInfo ci) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc == null || ClientScreen.current() == null) return;
|
||||
if (!BetterButtons.hasPending()) {
|
||||
|
|
@ -748,7 +748,7 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
shift = At.Shift.BEFORE
|
||||
)
|
||||
)
|
||||
private void combatant$captureWorldForHudGlass(DeltaTracker tickCounter, boolean tick, CallbackInfo ci) {
|
||||
private void lovisual$captureWorldForHudGlass(DeltaTracker tickCounter, boolean tick, CallbackInfo ci) {
|
||||
MenuBackgroundRenderer.drainDeferred(minecraft);
|
||||
Renderer2D.captureWorldGlassSource();
|
||||
if (AddonRenderPipelineManager.hasActiveCallbacks(LoVisualRenderStage.SCREEN_BEFORE_VANILLA_GUI)) {
|
||||
|
|
@ -759,12 +759,12 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
Renderer2D.COLOR.render();
|
||||
}
|
||||
Renderer2D.drainDeferred2D(Renderer2D.Deferred2DLayer.BEFORE_VANILLA_GUI);
|
||||
combatant$drainHudLayersBelowScreenGui();
|
||||
lovisual$drainHudLayersBelowScreenGui();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gui.extractRenderState() extracts vanilla HUD first and the current Screen after it.
|
||||
* Normal gameplay keeps Combatant HUD spliced into that HUD order through HudDeferredGuiElement
|
||||
* Normal gameplay keeps LoVisual HUD spliced into that HUD order through HudDeferredGuiElement
|
||||
* markers. When a real Screen is open, however, the screen must remain the top GUI owner:
|
||||
* HUD/world overlaysare drained before GuiRenderer.render(),
|
||||
* preserving their internal order while keeping container/inventory GUI above them.
|
||||
|
|
@ -772,7 +772,7 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
* intentionally not drained here.
|
||||
*/
|
||||
@Unique
|
||||
private static void combatant$drainHudLayersBelowScreenGui() {
|
||||
private static void lovisual$drainHudLayersBelowScreenGui() {
|
||||
if (ClientScreen.current() == null) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -795,7 +795,7 @@ public abstract class GameRendererMixin implements IrisFinalizedSceneRenderer {
|
|||
shift = At.Shift.AFTER
|
||||
)
|
||||
)
|
||||
private void combatant$debug2dImmediateAfterGui(DeltaTracker tickCounter, boolean tick, CallbackInfo ci) {
|
||||
private void lovisual$debug2dImmediateAfterGui(DeltaTracker tickCounter, boolean tick, CallbackInfo ci) {
|
||||
Renderer2D.drainDeferred2D(Renderer2D.Deferred2DLayer.AFTER_VANILLA_GUI);
|
||||
if (AddonRenderPipelineManager.hasActiveCallbacks(LoVisualRenderStage.SCREEN_AFTER_VANILLA_GUI)) {
|
||||
float tickDelta = tickCounter.getGameTimeDeltaPartialTick(true);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -17,9 +17,9 @@ import dev.loki.lovisual.mixininterface.IGlBackendInfo;
|
|||
public abstract class GlDeviceBackendMixin implements IGlBackendInfo {
|
||||
@Override
|
||||
@Invoker("directStateAccess")
|
||||
public abstract DirectStateAccess combatant$directStateAccess();
|
||||
public abstract DirectStateAccess lovisual$directStateAccess();
|
||||
|
||||
@Override
|
||||
@Invoker("frameBufferCache")
|
||||
public abstract FrameBufferCache combatant$frameBufferCache();
|
||||
public abstract FrameBufferCache lovisual$frameBufferCache();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -17,17 +17,17 @@ import dev.loki.lovisual.render.engine.profiler.GlSyncTracker;
|
|||
@Mixin(GlStateManager.class)
|
||||
public class GlStateManagerMixin {
|
||||
@Inject(method = "_glFenceSync", at = @At("RETURN"))
|
||||
private static void combatant$onFenceSync(int condition, int flags, CallbackInfoReturnable<Long> cir) {
|
||||
private static void lovisual$onFenceSync(int condition, int flags, CallbackInfoReturnable<Long> cir) {
|
||||
GlSyncTracker.onFence(cir.getReturnValue());
|
||||
}
|
||||
|
||||
@Inject(method = "_glClientWaitSync", at = @At("HEAD"))
|
||||
private static void combatant$onClientWaitSync(long sync, int flags, long timeout, CallbackInfoReturnable<Integer> cir) {
|
||||
private static void lovisual$onClientWaitSync(long sync, int flags, long timeout, CallbackInfoReturnable<Integer> cir) {
|
||||
GlSyncTracker.onWaitStart(sync);
|
||||
}
|
||||
|
||||
@Inject(method = "_glClientWaitSync", at = @At("RETURN"))
|
||||
private static void combatant$onClientWaitSyncReturn(long sync, int flags, long timeout, CallbackInfoReturnable<Integer> cir) {
|
||||
private static void lovisual$onClientWaitSyncReturn(long sync, int flags, long timeout, CallbackInfoReturnable<Integer> cir) {
|
||||
GlSyncTracker.onWaitEnd();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -16,7 +16,7 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import dev.loki.lovisual.mixininterface.IMsaaTexture;
|
||||
import dev.loki.lovisual.render.engine.core.CombatantRenderSystem;
|
||||
import dev.loki.lovisual.render.engine.core.LoVisualRenderSystem;
|
||||
|
||||
@Mixin(GlTexture.class)
|
||||
public abstract class GlTextureMixin implements IMsaaTexture {
|
||||
|
|
@ -25,31 +25,31 @@ public abstract class GlTextureMixin implements IMsaaTexture {
|
|||
protected int id;
|
||||
|
||||
@Unique
|
||||
private int combatant$samples = 1;
|
||||
private int lovisual$samples = 1;
|
||||
|
||||
@Override
|
||||
public void combatant$setSamples(int samples) {
|
||||
combatant$samples = samples;
|
||||
public void lovisual$setSamples(int samples) {
|
||||
lovisual$samples = samples;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int combatant$getSamples() {
|
||||
return combatant$samples;
|
||||
public int lovisual$getSamples() {
|
||||
return lovisual$samples;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean combatant$isMsaa() {
|
||||
return combatant$samples > 1;
|
||||
public boolean lovisual$isMsaa() {
|
||||
return lovisual$samples > 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int combatant$getGlId() {
|
||||
public int lovisual$getGlId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Inject(method = "destroyImmediately", at = @At("HEAD"))
|
||||
private void combatant$onFree(CallbackInfo ci) {
|
||||
CombatantRenderSystem.rhi().msaa().unregisterTexture(id);
|
||||
private void lovisual$onFree(CallbackInfo ci) {
|
||||
LoVisualRenderSystem.rhi().msaa().unregisterTexture(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -13,23 +13,23 @@ import com.mojang.blaze3d.textures.GpuTexture;
|
|||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import dev.loki.lovisual.mixininterface.IGpuDevice;
|
||||
import dev.loki.lovisual.mixininterface.IMsaaDevice;
|
||||
import dev.loki.lovisual.render.engine.core.CombatantRenderSystem;
|
||||
import dev.loki.lovisual.render.engine.core.LoVisualRenderSystem;
|
||||
import dev.loki.lovisual.render.engine.rhi.scissor.GlobalScissorState;
|
||||
|
||||
@Mixin(GpuDevice.class)
|
||||
public abstract class GpuDeviceMixin implements IGpuDevice, IMsaaDevice {
|
||||
@Override
|
||||
public void combatant$pushScissor(int x, int y, int width, int height) {
|
||||
public void lovisual$pushScissor(int x, int y, int width, int height) {
|
||||
GlobalScissorState.push(x, y, width, height);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void combatant$popScissor() {
|
||||
public void lovisual$popScissor() {
|
||||
GlobalScissorState.pop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public GpuTexture combatant$createMsaaTexture(String label, int usage, GpuFormat format, int width, int height, int samples) {
|
||||
return CombatantRenderSystem.rhi().msaa().createTexture(label, usage, format, width, height, samples);
|
||||
public GpuTexture lovisual$createMsaaTexture(String label, int usage, GpuFormat format, int width, int height, int samples) {
|
||||
return LoVisualRenderSystem.rhi().msaa().createTexture(label, usage, format, width, height, samples);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -14,7 +14,7 @@ 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 dev.loki.lovisual.render.engine.core.CombatantRenderSystem;
|
||||
import dev.loki.lovisual.render.engine.core.LoVisualRenderSystem;
|
||||
import dev.loki.lovisual.render.engine.profiler.TracyGpuProfiler;
|
||||
import dev.loki.lovisual.render.engine.profiler.TracyProfiler;
|
||||
import dev.loki.lovisual.render.engine.renderer.Renderer2D;
|
||||
|
|
@ -24,23 +24,23 @@ import dev.loki.lovisual.util.FastFps;
|
|||
public abstract class GpuSurfaceMixin {
|
||||
/**
|
||||
* This is the last safe point before Minecraft copies the main render target into the
|
||||
* window surface. Combatant queued text/UI/RHI submission must be flushed here, not in
|
||||
* window surface. LoVisual queued text/UI/RHI submission must be flushed here, not in
|
||||
* present(), otherwise those draws happen after the surface blit and are not visible in
|
||||
* the frame that produced them.
|
||||
*/
|
||||
@Inject(method = "blitFromTexture", at = @At("HEAD"))
|
||||
private void combatant$beforeSurfaceBlit(CommandEncoder encoder, GpuTextureView textureView, CallbackInfo info) {
|
||||
CombatantRenderSystem.endRenderSubmission();
|
||||
private void lovisual$beforeSurfaceBlit(CommandEncoder encoder, GpuTextureView textureView, CallbackInfo info) {
|
||||
LoVisualRenderSystem.endRenderSubmission();
|
||||
}
|
||||
|
||||
@Inject(method = "present", at = @At("HEAD"))
|
||||
private void combatant$onPresentHead(CallbackInfo info) {
|
||||
private void lovisual$onPresentHead(CallbackInfo info) {
|
||||
FastFps.onFrame();
|
||||
}
|
||||
|
||||
@Inject(method = "present", at = @At("TAIL"))
|
||||
private void combatant$onPresentTail(CallbackInfo info) {
|
||||
CombatantRenderSystem.onFramePresented();
|
||||
private void lovisual$onPresentTail(CallbackInfo info) {
|
||||
LoVisualRenderSystem.onFramePresented();
|
||||
if (TracyGpuProfiler.isEnabled()) {
|
||||
TracyGpuProfiler.onFrameEnd();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -58,7 +58,7 @@ public abstract class GuiGraphicsMixin implements IGuiGraphics {
|
|||
public abstract int guiHeight();
|
||||
|
||||
@Override
|
||||
public void combatant$runUnscaled(Runnable task) {
|
||||
public void lovisual$runUnscaled(Runnable task) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
double scale = mc.getWindow().getGuiScale();
|
||||
double uiScale = ViewportContext.getUiScale();
|
||||
|
|
@ -72,7 +72,7 @@ public abstract class GuiGraphicsMixin implements IGuiGraphics {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void combatant$withTransform(float tx, float ty, float angleRad, Runnable task) {
|
||||
public void lovisual$withTransform(float tx, float ty, float angleRad, Runnable task) {
|
||||
pose.pushMatrix();
|
||||
try {
|
||||
pose.translate(tx, ty);
|
||||
|
|
@ -84,7 +84,7 @@ public abstract class GuiGraphicsMixin implements IGuiGraphics {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void combatant$addDeferredHudMarker(Renderer2D.Deferred2DLayer layer) {
|
||||
public void lovisual$addDeferredHudMarker(Renderer2D.Deferred2DLayer layer) {
|
||||
if (layer == null || guiRenderState == null) return;
|
||||
int width = Math.max(1, guiWidth());
|
||||
int height = Math.max(1, guiHeight());
|
||||
|
|
@ -92,32 +92,32 @@ public abstract class GuiGraphicsMixin implements IGuiGraphics {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void combatant$drawItemBar(ItemStack stack, int x, int y) {
|
||||
combatant$invokeDrawItemBar(stack, x, y);
|
||||
public void lovisual$drawItemBar(ItemStack stack, int x, int y) {
|
||||
lovisual$invokeDrawItemBar(stack, x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void combatant$drawCooldownProgress(ItemStack stack, int x, int y) {
|
||||
combatant$invokeDrawCooldownProgress(stack, x, y);
|
||||
public void lovisual$drawCooldownProgress(ItemStack stack, int x, int y) {
|
||||
lovisual$invokeDrawCooldownProgress(stack, x, y);
|
||||
}
|
||||
|
||||
@Invoker("itemBar")
|
||||
public abstract void combatant$invokeDrawItemBar(ItemStack stack, int x, int y);
|
||||
public abstract void lovisual$invokeDrawItemBar(ItemStack stack, int x, int y);
|
||||
|
||||
@Invoker("itemCooldown")
|
||||
public abstract void combatant$invokeDrawCooldownProgress(ItemStack stack, int x, int y);
|
||||
public abstract void lovisual$invokeDrawCooldownProgress(ItemStack stack, int x, int y);
|
||||
|
||||
@Accessor("deferredTooltip")
|
||||
public abstract Runnable combatant$getTooltipDrawer();
|
||||
public abstract Runnable lovisual$getTooltipDrawer();
|
||||
|
||||
@Accessor("deferredTooltip")
|
||||
public abstract void combatant$setTooltipDrawer(Runnable drawer);
|
||||
public abstract void lovisual$setTooltipDrawer(Runnable drawer);
|
||||
|
||||
@Inject(method = "extractDeferredElements", at = @At("HEAD"))
|
||||
private void combatant$suppressVanillaTooltip(int mouseX, int mouseY, float tickDelta, CallbackInfo ci) {
|
||||
private void lovisual$suppressVanillaTooltip(int mouseX, int mouseY, float tickDelta, CallbackInfo ci) {
|
||||
if (!BetterTooltips.hasTooltip()) return;
|
||||
if (combatant$getTooltipDrawer() == null) return;
|
||||
combatant$setTooltipDrawer(null);
|
||||
if (lovisual$getTooltipDrawer() == null) return;
|
||||
lovisual$setTooltipDrawer(null);
|
||||
}
|
||||
|
||||
@Inject(
|
||||
|
|
@ -125,7 +125,7 @@ public abstract class GuiGraphicsMixin implements IGuiGraphics {
|
|||
at = @At("HEAD"),
|
||||
cancellable = true
|
||||
)
|
||||
private void combatant$drawCustomTooltip(net.minecraft.client.gui.Font tr,
|
||||
private void lovisual$drawCustomTooltip(net.minecraft.client.gui.Font tr,
|
||||
java.util.List<FormattedCharSequence> lines,
|
||||
ClientTooltipPositioner positioner,
|
||||
int x, int y, boolean focused,
|
||||
|
|
@ -143,7 +143,7 @@ public abstract class GuiGraphicsMixin implements IGuiGraphics {
|
|||
at = @At("HEAD"),
|
||||
cancellable = true
|
||||
)
|
||||
private void combatant$drawCustomItemTooltip(net.minecraft.client.gui.Font tr,
|
||||
private void lovisual$drawCustomItemTooltip(net.minecraft.client.gui.Font tr,
|
||||
ItemStack stack,
|
||||
int x, int y,
|
||||
CallbackInfo ci) {
|
||||
|
|
@ -173,7 +173,7 @@ public abstract class GuiGraphicsMixin implements IGuiGraphics {
|
|||
at = @At("HEAD"),
|
||||
cancellable = true
|
||||
)
|
||||
private void combatant$drawCustomTooltipWithData(net.minecraft.client.gui.Font tr,
|
||||
private void lovisual$drawCustomTooltipWithData(net.minecraft.client.gui.Font tr,
|
||||
java.util.List<net.minecraft.network.chat.Component> lines,
|
||||
java.util.Optional<net.minecraft.world.inventory.tooltip.TooltipComponent> data,
|
||||
int x, int y,
|
||||
|
|
@ -207,7 +207,7 @@ public abstract class GuiGraphicsMixin implements IGuiGraphics {
|
|||
at = @At("HEAD"),
|
||||
cancellable = true
|
||||
)
|
||||
private void combatant$drawCustomTooltipWithDataNoStyle(net.minecraft.client.gui.Font tr,
|
||||
private void lovisual$drawCustomTooltipWithDataNoStyle(net.minecraft.client.gui.Font tr,
|
||||
java.util.List<net.minecraft.network.chat.Component> lines,
|
||||
java.util.Optional<net.minecraft.world.inventory.tooltip.TooltipComponent> data,
|
||||
int x, int y,
|
||||
|
|
@ -237,7 +237,7 @@ public abstract class GuiGraphicsMixin implements IGuiGraphics {
|
|||
|
||||
|
||||
@Inject(method = "itemCooldown", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$renderCustomPvpCooldown(ItemStack stack, int x, int y, CallbackInfo ci) {
|
||||
private void lovisual$renderCustomPvpCooldown(ItemStack stack, int x, int y, CallbackInfo ci) {
|
||||
if (stack.isEmpty()) return;
|
||||
PvpCooldowns cooldowns = Modules.get(PvpCooldowns.class);
|
||||
if (cooldowns == null || !cooldowns.isSystemEnabled()) return;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -42,13 +42,13 @@ import dev.loki.lovisual.features.module.modules.misc.MessageFilter;
|
|||
import dev.loki.lovisual.features.module.modules.visuals.Crosshair;
|
||||
import dev.loki.lovisual.features.module.modules.visuals.NoRender;
|
||||
import dev.loki.lovisual.mixininterface.IGuiGraphics;
|
||||
import dev.loki.lovisual.render.engine.core.CombatantRenderSystem;
|
||||
import dev.loki.lovisual.render.engine.core.LoVisualRenderSystem;
|
||||
import dev.loki.lovisual.render.engine.core.RenderPhase;
|
||||
import dev.loki.lovisual.render.engine.core.RenderPhaseScope;
|
||||
import dev.loki.lovisual.render.engine.core.ViewportContext;
|
||||
// import dev.loki.lovisual.render.engine.debug.RenderThread2DDebugRenderer; // disabled: debug probes are manual-only
|
||||
import dev.loki.lovisual.render.engine.renderer.Renderer2D;
|
||||
import dev.loki.lovisual.runtime.RuntimeGate;
|
||||
import dev.loki.lovisual.Lifecycle;
|
||||
import dev.loki.lovisual.util.item.IllegalItemUtil;
|
||||
import dev.loki.lovisual.util.item.RarityColorUtil;
|
||||
import dev.loki.lovisual.util.item.TopEnchantUtil;
|
||||
|
|
@ -68,12 +68,12 @@ public abstract class GuiMixin {
|
|||
private Minecraft minecraft;
|
||||
|
||||
@Inject(method = "extractRenderState(Lnet/minecraft/client/gui/GuiGraphicsExtractor;Lnet/minecraft/client/DeltaTracker;)V", at = @At("TAIL"))
|
||||
private void combatant$debug2dGuiStateProbe(GuiGraphicsExtractor ctx, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
private void lovisual$debug2dGuiStateProbe(GuiGraphicsExtractor ctx, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
// RenderThread2DDebugRenderer.extractGuiStateProbe(ctx);
|
||||
}
|
||||
|
||||
@Unique
|
||||
private static void combatant$renderCustomBarOnly(GuiGraphicsExtractor ctx,
|
||||
private static void lovisual$renderCustomBarOnly(GuiGraphicsExtractor ctx,
|
||||
DeltaTracker tickCounter,
|
||||
Minecraft mc,
|
||||
CustomBar bar) {
|
||||
|
|
@ -81,9 +81,9 @@ public abstract class GuiMixin {
|
|||
boolean useLocator = !useJump && CustomBar.shouldUseLocator(mc, bar);
|
||||
boolean drawXp = !useJump && !useLocator;
|
||||
|
||||
CombatantRenderSystem.ensureFrameContext();
|
||||
try (RenderPhaseScope ignored = CombatantRenderSystem.phase(RenderPhase.HUD_MAIN, "2d:hud:custom_bar")) {
|
||||
Renderer2D.withDeferredLayer(COMBATANT$VANILLA_HUD_REPLACEMENT_LAYER, () -> {
|
||||
LoVisualRenderSystem.ensureFrameContext();
|
||||
try (RenderPhaseScope ignored = LoVisualRenderSystem.phase(RenderPhase.HUD_MAIN, "2d:hud:custom_bar")) {
|
||||
Renderer2D.withDeferredLayer(LOVISUAL$VANILLA_HUD_REPLACEMENT_LAYER, () -> {
|
||||
ViewportContext.beginUnscaled(ctx);
|
||||
Renderer2D.COLOR.begin();
|
||||
if (drawXp) {
|
||||
|
|
@ -102,19 +102,19 @@ public abstract class GuiMixin {
|
|||
CustomBar.renderXpBarText(ctx, mc);
|
||||
}
|
||||
});
|
||||
combatant$appendVanillaHudReplacementMarker(ctx);
|
||||
lovisual$appendVanillaHudReplacementMarker(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
@Unique
|
||||
private static final Renderer2D.Deferred2DLayer COMBATANT$VANILLA_HUD_REPLACEMENT_LAYER =
|
||||
private static final Renderer2D.Deferred2DLayer LOVISUAL$VANILLA_HUD_REPLACEMENT_LAYER =
|
||||
Renderer2D.Deferred2DLayer.HUD_AFTER_MISC_OVERLAYS;
|
||||
|
||||
@Unique
|
||||
private static void combatant$appendVanillaHudReplacementMarker(GuiGraphicsExtractor ctx) {
|
||||
private static void lovisual$appendVanillaHudReplacementMarker(GuiGraphicsExtractor ctx) {
|
||||
if (!(ctx instanceof IGuiGraphics graphics)) return;
|
||||
ctx.nextStratum();
|
||||
graphics.combatant$addDeferredHudMarker(COMBATANT$VANILLA_HUD_REPLACEMENT_LAYER);
|
||||
graphics.lovisual$addDeferredHudMarker(LOVISUAL$VANILLA_HUD_REPLACEMENT_LAYER);
|
||||
ctx.nextStratum();
|
||||
}
|
||||
|
||||
|
|
@ -135,8 +135,8 @@ public abstract class GuiMixin {
|
|||
at = @At("HEAD"),
|
||||
cancellable = true
|
||||
)
|
||||
private void combatant$hideScoreboardSidebar(GuiGraphicsExtractor context, Objective objective, CallbackInfo ci) {
|
||||
if (RuntimeGate.isPanic()) return;
|
||||
private void lovisual$hideScoreboardSidebar(GuiGraphicsExtractor context, Objective objective, CallbackInfo ci) {
|
||||
|
||||
NoRender noRender = Modules.get(NoRender.class);
|
||||
if ((noRender != null && noRender.hideScoreboard()) || Scoreboard.shouldReplaceVanilla()) {
|
||||
ci.cancel();
|
||||
|
|
@ -148,7 +148,7 @@ public abstract class GuiMixin {
|
|||
at = @At("HEAD"),
|
||||
cancellable = true
|
||||
)
|
||||
private void combatant$filterOverlayMessage(net.minecraft.network.chat.Component message, boolean tinted, CallbackInfo ci) {
|
||||
private void lovisual$filterOverlayMessage(net.minecraft.network.chat.Component message, boolean tinted, CallbackInfo ci) {
|
||||
if (DebugLog.serverOnly()) {
|
||||
if (message == null) {
|
||||
// DebugLog.server("HUD overlay message: tinted=%s raw=null", tinted);
|
||||
|
|
@ -161,7 +161,7 @@ public abstract class GuiMixin {
|
|||
if (Events.BUS.hasListeners(PvpOverlayEvent.class)) {
|
||||
Events.BUS.post(new PvpOverlayEvent(message, tinted));
|
||||
}
|
||||
if (RuntimeGate.isPanic()) return;
|
||||
|
||||
MessageFilter messageFilter = Modules.get(MessageFilter.class);
|
||||
if (messageFilter != null && messageFilter.shouldHideHud(message)) {
|
||||
ci.cancel();
|
||||
|
|
@ -173,8 +173,8 @@ public abstract class GuiMixin {
|
|||
at = @At("HEAD"),
|
||||
cancellable = true
|
||||
)
|
||||
private void combatant$hideVanillaPotions(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
if (RuntimeGate.isPanic()) return;
|
||||
private void lovisual$hideVanillaPotions(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc == null || mc.player == null) return;
|
||||
if (!DraggableHudElementRegistry.isEnabled(Potions.class)) return;
|
||||
|
|
@ -188,8 +188,8 @@ public abstract class GuiMixin {
|
|||
at = @At("HEAD"),
|
||||
cancellable = true
|
||||
)
|
||||
private void combatant$replaceCrosshair(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
if (RuntimeGate.isPanic()) return;
|
||||
private void lovisual$replaceCrosshair(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
|
||||
Crosshair crosshair = Modules.get(Crosshair.class);
|
||||
if (crosshair != null && crosshair.shouldHideVanilla()) {
|
||||
ci.cancel();
|
||||
|
|
@ -201,8 +201,8 @@ public abstract class GuiMixin {
|
|||
at = @At("HEAD"),
|
||||
cancellable = true
|
||||
)
|
||||
private void combatant$killVignette(GuiGraphicsExtractor context, Entity entity, CallbackInfo ci) {
|
||||
if (RuntimeGate.isPanic()) return;
|
||||
private void lovisual$killVignette(GuiGraphicsExtractor context, Entity entity, CallbackInfo ci) {
|
||||
|
||||
// Completely remove vanilla vignette post-processing
|
||||
ci.cancel();
|
||||
}
|
||||
|
|
@ -212,8 +212,8 @@ public abstract class GuiMixin {
|
|||
at = @At("HEAD"),
|
||||
cancellable = true
|
||||
)
|
||||
private void combatant$customHotbar(GuiGraphicsExtractor ctx, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
if (RuntimeGate.isPanic()) return;
|
||||
private void lovisual$customHotbar(GuiGraphicsExtractor ctx, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc == null || mc.player == null) return;
|
||||
|
||||
|
|
@ -230,9 +230,9 @@ public abstract class GuiMixin {
|
|||
boolean useLocator = barEnabled && !useJump && CustomBar.shouldUseLocator(mc, bar);
|
||||
boolean drawXp = barEnabled && !useJump && !useLocator;
|
||||
|
||||
CombatantRenderSystem.ensureFrameContext();
|
||||
try (RenderPhaseScope ignored = CombatantRenderSystem.phase(RenderPhase.HUD_MAIN, "2d:hud:custom_hotbar")) {
|
||||
Renderer2D.withDeferredLayer(COMBATANT$VANILLA_HUD_REPLACEMENT_LAYER, () -> {
|
||||
LoVisualRenderSystem.ensureFrameContext();
|
||||
try (RenderPhaseScope ignored = LoVisualRenderSystem.phase(RenderPhase.HUD_MAIN, "2d:hud:custom_hotbar")) {
|
||||
Renderer2D.withDeferredLayer(LOVISUAL$VANILLA_HUD_REPLACEMENT_LAYER, () -> {
|
||||
ViewportContext.beginUnscaled(ctx);
|
||||
Renderer2D.COLOR.begin();
|
||||
if (hotbarEnabled) {
|
||||
|
|
@ -254,7 +254,7 @@ public abstract class GuiMixin {
|
|||
CustomHotbar.renderItems(ctx, tickCounter, mc);
|
||||
}
|
||||
});
|
||||
combatant$appendVanillaHudReplacementMarker(ctx);
|
||||
lovisual$appendVanillaHudReplacementMarker(ctx);
|
||||
|
||||
if (drawXp) {
|
||||
CustomBar.renderXpBarText(ctx, mc);
|
||||
|
|
@ -269,8 +269,8 @@ public abstract class GuiMixin {
|
|||
method = "extractItemHotbar(Lnet/minecraft/client/gui/GuiGraphicsExtractor;Lnet/minecraft/client/DeltaTracker;)V",
|
||||
at = @At("TAIL")
|
||||
)
|
||||
private void combatant$customBarAfterVanillaHotbar(GuiGraphicsExtractor ctx, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
if (RuntimeGate.isPanic()) return;
|
||||
private void lovisual$customBarAfterVanillaHotbar(GuiGraphicsExtractor ctx, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc == null || mc.player == null) return;
|
||||
|
||||
|
|
@ -280,7 +280,7 @@ public abstract class GuiMixin {
|
|||
CustomBar bar = CustomBar.get();
|
||||
if (bar == null || !bar.isHudBarEnabled() || !bar.isHotbarXpBarEnabled()) return;
|
||||
|
||||
combatant$renderCustomBarOnly(ctx, tickCounter, mc, bar);
|
||||
lovisual$renderCustomBarOnly(ctx, tickCounter, mc, bar);
|
||||
}
|
||||
|
||||
@Inject(
|
||||
|
|
@ -288,8 +288,8 @@ public abstract class GuiMixin {
|
|||
at = @At("HEAD"),
|
||||
cancellable = true
|
||||
)
|
||||
private void combatant$disableVanillaPortalOverlay(GuiGraphicsExtractor context, float nauseaStrength, CallbackInfo ci) {
|
||||
if (RuntimeGate.isPanic()) return;
|
||||
private void lovisual$disableVanillaPortalOverlay(GuiGraphicsExtractor context, float nauseaStrength, CallbackInfo ci) {
|
||||
|
||||
ci.cancel();
|
||||
}
|
||||
|
||||
|
|
@ -298,8 +298,8 @@ public abstract class GuiMixin {
|
|||
at = @At("HEAD"),
|
||||
cancellable = true
|
||||
)
|
||||
private void combatant$disableVanillaSleepOverlay(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
if (RuntimeGate.isPanic()) return;
|
||||
private void lovisual$disableVanillaSleepOverlay(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
|
||||
ci.cancel();
|
||||
}
|
||||
|
||||
|
|
@ -308,23 +308,23 @@ public abstract class GuiMixin {
|
|||
at = @At("HEAD"),
|
||||
cancellable = true
|
||||
)
|
||||
private void combatant$renderHealthBar(GuiGraphicsExtractor context,
|
||||
private void lovisual$renderHealthBar(GuiGraphicsExtractor context,
|
||||
Player player,
|
||||
int x, int y, int lines,
|
||||
int regeneratingHeartIndex, float maxHealth,
|
||||
int lastHealth, int health,
|
||||
int absorption, boolean blinking,
|
||||
CallbackInfo ci) {
|
||||
if (!RuntimeGate.canRunHud()) return;
|
||||
if (!Lifecycle.canRunHud()) return;
|
||||
if (!(player instanceof LocalPlayer clientPlayer)) return;
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc == null) return;
|
||||
|
||||
if (!CustomHealthBar.shouldRenderHealthBar(mc, clientPlayer, maxHealth)) return;
|
||||
|
||||
CombatantRenderSystem.ensureFrameContext();
|
||||
try (RenderPhaseScope ignored = CombatantRenderSystem.phase(RenderPhase.HUD_MAIN, "2d:hud:custom_health")) {
|
||||
Renderer2D.withDeferredLayer(COMBATANT$VANILLA_HUD_REPLACEMENT_LAYER, () -> {
|
||||
LoVisualRenderSystem.ensureFrameContext();
|
||||
try (RenderPhaseScope ignored = LoVisualRenderSystem.phase(RenderPhase.HUD_MAIN, "2d:hud:custom_health")) {
|
||||
Renderer2D.withDeferredLayer(LOVISUAL$VANILLA_HUD_REPLACEMENT_LAYER, () -> {
|
||||
ViewportContext.beginUnscaled(context);
|
||||
Renderer2D.COLOR.begin();
|
||||
CustomHealthBar.HealthTextInfo textInfo =
|
||||
|
|
@ -340,14 +340,14 @@ public abstract class GuiMixin {
|
|||
Renderer2D.COLOR.render();
|
||||
ViewportContext.end(context);
|
||||
});
|
||||
combatant$appendVanillaHudReplacementMarker(context);
|
||||
lovisual$appendVanillaHudReplacementMarker(context);
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "extractSelectedItemName", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$colorizeHeldItemTooltip(GuiGraphicsExtractor context, CallbackInfo ci) {
|
||||
if (!RuntimeGate.canRunHud()) return;
|
||||
private void lovisual$colorizeHeldItemTooltip(GuiGraphicsExtractor context, CallbackInfo ci) {
|
||||
if (!Lifecycle.canRunHud()) return;
|
||||
SwapTooltip swapTooltip = SwapTooltip.get();
|
||||
if (swapTooltip == null || !swapTooltip.isEnabled()) {
|
||||
return;
|
||||
|
|
@ -392,8 +392,8 @@ public abstract class GuiMixin {
|
|||
target = "Lnet/minecraft/world/entity/player/Player;getAbsorptionAmount()F"
|
||||
)
|
||||
)
|
||||
private float combatant$ignoreAbsorptionForLayout(Player player) {
|
||||
if (!RuntimeGate.canRunHud()) {
|
||||
private float lovisual$ignoreAbsorptionForLayout(Player player) {
|
||||
if (!Lifecycle.canRunHud()) {
|
||||
return player.getAbsorptionAmount();
|
||||
}
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
|
|
@ -413,8 +413,8 @@ public abstract class GuiMixin {
|
|||
target = "Lnet/minecraft/world/entity/player/Player;getAttributeValue(Lnet/minecraft/core/Holder;)D"
|
||||
)
|
||||
)
|
||||
private double combatant$clampMaxHealthForLayout(Player player, Holder<Attribute> attribute) {
|
||||
if (!RuntimeGate.canRunHud()) {
|
||||
private double lovisual$clampMaxHealthForLayout(Player player, Holder<Attribute> attribute) {
|
||||
if (!Lifecycle.canRunHud()) {
|
||||
return player.getAttributes().getValue(attribute);
|
||||
}
|
||||
if (attribute == Attributes.MAX_HEALTH) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -51,10 +51,10 @@ public abstract class GuiRendererMixin {
|
|||
private ProjectionMatrixBuffer guiProjectionMatrixBuffer;
|
||||
|
||||
@Unique
|
||||
private final ObjectArrayList<QueuedHudMarker> combatant$hudMarkers = new ObjectArrayList<>(16);
|
||||
private final ObjectArrayList<QueuedHudMarker> lovisual$hudMarkers = new ObjectArrayList<>(16);
|
||||
|
||||
@Unique
|
||||
private GuiRenderState.TraverseRange combatant$currentTraverseRange;
|
||||
private GuiRenderState.TraverseRange lovisual$currentTraverseRange;
|
||||
|
||||
@Shadow
|
||||
private void executeDrawRange(Supplier<String> supplier,
|
||||
|
|
@ -66,56 +66,56 @@ public abstract class GuiRendererMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "render", at = @At("HEAD"))
|
||||
private void combatant$clearHudMarkersAtFrameStart(CallbackInfo ci) {
|
||||
combatant$hudMarkers.clear();
|
||||
private void lovisual$clearHudMarkersAtFrameStart(CallbackInfo ci) {
|
||||
lovisual$hudMarkers.clear();
|
||||
}
|
||||
|
||||
@Inject(method = "render", at = @At("RETURN"))
|
||||
private void combatant$clearHudMarkersAtFrameEnd(CallbackInfo ci) {
|
||||
combatant$hudMarkers.clear();
|
||||
private void lovisual$clearHudMarkersAtFrameEnd(CallbackInfo ci) {
|
||||
lovisual$hudMarkers.clear();
|
||||
}
|
||||
|
||||
@Inject(method = "addElementsToMeshes", at = @At("HEAD"))
|
||||
private void combatant$enterTraverseRange(GuiRenderState.TraverseRange range, CallbackInfo ci) {
|
||||
combatant$currentTraverseRange = range;
|
||||
private void lovisual$enterTraverseRange(GuiRenderState.TraverseRange range, CallbackInfo ci) {
|
||||
lovisual$currentTraverseRange = range;
|
||||
}
|
||||
|
||||
@Inject(method = "addElementsToMeshes", at = @At("RETURN"))
|
||||
private void combatant$exitTraverseRange(GuiRenderState.TraverseRange range, CallbackInfo ci) {
|
||||
combatant$currentTraverseRange = null;
|
||||
private void lovisual$exitTraverseRange(GuiRenderState.TraverseRange range, CallbackInfo ci) {
|
||||
lovisual$currentTraverseRange = null;
|
||||
}
|
||||
|
||||
@Inject(method = "addElementToMesh", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$captureHudDeferredMarker(GuiElementRenderState element, CallbackInfo ci) {
|
||||
private void lovisual$captureHudDeferredMarker(GuiElementRenderState element, CallbackInfo ci) {
|
||||
if (!(element instanceof HudDeferredGuiElement marker)) return;
|
||||
int drawIndex = draws != null ? draws.size() : 0;
|
||||
GuiRenderState.TraverseRange range = combatant$currentTraverseRange != null
|
||||
? combatant$currentTraverseRange
|
||||
GuiRenderState.TraverseRange range = lovisual$currentTraverseRange != null
|
||||
? lovisual$currentTraverseRange
|
||||
: GuiRenderState.TraverseRange.BEFORE_BLUR;
|
||||
combatant$hudMarkers.add(new QueuedHudMarker(drawIndex, range, marker.layer()));
|
||||
lovisual$hudMarkers.add(new QueuedHudMarker(drawIndex, range, marker.layer()));
|
||||
ci.cancel();
|
||||
}
|
||||
|
||||
@Inject(method = "draw", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$drawWithDeferredHudMarkers(CallbackInfo ci) {
|
||||
if (combatant$hudMarkers.isEmpty()) return;
|
||||
private void lovisual$drawWithDeferredHudMarkers(CallbackInfo ci) {
|
||||
if (lovisual$hudMarkers.isEmpty()) return;
|
||||
|
||||
if (draws == null || draws.isEmpty()) {
|
||||
combatant$drainHudMarkersUpTo(Integer.MAX_VALUE);
|
||||
lovisual$drainHudMarkersUpTo(Integer.MAX_VALUE);
|
||||
ci.cancel();
|
||||
return;
|
||||
}
|
||||
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc == null || mc.gameRenderer == null) {
|
||||
combatant$drainHudMarkersUpTo(Integer.MAX_VALUE);
|
||||
lovisual$drainHudMarkersUpTo(Integer.MAX_VALUE);
|
||||
ci.cancel();
|
||||
return;
|
||||
}
|
||||
|
||||
WindowRenderState window = mc.gameRenderer.gameRenderState().windowRenderState;
|
||||
if (window == null || window.guiScale == 0) {
|
||||
combatant$drainHudMarkersUpTo(Integer.MAX_VALUE);
|
||||
lovisual$drainHudMarkersUpTo(Integer.MAX_VALUE);
|
||||
ci.cancel();
|
||||
return;
|
||||
}
|
||||
|
|
@ -131,7 +131,7 @@ public abstract class GuiRendererMixin {
|
|||
|
||||
RenderTarget target = mc.gameRenderer.mainRenderTarget();
|
||||
if (target == null) {
|
||||
combatant$drainHudMarkersUpTo(Integer.MAX_VALUE);
|
||||
lovisual$drainHudMarkersUpTo(Integer.MAX_VALUE);
|
||||
ci.cancel();
|
||||
return;
|
||||
}
|
||||
|
|
@ -141,7 +141,7 @@ public abstract class GuiRendererMixin {
|
|||
|
||||
int beforeBlurEnd = Math.min(firstDrawIndexAfterBlur, draws.size());
|
||||
if (beforeBlurEnd > 0) {
|
||||
combatant$executeDrawRangeWithHudMarkers(
|
||||
lovisual$executeDrawRangeWithHudMarkers(
|
||||
() -> "gui before blur",
|
||||
target,
|
||||
transform,
|
||||
|
|
@ -150,19 +150,19 @@ public abstract class GuiRendererMixin {
|
|||
GuiRenderState.TraverseRange.BEFORE_BLUR
|
||||
);
|
||||
} else {
|
||||
combatant$drainHudMarkersInRange(GuiRenderState.TraverseRange.BEFORE_BLUR, Integer.MAX_VALUE);
|
||||
lovisual$drainHudMarkersInRange(GuiRenderState.TraverseRange.BEFORE_BLUR, Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
boolean hasAfterBlurMarkers = combatant$hasPendingHudMarkersInRange(GuiRenderState.TraverseRange.AFTER_BLUR);
|
||||
boolean hasAfterBlurMarkers = lovisual$hasPendingHudMarkersInRange(GuiRenderState.TraverseRange.AFTER_BLUR);
|
||||
if (draws.size() <= firstDrawIndexAfterBlur && !hasAfterBlurMarkers) {
|
||||
combatant$drainHudMarkersUpTo(Integer.MAX_VALUE);
|
||||
lovisual$drainHudMarkersUpTo(Integer.MAX_VALUE);
|
||||
ci.cancel();
|
||||
return;
|
||||
}
|
||||
|
||||
RenderSystem.getDevice().createCommandEncoder().clearDepthTexture(target.getDepthTexture(), 0.0D);
|
||||
mc.gameRenderer.processBlurEffect();
|
||||
combatant$executeDrawRangeWithHudMarkers(
|
||||
lovisual$executeDrawRangeWithHudMarkers(
|
||||
() -> "gui after blur",
|
||||
target,
|
||||
transform,
|
||||
|
|
@ -170,25 +170,25 @@ public abstract class GuiRendererMixin {
|
|||
draws.size(),
|
||||
GuiRenderState.TraverseRange.AFTER_BLUR
|
||||
);
|
||||
combatant$drainHudMarkersUpTo(Integer.MAX_VALUE);
|
||||
lovisual$drainHudMarkersUpTo(Integer.MAX_VALUE);
|
||||
ci.cancel();
|
||||
}
|
||||
|
||||
@Unique
|
||||
private void combatant$executeDrawRangeWithHudMarkers(Supplier<String> label,
|
||||
private void lovisual$executeDrawRangeWithHudMarkers(Supplier<String> label,
|
||||
RenderTarget target,
|
||||
GpuBufferSlice transform,
|
||||
int start,
|
||||
int end,
|
||||
GuiRenderState.TraverseRange range) {
|
||||
int cursor = start;
|
||||
for (int i = 0, size = combatant$hudMarkers.size(); i < size; i++) {
|
||||
QueuedHudMarker marker = combatant$hudMarkers.get(i);
|
||||
for (int i = 0, size = lovisual$hudMarkers.size(); i < size; i++) {
|
||||
QueuedHudMarker marker = lovisual$hudMarkers.get(i);
|
||||
if (marker == null || marker.drained || marker.range != range) continue;
|
||||
|
||||
int markerIndex = marker.drawIndex;
|
||||
if (markerIndex < start) {
|
||||
combatant$drainHudMarker(marker);
|
||||
lovisual$drainHudMarker(marker);
|
||||
continue;
|
||||
}
|
||||
if (markerIndex > end) continue;
|
||||
|
|
@ -196,7 +196,7 @@ public abstract class GuiRendererMixin {
|
|||
if (cursor < markerIndex) {
|
||||
executeDrawRange(label, target, transform, cursor, markerIndex);
|
||||
}
|
||||
combatant$drainHudMarker(marker);
|
||||
lovisual$drainHudMarker(marker);
|
||||
cursor = Math.max(cursor, markerIndex);
|
||||
}
|
||||
|
||||
|
|
@ -206,9 +206,9 @@ public abstract class GuiRendererMixin {
|
|||
}
|
||||
|
||||
@Unique
|
||||
private boolean combatant$hasPendingHudMarkersInRange(GuiRenderState.TraverseRange range) {
|
||||
for (int i = 0, size = combatant$hudMarkers.size(); i < size; i++) {
|
||||
QueuedHudMarker marker = combatant$hudMarkers.get(i);
|
||||
private boolean lovisual$hasPendingHudMarkersInRange(GuiRenderState.TraverseRange range) {
|
||||
for (int i = 0, size = lovisual$hudMarkers.size(); i < size; i++) {
|
||||
QueuedHudMarker marker = lovisual$hudMarkers.get(i);
|
||||
if (marker != null && !marker.drained && marker.range == range) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -217,29 +217,29 @@ public abstract class GuiRendererMixin {
|
|||
}
|
||||
|
||||
@Unique
|
||||
private void combatant$drainHudMarkersInRange(GuiRenderState.TraverseRange range, int drawIndexInclusive) {
|
||||
for (int i = 0, size = combatant$hudMarkers.size(); i < size; i++) {
|
||||
QueuedHudMarker marker = combatant$hudMarkers.get(i);
|
||||
private void lovisual$drainHudMarkersInRange(GuiRenderState.TraverseRange range, int drawIndexInclusive) {
|
||||
for (int i = 0, size = lovisual$hudMarkers.size(); i < size; i++) {
|
||||
QueuedHudMarker marker = lovisual$hudMarkers.get(i);
|
||||
if (marker == null || marker.drained || marker.range != range) continue;
|
||||
if (marker.drawIndex <= drawIndexInclusive) {
|
||||
combatant$drainHudMarker(marker);
|
||||
lovisual$drainHudMarker(marker);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Unique
|
||||
private void combatant$drainHudMarkersUpTo(int drawIndexInclusive) {
|
||||
for (int i = 0, size = combatant$hudMarkers.size(); i < size; i++) {
|
||||
QueuedHudMarker marker = combatant$hudMarkers.get(i);
|
||||
private void lovisual$drainHudMarkersUpTo(int drawIndexInclusive) {
|
||||
for (int i = 0, size = lovisual$hudMarkers.size(); i < size; i++) {
|
||||
QueuedHudMarker marker = lovisual$hudMarkers.get(i);
|
||||
if (marker == null || marker.drained) continue;
|
||||
if (marker.drawIndex <= drawIndexInclusive) {
|
||||
combatant$drainHudMarker(marker);
|
||||
lovisual$drainHudMarker(marker);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Unique
|
||||
private void combatant$drainHudMarker(QueuedHudMarker marker) {
|
||||
private void lovisual$drainHudMarker(QueuedHudMarker marker) {
|
||||
if (marker == null || marker.drained) return;
|
||||
marker.drained = true;
|
||||
Renderer2D.drainDeferred2D(marker.layer);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -27,7 +27,7 @@ import dev.loki.lovisual.features.gui.clickgui.ClickGuiScreen;
|
|||
import dev.loki.lovisual.features.gui.hud.nondraggable.impl.CustomBar;
|
||||
import dev.loki.lovisual.features.gui.hud.nondraggable.impl.DynamicIsland;
|
||||
import dev.loki.lovisual.features.module.modules.misc.ClickGui;
|
||||
import dev.loki.lovisual.render.engine.core.CombatantRenderSystem;
|
||||
import dev.loki.lovisual.render.engine.core.LoVisualRenderSystem;
|
||||
import dev.loki.lovisual.render.engine.core.RenderPhase;
|
||||
import dev.loki.lovisual.render.engine.core.RenderPhaseScope;
|
||||
import dev.loki.lovisual.render.engine.renderer.Renderer2D;
|
||||
|
|
@ -36,7 +36,7 @@ import dev.loki.lovisual.render.engine.renderer.Renderer2D;
|
|||
public abstract class GuiScreenMixin {
|
||||
|
||||
@Unique
|
||||
private static void combatant$extractCustomBarHeads(GuiGraphicsExtractor drawContext, DeltaTracker tickCounter) {
|
||||
private static void lovisual$extractCustomBarHeads(GuiGraphicsExtractor drawContext, DeltaTracker tickCounter) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc == null || mc.player == null) return;
|
||||
if (ClientScreen.current() != null) return;
|
||||
|
|
@ -45,8 +45,8 @@ public abstract class GuiScreenMixin {
|
|||
if (bar == null || !bar.isHudBarEnabled() || !bar.isHotbarXpBarEnabled()) return;
|
||||
if (CustomBar.shouldUseJumpBar(mc) || !CustomBar.shouldUseLocator(mc, bar)) return;
|
||||
|
||||
CombatantRenderSystem.ensureFrameContext();
|
||||
try (RenderPhaseScope ignored = CombatantRenderSystem.phase(RenderPhase.SCREEN_TOP, "2d:hud:custom_bar_heads")) {
|
||||
LoVisualRenderSystem.ensureFrameContext();
|
||||
try (RenderPhaseScope ignored = LoVisualRenderSystem.phase(RenderPhase.SCREEN_TOP, "2d:hud:custom_bar_heads")) {
|
||||
Renderer2D.withDeferredLayer(Renderer2D.Deferred2DLayer.AFTER_VANILLA_GUI, () -> {
|
||||
CustomBar.renderLocatorHeads(drawContext, tickCounter, mc);
|
||||
Renderer2D.COLOR.render();
|
||||
|
|
@ -55,7 +55,7 @@ public abstract class GuiScreenMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "setScreen", at = @At("HEAD"))
|
||||
private void combatant$closeClickGuiOnScreen(Screen screen, CallbackInfo ci) {
|
||||
private void lovisual$closeClickGuiOnScreen(Screen screen, CallbackInfo ci) {
|
||||
if (!ModuleManager.isEnabled("clickgui")) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -87,14 +87,14 @@ public abstract class GuiScreenMixin {
|
|||
target = "Lnet/minecraft/client/gui/GuiGraphicsExtractor;applyCursor(Lcom/mojang/blaze3d/platform/Window;)V"
|
||||
)
|
||||
)
|
||||
private void combatant$extractTopLayer(DeltaTracker tickCounter, boolean renderLevel, boolean renderScreens, CallbackInfo ci,
|
||||
private void lovisual$extractTopLayer(DeltaTracker tickCounter, boolean renderLevel, boolean renderScreens, CallbackInfo ci,
|
||||
@Local(ordinal = 0) GuiGraphicsExtractor drawContext) {
|
||||
if (drawContext == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
drawContext.nextStratum();
|
||||
combatant$extractCustomBarHeads(drawContext, tickCounter);
|
||||
lovisual$extractCustomBarHeads(drawContext, tickCounter);
|
||||
DynamicIsland.renderScreenOverlay(drawContext, tickCounter.getGameTimeDeltaTicks());
|
||||
ClickGuiRenderer.renderTopLayer(drawContext, tickCounter.getGameTimeDeltaTicks());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -12,23 +12,12 @@ 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;
|
||||
import dev.loki.lovisual.features.module.Modules;
|
||||
import dev.loki.lovisual.features.module.modules.movement.Sprint;
|
||||
|
||||
@Mixin(ClientInput.class)
|
||||
public abstract class InputMixin {
|
||||
|
||||
@Inject(method = "hasForwardImpulse", at = @At("HEAD"), cancellable = true)
|
||||
private void allowAllDirections(CallbackInfoReturnable<Boolean> cir) {
|
||||
Sprint module = Modules.get(Sprint.class);
|
||||
if (module == null || !module.shouldAllowDirectionalSprint()) return;
|
||||
|
||||
ClientInput input = (ClientInput) (Object) this;
|
||||
if (input.keyPresses.forward()
|
||||
|| input.keyPresses.backward()
|
||||
|| input.keyPresses.left()
|
||||
|| input.keyPresses.right()) {
|
||||
cir.setReturnValue(true);
|
||||
}
|
||||
// Sprint module removed; keep vanilla forward impulse check.
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -18,7 +18,6 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import dev.loki.lovisual.features.module.Modules;
|
||||
import dev.loki.lovisual.features.module.modules.combat.TPSSync;
|
||||
import dev.loki.lovisual.features.module.modules.movement.Timer;
|
||||
import dev.loki.lovisual.mixins.accessors.ItemCooldownEntryAccessor;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
|
@ -33,36 +32,34 @@ public abstract class ItemCooldownsMixin {
|
|||
@Final
|
||||
private Map<Identifier, ?> cooldowns;
|
||||
@Unique
|
||||
private float combatant$timerRemainder = 0f;
|
||||
private float lovisual$timerRemainder = 0f;
|
||||
|
||||
@Shadow
|
||||
protected abstract void onCooldownEnded(Identifier groupId);
|
||||
|
||||
@Inject(method = "tick", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$timerCompensate(CallbackInfo ci) {
|
||||
float mult = Timer.getTickTimer();
|
||||
private void lovisual$timerCompensate(CallbackInfo ci) {
|
||||
// Timer module removed; scale only by server TPS when active.
|
||||
float serverDelta = 1.0f;
|
||||
TPSSync tps = Modules.get(TPSSync.class);
|
||||
if (tps != null && tps.isEnabled()) {
|
||||
serverDelta = tps.getServerTickDelta();
|
||||
}
|
||||
|
||||
float scale = (mult <= 0.0001f) ? 1.0f : (serverDelta / mult);
|
||||
if (scale > 1.0f) scale = 1.0f;
|
||||
if (scale < 0.0f) scale = 0.0f;
|
||||
if (serverDelta > 1.0f) serverDelta = 1.0f;
|
||||
if (serverDelta < 0.0f) serverDelta = 0.0f;
|
||||
|
||||
if (Math.abs(scale - 1.0f) < 0.0001f) {
|
||||
if (Math.abs(serverDelta - 1.0f) < 0.0001f) {
|
||||
return;
|
||||
}
|
||||
|
||||
float step = scale;
|
||||
combatant$timerRemainder += step;
|
||||
int inc = (int) combatant$timerRemainder;
|
||||
lovisual$timerRemainder += serverDelta;
|
||||
int inc = (int) lovisual$timerRemainder;
|
||||
if (inc <= 0) {
|
||||
ci.cancel();
|
||||
return;
|
||||
}
|
||||
combatant$timerRemainder -= inc;
|
||||
lovisual$timerRemainder -= inc;
|
||||
|
||||
tickCount += inc;
|
||||
if (!cooldowns.isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -15,15 +15,15 @@ import dev.loki.lovisual.mixininterface.IItemEntityRenderState;
|
|||
@Mixin(ItemEntityRenderState.class)
|
||||
public class ItemEntityRenderStateMixin implements IItemEntityRenderState {
|
||||
@Unique
|
||||
private boolean combatant$onGround;
|
||||
private boolean lovisual$onGround;
|
||||
|
||||
@Override
|
||||
public boolean combatant$isOnGround() {
|
||||
return combatant$onGround;
|
||||
public boolean lovisual$isOnGround() {
|
||||
return lovisual$onGround;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void combatant$setOnGround(boolean onGround) {
|
||||
combatant$onGround = onGround;
|
||||
public void lovisual$setOnGround(boolean onGround) {
|
||||
lovisual$onGround = onGround;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -39,12 +39,12 @@ public abstract class ItemEntityRendererMixin extends EntityRenderer<ItemEntity,
|
|||
}
|
||||
|
||||
@Inject(method = "extractRenderState", at = @At("TAIL"))
|
||||
private void combatant$captureOnGround(ItemEntity itemEntity, ItemEntityRenderState state, float tickDelta, CallbackInfo ci) {
|
||||
((IItemEntityRenderState) state).combatant$setOnGround(itemEntity.onGround());
|
||||
private void lovisual$captureOnGround(ItemEntity itemEntity, ItemEntityRenderState state, float tickDelta, CallbackInfo ci) {
|
||||
((IItemEntityRenderState) state).lovisual$setOnGround(itemEntity.onGround());
|
||||
}
|
||||
|
||||
@Inject(method = "submit", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$renderItemPhysics(
|
||||
private void lovisual$renderItemPhysics(
|
||||
ItemEntityRenderState state,
|
||||
PoseStack matrices,
|
||||
SubmitNodeCollector queue,
|
||||
|
|
@ -61,7 +61,7 @@ public abstract class ItemEntityRendererMixin extends EntityRenderer<ItemEntity,
|
|||
float baseY = -((float) box.minY) + 0.0625F;
|
||||
matrices.translate(0.0F, baseY, 0.0F);
|
||||
|
||||
if (((IItemEntityRenderState) state).combatant$isOnGround()) {
|
||||
if (((IItemEntityRenderState) state).lovisual$isOnGround()) {
|
||||
matrices.mulPose(Axis.XP.rotationDegrees(90.0F));
|
||||
} else {
|
||||
float rotation = ItemEntity.getSpin(state.ageInTicks, state.bobOffset);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -20,33 +20,33 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||
@Mixin(ItemFeatureRenderer.class)
|
||||
public abstract class ItemFeatureRendererMixin {
|
||||
@Unique
|
||||
private static final int COMBATANT_VIEW_FADE_DITHER_MARK = 0x00010001;
|
||||
private static final int LOVISUAL_VIEW_FADE_DITHER_MARK = 0x00010001;
|
||||
@Unique
|
||||
private static final int COMBATANT_VIEW_FADE_A2C_MARK = 0x00010100;
|
||||
private static final int LOVISUAL_VIEW_FADE_A2C_MARK = 0x00010100;
|
||||
|
||||
@Unique
|
||||
private static boolean combatant$isViewFadeMarked(int argb) {
|
||||
private static boolean lovisual$isViewFadeMarked(int argb) {
|
||||
int alpha = (argb >>> 24) & 0xFF;
|
||||
if (alpha >= 255) {
|
||||
return false;
|
||||
}
|
||||
int rgbMarker = argb & 0x00010101;
|
||||
return rgbMarker == COMBATANT_VIEW_FADE_DITHER_MARK || rgbMarker == COMBATANT_VIEW_FADE_A2C_MARK;
|
||||
return rgbMarker == LOVISUAL_VIEW_FADE_DITHER_MARK || rgbMarker == LOVISUAL_VIEW_FADE_A2C_MARK;
|
||||
}
|
||||
|
||||
@Unique
|
||||
private static boolean combatant$hasViewFadeTint(int[] tints) {
|
||||
return tints != null && tints.length > 0 && combatant$isViewFadeMarked(tints[0]);
|
||||
private static boolean lovisual$hasViewFadeTint(int[] tints) {
|
||||
return tints != null && tints.length > 0 && lovisual$isViewFadeMarked(tints[0]);
|
||||
}
|
||||
|
||||
@ModifyReturnValue(
|
||||
method = "getLayerColorSafe([ILnet/minecraft/client/resources/model/geometry/BakedQuad$MaterialInfo;)I",
|
||||
at = @At("RETURN")
|
||||
)
|
||||
private static int combatant$applyViewFadeToUntintedItemQuads(int original,
|
||||
private static int lovisual$applyViewFadeToUntintedItemQuads(int original,
|
||||
int[] tints,
|
||||
BakedQuad.MaterialInfo materialInfo) {
|
||||
if (original != -1 || !combatant$hasViewFadeTint(tints)) {
|
||||
if (original != -1 || !lovisual$hasViewFadeTint(tints)) {
|
||||
return original;
|
||||
}
|
||||
return tints[0];
|
||||
|
|
@ -56,7 +56,7 @@ public abstract class ItemFeatureRendererMixin {
|
|||
method = "prepareMainSubmit",
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/resources/model/geometry/BakedQuad$MaterialInfo;itemRenderType()Lnet/minecraft/client/renderer/rendertype/RenderType;")
|
||||
)
|
||||
private RenderType combatant$useTranslucentRenderTypeForViewFadeItem(RenderType original,
|
||||
private RenderType lovisual$useTranslucentRenderTypeForViewFadeItem(RenderType original,
|
||||
@Local(argsOnly = true) ItemFeatureRenderer.Submit submit,
|
||||
@Local(ordinal = 0) BakedQuad.MaterialInfo materialInfo) {
|
||||
// Vanilla item translucent sheets render into ITEM_ENTITY_TARGET. For entity fade this can
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -33,7 +33,7 @@ import dev.loki.lovisual.features.module.modules.visuals.ViewModel;
|
|||
public abstract class ItemInHandRendererMixin {
|
||||
|
||||
@Inject(method = "tick", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$skipTickWithoutPlayer(CallbackInfo ci) {
|
||||
private void lovisual$skipTickWithoutPlayer(CallbackInfo ci) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc.level != null && mc.player == null) {
|
||||
ci.cancel();
|
||||
|
|
@ -44,7 +44,7 @@ public abstract class ItemInHandRendererMixin {
|
|||
method = "submitArmWithItem",
|
||||
at = @At("HEAD")
|
||||
)
|
||||
private void combatant$applyOffsets(
|
||||
private void lovisual$applyOffsets(
|
||||
AbstractClientPlayer player,
|
||||
float tickDelta,
|
||||
float pitch,
|
||||
|
|
@ -72,7 +72,7 @@ public abstract class ItemInHandRendererMixin {
|
|||
at = @At("HEAD"),
|
||||
argsOnly = true,
|
||||
index = 7)
|
||||
private float combatant$scaleEquipProgress(float equipProgress) {
|
||||
private float lovisual$scaleEquipProgress(float equipProgress) {
|
||||
ViewModel viewModel = Modules.get(ViewModel.class);
|
||||
if (viewModel == null || !viewModel.isEnabled()) return equipProgress;
|
||||
return equipProgress * viewModel.equipLowering.get();
|
||||
|
|
@ -90,7 +90,7 @@ public abstract class ItemInHandRendererMixin {
|
|||
target = "Lnet/minecraft/client/renderer/item/ItemStackRenderState;submit(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;III)V"
|
||||
)
|
||||
)
|
||||
private void combatant$scaleMiniItems(
|
||||
private void lovisual$scaleMiniItems(
|
||||
LivingEntity entity,
|
||||
ItemStack stack,
|
||||
ItemDisplayContext ctx,
|
||||
|
|
@ -113,7 +113,7 @@ public abstract class ItemInHandRendererMixin {
|
|||
at = @At("HEAD"),
|
||||
cancellable = true
|
||||
)
|
||||
private void combatant$customSwing(
|
||||
private void lovisual$customSwing(
|
||||
float swingProgress,
|
||||
PoseStack ms,
|
||||
int direction,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -25,7 +25,7 @@ public class ItemMixin {
|
|||
target = "Lnet/minecraft/world/entity/player/Player;calculateViewVector(FF)Lnet/minecraft/world/phys/Vec3;"
|
||||
)
|
||||
)
|
||||
private static Vec3 combatant$raycastRotation(Player player, float pitch, float yaw) {
|
||||
private static Vec3 lovisual$raycastRotation(Player player, float pitch, float yaw) {
|
||||
return RotationManager.INSTANCE.getMovementRotation().directionVector();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -50,7 +50,7 @@ public class ItemStackMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "getTooltipLines", at = @At("RETURN"), cancellable = true)
|
||||
private void combatant$colorizeTooltip(Item.TooltipContext tooltipContext, @Nullable Player player, TooltipFlag type, CallbackInfoReturnable<List<Component>> cir) {
|
||||
private void lovisual$colorizeTooltip(Item.TooltipContext tooltipContext, @Nullable Player player, TooltipFlag type, CallbackInfoReturnable<List<Component>> cir) {
|
||||
BetterTooltips tooltips = BetterTooltips.get();
|
||||
if (tooltips == null || !tooltips.isItemInfoColorizeEnabled()) return;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -30,32 +30,32 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||
@Mixin(Screen.class)
|
||||
public abstract class JoinMultiplayerScreenMixin {
|
||||
@Unique
|
||||
private static final float COMBATANT_PROXY_BUTTON_X = 8f;
|
||||
private static final float LOVISUAL_PROXY_BUTTON_X = 8f;
|
||||
@Unique
|
||||
private static final float COMBATANT_PROXY_BUTTON_Y = 8f;
|
||||
private static final float LOVISUAL_PROXY_BUTTON_Y = 8f;
|
||||
@Unique
|
||||
private static final float COMBATANT_PROXY_BUTTON_W = 24f;
|
||||
private static final float LOVISUAL_PROXY_BUTTON_W = 24f;
|
||||
@Unique
|
||||
private static final float COMBATANT_PROXY_BUTTON_H = 24f;
|
||||
private static final float LOVISUAL_PROXY_BUTTON_H = 24f;
|
||||
@Unique
|
||||
private float combatant$proxyHover;
|
||||
private float lovisual$proxyHover;
|
||||
@Unique
|
||||
private float combatant$proxyPress;
|
||||
private float lovisual$proxyPress;
|
||||
|
||||
@Inject(method = "extractRenderState(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IIF)V", at = @At("RETURN"))
|
||||
private void combatant$renderProxyEntry(GuiGraphicsExtractor context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
private void lovisual$renderProxyEntry(GuiGraphicsExtractor context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
Screen self = (Screen) (Object) this;
|
||||
if (!(self instanceof JoinMultiplayerScreen)) return;
|
||||
float dt = AnimationUtility.deltaTime();
|
||||
boolean hovered = combatant$inside(mouseX, mouseY, COMBATANT_PROXY_BUTTON_X, COMBATANT_PROXY_BUTTON_Y,
|
||||
COMBATANT_PROXY_BUTTON_W, COMBATANT_PROXY_BUTTON_H);
|
||||
combatant$proxyHover = combatant$animate(combatant$proxyHover, hovered ? 1f : 0f, dt, 11f);
|
||||
combatant$proxyPress = combatant$animate(combatant$proxyPress, 0f, dt, 8f);
|
||||
boolean hovered = lovisual$inside(mouseX, mouseY, LOVISUAL_PROXY_BUTTON_X, LOVISUAL_PROXY_BUTTON_Y,
|
||||
LOVISUAL_PROXY_BUTTON_W, LOVISUAL_PROXY_BUTTON_H);
|
||||
lovisual$proxyHover = lovisual$animate(lovisual$proxyHover, hovered ? 1f : 0f, dt, 11f);
|
||||
lovisual$proxyPress = lovisual$animate(lovisual$proxyPress, 0f, dt, 8f);
|
||||
|
||||
ViewportContext.beginScaled(context);
|
||||
Renderer2D.COLOR.begin();
|
||||
try {
|
||||
combatant$drawProxyButton();
|
||||
lovisual$drawProxyButton();
|
||||
} finally {
|
||||
Renderer2D.COLOR.render();
|
||||
ViewportContext.end(context);
|
||||
|
|
@ -63,17 +63,17 @@ public abstract class JoinMultiplayerScreenMixin {
|
|||
}
|
||||
|
||||
@Unique
|
||||
private void combatant$drawProxyButton() {
|
||||
float hover = AnimationUtility.easeOutCubic(combatant$proxyHover);
|
||||
float press = AnimationUtility.easeOutCubic(combatant$proxyPress);
|
||||
private void lovisual$drawProxyButton() {
|
||||
float hover = AnimationUtility.easeOutCubic(lovisual$proxyHover);
|
||||
float press = AnimationUtility.easeOutCubic(lovisual$proxyPress);
|
||||
Themes.Theme theme = Theme.theme();
|
||||
boolean enabled = ProxyBackend.isEnabled();
|
||||
ProxyEntry active = ProxyBackend.activeProxy();
|
||||
boolean configured = active.isConfigured();
|
||||
|
||||
float size = COMBATANT_PROXY_BUTTON_W * (1.0f + hover * 0.035f - press * 0.025f);
|
||||
float x = COMBATANT_PROXY_BUTTON_X + (COMBATANT_PROXY_BUTTON_W - size) * 0.5f;
|
||||
float y = COMBATANT_PROXY_BUTTON_Y + (COMBATANT_PROXY_BUTTON_H - size) * 0.5f - hover * 0.35f;
|
||||
float size = LOVISUAL_PROXY_BUTTON_W * (1.0f + hover * 0.035f - press * 0.025f);
|
||||
float x = LOVISUAL_PROXY_BUTTON_X + (LOVISUAL_PROXY_BUTTON_W - size) * 0.5f;
|
||||
float y = LOVISUAL_PROXY_BUTTON_Y + (LOVISUAL_PROXY_BUTTON_H - size) * 0.5f - hover * 0.35f;
|
||||
float radius = 5.0f;
|
||||
float centerX = x + size * 0.5f;
|
||||
float centerY = y + size * 0.5f;
|
||||
|
|
@ -97,13 +97,13 @@ public abstract class JoinMultiplayerScreenMixin {
|
|||
}
|
||||
|
||||
@Unique
|
||||
private static float combatant$animate(float current, float target, float dt, float speed) {
|
||||
private static float lovisual$animate(float current, float target, float dt, float speed) {
|
||||
float next = AnimationUtility.approach(current, target, dt, speed);
|
||||
return AnimationUtility.snap(next, target, 0.001f);
|
||||
}
|
||||
|
||||
@Unique
|
||||
private static boolean combatant$inside(float mx, float my, float x, float y, float w, float h) {
|
||||
private static boolean lovisual$inside(float mx, float my, float x, float y, float w, float h) {
|
||||
return mx >= x && mx <= x + w && my >= y && my <= y + h;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -16,14 +16,14 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import dev.loki.lovisual.features.gui.hud.nondraggable.impl.CustomBar;
|
||||
import dev.loki.lovisual.runtime.RuntimeGate;
|
||||
import dev.loki.lovisual.Lifecycle;
|
||||
|
||||
@Mixin(JumpableVehicleBar.class)
|
||||
public abstract class JumpBarMixin {
|
||||
|
||||
@Inject(method = "extractBackground", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$renderJumpBar(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
if (!RuntimeGate.canRunHud()) return;
|
||||
private void lovisual$renderJumpBar(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
if (!Lifecycle.canRunHud()) return;
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc == null || mc.player == null) return;
|
||||
|
||||
|
|
@ -35,8 +35,8 @@ public abstract class JumpBarMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "extractRenderState", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$renderJumpAddons(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
if (!RuntimeGate.canRunHud()) return;
|
||||
private void lovisual$renderJumpAddons(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
if (!Lifecycle.canRunHud()) return;
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc == null || mc.player == null) return;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -23,7 +23,7 @@ public class KeyMappingMixin {
|
|||
private boolean isDown;
|
||||
|
||||
@Inject(method = "isDown", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$keybindIsPressedEvent(CallbackInfoReturnable<Boolean> cir) {
|
||||
private void lovisual$keybindIsPressedEvent(CallbackInfoReturnable<Boolean> cir) {
|
||||
if (!Events.BUS.hasListeners(KeybindIsPressedEvent.class)) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -28,7 +28,7 @@ public abstract class KeyboardInputMixin extends InputMixin {
|
|||
target = "(ZZZZZZZ)Lnet/minecraft/world/entity/player/Input;"
|
||||
)
|
||||
)
|
||||
private Input combatant$applyFreeCorrection(Input original) {
|
||||
private Input lovisual$applyFreeCorrection(Input original) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc.player == null) {
|
||||
return original;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -34,7 +34,7 @@ import dev.loki.lovisual.features.gui.clickgui.*;
|
|||
import dev.loki.lovisual.features.gui.hud.draggable.impl.BetterChat;
|
||||
import dev.loki.lovisual.features.module.ModuleManager;
|
||||
import dev.loki.lovisual.mixins.accessors.ChatScreenAccessor;
|
||||
import dev.loki.lovisual.runtime.RuntimeGate;
|
||||
import dev.loki.lovisual.Lifecycle;
|
||||
import dev.loki.lovisual.util.NarratorBlocker;
|
||||
import dev.loki.lovisual.util.input.KeyManager;
|
||||
import dev.loki.lovisual.util.text.ClipboardUtil;
|
||||
|
|
@ -70,9 +70,9 @@ public class KeyboardMixin {
|
|||
|
||||
// ===== CHAR TYPING =====
|
||||
@Inject(method = "charTyped", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$onChar(long window, CharacterEvent input, CallbackInfo ci) {
|
||||
private void lovisual$onChar(long window, CharacterEvent input, CallbackInfo ci) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (RuntimeGate.canRunHud()
|
||||
if (Lifecycle.canRunHud()
|
||||
&& ClientScreen.current() instanceof ChatScreen
|
||||
&& BetterChat.isActive()
|
||||
&& BetterChatSearch.isActive()) {
|
||||
|
|
@ -80,7 +80,7 @@ public class KeyboardMixin {
|
|||
ci.cancel();
|
||||
return;
|
||||
}
|
||||
if (!RuntimeGate.canRunClientLogic() || !ModuleManager.isEnabled("clickgui")) return;
|
||||
if (!Lifecycle.isActive() || !ModuleManager.isEnabled("clickgui")) return;
|
||||
|
||||
char c = (char) input.codepoint();
|
||||
|
||||
|
|
@ -97,7 +97,7 @@ public class KeyboardMixin {
|
|||
|
||||
// ===== KEY DOWN =====
|
||||
@Inject(method = "keyPress", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$onKey(long window, int action, KeyEvent input, CallbackInfo ci) {
|
||||
private void lovisual$onKey(long window, int action, KeyEvent input, CallbackInfo ci) {
|
||||
KeyManager.handleKeyEvent(input.key(), input.scancode(), action);
|
||||
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
|
|
@ -112,7 +112,7 @@ public class KeyboardMixin {
|
|||
boolean narratorHotkeyContext = screen == null
|
||||
|| !(screen.getFocused() instanceof EditBox)
|
||||
|| !((EditBox) screen.getFocused()).canConsumeInput();
|
||||
if (RuntimeGate.canRunClientLogic()
|
||||
if (Lifecycle.isActive()
|
||||
&& NarratorBlocker.isBlocked()
|
||||
&& narratorHotkeyContext
|
||||
&& action != GLFW.GLFW_RELEASE
|
||||
|
|
@ -123,7 +123,7 @@ public class KeyboardMixin {
|
|||
return;
|
||||
}
|
||||
|
||||
if (RuntimeGate.canRunClientLogic()
|
||||
if (Lifecycle.isActive()
|
||||
&& ModuleManager.isEnabled("clickgui")
|
||||
&& (ClientScreen.current() instanceof ClickGuiScreen
|
||||
|| ClientScreen.current() instanceof ClickGuiPickerScreen
|
||||
|
|
@ -135,7 +135,7 @@ public class KeyboardMixin {
|
|||
forwardMovementKeys(mc.options, input, action != GLFW.GLFW_RELEASE);
|
||||
}
|
||||
}
|
||||
if (RuntimeGate.canRunHud()
|
||||
if (Lifecycle.canRunHud()
|
||||
&& ClientScreen.current() instanceof ChatScreen
|
||||
&& BetterChat.isActive()
|
||||
&& BetterChatSearch.isActive()) {
|
||||
|
|
@ -176,7 +176,7 @@ public class KeyboardMixin {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (RuntimeGate.canRunHud()
|
||||
if (Lifecycle.canRunHud()
|
||||
&& ClientScreen.current() instanceof ChatScreen
|
||||
&& BetterChat.isActive()
|
||||
&& !BetterChatSearch.isActive()) {
|
||||
|
|
@ -188,7 +188,7 @@ public class KeyboardMixin {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (!RuntimeGate.canRunClientLogic() || !ModuleManager.isEnabled("clickgui")) return;
|
||||
if (!Lifecycle.isActive() || !ModuleManager.isEnabled("clickgui")) return;
|
||||
|
||||
int key = input.key();
|
||||
int scancode = input.scancode();
|
||||
|
|
@ -224,11 +224,11 @@ public class KeyboardMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "keyPress", at = @At("HEAD"))
|
||||
private void combatant$betterChatCopy(long window, int action, KeyEvent input, CallbackInfo ci) {
|
||||
private void lovisual$betterChatCopy(long window, int action, KeyEvent input, CallbackInfo ci) {
|
||||
if (action != 1) return; // GLFW_PRESS
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (!(ClientScreen.current() instanceof ChatScreen)) return;
|
||||
if (!RuntimeGate.canRunHud()) return;
|
||||
if (!Lifecycle.canRunHud()) return;
|
||||
if (!BetterChat.isActive()) return;
|
||||
if ((input.modifiers() & GLFW.GLFW_MOD_CONTROL) == 0) return;
|
||||
if (input.key() == GLFW.GLFW_KEY_C) {
|
||||
|
|
@ -237,12 +237,12 @@ public class KeyboardMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "keyPress", at = @At("HEAD"))
|
||||
private void combatant$betterChat$clearOnDebug(long window, int action, KeyEvent input, CallbackInfo ci) {
|
||||
private void lovisual$betterChat$clearOnDebug(long window, int action, KeyEvent input, CallbackInfo ci) {
|
||||
if (action != GLFW.GLFW_PRESS) return;
|
||||
if (input.key() != GLFW.GLFW_KEY_D) return;
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc == null) return;
|
||||
if (!RuntimeGate.canRunHud()) return;
|
||||
if (!Lifecycle.canRunHud()) return;
|
||||
// F3 + D clears vanilla chat; mirror it for BetterChat
|
||||
if (InputConstants.isKeyDown(mc.getWindow(), GLFW.GLFW_KEY_F3)) {
|
||||
BetterChatStoreManager.clearActive();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -23,7 +23,7 @@ import dev.loki.lovisual.features.module.modules.visuals.WorldTweaks;
|
|||
public class LavaFogModifierMixin {
|
||||
|
||||
@Inject(method = "setupFog", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$noLavaFog(FogData data,
|
||||
private void lovisual$noLavaFog(FogData data,
|
||||
Camera camera,
|
||||
ClientLevel world,
|
||||
float viewDistance,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -46,7 +46,7 @@ public abstract class LevelExtractorMixin {
|
|||
}
|
||||
}
|
||||
|
||||
EntityRenderState state = ((LevelExtractorAccessor) this).combatant$invokeExtractEntity(
|
||||
EntityRenderState state = ((LevelExtractorAccessor) this).lovisual$invokeExtractEntity(
|
||||
mc.player,
|
||||
tickCounter.getGameTimeDeltaPartialTick(false)
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -40,7 +40,7 @@ import dev.loki.lovisual.features.module.modules.visuals.ReimaginedVisual;
|
|||
import dev.loki.lovisual.features.module.modules.visuals.WorldTweaks;
|
||||
import dev.loki.lovisual.mixins.accessors.GameRendererAccessor;
|
||||
import dev.loki.lovisual.mixins.accessors.LevelRendererAccessor;
|
||||
import dev.loki.lovisual.render.engine.core.CombatantWorldMatrices;
|
||||
import dev.loki.lovisual.render.engine.core.LoVisualWorldMatrices;
|
||||
import dev.loki.lovisual.render.engine.depth.PreTranslucentDepth;
|
||||
import dev.loki.lovisual.render.engine.depth.WorldSceneDepth;
|
||||
import dev.loki.lovisual.render.iris.IrisRuntime;
|
||||
|
|
@ -61,12 +61,12 @@ public abstract class LevelRendererMixin {
|
|||
target = "Lnet/minecraft/client/renderer/GameRenderer;mainRenderTarget()Lcom/mojang/blaze3d/pipeline/RenderTarget;"
|
||||
)
|
||||
)
|
||||
private RenderTarget combatant$stableSkyRendererTarget(GameRenderer instance, Operation<RenderTarget> original) {
|
||||
return ((GameRendererAccessor) instance).combatant$getMainRenderTargetRaw();
|
||||
private RenderTarget lovisual$stableSkyRendererTarget(GameRenderer instance, Operation<RenderTarget> original) {
|
||||
return ((GameRendererAccessor) instance).lovisual$getMainRenderTargetRaw();
|
||||
}
|
||||
|
||||
@Unique
|
||||
private static void combatant$dependsOn(FramePass pass, ResourceHandle<RenderTarget> handle) {
|
||||
private static void lovisual$dependsOn(FramePass pass, ResourceHandle<RenderTarget> handle) {
|
||||
if (pass != null && handle != null) {
|
||||
pass.reads(handle);
|
||||
}
|
||||
|
|
@ -74,12 +74,12 @@ public abstract class LevelRendererMixin {
|
|||
|
||||
@Unique
|
||||
@SuppressWarnings("unchecked")
|
||||
private static ResourceHandle<RenderTarget> combatant$asRenderTargetHandle(ResourceHandle<?> handle) {
|
||||
private static ResourceHandle<RenderTarget> lovisual$asRenderTargetHandle(ResourceHandle<?> handle) {
|
||||
return (ResourceHandle<RenderTarget>) handle;
|
||||
}
|
||||
|
||||
@Unique
|
||||
private static RenderTarget combatant$getFramebuffer(ResourceHandle<RenderTarget> handle) {
|
||||
private static RenderTarget lovisual$getFramebuffer(ResourceHandle<RenderTarget> handle) {
|
||||
if (handle == null) {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -91,7 +91,7 @@ public abstract class LevelRendererMixin {
|
|||
}
|
||||
|
||||
@Unique
|
||||
private static boolean combatant$needsWorldSceneDepthCapture() {
|
||||
private static boolean lovisual$needsWorldSceneDepthCapture() {
|
||||
ReimaginedVisual module = Modules.get(ReimaginedVisual.class);
|
||||
return module != null && module.needsWorldSceneDepthCapture();
|
||||
}
|
||||
|
|
@ -107,7 +107,7 @@ public abstract class LevelRendererMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "render", at = @At("HEAD"))
|
||||
private void combatant$captureIrisModelView(
|
||||
private void lovisual$captureIrisModelView(
|
||||
GraphicsResourceAllocator allocator,
|
||||
DeltaTracker tickCounter,
|
||||
boolean renderBlockOutline,
|
||||
|
|
@ -122,8 +122,8 @@ public abstract class LevelRendererMixin {
|
|||
return;
|
||||
}
|
||||
|
||||
if (CombatantWorldMatrices.isValid()) {
|
||||
CombatantWorldMatrices.capturePosition(
|
||||
if (LoVisualWorldMatrices.isValid()) {
|
||||
LoVisualWorldMatrices.capturePosition(
|
||||
positionMatrix,
|
||||
cameraRenderState != null && cameraRenderState.pos != null
|
||||
? cameraRenderState.pos
|
||||
|
|
@ -133,7 +133,7 @@ public abstract class LevelRendererMixin {
|
|||
}
|
||||
|
||||
if (cameraRenderState != null && cameraRenderState.projectionMatrix != null) {
|
||||
CombatantWorldMatrices.capture(
|
||||
LoVisualWorldMatrices.capture(
|
||||
positionMatrix,
|
||||
cameraRenderState.projectionMatrix,
|
||||
cameraRenderState.projectionMatrix,
|
||||
|
|
@ -147,7 +147,7 @@ public abstract class LevelRendererMixin {
|
|||
at = @At("HEAD"),
|
||||
cancellable = true
|
||||
)
|
||||
private void combatant$disableVanillaOutline(PoseStack matrices,
|
||||
private void lovisual$disableVanillaOutline(PoseStack matrices,
|
||||
SubmitNodeCollector consumers,
|
||||
LevelRenderState renderState,
|
||||
CallbackInfo ci) {
|
||||
|
|
@ -165,7 +165,7 @@ public abstract class LevelRendererMixin {
|
|||
shift = At.Shift.AFTER
|
||||
)
|
||||
)
|
||||
private void combatant$captureWorldSceneDepth(
|
||||
private void lovisual$captureWorldSceneDepth(
|
||||
GraphicsResourceAllocator allocator,
|
||||
DeltaTracker tickCounter,
|
||||
boolean renderBlockOutline,
|
||||
|
|
@ -183,7 +183,7 @@ public abstract class LevelRendererMixin {
|
|||
if (frameGraphBuilder == null || targets == null || targets.main == null) {
|
||||
return;
|
||||
}
|
||||
if (!combatant$needsWorldSceneDepthCapture()) {
|
||||
if (!lovisual$needsWorldSceneDepthCapture()) {
|
||||
WorldSceneDepth.reset();
|
||||
return;
|
||||
}
|
||||
|
|
@ -194,15 +194,15 @@ public abstract class LevelRendererMixin {
|
|||
ResourceHandle<RenderTarget> particles = targets.particles;
|
||||
ResourceHandle<RenderTarget> weather = targets.weather;
|
||||
|
||||
FramePass pass = frameGraphBuilder.addPass("combatant_scene_depth_capture");
|
||||
combatant$dependsOn(pass, main);
|
||||
combatant$dependsOn(pass, translucent);
|
||||
combatant$dependsOn(pass, itemEntity);
|
||||
combatant$dependsOn(pass, particles);
|
||||
combatant$dependsOn(pass, weather);
|
||||
FramePass pass = frameGraphBuilder.addPass("lovisual_scene_depth_capture");
|
||||
lovisual$dependsOn(pass, main);
|
||||
lovisual$dependsOn(pass, translucent);
|
||||
lovisual$dependsOn(pass, itemEntity);
|
||||
lovisual$dependsOn(pass, particles);
|
||||
lovisual$dependsOn(pass, weather);
|
||||
pass.disableCulling();
|
||||
pass.executes(() -> {
|
||||
RenderTarget mainFramebuffer = combatant$getFramebuffer(main);
|
||||
RenderTarget mainFramebuffer = lovisual$getFramebuffer(main);
|
||||
Minecraft client = Minecraft.getInstance();
|
||||
RenderTarget fallbackFramebuffer = client != null ? client.gameRenderer.mainRenderTarget() : null;
|
||||
int width = mainFramebuffer != null ? mainFramebuffer.width : fallbackFramebuffer != null ? fallbackFramebuffer.width : 1;
|
||||
|
|
@ -210,20 +210,20 @@ public abstract class LevelRendererMixin {
|
|||
|
||||
WorldSceneDepth.beginFrame(width, height);
|
||||
WorldSceneDepth.captureMain(mainFramebuffer);
|
||||
WorldSceneDepth.captureTranslucent(combatant$getFramebuffer(translucent));
|
||||
WorldSceneDepth.captureItemEntity(combatant$getFramebuffer(itemEntity));
|
||||
WorldSceneDepth.captureParticles(combatant$getFramebuffer(particles));
|
||||
WorldSceneDepth.captureWeather(combatant$getFramebuffer(weather));
|
||||
WorldSceneDepth.captureTranslucent(lovisual$getFramebuffer(translucent));
|
||||
WorldSceneDepth.captureItemEntity(lovisual$getFramebuffer(itemEntity));
|
||||
WorldSceneDepth.captureParticles(lovisual$getFramebuffer(particles));
|
||||
WorldSceneDepth.captureWeather(lovisual$getFramebuffer(weather));
|
||||
});
|
||||
}
|
||||
|
||||
@Inject(method = "addSkyPass", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$renderSky(FrameGraphBuilder frameGraphBuilder, net.minecraft.client.renderer.state.level.CameraRenderState cameraRenderState, GpuBufferSlice fog, CallbackInfo ci) {
|
||||
private void lovisual$renderSky(FrameGraphBuilder frameGraphBuilder, net.minecraft.client.renderer.state.level.CameraRenderState cameraRenderState, GpuBufferSlice fog, CallbackInfo ci) {
|
||||
if (IrisRuntime.isModLoaded()) return;
|
||||
if (shouldSkipSky(cameraRenderState)) return;
|
||||
|
||||
LevelRendererAccessor accessor = (LevelRendererAccessor) this;
|
||||
SkyRenderState sky = accessor.combatant$getWorldRenderState().skyRenderState;
|
||||
SkyRenderState sky = accessor.lovisual$getWorldRenderState().skyRenderState;
|
||||
if (sky == null || sky.skybox != DimensionType.Skybox.OVERWORLD) return;
|
||||
|
||||
WorldTweaks worldTweaks = Modules.get(WorldTweaks.class);
|
||||
|
|
@ -240,9 +240,9 @@ public abstract class LevelRendererMixin {
|
|||
: null;
|
||||
if (camera == null) return;
|
||||
|
||||
FramePass pass = frameGraphBuilder.addPass("combatant_sky");
|
||||
FramePass pass = frameGraphBuilder.addPass("lovisual_sky");
|
||||
targets.main = pass.readsAndWrites(targets.main);
|
||||
pass.executes(() -> CustomSkyboxRenderer.render(camera, fog, sky, accessor.combatant$getSkyRendering()));
|
||||
pass.executes(() -> CustomSkyboxRenderer.render(camera, fog, sky, accessor.lovisual$getSkyRendering()));
|
||||
ci.cancel();
|
||||
}
|
||||
|
||||
|
|
@ -256,7 +256,7 @@ public abstract class LevelRendererMixin {
|
|||
),
|
||||
remap = false
|
||||
)
|
||||
private void combatant$capturePreWaterScene(
|
||||
private void lovisual$capturePreWaterScene(
|
||||
GpuBufferSlice fogBuffer,
|
||||
LevelRenderState worldRenderState,
|
||||
net.minecraft.util.profiling.ProfilerFiller profiler,
|
||||
|
|
@ -272,7 +272,7 @@ public abstract class LevelRendererMixin {
|
|||
if (IrisRuntime.isShaderpackRendererActive()) {
|
||||
return;
|
||||
}
|
||||
RenderTarget mainFramebuffer = combatant$getFramebuffer(combatant$asRenderTargetHandle(mainFramebufferHandle));
|
||||
RenderTarget mainFramebuffer = lovisual$getFramebuffer(lovisual$asRenderTargetHandle(mainFramebufferHandle));
|
||||
if (mainFramebuffer == null) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
mainFramebuffer = mc != null && mc.gameRenderer != null ? mc.gameRenderer.mainRenderTarget() : null;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -23,12 +23,12 @@ import dev.loki.lovisual.util.wav.CustomSoundEngine;
|
|||
@Mixin(Library.class)
|
||||
public class LibraryMixin {
|
||||
@Inject(method = "init", at = @At("RETURN"))
|
||||
private void combatant$resetOnInit(@Nullable String deviceSpecifier, DeviceList deviceList, boolean directionalAudio, CallbackInfo ci) {
|
||||
private void lovisual$resetOnInit(@Nullable String deviceSpecifier, DeviceList deviceList, boolean directionalAudio, CallbackInfo ci) {
|
||||
CustomSoundEngine.get().reset();
|
||||
}
|
||||
|
||||
@Inject(method = "cleanup", at = @At("HEAD"))
|
||||
private void combatant$resetOnClose(CallbackInfo ci) {
|
||||
private void lovisual$resetOnClose(CallbackInfo ci) {
|
||||
CustomSoundEngine.get().reset();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -27,7 +27,7 @@ public abstract class LightmapMixin {
|
|||
),
|
||||
index = 0
|
||||
)
|
||||
private float combatant$ambientLightEvent(float original) {
|
||||
private float lovisual$ambientLightEvent(float original) {
|
||||
LightmapEvent event = new LightmapEvent(original);
|
||||
Events.BUS.post(event);
|
||||
float value = event.getAmbientLight();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -20,7 +20,7 @@ import dev.loki.lovisual.render.engine.light.LightmapState;
|
|||
@Mixin(LightmapRenderStateExtractor.class)
|
||||
public abstract class LightmapRenderStateExtractorMixin {
|
||||
@Inject(method = "extract", at = @At("TAIL"))
|
||||
private void combatant$modifyLightmapState(LightmapRenderState state, float tickDelta, CallbackInfo ci) {
|
||||
private void lovisual$modifyLightmapState(LightmapRenderState state, float tickDelta, CallbackInfo ci) {
|
||||
if (state == null) return;
|
||||
|
||||
LightmapModifyEvent event = new LightmapModifyEvent(state);
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* Combatant modifications copyright (c) 2026 pivosos2007.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* LoVisual modifications copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Portions of this file are based on LiquidBounce
|
||||
* (https://github.com/CCBlueX/LiquidBounce).
|
||||
* Copyright (c) 2015-2026 CCBlueX.
|
||||
*
|
||||
* LiquidBounce portions are licensed under GPLv3-or-later.
|
||||
* Combatant modifications are licensed under GPLv3.
|
||||
* LoVisual modifications are licensed under GPLv3.
|
||||
* See THIRD_PARTY_NOTICES.md for details.
|
||||
*/
|
||||
|
||||
|
|
@ -55,9 +55,6 @@ import dev.loki.lovisual.events.impl.PlayerJumpEvent;
|
|||
import dev.loki.lovisual.features.module.Modules;
|
||||
import dev.loki.lovisual.features.module.modules.combat.PvpCooldowns;
|
||||
import dev.loki.lovisual.features.module.modules.combat.TPSSync;
|
||||
import dev.loki.lovisual.features.module.modules.movement.ElytraFly;
|
||||
import dev.loki.lovisual.features.module.modules.movement.NoStun;
|
||||
import dev.loki.lovisual.features.module.modules.movement.Timer;
|
||||
import dev.loki.lovisual.features.module.modules.visuals.NoRender;
|
||||
import dev.loki.lovisual.features.module.modules.visuals.WorldTweaks;
|
||||
import dev.loki.lovisual.util.aiming.RotationManager;
|
||||
|
|
@ -71,28 +68,28 @@ import dev.loki.lovisual.util.pvp.opponents.TotemPopCounter;
|
|||
public abstract class LivingEntityMixin {
|
||||
|
||||
@Unique
|
||||
private float combatant$itemUseRemainder = 0f;
|
||||
private float lovisual$itemUseRemainder = 0f;
|
||||
|
||||
@Unique
|
||||
private float combatant$effectTickRemainder = 0f;
|
||||
private float lovisual$effectTickRemainder = 0f;
|
||||
|
||||
@Shadow
|
||||
protected int useItemRemaining;
|
||||
@Unique
|
||||
private PlayerJumpEvent combatant$playerJumpEvent;
|
||||
private PlayerJumpEvent lovisual$playerJumpEvent;
|
||||
|
||||
@Shadow
|
||||
protected abstract float getJumpPower();
|
||||
|
||||
@Inject(method = "getAttributeValue", at = @At("RETURN"))
|
||||
private void combatant$noStunSlownessMovementSpeed(Holder<Attribute> attribute, CallbackInfoReturnable<Double> cir) {
|
||||
private void lovisual$noStunSlownessMovementSpeed(Holder<Attribute> attribute, CallbackInfoReturnable<Double> cir) {
|
||||
if (!attribute.equals(Attributes.MOVEMENT_SPEED)) return;
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
@ModifyReturnValue(method = "getMainHandItem", at = @At("RETURN"))
|
||||
private ItemStack combatant$applyInventorySwapLeaseForMainHand(ItemStack original) {
|
||||
private ItemStack lovisual$applyInventorySwapLeaseForMainHand(ItemStack original) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if ((Object) this == mc.player) {
|
||||
InventorySwap.INSTANCE.isHotbarLeased();
|
||||
|
|
@ -107,7 +104,7 @@ public abstract class LivingEntityMixin {
|
|||
* This never cancels item use; it only starts a visible local timer when explicitly configured.
|
||||
*/
|
||||
@Inject(method = "updatingUsingItem", at = @At("HEAD"))
|
||||
private void combatant$onFinishEating(CallbackInfo ci) {
|
||||
private void lovisual$onFinishEating(CallbackInfo ci) {
|
||||
LivingEntity self = (LivingEntity) (Object) this;
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (self != mc.player) return;
|
||||
|
|
@ -124,32 +121,32 @@ public abstract class LivingEntityMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "updatingUsingItem", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$fixItemUseSpeed(CallbackInfo ci) {
|
||||
private void lovisual$fixItemUseSpeed(CallbackInfo ci) {
|
||||
LivingEntity self = (LivingEntity) (Object) this;
|
||||
if (!(self instanceof Player player)) {
|
||||
combatant$itemUseRemainder = 0f;
|
||||
lovisual$itemUseRemainder = 0f;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!player.level().isClientSide()) return;
|
||||
if (!player.isUsingItem()) {
|
||||
combatant$itemUseRemainder = 0f;
|
||||
lovisual$itemUseRemainder = 0f;
|
||||
return;
|
||||
}
|
||||
|
||||
float scale = combatant$clientTickScale();
|
||||
float scale = lovisual$clientTickScale();
|
||||
if (scale >= 0.999f) {
|
||||
combatant$itemUseRemainder = 0f;
|
||||
lovisual$itemUseRemainder = 0f;
|
||||
return;
|
||||
}
|
||||
|
||||
combatant$itemUseRemainder += scale;
|
||||
if (combatant$itemUseRemainder < 1.0f) {
|
||||
lovisual$itemUseRemainder += scale;
|
||||
if (lovisual$itemUseRemainder < 1.0f) {
|
||||
ci.cancel();
|
||||
return;
|
||||
}
|
||||
|
||||
combatant$itemUseRemainder -= 1.0f;
|
||||
lovisual$itemUseRemainder -= 1.0f;
|
||||
}
|
||||
|
||||
@Redirect(
|
||||
|
|
@ -159,7 +156,7 @@ public abstract class LivingEntityMixin {
|
|||
target = "Lnet/minecraft/world/effect/MobEffectInstance;tickClient()V"
|
||||
)
|
||||
)
|
||||
private void combatant$scaleClientEffects(MobEffectInstance instance) {
|
||||
private void lovisual$scaleClientEffects(MobEffectInstance instance) {
|
||||
LivingEntity self = (LivingEntity) (Object) this;
|
||||
if (!self.level().isClientSide()) {
|
||||
instance.tickClient();
|
||||
|
|
@ -172,42 +169,39 @@ public abstract class LivingEntityMixin {
|
|||
return;
|
||||
}
|
||||
|
||||
float scale = combatant$clientTickScale();
|
||||
float scale = lovisual$clientTickScale();
|
||||
if (scale >= 0.999f) {
|
||||
combatant$effectTickRemainder = 0f;
|
||||
lovisual$effectTickRemainder = 0f;
|
||||
instance.tickClient();
|
||||
return;
|
||||
}
|
||||
|
||||
combatant$effectTickRemainder += scale;
|
||||
if (combatant$effectTickRemainder < 1.0f) {
|
||||
lovisual$effectTickRemainder += scale;
|
||||
if (lovisual$effectTickRemainder < 1.0f) {
|
||||
return;
|
||||
}
|
||||
combatant$effectTickRemainder -= 1.0f;
|
||||
lovisual$effectTickRemainder -= 1.0f;
|
||||
instance.tickClient();
|
||||
}
|
||||
|
||||
@Unique
|
||||
private float combatant$clientTickScale() {
|
||||
float mult = Timer.getTickTimer();
|
||||
if (mult <= 0.0001f) return 1.0f;
|
||||
|
||||
private float lovisual$clientTickScale() {
|
||||
// Timer module removed; scale only by server TPS when active.
|
||||
float serverDelta = 1.0f;
|
||||
TPSSync tps = Modules.get(TPSSync.class);
|
||||
if (tps != null && tps.isEnabled()) {
|
||||
serverDelta = tps.getServerTickDelta();
|
||||
}
|
||||
|
||||
float scale = serverDelta / mult;
|
||||
if (scale > 1.0f) return 1.0f;
|
||||
return Math.max(scale, 0.0f);
|
||||
if (serverDelta > 1.0f) return 1.0f;
|
||||
return Math.max(serverDelta, 0.0f);
|
||||
}
|
||||
|
||||
/**
|
||||
* Local totem cooldowns are handled from the confirmed entity-status packet when explicitly configured.
|
||||
*/
|
||||
@Inject(method = "checkTotemDeathProtection", at = @At("RETURN"))
|
||||
private void combatant$onTotemUse(DamageSource source, CallbackInfoReturnable<Boolean> cir) {
|
||||
private void lovisual$onTotemUse(DamageSource source, CallbackInfoReturnable<Boolean> cir) {
|
||||
// no local use blocking or prediction here
|
||||
}
|
||||
|
||||
|
|
@ -215,7 +209,7 @@ public abstract class LivingEntityMixin {
|
|||
* Сброс кулдаунов при смерти.
|
||||
*/
|
||||
@Inject(method = "die", at = @At("HEAD"))
|
||||
private void combatant$onDeath(DamageSource source, CallbackInfo ci) {
|
||||
private void lovisual$onDeath(DamageSource source, CallbackInfo ci) {
|
||||
LivingEntity self = (LivingEntity) (Object) this;
|
||||
if (self instanceof Player player) {
|
||||
TotemPopCounter.onPlayerDeath(player.getUUID());
|
||||
|
|
@ -248,22 +242,7 @@ public abstract class LivingEntityMixin {
|
|||
|
||||
@Inject(method = "aiStep", at = @At("HEAD"))
|
||||
private void preventCrash(CallbackInfo ci) {
|
||||
LivingEntity self = (LivingEntity) (Object) this;
|
||||
|
||||
if (!(self instanceof Player p)) return;
|
||||
ElytraFly elytraFly = Modules.get(ElytraFly.class);
|
||||
if (elytraFly == null || !elytraFly.isEnabled()) return;
|
||||
if (!elytraFly.noCrash.get()) return;
|
||||
if (!p.isFallFlying()) return;
|
||||
|
||||
Vec3 vel = p.getDeltaMovement();
|
||||
|
||||
if (vel.horizontalDistance() < 1) return;
|
||||
AABB next = p.getBoundingBox().move(vel);
|
||||
|
||||
if (!p.level().noCollision(next)) {
|
||||
p.setDeltaMovement(0, 0, 0);
|
||||
}
|
||||
// ElytraFly module removed; no crash-prevention override remains.
|
||||
}
|
||||
|
||||
@ModifyExpressionValue(
|
||||
|
|
@ -273,7 +252,7 @@ public abstract class LivingEntityMixin {
|
|||
target = "Lnet/minecraft/world/entity/LivingEntity;getLookAngle()Lnet/minecraft/world/phys/Vec3;"
|
||||
)
|
||||
)
|
||||
private Vec3 combatant$modifyGlidingRotationVector(Vec3 original) {
|
||||
private Vec3 lovisual$modifyGlidingRotationVector(Vec3 original) {
|
||||
LivingEntity self = (LivingEntity) (Object) this;
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (!(self instanceof LocalPlayer player) || mc == null || player != mc.player) {
|
||||
|
|
@ -298,7 +277,7 @@ public abstract class LivingEntityMixin {
|
|||
target = "Lnet/minecraft/world/entity/LivingEntity;getXRot()F"
|
||||
)
|
||||
)
|
||||
private float combatant$modifyGlidingPitch(float original) {
|
||||
private float lovisual$modifyGlidingPitch(float original) {
|
||||
LivingEntity self = (LivingEntity) (Object) this;
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (!(self instanceof LocalPlayer player) || mc == null || player != mc.player) {
|
||||
|
|
@ -337,28 +316,28 @@ public abstract class LivingEntityMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "jumpFromGround", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$onJumpHead(CallbackInfo ci) {
|
||||
private void lovisual$onJumpHead(CallbackInfo ci) {
|
||||
LivingEntity self = (LivingEntity) (Object) this;
|
||||
if (!(self instanceof LocalPlayer player)) {
|
||||
combatant$playerJumpEvent = null;
|
||||
lovisual$playerJumpEvent = null;
|
||||
return;
|
||||
}
|
||||
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc == null || player != mc.player) {
|
||||
combatant$playerJumpEvent = null;
|
||||
lovisual$playerJumpEvent = null;
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerJumpEvent event = new PlayerJumpEvent(self.getYRot(), getJumpPower());
|
||||
Events.BUS.post(event);
|
||||
if (event.isCancelled()) {
|
||||
combatant$playerJumpEvent = null;
|
||||
lovisual$playerJumpEvent = null;
|
||||
ci.cancel();
|
||||
return;
|
||||
}
|
||||
|
||||
combatant$playerJumpEvent = event;
|
||||
lovisual$playerJumpEvent = event;
|
||||
}
|
||||
|
||||
@ModifyExpressionValue(
|
||||
|
|
@ -368,8 +347,8 @@ public abstract class LivingEntityMixin {
|
|||
target = "Lnet/minecraft/world/entity/LivingEntity;getJumpPower()F"
|
||||
)
|
||||
)
|
||||
private float combatant$modifyJumpMotion(float original) {
|
||||
return combatant$playerJumpEvent != null ? combatant$playerJumpEvent.getMotion() : original;
|
||||
private float lovisual$modifyJumpMotion(float original) {
|
||||
return lovisual$playerJumpEvent != null ? lovisual$playerJumpEvent.getMotion() : original;
|
||||
}
|
||||
|
||||
@ModifyExpressionValue(
|
||||
|
|
@ -379,7 +358,7 @@ public abstract class LivingEntityMixin {
|
|||
target = "(DDD)Lnet/minecraft/world/phys/Vec3;"
|
||||
)
|
||||
)
|
||||
private Vec3 combatant$fixJumpRotation(Vec3 original) {
|
||||
private Vec3 lovisual$fixJumpRotation(Vec3 original) {
|
||||
LivingEntity self = (LivingEntity) (Object) this;
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (!(self instanceof LocalPlayer player) || mc == null || player != mc.player) {
|
||||
|
|
@ -403,13 +382,13 @@ public abstract class LivingEntityMixin {
|
|||
target = "Lnet/minecraft/world/entity/LivingEntity;getYRot()F"
|
||||
)
|
||||
)
|
||||
private float combatant$omniSprintJumpYaw(LivingEntity instance) {
|
||||
return combatant$playerJumpEvent != null ? combatant$playerJumpEvent.getYaw() : instance.getYRot();
|
||||
private float lovisual$omniSprintJumpYaw(LivingEntity instance) {
|
||||
return lovisual$playerJumpEvent != null ? lovisual$playerJumpEvent.getYaw() : instance.getYRot();
|
||||
}
|
||||
|
||||
@Inject(method = "jumpFromGround", at = @At("RETURN"))
|
||||
private void combatant$onJumpReturn(CallbackInfo ci) {
|
||||
combatant$playerJumpEvent = null;
|
||||
private void lovisual$onJumpReturn(CallbackInfo ci) {
|
||||
lovisual$playerJumpEvent = null;
|
||||
}
|
||||
|
||||
@Unique
|
||||
|
|
@ -426,38 +405,7 @@ public abstract class LivingEntityMixin {
|
|||
cancellable = true
|
||||
)
|
||||
private void nostun$soulSandVelocity(CallbackInfoReturnable<Float> cir) {
|
||||
LivingEntity self = (LivingEntity) (Object) this;
|
||||
if (!(self instanceof Player player)) return;
|
||||
Minecraft client = Minecraft.getInstance();
|
||||
if (client == null || player != client.player) return;
|
||||
|
||||
NoStun ns = Modules.get(NoStun.class);
|
||||
if (ns == null || !ns.isEnabled()) return;
|
||||
if (ns.isVulcan297()) {
|
||||
BlockPos pos = player.blockPosition();
|
||||
BlockState state = player.level().getBlockState(pos);
|
||||
if (state.is(Blocks.SOUL_SAND)) {
|
||||
cir.setReturnValue(ns.getSoulSandVelocityMultiplier(cir.getReturnValue()));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// общий тумблер env
|
||||
if (!ns.isFunctionEnabled(NoStun.fnEnvBlocks())) return;
|
||||
|
||||
// конкретный тумблер песка душ
|
||||
if (!ns.isEnvBlockEnabled(NoStun.envSoulSand())) return;
|
||||
|
||||
BlockPos pos = player.blockPosition();
|
||||
BlockState state = player.level().getBlockState(pos);
|
||||
|
||||
if (!state.is(Blocks.SOUL_SAND)) return;
|
||||
|
||||
float vanilla = cir.getReturnValue();
|
||||
|
||||
if (vanilla < 1.0F) {
|
||||
cir.setReturnValue(1.0F);
|
||||
}
|
||||
// NoStun module removed; no velocity override remains.
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -15,41 +15,41 @@ import dev.loki.lovisual.render.ViewObstructionFadeState;
|
|||
@Mixin(LivingEntityRenderState.class)
|
||||
public abstract class LivingEntityRenderStateMixin implements ViewObstructionFadeState {
|
||||
@Unique
|
||||
private boolean combatant$viewObstructionFadeActive;
|
||||
private boolean lovisual$viewObstructionFadeActive;
|
||||
|
||||
@Unique
|
||||
private float combatant$viewObstructionFadeAlpha = 1.0f;
|
||||
private float lovisual$viewObstructionFadeAlpha = 1.0f;
|
||||
|
||||
@Unique
|
||||
private boolean combatant$seeInvisibleFadeActive;
|
||||
private boolean lovisual$seeInvisibleFadeActive;
|
||||
|
||||
@Override
|
||||
public boolean combatant$isViewObstructionFadeActive() {
|
||||
return combatant$viewObstructionFadeActive;
|
||||
public boolean lovisual$isViewObstructionFadeActive() {
|
||||
return lovisual$viewObstructionFadeActive;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float combatant$getViewObstructionFadeAlpha() {
|
||||
return combatant$viewObstructionFadeAlpha;
|
||||
public float lovisual$getViewObstructionFadeAlpha() {
|
||||
return lovisual$viewObstructionFadeAlpha;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void combatant$setViewObstructionFadeActive(boolean active) {
|
||||
this.combatant$viewObstructionFadeActive = active;
|
||||
public void lovisual$setViewObstructionFadeActive(boolean active) {
|
||||
this.lovisual$viewObstructionFadeActive = active;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void combatant$setViewObstructionFadeAlpha(float alpha) {
|
||||
this.combatant$viewObstructionFadeAlpha = alpha;
|
||||
public void lovisual$setViewObstructionFadeAlpha(float alpha) {
|
||||
this.lovisual$viewObstructionFadeAlpha = alpha;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean combatant$isSeeInvisibleFadeActive() {
|
||||
return combatant$seeInvisibleFadeActive;
|
||||
public boolean lovisual$isSeeInvisibleFadeActive() {
|
||||
return lovisual$seeInvisibleFadeActive;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void combatant$setSeeInvisibleFadeActive(boolean active) {
|
||||
this.combatant$seeInvisibleFadeActive = active;
|
||||
public void lovisual$setSeeInvisibleFadeActive(boolean active) {
|
||||
this.lovisual$seeInvisibleFadeActive = active;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -55,7 +55,7 @@ public abstract class LivingEntityRendererMixin<T extends LivingEntity, S extend
|
|||
at = @At("HEAD"),
|
||||
cancellable = true
|
||||
)
|
||||
private void combatant$hideVanillaLabels(T entity, double distanceSq, CallbackInfoReturnable<Boolean> cir) {
|
||||
private void lovisual$hideVanillaLabels(T entity, double distanceSq, CallbackInfoReturnable<Boolean> cir) {
|
||||
if (entity instanceof Player && Modules.get(NameTags.class) != null && Modules.get(NameTags.class).isEnabled()) {
|
||||
cir.setReturnValue(false);
|
||||
}
|
||||
|
|
@ -65,7 +65,7 @@ public abstract class LivingEntityRendererMixin<T extends LivingEntity, S extend
|
|||
method = "extractRenderState(Lnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/client/renderer/entity/state/LivingEntityRenderState;F)V",
|
||||
at = @At("TAIL")
|
||||
)
|
||||
private void combatant$updateViewObstructionFadeState(T entity, S state, float tickProgress, CallbackInfo ci) {
|
||||
private void lovisual$updateViewObstructionFadeState(T entity, S state, float tickProgress, CallbackInfo ci) {
|
||||
if (!(state instanceof ViewObstructionFadeState fadeState)) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -88,16 +88,16 @@ public abstract class LivingEntityRendererMixin<T extends LivingEntity, S extend
|
|||
if (seeInvisibleFadeActive) {
|
||||
alpha = Math.min(alpha, seeInvisibleAlpha);
|
||||
}
|
||||
fadeState.combatant$setViewObstructionFadeActive(active);
|
||||
fadeState.combatant$setViewObstructionFadeAlpha(active ? alpha : 1.0f);
|
||||
fadeState.combatant$setSeeInvisibleFadeActive(seeInvisibleFadeActive);
|
||||
fadeState.lovisual$setViewObstructionFadeActive(active);
|
||||
fadeState.lovisual$setViewObstructionFadeAlpha(active ? alpha : 1.0f);
|
||||
fadeState.lovisual$setSeeInvisibleFadeActive(seeInvisibleFadeActive);
|
||||
}
|
||||
|
||||
@ModifyExpressionValue(
|
||||
method = "extractRenderState(Lnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/client/renderer/entity/state/LivingEntityRenderState;F)V",
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Mth;rotLerp(FFF)F")
|
||||
)
|
||||
private float combatant$renderRotationYaw(float original, @Local(argsOnly = true) T entity, @Local(argsOnly = true) float tickProgress) {
|
||||
private float lovisual$renderRotationYaw(float original, @Local(argsOnly = true) T entity, @Local(argsOnly = true) float tickProgress) {
|
||||
if (!(entity instanceof LocalPlayer player)) {
|
||||
return original;
|
||||
}
|
||||
|
|
@ -125,7 +125,7 @@ public abstract class LivingEntityRendererMixin<T extends LivingEntity, S extend
|
|||
method = "extractRenderState(Lnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/client/renderer/entity/state/LivingEntityRenderState;F)V",
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/LivingEntity;getXRot(F)F")
|
||||
)
|
||||
private float combatant$renderRotationPitch(float original, @Local(argsOnly = true) T entity, @Local(argsOnly = true) float tickProgress) {
|
||||
private float lovisual$renderRotationPitch(float original, @Local(argsOnly = true) T entity, @Local(argsOnly = true) float tickProgress) {
|
||||
if (!(entity instanceof LocalPlayer player)) {
|
||||
return original;
|
||||
}
|
||||
|
|
@ -154,7 +154,7 @@ public abstract class LivingEntityRendererMixin<T extends LivingEntity, S extend
|
|||
method = "submit",
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/LivingEntityRenderer;getRenderType(Lnet/minecraft/client/renderer/entity/state/LivingEntityRenderState;ZZZ)Lnet/minecraft/client/renderer/rendertype/RenderType;")
|
||||
)
|
||||
private RenderType combatant$useTranslucentRenderTypeForViewFade(RenderType original, @Local(argsOnly = true) S state) {
|
||||
private RenderType lovisual$useTranslucentRenderTypeForViewFade(RenderType original, @Local(argsOnly = true) S state) {
|
||||
if (original == null || original.hasBlending()) {
|
||||
return original;
|
||||
}
|
||||
|
|
@ -162,8 +162,8 @@ public abstract class LivingEntityRendererMixin<T extends LivingEntity, S extend
|
|||
return original;
|
||||
}
|
||||
if (!(state instanceof ViewObstructionFadeState fadeState)
|
||||
|| !fadeState.combatant$isViewObstructionFadeActive()
|
||||
|| fadeState.combatant$getViewObstructionFadeAlpha() >= 0.99f) {
|
||||
|| !fadeState.lovisual$isViewObstructionFadeActive()
|
||||
|| fadeState.lovisual$getViewObstructionFadeAlpha() >= 0.99f) {
|
||||
return original;
|
||||
}
|
||||
return RenderTypes.entityTranslucent(getTextureLocation(state), true);
|
||||
|
|
@ -173,11 +173,11 @@ public abstract class LivingEntityRendererMixin<T extends LivingEntity, S extend
|
|||
method = "submit",
|
||||
constant = @Constant(intValue = 654311423)
|
||||
)
|
||||
private int combatant$seeInvisibles$overrideInvisiblePlayerAlpha(int vanillaTint, S state) {
|
||||
private int lovisual$seeInvisibles$overrideInvisiblePlayerAlpha(int vanillaTint, S state) {
|
||||
SeeInvisibles seeInvisibles = Modules.get(SeeInvisibles.class);
|
||||
if (seeInvisibles != null
|
||||
&& state instanceof ViewObstructionFadeState fadeState
|
||||
&& fadeState.combatant$isSeeInvisibleFadeActive()
|
||||
&& fadeState.lovisual$isSeeInvisibleFadeActive()
|
||||
&& seeInvisibles.shouldRenderInvisiblePlayer(state.entityType, state.isInvisible)) {
|
||||
return seeInvisibles.getInvisiblePlayerTintArgb();
|
||||
}
|
||||
|
|
@ -185,12 +185,12 @@ public abstract class LivingEntityRendererMixin<T extends LivingEntity, S extend
|
|||
}
|
||||
|
||||
@Inject(method = "submit", at = @At("HEAD"))
|
||||
private void combatant$pushViewObstructionFadeContext(S state, com.mojang.blaze3d.vertex.PoseStack matrixStack, net.minecraft.client.renderer.SubmitNodeCollector orderedRenderCommandQueue, net.minecraft.client.renderer.state.level.CameraRenderState cameraRenderState, CallbackInfo ci) {
|
||||
private void lovisual$pushViewObstructionFadeContext(S state, com.mojang.blaze3d.vertex.PoseStack matrixStack, net.minecraft.client.renderer.SubmitNodeCollector orderedRenderCommandQueue, net.minecraft.client.renderer.state.level.CameraRenderState cameraRenderState, CallbackInfo ci) {
|
||||
ViewObstructionFadeContext.push(state instanceof ViewObstructionFadeState fadeState ? fadeState : null);
|
||||
}
|
||||
|
||||
@Inject(method = "submit", at = @At("RETURN"))
|
||||
private void combatant$popViewObstructionFadeContext(S state, com.mojang.blaze3d.vertex.PoseStack matrixStack, net.minecraft.client.renderer.SubmitNodeCollector orderedRenderCommandQueue, net.minecraft.client.renderer.state.level.CameraRenderState cameraRenderState, CallbackInfo ci) {
|
||||
private void lovisual$popViewObstructionFadeContext(S state, com.mojang.blaze3d.vertex.PoseStack matrixStack, net.minecraft.client.renderer.SubmitNodeCollector orderedRenderCommandQueue, net.minecraft.client.renderer.state.level.CameraRenderState cameraRenderState, CallbackInfo ci) {
|
||||
ViewObstructionFadeContext.pop();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* Combatant modifications copyright (c) 2026 pivosos2007.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* LoVisual modifications copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Portions of this file are based on LiquidBounce
|
||||
* (https://github.com/CCBlueX/LiquidBounce).
|
||||
* Copyright (c) 2015-2026 CCBlueX.
|
||||
*
|
||||
* LiquidBounce portions are licensed under GPLv3-or-later.
|
||||
* Combatant modifications are licensed under GPLv3.
|
||||
* LoVisual modifications are licensed under GPLv3.
|
||||
* See THIRD_PARTY_NOTICES.md for details.
|
||||
*/
|
||||
|
||||
|
|
@ -21,7 +21,6 @@ package dev.loki.lovisual.mixins;
|
|||
|
||||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||
import dev.loki.lovisual.events.impl.*;
|
||||
import dev.loki.lovisual.features.module.modules.movement.*;
|
||||
import dev.loki.lovisual.util.combat.SprintController;
|
||||
import dev.loki.lovisual.util.screen.ClientScreen;
|
||||
import net.minecraft.client.player.ClientInput;
|
||||
|
|
@ -48,14 +47,11 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|||
import dev.loki.lovisual.events.Events;
|
||||
import dev.loki.lovisual.events.impl.*;
|
||||
import dev.loki.lovisual.features.module.Modules;
|
||||
import dev.loki.lovisual.features.module.modules.movement.*;
|
||||
import dev.loki.lovisual.features.module.modules.player.XCarry;
|
||||
import dev.loki.lovisual.features.module.modules.visuals.Freecam;
|
||||
import dev.loki.lovisual.mixininterface.ILocalPlayer;
|
||||
import dev.loki.lovisual.mixins.accessors.EntityAccessor;
|
||||
import dev.loki.lovisual.mixins.accessors.InputAccessor;
|
||||
import dev.loki.lovisual.mixins.accessors.LocalPlayerAccessor;
|
||||
import dev.loki.lovisual.runtime.RuntimeGate;
|
||||
import dev.loki.lovisual.util.aiming.RotationManager;
|
||||
import dev.loki.lovisual.util.aiming.data.Rotation;
|
||||
|
||||
|
|
@ -68,17 +64,17 @@ public abstract class LocalPlayerMixin implements ILocalPlayer {
|
|||
@Shadow
|
||||
public ClientInput input;
|
||||
@Unique
|
||||
private float combatant$lastYaw;
|
||||
private float lovisual$lastYaw;
|
||||
@Unique
|
||||
private float combatant$lastPitch;
|
||||
private float lovisual$lastPitch;
|
||||
@Unique
|
||||
private double combatant$rotationPrevX;
|
||||
private double lovisual$rotationPrevX;
|
||||
@Unique
|
||||
private double combatant$rotationPrevZ;
|
||||
private double lovisual$rotationPrevZ;
|
||||
@Unique
|
||||
private float combatant$rotationPrevBodyYaw;
|
||||
private float lovisual$rotationPrevBodyYaw;
|
||||
@Unique
|
||||
private boolean combatant$rotationBodyYawInitialized;
|
||||
private boolean lovisual$rotationBodyYawInitialized;
|
||||
@Unique
|
||||
private float freecam$lastHealth = Float.NaN;
|
||||
@Unique
|
||||
|
|
@ -92,11 +88,11 @@ public abstract class LocalPlayerMixin implements ILocalPlayer {
|
|||
@Unique
|
||||
private float savedHeadYaw;
|
||||
@Unique
|
||||
private Runnable combatant$eventPostAction;
|
||||
private Runnable lovisual$eventPostAction;
|
||||
@Unique
|
||||
private EventSync combatant$activeSyncEvent;
|
||||
private EventSync lovisual$activeSyncEvent;
|
||||
@Unique
|
||||
private boolean combatant$postUpdateLock = false;
|
||||
private boolean lovisual$postUpdateLock = false;
|
||||
@Unique
|
||||
private Input lastInput;
|
||||
@Unique
|
||||
|
|
@ -109,7 +105,7 @@ public abstract class LocalPlayerMixin implements ILocalPlayer {
|
|||
private boolean wasGround = true;
|
||||
|
||||
@Unique
|
||||
private static boolean combatant$sameInput(Input a, Input b) {
|
||||
private static boolean lovisual$sameInput(Input a, Input b) {
|
||||
if (a == b) return true;
|
||||
if (a == null || b == null) return false;
|
||||
|
||||
|
|
@ -123,7 +119,7 @@ public abstract class LocalPlayerMixin implements ILocalPlayer {
|
|||
}
|
||||
|
||||
@Unique
|
||||
private static float combatant$impulse(boolean positive, boolean negative) {
|
||||
private static float lovisual$impulse(boolean positive, boolean negative) {
|
||||
if (positive == negative) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
|
@ -131,7 +127,7 @@ public abstract class LocalPlayerMixin implements ILocalPlayer {
|
|||
}
|
||||
|
||||
@Unique
|
||||
private static float combatant$simulateBodyYaw(
|
||||
private static float lovisual$simulateBodyYaw(
|
||||
float yaw,
|
||||
float prevBodyYaw,
|
||||
double prevX,
|
||||
|
|
@ -168,54 +164,54 @@ public abstract class LocalPlayerMixin implements ILocalPlayer {
|
|||
}
|
||||
|
||||
@Inject(method = "tick", at = @At("HEAD"))
|
||||
private void combatant$cacheLastRotations(CallbackInfo ci) {
|
||||
private void lovisual$cacheLastRotations(CallbackInfo ci) {
|
||||
LocalPlayer self = (LocalPlayer) (Object) this;
|
||||
combatant$lastYaw = self.getYRot();
|
||||
combatant$lastPitch = self.getXRot();
|
||||
lovisual$lastYaw = self.getYRot();
|
||||
lovisual$lastPitch = self.getXRot();
|
||||
RotationManager.INSTANCE.runTickLifecycle();
|
||||
if (!combatant$rotationBodyYawInitialized) {
|
||||
combatant$rotationPrevX = self.getX();
|
||||
combatant$rotationPrevZ = self.getZ();
|
||||
combatant$rotationPrevBodyYaw = self.getVisualRotationYInDegrees();
|
||||
combatant$rotationBodyYawInitialized = true;
|
||||
if (!lovisual$rotationBodyYawInitialized) {
|
||||
lovisual$rotationPrevX = self.getX();
|
||||
lovisual$rotationPrevZ = self.getZ();
|
||||
lovisual$rotationPrevBodyYaw = self.getVisualRotationYInDegrees();
|
||||
lovisual$rotationBodyYawInitialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "handlePortalTransitionEffect", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$disablePortalNausea(boolean inPortal, CallbackInfo ci) {
|
||||
if (RuntimeGate.isPanic()) return;
|
||||
private void lovisual$disablePortalNausea(boolean inPortal, CallbackInfo ci) {
|
||||
|
||||
LocalPlayer self = (LocalPlayer) (Object) this;
|
||||
PortalProcessor portalManager = null;
|
||||
if (self instanceof EntityAccessor accessor) {
|
||||
portalManager = accessor.combatant$getPortalManager();
|
||||
portalManager = accessor.lovisual$getPortalManager();
|
||||
}
|
||||
if (portalManager != null && portalManager.isInsidePortalThisTick()) {
|
||||
if (self instanceof LocalPlayerAccessor accessor) {
|
||||
accessor.combatant$setNauseaIntensity(0.0f);
|
||||
accessor.combatant$setLastNauseaIntensity(0.0f);
|
||||
accessor.lovisual$setNauseaIntensity(0.0f);
|
||||
accessor.lovisual$setLastNauseaIntensity(0.0f);
|
||||
}
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float combatant$getLastYaw() {
|
||||
return combatant$lastYaw;
|
||||
public float lovisual$getLastYaw() {
|
||||
return lovisual$lastYaw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float combatant$getLastPitch() {
|
||||
return combatant$lastPitch;
|
||||
public float lovisual$getLastPitch() {
|
||||
return lovisual$lastPitch;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void combatant$setLastYaw(float yaw) {
|
||||
this.combatant$lastYaw = yaw;
|
||||
public void lovisual$setLastYaw(float yaw) {
|
||||
this.lovisual$lastYaw = yaw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void combatant$setLastPitch(float pitch) {
|
||||
this.combatant$lastPitch = pitch;
|
||||
public void lovisual$setLastPitch(float pitch) {
|
||||
this.lovisual$lastPitch = pitch;
|
||||
}
|
||||
|
||||
@ModifyExpressionValue(
|
||||
|
|
@ -225,8 +221,8 @@ public abstract class LocalPlayerMixin implements ILocalPlayer {
|
|||
target = "Lnet/minecraft/client/player/LocalPlayer;canStartSprinting()Z"
|
||||
)
|
||||
)
|
||||
private boolean combatant$sprintMovementStart(boolean original) {
|
||||
return combatant$postSprintControl(original, SprintControlEvent.Source.MOVEMENT_TICK);
|
||||
private boolean lovisual$sprintMovementStart(boolean original) {
|
||||
return lovisual$postSprintControl(original, SprintControlEvent.Source.MOVEMENT_TICK);
|
||||
}
|
||||
|
||||
@ModifyExpressionValue(
|
||||
|
|
@ -236,8 +232,8 @@ public abstract class LocalPlayerMixin implements ILocalPlayer {
|
|||
target = "Lnet/minecraft/world/entity/player/Input;sprint()Z"
|
||||
)
|
||||
)
|
||||
private boolean combatant$sprintMovementInput(boolean original) {
|
||||
return combatant$postSprintControl(original, SprintControlEvent.Source.MOVEMENT_TICK);
|
||||
private boolean lovisual$sprintMovementInput(boolean original) {
|
||||
return lovisual$postSprintControl(original, SprintControlEvent.Source.MOVEMENT_TICK);
|
||||
}
|
||||
|
||||
@ModifyExpressionValue(
|
||||
|
|
@ -247,7 +243,7 @@ public abstract class LocalPlayerMixin implements ILocalPlayer {
|
|||
target = "Lnet/minecraft/client/player/LocalPlayer;isSprinting()Z"
|
||||
)
|
||||
)
|
||||
private boolean combatant$sprintNetwork(boolean original) {
|
||||
private boolean lovisual$sprintNetwork(boolean original) {
|
||||
if (SprintController.INSTANCE.isSprintBlocked()) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -256,7 +252,7 @@ public abstract class LocalPlayerMixin implements ILocalPlayer {
|
|||
}
|
||||
|
||||
@Unique
|
||||
private boolean combatant$postSprintControl(boolean original, SprintControlEvent.Source source) {
|
||||
private boolean lovisual$postSprintControl(boolean original, SprintControlEvent.Source source) {
|
||||
LocalPlayer self = (LocalPlayer) (Object) this;
|
||||
|
||||
if (self.input == null) {
|
||||
|
|
@ -280,42 +276,12 @@ public abstract class LocalPlayerMixin implements ILocalPlayer {
|
|||
|
||||
@Inject(method = "modifyInput", at = @At("RETURN"), cancellable = true)
|
||||
private void boostWhenUsing(Vec2 input, CallbackInfoReturnable<Vec2> cir) {
|
||||
NoStun ns = Modules.get(NoStun.class);
|
||||
if (ns == null || !ns.isEnabled()) return;
|
||||
if (!ns.isFunctionEnabled(NoStun.fnUseSpeed())) return;
|
||||
|
||||
LocalPlayer player = (LocalPlayer) (Object) this;
|
||||
if (player.isUsingItem() && !player.isPassenger()) {
|
||||
Vec2 base = cir.getReturnValue();
|
||||
|
||||
// 0.0 -> vanilla (no change), 1.0 -> normal walking speed.
|
||||
// In vanilla, most item-use slowdowns are ~0.2x, so we approximate by lerping 1..5.
|
||||
float t = ns.getEatSpeed01();
|
||||
float mult = 1.0f + t * 4.0f;
|
||||
|
||||
if (mult > 1.001f) {
|
||||
cir.setReturnValue(base.scale(mult));
|
||||
}
|
||||
}
|
||||
// NoStun module removed; no item-use speed boost remains.
|
||||
}
|
||||
|
||||
@Inject(method = "aiStep", at = @At("HEAD"))
|
||||
private void combatant$elytraFlyVanilla(CallbackInfo ci) {
|
||||
LocalPlayer player = (LocalPlayer) (Object) this;
|
||||
ElytraFly elytraFly = Modules.get(ElytraFly.class);
|
||||
if (elytraFly == null || !elytraFly.shouldApplyVanillaHook(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Vec3 velocity = player.getDeltaMovement();
|
||||
Vec3 look = player.getViewVector(1.0f);
|
||||
float pitch = player.getXRot();
|
||||
|
||||
velocity = velocity.scale(elytraFly.getVanillaDragFactor());
|
||||
velocity = velocity.add(look.scale(elytraFly.getVanillaForwardBoostFactor()));
|
||||
|
||||
double lift = -Math.sin(Math.toRadians(pitch)) * elytraFly.getVanillaPitchLiftFactor();
|
||||
player.setDeltaMovement(velocity.add(0.0, lift, 0.0));
|
||||
private void lovisual$elytraFlyVanilla(CallbackInfo ci) {
|
||||
// ElytraFly module removed; no vanilla elytra override remains.
|
||||
}
|
||||
|
||||
@Shadow
|
||||
|
|
@ -362,7 +328,7 @@ public abstract class LocalPlayerMixin implements ILocalPlayer {
|
|||
shift = At.Shift.AFTER
|
||||
)
|
||||
)
|
||||
private void combatant$afterInputTickSprint(CallbackInfo ci) {
|
||||
private void lovisual$afterInputTickSprint(CallbackInfo ci) {
|
||||
if (this.input == null) return;
|
||||
|
||||
Input original = this.input.keyPresses;
|
||||
|
|
@ -375,19 +341,19 @@ public abstract class LocalPlayerMixin implements ILocalPlayer {
|
|||
Events.BUS.post(event);
|
||||
|
||||
Input eventInput = event.toPlayerInput();
|
||||
if (!combatant$sameInput(input, eventInput)) {
|
||||
if (!lovisual$sameInput(input, eventInput)) {
|
||||
input = eventInput;
|
||||
}
|
||||
}
|
||||
|
||||
Input transformedInput = combatant$transformDirection(input);
|
||||
if (!combatant$sameInput(input, transformedInput)) {
|
||||
Input transformedInput = lovisual$transformDirection(input);
|
||||
if (!lovisual$sameInput(input, transformedInput)) {
|
||||
input = transformedInput;
|
||||
}
|
||||
|
||||
if (Events.BUS.hasListeners(SprintControlEvent.class)) {
|
||||
float forward = combatant$impulse(input.forward(), input.backward());
|
||||
float sideways = combatant$impulse(input.left(), input.right());
|
||||
float forward = lovisual$impulse(input.forward(), input.backward());
|
||||
float sideways = lovisual$impulse(input.left(), input.right());
|
||||
|
||||
SprintControlEvent event = new SprintControlEvent(
|
||||
forward,
|
||||
|
|
@ -410,13 +376,13 @@ public abstract class LocalPlayerMixin implements ILocalPlayer {
|
|||
}
|
||||
}
|
||||
|
||||
if (!combatant$sameInput(original, input)) {
|
||||
combatant$applyPlayerInput(input);
|
||||
if (!lovisual$sameInput(original, input)) {
|
||||
lovisual$applyPlayerInput(input);
|
||||
}
|
||||
}
|
||||
|
||||
@Unique
|
||||
private void combatant$applyPlayerInput(Input input) {
|
||||
private void lovisual$applyPlayerInput(Input input) {
|
||||
if (this.input == null || input == null) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -424,14 +390,14 @@ public abstract class LocalPlayerMixin implements ILocalPlayer {
|
|||
InputAccessor accessor = (InputAccessor) this.input;
|
||||
accessor.setPlayerInput(input);
|
||||
|
||||
float forward = combatant$impulse(input.forward(), input.backward());
|
||||
float sideways = combatant$impulse(input.left(), input.right());
|
||||
float forward = lovisual$impulse(input.forward(), input.backward());
|
||||
float sideways = lovisual$impulse(input.left(), input.right());
|
||||
|
||||
accessor.setMovementVector(new Vec2(sideways, forward).normalized());
|
||||
}
|
||||
|
||||
@Unique
|
||||
private Input combatant$transformDirection(Input input) {
|
||||
private Input lovisual$transformDirection(Input input) {
|
||||
// Free correction now runs at KeyboardInput.tick(), matching the input pipeline.
|
||||
// Keep this post-input hook inert to avoid double-transforming movement input.
|
||||
return input;
|
||||
|
|
@ -490,38 +456,36 @@ public abstract class LocalPlayerMixin implements ILocalPlayer {
|
|||
|
||||
@Unique
|
||||
private boolean shouldFreezeNow() {
|
||||
boolean freezeModule = Modules.enabled(Freeze.class);
|
||||
Freecam freecam = Modules.get(Freecam.class);
|
||||
boolean freecamFreeze = freecam != null && freecam.freezePlayer() && freecam.isCameraInput();
|
||||
return freezeModule || freecamFreeze;
|
||||
return freecam != null && freecam.freezePlayer() && freecam.isCameraInput();
|
||||
}
|
||||
|
||||
@Inject(method = "sendPosition", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$eventSync(CallbackInfo ci) {
|
||||
private void lovisual$eventSync(CallbackInfo ci) {
|
||||
if (!Events.BUS.hasListeners(EventSync.class)) return;
|
||||
combatant$eventPostAction = null;
|
||||
lovisual$eventPostAction = null;
|
||||
LocalPlayer self = (LocalPlayer) (Object) this;
|
||||
EventSync event = new EventSync(self.getYRot(), self.getXRot());
|
||||
Events.BUS.post(event);
|
||||
combatant$activeSyncEvent = event;
|
||||
combatant$eventPostAction = event.getPostAction();
|
||||
lovisual$activeSyncEvent = event;
|
||||
lovisual$eventPostAction = event.getPostAction();
|
||||
if (event.isCancelled()) {
|
||||
combatant$activeSyncEvent = null;
|
||||
combatant$eventPostAction = null;
|
||||
lovisual$activeSyncEvent = null;
|
||||
lovisual$eventPostAction = null;
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "sendPosition", at = @At("RETURN"))
|
||||
private void combatant$eventPostSync(CallbackInfo ci) {
|
||||
private void lovisual$eventPostSync(CallbackInfo ci) {
|
||||
if (Events.BUS.hasListeners(EventPostSync.class)) {
|
||||
Events.BUS.post(new EventPostSync());
|
||||
}
|
||||
if (combatant$eventPostAction != null) {
|
||||
combatant$eventPostAction.run();
|
||||
combatant$eventPostAction = null;
|
||||
if (lovisual$eventPostAction != null) {
|
||||
lovisual$eventPostAction.run();
|
||||
lovisual$eventPostAction = null;
|
||||
}
|
||||
combatant$activeSyncEvent = null;
|
||||
lovisual$activeSyncEvent = null;
|
||||
}
|
||||
|
||||
@ModifyExpressionValue(
|
||||
|
|
@ -531,10 +495,10 @@ public abstract class LocalPlayerMixin implements ILocalPlayer {
|
|||
target = "Lnet/minecraft/client/player/LocalPlayer;getYRot()F"
|
||||
)
|
||||
)
|
||||
private float combatant$eventSyncYaw(float original) {
|
||||
combatant$updateVisualBodyYaw();
|
||||
private float lovisual$eventSyncYaw(float original) {
|
||||
lovisual$updateVisualBodyYaw();
|
||||
|
||||
EventSync event = combatant$activeSyncEvent;
|
||||
EventSync event = lovisual$activeSyncEvent;
|
||||
if (event != null && event.hasRotationOverride()) return event.getYaw();
|
||||
|
||||
Rotation rotation = RotationManager.INSTANCE.getCurrentRotation();
|
||||
|
|
@ -548,8 +512,8 @@ public abstract class LocalPlayerMixin implements ILocalPlayer {
|
|||
target = "Lnet/minecraft/client/player/LocalPlayer;getXRot()F"
|
||||
)
|
||||
)
|
||||
private float combatant$eventSyncPitch(float original) {
|
||||
EventSync event = combatant$activeSyncEvent;
|
||||
private float lovisual$eventSyncPitch(float original) {
|
||||
EventSync event = lovisual$activeSyncEvent;
|
||||
if (event != null && event.hasRotationOverride()) return Mth.clamp(event.getPitch(), -90.0f, 90.0f);
|
||||
|
||||
Rotation rotation = RotationManager.INSTANCE.getCurrentRotation();
|
||||
|
|
@ -563,8 +527,8 @@ public abstract class LocalPlayerMixin implements ILocalPlayer {
|
|||
target = "Lnet/minecraft/client/player/LocalPlayer;getYRot()F"
|
||||
)
|
||||
)
|
||||
private float combatant$visualTickYaw(float original) {
|
||||
combatant$updateVisualBodyYaw();
|
||||
private float lovisual$visualTickYaw(float original) {
|
||||
lovisual$updateVisualBodyYaw();
|
||||
|
||||
Rotation rotation = RotationManager.INSTANCE.getCurrentRotation();
|
||||
return rotation != null ? rotation.yaw() : original;
|
||||
|
|
@ -577,7 +541,7 @@ public abstract class LocalPlayerMixin implements ILocalPlayer {
|
|||
target = "Lnet/minecraft/client/player/LocalPlayer;getXRot()F"
|
||||
)
|
||||
)
|
||||
private float combatant$visualTickPitch(float original) {
|
||||
private float lovisual$visualTickPitch(float original) {
|
||||
Rotation rotation = RotationManager.INSTANCE.getCurrentRotation();
|
||||
return rotation != null ? Mth.clamp(rotation.pitch(), -90.0f, 90.0f) : original;
|
||||
}
|
||||
|
|
@ -592,9 +556,9 @@ public abstract class LocalPlayerMixin implements ILocalPlayer {
|
|||
),
|
||||
cancellable = true
|
||||
)
|
||||
private void combatant$postPlayerUpdate(CallbackInfo ci) {
|
||||
private void lovisual$postPlayerUpdate(CallbackInfo ci) {
|
||||
if (!Events.BUS.hasListeners(PostPlayerUpdateEvent.class)) return;
|
||||
if (combatant$postUpdateLock) return;
|
||||
if (lovisual$postUpdateLock) return;
|
||||
|
||||
PostPlayerUpdateEvent event = new PostPlayerUpdateEvent();
|
||||
Events.BUS.post(event);
|
||||
|
|
@ -608,22 +572,20 @@ public abstract class LocalPlayerMixin implements ILocalPlayer {
|
|||
|
||||
LocalPlayer self = (LocalPlayer) (Object) this;
|
||||
for (int i = 0; i < iterations; i++) {
|
||||
combatant$postUpdateLock = true;
|
||||
lovisual$postUpdateLock = true;
|
||||
self.tick();
|
||||
combatant$postUpdateLock = false;
|
||||
lovisual$postUpdateLock = false;
|
||||
sendPosition();
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "sendPosition", at = @At("HEAD"), cancellable = true)
|
||||
private void cancelPackets(CallbackInfo ci) {
|
||||
if (Modules.enabled(Freeze.class)) {
|
||||
ci.cancel();
|
||||
}
|
||||
// Freeze module removed; only Freecam may still freeze movement.
|
||||
}
|
||||
|
||||
@Inject(method = "aiStep", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$freezeTickMovement(CallbackInfo ci) {
|
||||
private void lovisual$freezeTickMovement(CallbackInfo ci) {
|
||||
LocalPlayer p = (LocalPlayer) (Object) this;
|
||||
|
||||
if (!shouldFreezeNow()) {
|
||||
|
|
@ -659,241 +621,74 @@ public abstract class LocalPlayerMixin implements ILocalPlayer {
|
|||
}
|
||||
|
||||
@Inject(method = "aiStep", at = @At("HEAD"))
|
||||
private void combatant$noStunTickMovement(CallbackInfo ci) {
|
||||
NoStun ns = Modules.get(NoStun.class);
|
||||
if (ns == null || !ns.isEnabled()) return;
|
||||
|
||||
Freecam fc = Modules.get(Freecam.class);
|
||||
if (fc != null && fc.isEnabled() && fc.isCameraInput()) {
|
||||
return;
|
||||
}
|
||||
|
||||
LocalPlayer player = (LocalPlayer) (Object) this;
|
||||
if (ns.isFunctionEnabled(NoStun.fnNoHurtStun())) {
|
||||
if (player.hurtTime == 0) {
|
||||
lastInput = player.input.keyPresses;
|
||||
} else if (lastInput != null) {
|
||||
player.input.keyPresses = lastInput;
|
||||
}
|
||||
}
|
||||
|
||||
private void lovisual$noStunTickMovement(CallbackInfo ci) {
|
||||
// NoStun module removed; no hurt-time input override remains.
|
||||
}
|
||||
|
||||
@Unique
|
||||
private void combatant$updateVisualBodyYaw() {
|
||||
private void lovisual$updateVisualBodyYaw() {
|
||||
LocalPlayer self = (LocalPlayer) (Object) this;
|
||||
Rotation rotation = RotationManager.INSTANCE.getCurrentRotation();
|
||||
if (rotation == null) {
|
||||
combatant$rotationPrevX = self.getX();
|
||||
combatant$rotationPrevZ = self.getZ();
|
||||
combatant$rotationPrevBodyYaw = self.getVisualRotationYInDegrees();
|
||||
lovisual$rotationPrevX = self.getX();
|
||||
lovisual$rotationPrevZ = self.getZ();
|
||||
lovisual$rotationPrevBodyYaw = self.getVisualRotationYInDegrees();
|
||||
return;
|
||||
}
|
||||
|
||||
float newBodyYaw = combatant$simulateBodyYaw(
|
||||
float newBodyYaw = lovisual$simulateBodyYaw(
|
||||
rotation.yaw(),
|
||||
combatant$rotationPrevBodyYaw,
|
||||
combatant$rotationPrevX,
|
||||
combatant$rotationPrevZ,
|
||||
lovisual$rotationPrevBodyYaw,
|
||||
lovisual$rotationPrevX,
|
||||
lovisual$rotationPrevZ,
|
||||
self.getX(),
|
||||
self.getZ(),
|
||||
self.attackAnim
|
||||
);
|
||||
|
||||
self.setYBodyRot(newBodyYaw);
|
||||
combatant$rotationPrevBodyYaw = newBodyYaw;
|
||||
combatant$rotationPrevX = self.getX();
|
||||
combatant$rotationPrevZ = self.getZ();
|
||||
lovisual$rotationPrevBodyYaw = newBodyYaw;
|
||||
lovisual$rotationPrevX = self.getX();
|
||||
lovisual$rotationPrevZ = self.getZ();
|
||||
}
|
||||
|
||||
@Inject(method = "tick", at = @At("HEAD"))
|
||||
private void detectPearlImpact(CallbackInfo ci) {
|
||||
NoPush noPush = Modules.get(NoPush.class);
|
||||
if (noPush == null || !noPush.off("pearl_phase"))
|
||||
return;
|
||||
|
||||
LocalPlayer p = (LocalPlayer) (Object) this;
|
||||
|
||||
List<ThrownEnderpearl> pearls = new ArrayList<>();
|
||||
p.level().getEntities(
|
||||
EntityTypeTest.forClass(ThrownEnderpearl.class),
|
||||
p.getBoundingBox().inflate(1.5),
|
||||
e -> true,
|
||||
pearls
|
||||
);
|
||||
|
||||
// перл соприкасается → сейчас будет телепорт → готовим спуф
|
||||
if (!pearls.isEmpty()) {
|
||||
pendingSpoof = true;
|
||||
}
|
||||
// NoPush module removed; no pearl-phase spoofing remains.
|
||||
}
|
||||
|
||||
@Inject(method = "sendPosition", at = @At("HEAD"))
|
||||
private void sendSpoofAfterPearl(CallbackInfo ci) {
|
||||
NoPush noPush = Modules.get(NoPush.class);
|
||||
if (noPush == null || !noPush.off("pearl_phase"))
|
||||
return;
|
||||
|
||||
if (!pendingSpoof) return;
|
||||
LocalPlayer p = (LocalPlayer) (Object) this;
|
||||
// Avoid spoof when we only bonk a ceiling (causes freezes while looking up).
|
||||
if (p.verticalCollision && !p.horizontalCollision) {
|
||||
pendingSpoof = false;
|
||||
return;
|
||||
}
|
||||
pendingSpoof = false;
|
||||
|
||||
Vec3 pos = p.position();
|
||||
|
||||
p.connection.send(new ServerboundMovePlayerPacket.Pos(
|
||||
pos.x,
|
||||
pos.y + 0.0313, // легитная фаза
|
||||
pos.z,
|
||||
p.onGround(),
|
||||
false // horizontalCollision
|
||||
));
|
||||
// NoPush module removed; no pearl-phase spoofing remains.
|
||||
}
|
||||
|
||||
@Inject(method = "aiStep", at = @At("TAIL"))
|
||||
private void onCollideBoost(CallbackInfo ci) {
|
||||
|
||||
Speed speed = Modules.get(Speed.class);
|
||||
if (speed == null || !speed.enabled("entity_boost"))
|
||||
return;
|
||||
|
||||
LocalPlayer p = (LocalPlayer) (Object) this;
|
||||
|
||||
if (boostTicks > 0) {
|
||||
boostTicks--;
|
||||
|
||||
Vec3 vel = p.getDeltaMovement();
|
||||
double vx = vel.x + boostX;
|
||||
double vz = vel.z + boostZ;
|
||||
|
||||
double max = 0.48;
|
||||
double h = Math.hypot(vx, vz);
|
||||
if (h > max) {
|
||||
double s = max / h;
|
||||
vx *= s;
|
||||
vz *= s;
|
||||
}
|
||||
|
||||
p.setDeltaMovement(vx, vel.y, vz);
|
||||
return;
|
||||
}
|
||||
|
||||
List<Entity> nearby = p.level().getEntities(p, p.getBoundingBox().inflate(0.15), e -> e instanceof LivingEntity);
|
||||
if (nearby.isEmpty()) return;
|
||||
|
||||
Vec3 vel = p.getDeltaMovement();
|
||||
double dirX = vel.x;
|
||||
double dirZ = vel.z;
|
||||
|
||||
if (dirX == 0 && dirZ == 0) return;
|
||||
|
||||
double len = Math.sqrt(dirX * dirX + dirZ * dirZ);
|
||||
if (len < 1e-5) return;
|
||||
|
||||
dirX /= len;
|
||||
dirZ /= len;
|
||||
|
||||
double boost = speed.entityBoostStrength.get();
|
||||
|
||||
boostX = (dirX * boost) / 3.0;
|
||||
boostZ = (dirZ * boost) / 3.0;
|
||||
boostTicks = 3;
|
||||
// Speed module removed; no entity-collision boost remains.
|
||||
}
|
||||
|
||||
@Inject(method = "aiStep", at = @At("TAIL"))
|
||||
private void omniLongJump(CallbackInfo ci) {
|
||||
Speed speed = Modules.get(Speed.class);
|
||||
if (speed == null || !speed.enabled("jump_boost")) return;
|
||||
LocalPlayer p = (LocalPlayer) (Object) this;
|
||||
|
||||
boolean onGround = p.onGround();
|
||||
|
||||
if (p.isFallFlying()) {
|
||||
wasGround = onGround;
|
||||
return;
|
||||
}
|
||||
|
||||
if (wasGround && !onGround && p.isSprinting() && !p.isInWater()) {
|
||||
|
||||
Vec2 move = p.input.getMoveVector();
|
||||
float mx = move.x;
|
||||
float mz = move.y;
|
||||
|
||||
if (mx == 0 && mz == 0) {
|
||||
wasGround = onGround;
|
||||
return;
|
||||
}
|
||||
|
||||
float norm = Mth.sqrt(mx * mx + mz * mz);
|
||||
mx /= norm;
|
||||
mz /= norm;
|
||||
|
||||
float yaw = p.getYRot();
|
||||
float rad = (float) Math.toRadians(yaw);
|
||||
|
||||
double dirX = mz * -Mth.sin(rad) + mx * Mth.cos(rad);
|
||||
double dirZ = mz * Mth.cos(rad) + mx * Mth.sin(rad);
|
||||
|
||||
Vec3 vel = p.getDeltaMovement();
|
||||
double ui = speed.jumpAcceleration.get();
|
||||
double internal = ui * 0.832;
|
||||
double strength = 0.33 * internal;
|
||||
|
||||
double vx = dirX * strength;
|
||||
double vz = dirZ * strength;
|
||||
double max = 0.42;
|
||||
double h = Math.hypot(vx, vz);
|
||||
|
||||
if (h > max) {
|
||||
double scale = max / h;
|
||||
vx *= scale;
|
||||
vz *= scale;
|
||||
}
|
||||
|
||||
p.setDeltaMovement(vx, vel.y, vz);
|
||||
}
|
||||
|
||||
wasGround = onGround;
|
||||
// Speed module removed; no jump boost remains.
|
||||
}
|
||||
|
||||
@Inject(method = "modifyInput", at = @At("RETURN"), cancellable = true)
|
||||
private void applyLegitSpeed(Vec2 input, CallbackInfoReturnable<Vec2> cir) {
|
||||
Speed speed = Modules.get(Speed.class);
|
||||
if (speed == null || !speed.isEnabled()) return;
|
||||
if (!speed.enabled("legit_speed")) return;
|
||||
Vec2 base = cir.getReturnValue();
|
||||
float mult = speed.legitMultiplier.get();
|
||||
cir.setReturnValue(base.scale(mult));
|
||||
// Speed module removed; no input speed multiplier remains.
|
||||
}
|
||||
|
||||
@Inject(method = "closeContainer", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$inventoryMove$deferCloseHandledScreen(CallbackInfo ci) {
|
||||
InventoryMove module = Modules.get(InventoryMove.class);
|
||||
if (module == null || !module.isEnabled()) return;
|
||||
if (module.shouldCancelCloseHandledScreen()) {
|
||||
ci.cancel();
|
||||
}
|
||||
private void lovisual$inventoryMove$deferCloseHandledScreen(CallbackInfo ci) {
|
||||
// InventoryMove module removed; no container close deferral remains.
|
||||
}
|
||||
|
||||
@Inject(method = "closeContainer", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$keepInventoryOpen(CallbackInfo ci) {
|
||||
if (!Modules.enabled(XCarry.class)) return;
|
||||
|
||||
// Cancel only when closing own inventory screen (PlayerScreenHandler) to retain crafting/cursor items
|
||||
var screen = ClientScreen.current(net.minecraft.client.Minecraft.getInstance());
|
||||
if (screen instanceof net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<?> handled
|
||||
&& handled.getMenu() instanceof InventoryMenu) {
|
||||
((LocalPlayer) (Object) this).clientSideCloseContainer(); // client-side close without sending packet
|
||||
ci.cancel(); // skip packet CloseHandledScreen
|
||||
}
|
||||
private void lovisual$keepInventoryOpen(CallbackInfo ci) {
|
||||
// XCarry module removed; no inventory close suppression remains.
|
||||
}
|
||||
|
||||
@Inject(method = "moveTowardsClosestSpace", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$noPushOutOfBlocks(double x, double z, CallbackInfo ci) {
|
||||
private void lovisual$noPushOutOfBlocks(double x, double z, CallbackInfo ci) {
|
||||
if (!Events.BUS.hasListeners(EventPushOutOfBlocks.class)) return;
|
||||
EventPushOutOfBlocks event = new EventPushOutOfBlocks(x, z);
|
||||
Events.BUS.post(event);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -16,14 +16,14 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import dev.loki.lovisual.features.gui.hud.nondraggable.impl.CustomBar;
|
||||
import dev.loki.lovisual.runtime.RuntimeGate;
|
||||
import dev.loki.lovisual.Lifecycle;
|
||||
|
||||
@Mixin(LocatorBar.class)
|
||||
public abstract class LocatorBarMixin {
|
||||
|
||||
@Inject(method = "extractBackground", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$renderLocatorBar(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
if (!RuntimeGate.canRunHud()) return;
|
||||
private void lovisual$renderLocatorBar(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
if (!Lifecycle.canRunHud()) return;
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc == null || mc.player == null) return;
|
||||
|
||||
|
|
@ -36,8 +36,8 @@ public abstract class LocatorBarMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "extractRenderState", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$renderLocatorAddons(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
if (!RuntimeGate.canRunHud()) return;
|
||||
private void lovisual$renderLocatorAddons(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
|
||||
if (!Lifecycle.canRunHud()) return;
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc == null || mc.player == null) return;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -37,8 +37,6 @@ import dev.loki.lovisual.events.impl.CrosshairTargetUpdateEvent;
|
|||
import dev.loki.lovisual.features.gui.chat.BetterChatStoreManager;
|
||||
import dev.loki.lovisual.features.module.ModuleManager;
|
||||
import dev.loki.lovisual.features.module.Modules;
|
||||
import dev.loki.lovisual.features.module.modules.combat.*;
|
||||
import dev.loki.lovisual.features.module.modules.movement.Timer;
|
||||
import dev.loki.lovisual.features.module.modules.player.NoDelay;
|
||||
import dev.loki.lovisual.features.module.modules.player.NoInteract;
|
||||
import dev.loki.lovisual.features.module.modules.visuals.Freecam;
|
||||
|
|
@ -56,20 +54,20 @@ public class MinecraftMixin implements MinecraftGameConfigHolder {
|
|||
private GpuSurface windowSurface;
|
||||
|
||||
@Unique
|
||||
private GameConfig combatant$gameConfig;
|
||||
private GameConfig lovisual$gameConfig;
|
||||
|
||||
@Inject(method = "<init>", at = @At("RETURN"))
|
||||
private void combatant$captureGameConfig(GameConfig config, CallbackInfo ci) {
|
||||
this.combatant$gameConfig = config;
|
||||
private void lovisual$captureGameConfig(GameConfig config, CallbackInfo ci) {
|
||||
this.lovisual$gameConfig = config;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameConfig combatant$getGameConfig() {
|
||||
return combatant$gameConfig;
|
||||
public GameConfig lovisual$getGameConfig() {
|
||||
return lovisual$gameConfig;
|
||||
}
|
||||
|
||||
@Unique
|
||||
private static BlockHitResult combatant$miss(Vec3 pos) {
|
||||
private static BlockHitResult lovisual$miss(Vec3 pos) {
|
||||
return new BlockHitResult(
|
||||
pos,
|
||||
Direction.UP,
|
||||
|
|
@ -79,7 +77,7 @@ public class MinecraftMixin implements MinecraftGameConfigHolder {
|
|||
}
|
||||
|
||||
@Unique
|
||||
private static void combatant$guardSingleplayerSaveWithAltUsername() {
|
||||
private static void lovisual$guardSingleplayerSaveWithAltUsername() {
|
||||
SessionChanger.restoreSingleplayerJoinSessionForDisconnect();
|
||||
}
|
||||
|
||||
|
|
@ -88,12 +86,6 @@ public class MinecraftMixin implements MinecraftGameConfigHolder {
|
|||
NoDelay noDelay = Modules.get(NoDelay.class);
|
||||
if (noDelay != null && noDelay.handleFastUse()) {
|
||||
ci.cancel();
|
||||
return;
|
||||
}
|
||||
|
||||
AutoBow autoBow = Modules.get(AutoBow.class);
|
||||
if (autoBow != null && autoBow.shouldCancelVanillaDoItemUse()) {
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -120,16 +112,8 @@ public class MinecraftMixin implements MinecraftGameConfigHolder {
|
|||
}
|
||||
}
|
||||
|
||||
@Inject(method = "handleKeybinds", at = @At("TAIL"))
|
||||
private void combatant$autobow$finishInputCycle(CallbackInfo ci) {
|
||||
AutoBow autoBow = Modules.get(AutoBow.class);
|
||||
if (autoBow != null && autoBow.isEnabled()) {
|
||||
autoBow.onInputCycleHandled();
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "shouldEntityAppearGlowing", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$disablePvpGlow(Entity entity, CallbackInfoReturnable<Boolean> cir) {
|
||||
private void lovisual$disablePvpGlow(Entity entity, CallbackInfoReturnable<Boolean> cir) {
|
||||
if (!(entity instanceof Player)) return;
|
||||
PvpCooldowns mod = Modules.get(PvpCooldowns.class);
|
||||
if (mod == null || !mod.shouldHideTargetGlow()) return;
|
||||
|
|
@ -141,56 +125,17 @@ public class MinecraftMixin implements MinecraftGameConfigHolder {
|
|||
|
||||
@Inject(method = "continueAttack", at = @At("HEAD"), cancellable = true)
|
||||
private void onHandleBlockBreaking(boolean breaking, CallbackInfo ci) {
|
||||
Minecraft client = Minecraft.getInstance();
|
||||
LocalPlayer player = client.player;
|
||||
if (player == null) return;
|
||||
|
||||
// Hitbox должен работать даже при ломании блоков: не блокируем vanilla логику
|
||||
Hitbox hitbox = Modules.get(Hitbox.class);
|
||||
if (hitbox != null && hitbox.isEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean attackKeyPressed = client.options.keyAttack.isDown();
|
||||
|
||||
AutoAttack autoAttack = Modules.get(AutoAttack.class);
|
||||
boolean blockByAutoAttack = autoAttack != null
|
||||
&& autoAttack.isEnabled()
|
||||
&& !autoAttack.isAutoMode()
|
||||
&& autoAttack.shouldBlockBreaking();
|
||||
boolean shouldBlockBreaking = blockByAutoAttack;
|
||||
|
||||
if (shouldBlockBreaking && attackKeyPressed) {
|
||||
|
||||
// блокируем ломание
|
||||
ci.cancel();
|
||||
|
||||
if (client.gameMode != null)
|
||||
client.gameMode.stopDestroyBlock();
|
||||
|
||||
// имитация удара
|
||||
}
|
||||
// AutoAttack / Hitbox modules removed; no block-breaking override remains.
|
||||
}
|
||||
|
||||
@Inject(method = "startAttack", at = @At("HEAD"), cancellable = true)
|
||||
private void onDoAttack(CallbackInfoReturnable<Boolean> cir) {
|
||||
AttributeSwap attributeSwap = Modules.get(AttributeSwap.class);
|
||||
if (attributeSwap != null && attributeSwap.isEnabled() && attributeSwap.handleManualAttack()) {
|
||||
cir.setReturnValue(true);
|
||||
cir.cancel();
|
||||
return;
|
||||
}
|
||||
|
||||
AutoAttack autoAttack = Modules.get(AutoAttack.class);
|
||||
if (autoAttack != null && autoAttack.isEnabled()) {
|
||||
cir.setReturnValue(false);
|
||||
cir.cancel();
|
||||
}
|
||||
// AttributeSwap / AutoAttack modules removed; no attack override remains.
|
||||
}
|
||||
|
||||
@Inject(method = "disconnect(Lnet/minecraft/client/gui/screens/Screen;ZZ)V", at = @At("HEAD"))
|
||||
private void combatant$betterChat$saveOnDisconnect(net.minecraft.client.gui.screens.Screen screen, boolean transferring, boolean bl, CallbackInfo ci) {
|
||||
combatant$guardSingleplayerSaveWithAltUsername();
|
||||
private void lovisual$betterChat$saveOnDisconnect(net.minecraft.client.gui.screens.Screen screen, boolean transferring, boolean bl, CallbackInfo ci) {
|
||||
lovisual$guardSingleplayerSaveWithAltUsername();
|
||||
try {
|
||||
BetterChatStoreManager.flushAll();
|
||||
} catch (Throwable ignored) {
|
||||
|
|
@ -198,7 +143,7 @@ public class MinecraftMixin implements MinecraftGameConfigHolder {
|
|||
}
|
||||
|
||||
@Inject(method = "disconnect(Lnet/minecraft/client/gui/screens/Screen;ZZ)V", at = @At("TAIL"))
|
||||
private void combatant$sessionRestoreAfterDisconnect(net.minecraft.client.gui.screens.Screen screen, boolean transferring, boolean bl, CallbackInfo ci) {
|
||||
private void lovisual$sessionRestoreAfterDisconnect(net.minecraft.client.gui.screens.Screen screen, boolean transferring, boolean bl, CallbackInfo ci) {
|
||||
SessionChanger.restoreDeferredSessionAfterDisconnect();
|
||||
}
|
||||
|
||||
|
|
@ -234,7 +179,7 @@ public class MinecraftMixin implements MinecraftGameConfigHolder {
|
|||
// FREECAM + NO INTERACT
|
||||
// ===============================
|
||||
if (!fc.allowInteract()) {
|
||||
mc.hitResult = combatant$miss(start);
|
||||
mc.hitResult = lovisual$miss(start);
|
||||
mc.crosshairPickEntity = null;
|
||||
ci.cancel();
|
||||
return;
|
||||
|
|
@ -288,7 +233,7 @@ public class MinecraftMixin implements MinecraftGameConfigHolder {
|
|||
}
|
||||
|
||||
@Inject(method = "pick", at = @At("RETURN"))
|
||||
private void combatant$dispatchCrosshairTargetEvent(float tickDelta, CallbackInfo ci) {
|
||||
private void lovisual$dispatchCrosshairTargetEvent(float tickDelta, CallbackInfo ci) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc.player == null || mc.level == null) return;
|
||||
|
||||
|
|
@ -340,7 +285,7 @@ public class MinecraftMixin implements MinecraftGameConfigHolder {
|
|||
}
|
||||
|
||||
@Inject(method = "setLevel", at = @At("TAIL"))
|
||||
private void combatant$captureSingleplayerJoinSession(ClientLevel world, CallbackInfo ci) {
|
||||
private void lovisual$captureSingleplayerJoinSession(ClientLevel world, CallbackInfo ci) {
|
||||
if (world == null) {
|
||||
SessionChanger.clearSingleplayerJoinSession();
|
||||
} else {
|
||||
|
|
@ -349,7 +294,7 @@ public class MinecraftMixin implements MinecraftGameConfigHolder {
|
|||
}
|
||||
|
||||
@Inject(method = "clearDownloadedResourcePacks", at = @At("HEAD"))
|
||||
private void combatant$onDisconnected(CallbackInfo ci) {
|
||||
private void lovisual$onDisconnected(CallbackInfo ci) {
|
||||
StaffTracker.resetAll();
|
||||
AntiBotTracker.INSTANCE.reset();
|
||||
}
|
||||
|
|
@ -362,7 +307,7 @@ public class MinecraftMixin implements MinecraftGameConfigHolder {
|
|||
shift = At.Shift.AFTER
|
||||
)
|
||||
)
|
||||
private void combatant$frameModulesAfterRenderTick(boolean tick, CallbackInfo ci) {
|
||||
private void lovisual$frameModulesAfterRenderTick(boolean tick, CallbackInfo ci) {
|
||||
ModuleManager.frameAll(TickDelta.frameDeltaTicks());
|
||||
}
|
||||
|
||||
|
|
@ -375,7 +320,7 @@ public class MinecraftMixin implements MinecraftGameConfigHolder {
|
|||
shift = At.Shift.AFTER
|
||||
)
|
||||
)
|
||||
private void combatant$paceImmediateNoVsync(boolean tick, CallbackInfo ci) {
|
||||
private void lovisual$paceImmediateNoVsync(boolean tick, CallbackInfo ci) {
|
||||
Minecraft mc = (Minecraft) (Object) this;
|
||||
if (mc == null || mc.options == null || mc.getWindow() == null || windowSurface == null) {
|
||||
return;
|
||||
|
|
@ -394,27 +339,23 @@ public class MinecraftMixin implements MinecraftGameConfigHolder {
|
|||
}
|
||||
|
||||
int refreshRate = mc.getWindow().getRefreshRate();
|
||||
int targetFps = combatant$immediatePacingTarget(refreshRate);
|
||||
int targetFps = lovisual$immediatePacingTarget(refreshRate);
|
||||
FramerateLimiter.limitDisplayFPS(targetFps);
|
||||
}
|
||||
|
||||
@Unique
|
||||
private static int combatant$immediatePacingTarget(int refreshRate) {
|
||||
private static int lovisual$immediatePacingTarget(int refreshRate) {
|
||||
int base = refreshRate > 0 ? refreshRate : 120;
|
||||
return Mth.clamp(base * 2, 120, 360);
|
||||
}
|
||||
|
||||
@Inject(method = "getTickTargetMillis", at = @At("RETURN"), cancellable = true)
|
||||
private void combatant$applyTimer(float millis, CallbackInfoReturnable<Float> cir) {
|
||||
float mult = Timer.getTickTimer();
|
||||
if (mult <= 0.0001f) return;
|
||||
if (Math.abs(mult - 1.0f) < 0.0001f) return;
|
||||
float base = cir.getReturnValue();
|
||||
cir.setReturnValue(base / mult);
|
||||
private void lovisual$applyTimer(float millis, CallbackInfoReturnable<Float> cir) {
|
||||
// Timer module removed; tick speed remains unchanged.
|
||||
}
|
||||
|
||||
@Inject(method = "isLevelRunningNormally", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$skipPlayerDependentTicksWithoutPlayer(CallbackInfoReturnable<Boolean> cir) {
|
||||
private void lovisual$skipPlayerDependentTicksWithoutPlayer(CallbackInfoReturnable<Boolean> cir) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc.level != null && mc.player == null) {
|
||||
cir.setReturnValue(false);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -33,7 +33,7 @@ import dev.loki.lovisual.features.module.ModuleManager;
|
|||
import dev.loki.lovisual.features.module.Modules;
|
||||
import dev.loki.lovisual.features.module.modules.visuals.Freecam;
|
||||
import dev.loki.lovisual.features.module.modules.visuals.Zoom;
|
||||
import dev.loki.lovisual.runtime.RuntimeGate;
|
||||
import dev.loki.lovisual.Lifecycle;
|
||||
import dev.loki.lovisual.util.input.KeyManager;
|
||||
import dev.loki.lovisual.util.logging.DebugLog;
|
||||
|
||||
|
|
@ -46,19 +46,19 @@ public class MouseMixin {
|
|||
@Unique
|
||||
private double lastY;
|
||||
@Unique
|
||||
private static final float COMBATANT_PROXY_BUTTON_X = 8f;
|
||||
private static final float LOVISUAL_PROXY_BUTTON_X = 8f;
|
||||
@Unique
|
||||
private static final float COMBATANT_PROXY_BUTTON_Y = 8f;
|
||||
private static final float LOVISUAL_PROXY_BUTTON_Y = 8f;
|
||||
@Unique
|
||||
private static final float COMBATANT_PROXY_BUTTON_W = 24f;
|
||||
private static final float LOVISUAL_PROXY_BUTTON_W = 24f;
|
||||
@Unique
|
||||
private static final float COMBATANT_PROXY_BUTTON_H = 24f;
|
||||
private static final float LOVISUAL_PROXY_BUTTON_H = 24f;
|
||||
|
||||
// ===== Mouse scroll for ClickGUI =====
|
||||
@Inject(method = "onScroll", at = @At("HEAD"), cancellable = true)
|
||||
public void onMouseScroll(long window, double horizontal, double vertical, CallbackInfo ci) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (RuntimeGate.canRunClientLogic()
|
||||
if (Lifecycle.isActive()
|
||||
&& ModuleManager.isEnabled("clickgui")
|
||||
&& !(ClientScreen.current() instanceof ClickGuiScreen
|
||||
|| ClientScreen.current() instanceof ClickGuiPickerScreen
|
||||
|
|
@ -67,7 +67,7 @@ public class MouseMixin {
|
|||
ci.cancel();
|
||||
return;
|
||||
}
|
||||
if (RuntimeGate.canRunHud()
|
||||
if (Lifecycle.canRunHud()
|
||||
&& ClientScreen.current(net.minecraft.client.Minecraft.getInstance()) instanceof net.minecraft.client.gui.screens.ChatScreen) {
|
||||
if (BetterChatRenderer.onScroll(vertical)) {
|
||||
ci.cancel();
|
||||
|
|
@ -80,14 +80,14 @@ public class MouseMixin {
|
|||
KeyManager.handleMouseButtonEvent(input.button(), action);
|
||||
|
||||
net.minecraft.client.Minecraft mc = net.minecraft.client.Minecraft.getInstance();
|
||||
if (RuntimeGate.canRunHud() && mc != null) {
|
||||
if (Lifecycle.canRunHud() && mc != null) {
|
||||
boolean pressed = action == 1;
|
||||
int button = input.button();
|
||||
if (pressed && button == 0 && ClientScreen.current() instanceof JoinMultiplayerScreen screen) {
|
||||
double scale = Math.max(1.0, mc.getWindow().getGuiScale());
|
||||
float mx = (float) (mc.mouseHandler.xpos() / scale);
|
||||
float my = (float) (mc.mouseHandler.ypos() / scale);
|
||||
if (combatant$proxyButtonHit(mx, my)) {
|
||||
if (lovisual$proxyButtonHit(mx, my)) {
|
||||
ClientScreen.show(mc, new LoVisualProxyManagerScreen(screen));
|
||||
ci.cancel();
|
||||
return;
|
||||
|
|
@ -110,18 +110,18 @@ public class MouseMixin {
|
|||
}
|
||||
|
||||
@Unique
|
||||
private static boolean combatant$proxyButtonHit(float mx, float my) {
|
||||
return mx >= COMBATANT_PROXY_BUTTON_X
|
||||
&& mx <= COMBATANT_PROXY_BUTTON_X + COMBATANT_PROXY_BUTTON_W
|
||||
&& my >= COMBATANT_PROXY_BUTTON_Y
|
||||
&& my <= COMBATANT_PROXY_BUTTON_Y + COMBATANT_PROXY_BUTTON_H;
|
||||
private static boolean lovisual$proxyButtonHit(float mx, float my) {
|
||||
return mx >= LOVISUAL_PROXY_BUTTON_X
|
||||
&& mx <= LOVISUAL_PROXY_BUTTON_X + LOVISUAL_PROXY_BUTTON_W
|
||||
&& my >= LOVISUAL_PROXY_BUTTON_Y
|
||||
&& my <= LOVISUAL_PROXY_BUTTON_Y + LOVISUAL_PROXY_BUTTON_H;
|
||||
}
|
||||
|
||||
// ===== Mouse button for ClickGUI =====
|
||||
@Inject(method = "onButton", at = @At("HEAD"), cancellable = true)
|
||||
private void clickGuiMouseButton(long window, MouseButtonInfo input, int action, CallbackInfo ci) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (RuntimeGate.canRunClientLogic()
|
||||
if (Lifecycle.isActive()
|
||||
&& ModuleManager.isEnabled("clickgui")
|
||||
&& !(ClientScreen.current() instanceof ClickGuiScreen
|
||||
|| ClientScreen.current() instanceof ClickGuiPickerScreen
|
||||
|
|
@ -152,7 +152,7 @@ public class MouseMixin {
|
|||
lastX = x;
|
||||
lastY = y;
|
||||
|
||||
if (RuntimeGate.canRunClientLogic()
|
||||
if (Lifecycle.isActive()
|
||||
&& ModuleManager.isEnabled("clickgui")
|
||||
&& !(ClientScreen.current() instanceof ClickGuiScreen
|
||||
|| ClientScreen.current() instanceof ClickGuiPickerScreen
|
||||
|
|
@ -162,7 +162,7 @@ public class MouseMixin {
|
|||
return;
|
||||
}
|
||||
|
||||
if (RuntimeGate.canRunHud()
|
||||
if (Lifecycle.canRunHud()
|
||||
&& ClientScreen.current() instanceof net.minecraft.client.gui.screens.ChatScreen) {
|
||||
BetterChatRenderer.onMouseMove(x, y);
|
||||
}
|
||||
|
|
@ -178,7 +178,7 @@ public class MouseMixin {
|
|||
private void freecam$look(LocalPlayer player, double dx, double dy) {
|
||||
Freecam fc = Modules.get(Freecam.class);
|
||||
|
||||
if (!RuntimeGate.canRunClientLogic() || fc == null || !fc.isEnabled()) {
|
||||
if (!Lifecycle.isActive() || fc == null || !fc.isEnabled()) {
|
||||
player.turn(dx, dy);
|
||||
return;
|
||||
}
|
||||
|
|
@ -211,9 +211,9 @@ public class MouseMixin {
|
|||
ordinal = 0
|
||||
)
|
||||
)
|
||||
private Object combatant$zoomSensitivity(Object original) {
|
||||
private Object lovisual$zoomSensitivity(Object original) {
|
||||
Zoom zoom = Modules.get(Zoom.class);
|
||||
if (!RuntimeGate.canRunClientLogic() || zoom == null || !zoom.isEnabled() || !zoom.shouldApplyZoom())
|
||||
if (!Lifecycle.isActive() || zoom == null || !zoom.isEnabled() || !zoom.shouldApplyZoom())
|
||||
return original;
|
||||
|
||||
if (!(original instanceof Double originalValue)) return original;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -30,9 +30,6 @@ import dev.loki.lovisual.events.impl.AttackEntityEvent;
|
|||
import dev.loki.lovisual.events.impl.EventBreakBlock;
|
||||
import dev.loki.lovisual.features.gui.hud.draggable.impl.TargetHud;
|
||||
import dev.loki.lovisual.features.module.Modules;
|
||||
import dev.loki.lovisual.features.module.modules.combat.AttributeSwap;
|
||||
import dev.loki.lovisual.features.module.modules.combat.Criticals;
|
||||
import dev.loki.lovisual.features.module.modules.combat.Hitbox;
|
||||
import dev.loki.lovisual.features.module.modules.combat.PvpCooldowns;
|
||||
import dev.loki.lovisual.features.module.modules.misc.HitSounds;
|
||||
import dev.loki.lovisual.features.module.modules.visuals.Freecam;
|
||||
|
|
@ -45,14 +42,14 @@ import dev.loki.lovisual.util.target.TargetManager;
|
|||
public class MultiPlayerGameModeMixin {
|
||||
|
||||
@Inject(method = "tick", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$skipTickWithoutPlayer(CallbackInfo ci) {
|
||||
private void lovisual$skipTickWithoutPlayer(CallbackInfo ci) {
|
||||
if (Minecraft.getInstance().player == null) {
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "ensureHasSentCarriedItem", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$skipCarriedItemSyncWithoutPlayer(CallbackInfo ci) {
|
||||
private void lovisual$skipCarriedItemSyncWithoutPlayer(CallbackInfo ci) {
|
||||
if (Minecraft.getInstance().player == null) {
|
||||
ci.cancel();
|
||||
}
|
||||
|
|
@ -65,12 +62,12 @@ public class MultiPlayerGameModeMixin {
|
|||
target = "Lnet/minecraft/world/entity/player/Inventory;getSelectedSlot()I"
|
||||
)
|
||||
)
|
||||
private int combatant$hookSilentSelectedSlot(int original) {
|
||||
private int lovisual$hookSilentSelectedSlot(int original) {
|
||||
return InventorySwap.INSTANCE.effectiveSelectedSlot();
|
||||
}
|
||||
|
||||
@Inject(method = "destroyBlock", at = @At("RETURN"))
|
||||
private void combatant$breakBlockEvent(BlockPos pos, CallbackInfoReturnable<Boolean> cir) {
|
||||
private void lovisual$breakBlockEvent(BlockPos pos, CallbackInfoReturnable<Boolean> cir) {
|
||||
if (!cir.getReturnValue()) return;
|
||||
if (!Events.BUS.hasListeners(EventBreakBlock.class)) return;
|
||||
Events.BUS.post(new EventBreakBlock(pos));
|
||||
|
|
@ -146,22 +143,12 @@ public class MultiPlayerGameModeMixin {
|
|||
@Inject(method = "attack(Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/entity/Entity;)V",
|
||||
at = @At("HEAD"))
|
||||
private void onAttackEntity(Player player, Entity target, CallbackInfo ci) {
|
||||
if (!((WorldAccessor) player.level()).combatant$isClient()) return;
|
||||
|
||||
if (player instanceof LocalPlayer clientPlayer) {
|
||||
Criticals criticals = Modules.get(Criticals.class);
|
||||
if (criticals != null && criticals.isEnabled()) {
|
||||
criticals.beforeAttack(Minecraft.getInstance(), clientPlayer, target);
|
||||
}
|
||||
}
|
||||
if (!((WorldAccessor) player.level()).lovisual$isClient()) return;
|
||||
|
||||
if (Events.BUS.hasListeners(AttackEntityEvent.class)) {
|
||||
Events.BUS.post(new AttackEntityEvent(player, target));
|
||||
}
|
||||
|
||||
Hitbox hitbox = Modules.get(Hitbox.class);
|
||||
if (hitbox != null) hitbox.markHit(target);
|
||||
|
||||
HitSounds hitSounds = Modules.get(HitSounds.class);
|
||||
if (hitSounds != null) {
|
||||
hitSounds.handleHit(target);
|
||||
|
|
@ -178,8 +165,7 @@ public class MultiPlayerGameModeMixin {
|
|||
|
||||
@Inject(method = "attack(Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/entity/Entity;)V",
|
||||
at = @At("RETURN"))
|
||||
private void combatant$attributeSwapAfterClientAttack(Player player, Entity target, CallbackInfo ci) {
|
||||
if (player != Minecraft.getInstance().player) return;
|
||||
AttributeSwap.tryBreakShieldAfterClientAttack(target);
|
||||
private void lovisual$attributeSwapAfterClientAttack(Player player, Entity target, CallbackInfo ci) {
|
||||
// AttributeSwap module removed; no post-attack shield break remains.
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -29,7 +29,7 @@ public class NarratorManagerMixin {
|
|||
private Minecraft minecraft;
|
||||
|
||||
@Inject(method = "sayChatQueued(Lnet/minecraft/network/chat/Component;)V", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$muteChat(Component message, CallbackInfo ci) {
|
||||
private void lovisual$muteChat(Component message, CallbackInfo ci) {
|
||||
if (shouldMute()) {
|
||||
NarratorBlocker.enforce(this.minecraft);
|
||||
ci.cancel();
|
||||
|
|
@ -37,7 +37,7 @@ public class NarratorManagerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "saySystemChatQueued(Lnet/minecraft/network/chat/Component;)V", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$muteNarrator(Component message, CallbackInfo ci) {
|
||||
private void lovisual$muteNarrator(Component message, CallbackInfo ci) {
|
||||
if (shouldMute()) {
|
||||
NarratorBlocker.enforce(this.minecraft);
|
||||
ci.cancel();
|
||||
|
|
@ -45,7 +45,7 @@ public class NarratorManagerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "saySystemQueued(Lnet/minecraft/network/chat/Component;)V", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$muteSystem(Component message, CallbackInfo ci) {
|
||||
private void lovisual$muteSystem(Component message, CallbackInfo ci) {
|
||||
if (shouldMute()) {
|
||||
NarratorBlocker.enforce(this.minecraft);
|
||||
ci.cancel();
|
||||
|
|
@ -53,7 +53,7 @@ public class NarratorManagerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "saySystemNow(Lnet/minecraft/network/chat/Component;)V", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$muteImmediateText(Component message, CallbackInfo ci) {
|
||||
private void lovisual$muteImmediateText(Component message, CallbackInfo ci) {
|
||||
if (shouldMute()) {
|
||||
NarratorBlocker.enforce(this.minecraft);
|
||||
ci.cancel();
|
||||
|
|
@ -61,7 +61,7 @@ public class NarratorManagerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "saySystemNow(Ljava/lang/String;)V", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$muteImmediateString(String message, CallbackInfo ci) {
|
||||
private void lovisual$muteImmediateString(String message, CallbackInfo ci) {
|
||||
if (shouldMute()) {
|
||||
NarratorBlocker.enforce(this.minecraft);
|
||||
ci.cancel();
|
||||
|
|
@ -69,7 +69,7 @@ public class NarratorManagerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "narrateMessage(Ljava/lang/String;Z)V", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$muteSay(String message, boolean interrupt, CallbackInfo ci) {
|
||||
private void lovisual$muteSay(String message, boolean interrupt, CallbackInfo ci) {
|
||||
if (shouldMute()) {
|
||||
NarratorBlocker.enforce(this.minecraft);
|
||||
ci.cancel();
|
||||
|
|
@ -77,21 +77,21 @@ public class NarratorManagerMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "updateNarratorStatus", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$blockToggle(NarratorStatus mode, CallbackInfo ci) {
|
||||
private void lovisual$blockToggle(NarratorStatus mode, CallbackInfo ci) {
|
||||
if (!shouldMute()) return;
|
||||
NarratorBlocker.enforce(this.minecraft);
|
||||
ci.cancel();
|
||||
}
|
||||
|
||||
@Inject(method = "checkStatus", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$skipNarratorLibraryCheck(boolean narratorEnabled, CallbackInfo ci) {
|
||||
private void lovisual$skipNarratorLibraryCheck(boolean narratorEnabled, CallbackInfo ci) {
|
||||
if (!shouldMute()) return;
|
||||
NarratorBlocker.enforce(this.minecraft);
|
||||
ci.cancel();
|
||||
}
|
||||
|
||||
@Inject(method = "isActive", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$reportInactive(CallbackInfoReturnable<Boolean> cir) {
|
||||
private void lovisual$reportInactive(CallbackInfoReturnable<Boolean> cir) {
|
||||
if (!shouldMute()) return;
|
||||
cir.setReturnValue(false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -24,22 +24,22 @@ import java.io.File;
|
|||
public abstract class OptionsNarratorMixin {
|
||||
|
||||
@Inject(method = "<init>(Lnet/minecraft/client/Minecraft;Ljava/io/File;)V", at = @At("RETURN"))
|
||||
private void combatant$enforceNarratorDefaults(Minecraft client, File optionsFile, CallbackInfo ci) {
|
||||
private void lovisual$enforceNarratorDefaults(Minecraft client, File optionsFile, CallbackInfo ci) {
|
||||
NarratorBlocker.enforce((Options) (Object) this);
|
||||
}
|
||||
|
||||
@Inject(method = "save", at = @At("HEAD"))
|
||||
private void combatant$enforceNarratorBeforeWrite(CallbackInfo ci) {
|
||||
private void lovisual$enforceNarratorBeforeWrite(CallbackInfo ci) {
|
||||
NarratorBlocker.enforce((Options) (Object) this);
|
||||
}
|
||||
|
||||
@Inject(method = "narrator", at = @At("HEAD"))
|
||||
private void combatant$enforceNarratorGetter(CallbackInfoReturnable<OptionInstance<NarratorStatus>> cir) {
|
||||
private void lovisual$enforceNarratorGetter(CallbackInfoReturnable<OptionInstance<NarratorStatus>> cir) {
|
||||
NarratorBlocker.enforce((Options) (Object) this);
|
||||
}
|
||||
|
||||
@Inject(method = "narratorHotkey", at = @At("HEAD"))
|
||||
private void combatant$enforceNarratorHotkeyGetter(CallbackInfoReturnable<OptionInstance<Boolean>> cir) {
|
||||
private void lovisual$enforceNarratorHotkeyGetter(CallbackInfoReturnable<OptionInstance<Boolean>> cir) {
|
||||
NarratorBlocker.enforce((Options) (Object) this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -19,7 +19,7 @@ import dev.loki.lovisual.util.player.effect.StatusEffectHeuristics;
|
|||
public class ParticleManagerMixin {
|
||||
|
||||
@Inject(method = "createParticle(Lnet/minecraft/core/particles/ParticleOptions;DDDDDD)Lnet/minecraft/client/particle/Particle;", at = @At("HEAD"))
|
||||
private void combatant$heuristicParticle(ParticleOptions parameters, double x, double y, double z, double velocityX, double velocityY, double velocityZ, CallbackInfoReturnable<?> cir) {
|
||||
private void lovisual$heuristicParticle(ParticleOptions parameters, double x, double y, double z, double velocityX, double velocityY, double velocityZ, CallbackInfoReturnable<?> cir) {
|
||||
// dev.loki.lovisual.util.logging.DebugLog.info("ParticleManager add type=%s pos=%.2f %.2f %.2f", parameters.getType().toString(), x, y, z);
|
||||
StatusEffectHeuristics.handle(parameters, x, y, z);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -28,53 +28,53 @@ public abstract class PauseScreenMixin {
|
|||
private Button disconnectButton;
|
||||
|
||||
@Unique
|
||||
private Button combatant$lastExitButton;
|
||||
private Button lovisual$lastExitButton;
|
||||
@Unique
|
||||
private boolean combatant$disconnectBlocked;
|
||||
private boolean lovisual$disconnectBlocked;
|
||||
@Unique
|
||||
private boolean combatant$previousExitActive = true;
|
||||
private boolean lovisual$previousExitActive = true;
|
||||
|
||||
@Inject(method = "init", at = @At("TAIL"))
|
||||
private void combatant$blockDisconnectOnInit(CallbackInfo ci) {
|
||||
combatant$syncDisconnectButton();
|
||||
private void lovisual$blockDisconnectOnInit(CallbackInfo ci) {
|
||||
lovisual$syncDisconnectButton();
|
||||
}
|
||||
|
||||
@Inject(method = "extractRenderState", at = @At("HEAD"))
|
||||
private void combatant$blockDisconnectOnRender(GuiGraphicsExtractor context, int mouseX, int mouseY, float deltaTicks, CallbackInfo ci) {
|
||||
combatant$syncDisconnectButton();
|
||||
private void lovisual$blockDisconnectOnRender(GuiGraphicsExtractor context, int mouseX, int mouseY, float deltaTicks, CallbackInfo ci) {
|
||||
lovisual$syncDisconnectButton();
|
||||
}
|
||||
|
||||
@Unique
|
||||
private void combatant$syncDisconnectButton() {
|
||||
private void lovisual$syncDisconnectButton() {
|
||||
Button button = disconnectButton;
|
||||
if (button == null) {
|
||||
combatant$lastExitButton = null;
|
||||
combatant$disconnectBlocked = false;
|
||||
lovisual$lastExitButton = null;
|
||||
lovisual$disconnectBlocked = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (button != combatant$lastExitButton) {
|
||||
combatant$lastExitButton = button;
|
||||
combatant$disconnectBlocked = false;
|
||||
combatant$previousExitActive = button.active;
|
||||
if (button != lovisual$lastExitButton) {
|
||||
lovisual$lastExitButton = button;
|
||||
lovisual$disconnectBlocked = false;
|
||||
lovisual$previousExitActive = button.active;
|
||||
}
|
||||
|
||||
PvpCooldowns cooldowns = Modules.get(PvpCooldowns.class);
|
||||
boolean shouldBlock = cooldowns != null && cooldowns.shouldBlockDisconnect();
|
||||
if (shouldBlock) {
|
||||
if (!combatant$disconnectBlocked) {
|
||||
combatant$previousExitActive = button.active;
|
||||
if (!lovisual$disconnectBlocked) {
|
||||
lovisual$previousExitActive = button.active;
|
||||
}
|
||||
combatant$disconnectBlocked = true;
|
||||
lovisual$disconnectBlocked = true;
|
||||
button.active = false;
|
||||
button.setTooltip(Tooltip.create(cooldowns.getDisconnectBlockTooltip()));
|
||||
return;
|
||||
}
|
||||
|
||||
if (combatant$disconnectBlocked) {
|
||||
button.active = combatant$previousExitActive;
|
||||
if (lovisual$disconnectBlocked) {
|
||||
button.active = lovisual$previousExitActive;
|
||||
button.setTooltip(null);
|
||||
combatant$disconnectBlocked = false;
|
||||
lovisual$disconnectBlocked = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* Combatant modifications copyright (c) 2026 pivosos2007.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* LoVisual modifications copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Portions of this file are based on LiquidBounce
|
||||
* (https://github.com/CCBlueX/LiquidBounce).
|
||||
* Copyright (c) 2015-2026 CCBlueX.
|
||||
*
|
||||
* LiquidBounce portions are licensed under GPLv3-or-later.
|
||||
* Combatant modifications are licensed under GPLv3.
|
||||
* LoVisual modifications are licensed under GPLv3.
|
||||
* See THIRD_PARTY_NOTICES.md for details.
|
||||
*/
|
||||
|
||||
|
|
@ -39,8 +39,6 @@ import dev.loki.lovisual.events.impl.PlayerSafeWalkEvent;
|
|||
import dev.loki.lovisual.features.module.Modules;
|
||||
import dev.loki.lovisual.features.module.modules.player.NoDelay;
|
||||
import dev.loki.lovisual.features.module.modules.combat.TPSSync;
|
||||
import dev.loki.lovisual.features.module.modules.movement.NoStun;
|
||||
import dev.loki.lovisual.features.module.modules.movement.Timer;
|
||||
import dev.loki.lovisual.mixininterface.IPlayerAttackCooldown;
|
||||
import dev.loki.lovisual.util.aiming.RotationManager;
|
||||
|
||||
|
|
@ -52,7 +50,7 @@ public abstract class PlayerEntityMixin implements IPlayerAttackCooldown {
|
|||
private ItemCooldowns cooldowns;
|
||||
|
||||
@Inject(method = "isStayingOnGroundSurface", at = @At("RETURN"), cancellable = true)
|
||||
private void combatant$safeWalk(CallbackInfoReturnable<Boolean> cir) {
|
||||
private void lovisual$safeWalk(CallbackInfoReturnable<Boolean> cir) {
|
||||
if (cir.getReturnValue()) return;
|
||||
if ((Object) this != Minecraft.getInstance().player) return;
|
||||
if (!Events.BUS.hasListeners(PlayerSafeWalkEvent.class)) return;
|
||||
|
|
@ -65,11 +63,8 @@ public abstract class PlayerEntityMixin implements IPlayerAttackCooldown {
|
|||
}
|
||||
|
||||
@Inject(method = "isMobilityRestricted", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$noStunBlindnessSprint(CallbackInfoReturnable<Boolean> cir) {
|
||||
NoStun noStun = Modules.get(NoStun.class);
|
||||
if (noStun != null && noStun.shouldIgnoreBlindness((Player) (Object) this)) {
|
||||
cir.setReturnValue(false);
|
||||
}
|
||||
private void lovisual$noStunBlindnessSprint(CallbackInfoReturnable<Boolean> cir) {
|
||||
// NoStun module removed; no mobility override remains.
|
||||
}
|
||||
|
||||
@ModifyExpressionValue(
|
||||
|
|
@ -79,7 +74,7 @@ public abstract class PlayerEntityMixin implements IPlayerAttackCooldown {
|
|||
target = "Lnet/minecraft/world/entity/player/Player;getYRot()F"
|
||||
)
|
||||
)
|
||||
private float combatant$fixKnockbackYaw(float original) {
|
||||
private float lovisual$fixKnockbackYaw(float original) {
|
||||
if ((Object) this != Minecraft.getInstance().player) {
|
||||
return original;
|
||||
}
|
||||
|
|
@ -93,7 +88,7 @@ public abstract class PlayerEntityMixin implements IPlayerAttackCooldown {
|
|||
target = "Lnet/minecraft/world/entity/player/Player;getYRot()F"
|
||||
)
|
||||
)
|
||||
private float combatant$fixSweepYaw(float original) {
|
||||
private float lovisual$fixSweepYaw(float original) {
|
||||
if ((Object) this != Minecraft.getInstance().player) {
|
||||
return original;
|
||||
}
|
||||
|
|
@ -107,7 +102,7 @@ public abstract class PlayerEntityMixin implements IPlayerAttackCooldown {
|
|||
target = "Lnet/minecraft/world/entity/player/Player;getLookAngle()Lnet/minecraft/world/phys/Vec3;"
|
||||
)
|
||||
)
|
||||
private Vec3 combatant$fixTravelRotationVector(Vec3 original) {
|
||||
private Vec3 lovisual$fixTravelRotationVector(Vec3 original) {
|
||||
if ((Object) this != Minecraft.getInstance().player) {
|
||||
return original;
|
||||
}
|
||||
|
|
@ -131,7 +126,7 @@ public abstract class PlayerEntityMixin implements IPlayerAttackCooldown {
|
|||
method = "getCurrentItemAttackStrengthDelay",
|
||||
at = @At("RETURN")
|
||||
)
|
||||
private float combatant$tpsSyncAttackCooldown(float original) {
|
||||
private float lovisual$tpsSyncAttackCooldown(float original) {
|
||||
float result = original;
|
||||
|
||||
TPSSync tpsSync = Modules.get(TPSSync.class);
|
||||
|
|
@ -143,22 +138,17 @@ public abstract class PlayerEntityMixin implements IPlayerAttackCooldown {
|
|||
}
|
||||
}
|
||||
|
||||
float timerMult = Timer.getTickTimer();
|
||||
if (timerMult > 0.0001f && Math.abs(timerMult - 1.0f) > 0.0001f) {
|
||||
result = result * timerMult;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float combatant$getAttackCooldownProgress(float tickDelta) {
|
||||
public float lovisual$getAttackCooldownProgress(float tickDelta) {
|
||||
Player self = (Player) (Object) this;
|
||||
return self.getAttackStrengthScale(tickDelta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean combatant$isAttackCharged(float tickDelta) {
|
||||
return combatant$getAttackCooldownProgress(tickDelta) >= 1.0f;
|
||||
public boolean lovisual$isAttackCharged(float tickDelta) {
|
||||
return lovisual$getAttackCooldownProgress(tickDelta) >= 1.0f;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -30,13 +30,13 @@ public abstract class PlayerInventoryMixin {
|
|||
public abstract ItemStack getItem(int slot);
|
||||
|
||||
@ModifyReturnValue(method = "getSelectedSlot", at = @At("RETURN"))
|
||||
private int combatant$silentSelectedSlot(int original) {
|
||||
private int lovisual$silentSelectedSlot(int original) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
return player == mc.player ? InventorySwap.INSTANCE.effectiveSelectedSlot() : original;
|
||||
}
|
||||
|
||||
@ModifyReturnValue(method = "getSelectedItem", at = @At("RETURN"))
|
||||
private ItemStack combatant$silentSelectedStack(ItemStack original) {
|
||||
private ItemStack lovisual$silentSelectedStack(ItemStack original) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (player == mc.player && InventorySwap.INSTANCE.isHotbarLeased()) {
|
||||
return getItem(InventorySwap.INSTANCE.effectiveSelectedSlot());
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -8,7 +8,6 @@
|
|||
package dev.loki.lovisual.mixins;
|
||||
|
||||
import dev.loki.lovisual.features.gui.hud.nondraggable.impl.tab.CustomTabList;
|
||||
import dev.loki.lovisual.runtime.RuntimeGate;
|
||||
import net.minecraft.client.gui.GuiGraphicsExtractor;
|
||||
import net.minecraft.client.gui.components.PlayerTabOverlay;
|
||||
import net.minecraft.world.scores.Objective;
|
||||
|
|
@ -25,12 +24,12 @@ public abstract class PlayerTabOverlayMixin {
|
|||
at = @At("HEAD"),
|
||||
cancellable = true
|
||||
)
|
||||
private void combatant$extractCustomTabList(GuiGraphicsExtractor context,
|
||||
private void lovisual$extractCustomTabList(GuiGraphicsExtractor context,
|
||||
int width,
|
||||
Scoreboard scoreboard,
|
||||
Objective objective,
|
||||
CallbackInfo ci) {
|
||||
if (RuntimeGate.isPanic()) return;
|
||||
|
||||
if (!CustomTabList.shouldReplaceVanilla()) return;
|
||||
CustomTabList.renderVanillaTabStratum(context, width);
|
||||
ci.cancel();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -23,7 +23,7 @@ import dev.loki.lovisual.features.module.modules.visuals.WorldTweaks;
|
|||
public class PowderSnowFogModifierMixin {
|
||||
|
||||
@Inject(method = "setupFog", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$noPowderFog(FogData data,
|
||||
private void lovisual$noPowderFog(FogData data,
|
||||
Camera camera,
|
||||
ClientLevel world,
|
||||
float viewDistance,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -16,8 +16,6 @@ import net.minecraft.world.phys.Vec3;
|
|||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
import dev.loki.lovisual.features.module.Modules;
|
||||
import dev.loki.lovisual.features.module.modules.combat.Hitbox;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
@ -27,7 +25,7 @@ import java.util.function.Predicate;
|
|||
public class ProjectileUtilMixin {
|
||||
|
||||
// Intercept getOtherEntities in ProjectileUtil.raycast:
|
||||
// - If Hitbox is disabled/panic -> keep vanilla list.
|
||||
// - If Hitbox is disabled -> keep vanilla list.
|
||||
// - If enabled -> drop dead LivingEntity and those Hitbox wants to ignore.
|
||||
@Redirect(
|
||||
method = "getEntityHitResult(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/phys/Vec3;Lnet/minecraft/world/phys/Vec3;Lnet/minecraft/world/phys/AABB;Ljava/util/function/Predicate;D)Lnet/minecraft/world/phys/EntityHitResult;",
|
||||
|
|
@ -36,21 +34,9 @@ public class ProjectileUtilMixin {
|
|||
target = "Lnet/minecraft/world/level/Level;getEntities(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/phys/AABB;Ljava/util/function/Predicate;)Ljava/util/List;"
|
||||
)
|
||||
)
|
||||
private static List<Entity> combatant$filterEntities(Level world, Entity source, AABB box, Predicate<Entity> predicate) {
|
||||
List<Entity> original = world.getEntities(source, box, predicate);
|
||||
if (original == null || original.isEmpty()) return original;
|
||||
|
||||
Hitbox hb = Modules.get(Hitbox.class);
|
||||
if (hb == null || !hb.isEnabled()) return original;
|
||||
|
||||
List<Entity> filtered = new ArrayList<>(original.size());
|
||||
for (Entity e : original) {
|
||||
if (e instanceof LivingEntity living && !living.isAlive()) continue;
|
||||
if (hb.shouldIgnore(e)) continue;
|
||||
filtered.add(e);
|
||||
}
|
||||
|
||||
return filtered;
|
||||
private static List<Entity> lovisual$filterEntities(Level world, Entity source, AABB box, Predicate<Entity> predicate) {
|
||||
// Hitbox module removed; keep vanilla entity list.
|
||||
return world.getEntities(source, box, predicate);
|
||||
}
|
||||
|
||||
// Intercept getBoundingBox: add padding only for live targets allowed by Hitbox.
|
||||
|
|
@ -61,24 +47,14 @@ public class ProjectileUtilMixin {
|
|||
target = "Lnet/minecraft/world/entity/Entity;getBoundingBox()Lnet/minecraft/world/phys/AABB;"
|
||||
)
|
||||
)
|
||||
private static AABB combatant$padBoundingBox(Entity target,
|
||||
private static AABB lovisual$padBoundingBox(Entity target,
|
||||
Entity source,
|
||||
Vec3 start,
|
||||
Vec3 end,
|
||||
AABB box,
|
||||
Predicate<Entity> predicate,
|
||||
double maxDistance) {
|
||||
Hitbox hb = Modules.get(Hitbox.class);
|
||||
AABB bb = target.getBoundingBox();
|
||||
if (hb == null || !hb.shouldExpandFor(target)) {
|
||||
return bb;
|
||||
}
|
||||
|
||||
double baseDistanceSq = Hitbox.boxDistanceSq(bb, start);
|
||||
if (baseDistanceSq > maxDistance) {
|
||||
return bb;
|
||||
}
|
||||
|
||||
return bb.inflate(hb.getPadding());
|
||||
// Hitbox module removed; keep vanilla bounding box.
|
||||
return target.getBoundingBox();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -26,7 +26,7 @@ public abstract class RecipeBookScreenMixin {
|
|||
private RecipeBookComponent<?> recipeBookComponent;
|
||||
|
||||
@Inject(method = "initButton", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$disableRecipeBook(CallbackInfo ci) {
|
||||
private void lovisual$disableRecipeBook(CallbackInfo ci) {
|
||||
BetterMinecraft module = Modules.get(BetterMinecraft.class);
|
||||
if (module != null && module.isHideRecipeBookEnabled()) {
|
||||
ci.cancel();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -13,15 +13,15 @@ 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 dev.loki.lovisual.render.engine.core.CombatantRenderSystem;
|
||||
import dev.loki.lovisual.render.engine.core.LoVisualRenderSystem;
|
||||
import dev.loki.lovisual.util.logging.DebugLog;
|
||||
|
||||
@Mixin(RenderPass.class)
|
||||
public abstract class RenderPassMixin {
|
||||
@Inject(method = "setPipeline", at = @At("RETURN"))
|
||||
private void combatant$applyRhiPipelineState(RenderPipeline pipeline, CallbackInfo ci) {
|
||||
private void lovisual$applyRhiPipelineState(RenderPipeline pipeline, CallbackInfo ci) {
|
||||
try {
|
||||
CombatantRenderSystem.rhi().pipelineState().applyPipelineState(pipeline);
|
||||
LoVisualRenderSystem.rhi().pipelineState().applyPipelineState(pipeline);
|
||||
} catch (Throwable t) {
|
||||
DebugLog.error("[ShapeClip] pipeline state hook failed for " + pipeline, t);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* Combatant modifications copyright (c) 2026 pivosos2007.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* LoVisual modifications copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Portions of this file are based on, adapted from, or implemented
|
||||
* with reference to Meteor Client
|
||||
|
|
@ -22,28 +22,28 @@ import dev.loki.lovisual.render.engine.rhi.clip.ShapeClipRenderPassContract;
|
|||
@Mixin(RenderPipeline.class)
|
||||
public abstract class RenderPipelineMixin implements IRenderPipeline {
|
||||
@Unique
|
||||
private boolean combatant$lineSmooth;
|
||||
private boolean lovisual$lineSmooth;
|
||||
|
||||
@Unique
|
||||
private ShapeClipRenderPassContract combatant$shapeClipContract = ShapeClipRenderPassContract.NONE;
|
||||
private ShapeClipRenderPassContract lovisual$shapeClipContract = ShapeClipRenderPassContract.NONE;
|
||||
|
||||
@Override
|
||||
public void combatant$setLineSmooth(boolean lineSmooth) {
|
||||
this.combatant$lineSmooth = lineSmooth;
|
||||
public void lovisual$setLineSmooth(boolean lineSmooth) {
|
||||
this.lovisual$lineSmooth = lineSmooth;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean combatant$getLineSmooth() {
|
||||
return combatant$lineSmooth;
|
||||
public boolean lovisual$getLineSmooth() {
|
||||
return lovisual$lineSmooth;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void combatant$setShapeClipContract(ShapeClipRenderPassContract contract) {
|
||||
this.combatant$shapeClipContract = contract == null ? ShapeClipRenderPassContract.NONE : contract;
|
||||
public void lovisual$setShapeClipContract(ShapeClipRenderPassContract contract) {
|
||||
this.lovisual$shapeClipContract = contract == null ? ShapeClipRenderPassContract.NONE : contract;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShapeClipRenderPassContract combatant$getShapeClipContract() {
|
||||
return combatant$shapeClipContract;
|
||||
public ShapeClipRenderPassContract lovisual$getShapeClipContract() {
|
||||
return lovisual$shapeClipContract;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -32,7 +32,7 @@ public abstract class ScreenEffectRendererMixin {
|
|||
"Lnet/minecraft/client/renderer/ScreenEffectRenderer;submitFire(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;)V"
|
||||
)
|
||||
)
|
||||
private static void combatant$maybeRenderFireOverlay(
|
||||
private static void lovisual$maybeRenderFireOverlay(
|
||||
PoseStack matrices,
|
||||
SubmitNodeCollector vertexConsumers,
|
||||
TextureAtlasSprite sprite
|
||||
|
|
@ -66,7 +66,7 @@ public abstract class ScreenEffectRendererMixin {
|
|||
"Lnet/minecraft/client/renderer/ScreenEffectRenderer;submitBlockSprite(Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;I)V"
|
||||
)
|
||||
)
|
||||
private static void combatant$maybeRenderBlockOverlay(
|
||||
private static void lovisual$maybeRenderBlockOverlay(
|
||||
TextureAtlasSprite sprite,
|
||||
PoseStack matrices,
|
||||
SubmitNodeCollector vertexConsumers,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -24,20 +24,19 @@ import dev.loki.lovisual.features.command.CommandManager;
|
|||
import dev.loki.lovisual.features.gui.hud.nondraggable.impl.BetterButtons;
|
||||
import dev.loki.lovisual.features.module.Modules;
|
||||
import dev.loki.lovisual.features.module.modules.visuals.NoRender;
|
||||
import dev.loki.lovisual.render.engine.core.CombatantRenderSystem;
|
||||
import dev.loki.lovisual.render.engine.core.LoVisualRenderSystem;
|
||||
import dev.loki.lovisual.render.engine.core.RenderPhase;
|
||||
import dev.loki.lovisual.render.engine.core.RenderPhaseScope;
|
||||
import dev.loki.lovisual.render.engine.postprocess.MenuBackgroundRenderer;
|
||||
import dev.loki.lovisual.runtime.RuntimeGate;
|
||||
import dev.loki.lovisual.util.NarratorBlocker;
|
||||
|
||||
@Mixin(Screen.class)
|
||||
public abstract class ScreenMixin {
|
||||
@Unique
|
||||
private RenderPhaseScope combatant$screenPhaseScope;
|
||||
private RenderPhaseScope lovisual$screenPhaseScope;
|
||||
|
||||
@Inject(method = "defaultHandleGameClickEvent", at = @At("HEAD"), cancellable = true)
|
||||
private static void combatant$runClientChatCommand(ClickEvent event,
|
||||
private static void lovisual$runClientChatCommand(ClickEvent event,
|
||||
Minecraft client,
|
||||
Screen screen,
|
||||
CallbackInfo ci) {
|
||||
|
|
@ -50,7 +49,7 @@ public abstract class ScreenMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "extractMenuBackgroundTexture", at = @At("HEAD"), cancellable = true)
|
||||
private static void combatant$replaceMenuBackground(GuiGraphicsExtractor context,
|
||||
private static void lovisual$replaceMenuBackground(GuiGraphicsExtractor context,
|
||||
Identifier texture,
|
||||
int x,
|
||||
int y,
|
||||
|
|
@ -60,7 +59,7 @@ public abstract class ScreenMixin {
|
|||
int height,
|
||||
CallbackInfo ci) {
|
||||
if (texture == null || context == null) return;
|
||||
if (RuntimeGate.isPanic()) return;
|
||||
|
||||
if (!Screen.MENU_BACKGROUND.equals(texture)) return;
|
||||
if (x != 0 || y != 0) return;
|
||||
|
||||
|
|
@ -79,14 +78,14 @@ public abstract class ScreenMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "shouldRunNarration", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$disableNarratorUi(CallbackInfoReturnable<Boolean> cir) {
|
||||
private void lovisual$disableNarratorUi(CallbackInfoReturnable<Boolean> cir) {
|
||||
if (!NarratorBlocker.isBlocked()) return;
|
||||
cir.setReturnValue(false);
|
||||
}
|
||||
|
||||
@Inject(method = "extractBackground(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IIF)V", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$replaceScreenBackground(GuiGraphicsExtractor context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
if (RuntimeGate.isPanic()) return;
|
||||
private void lovisual$replaceScreenBackground(GuiGraphicsExtractor context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc == null || mc.level != null) return;
|
||||
MainConfig cfg = MainConfig.get();
|
||||
|
|
@ -99,7 +98,7 @@ public abstract class ScreenMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "extractBackground(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IIF)V", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$noRender$cancelDarkening(GuiGraphicsExtractor context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
private void lovisual$noRender$cancelDarkening(GuiGraphicsExtractor context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
NoRender module = Modules.get(NoRender.class);
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (module != null && mc != null && mc.level != null && module.screenDarkeningDisabled()) {
|
||||
|
|
@ -108,7 +107,7 @@ public abstract class ScreenMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "extractTransparentBackground(Lnet/minecraft/client/gui/GuiGraphicsExtractor;)V", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$noRender$cancelInGameBackground(GuiGraphicsExtractor context, CallbackInfo ci) {
|
||||
private void lovisual$noRender$cancelInGameBackground(GuiGraphicsExtractor context, CallbackInfo ci) {
|
||||
NoRender module = Modules.get(NoRender.class);
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (module != null && mc != null && mc.level != null && module.screenDarkeningDisabled()) {
|
||||
|
|
@ -117,8 +116,8 @@ public abstract class ScreenMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "extractPanorama", at = @At("HEAD"), cancellable = true, require = 0)
|
||||
private void combatant$replaceTitlePanorama(GuiGraphicsExtractor context, float delta, CallbackInfo ci) {
|
||||
if (RuntimeGate.isPanic()) return;
|
||||
private void lovisual$replaceTitlePanorama(GuiGraphicsExtractor context, float delta, CallbackInfo ci) {
|
||||
|
||||
Screen self = (Screen) (Object) this;
|
||||
if (!(self instanceof TitleScreen)) return;
|
||||
|
||||
|
|
@ -135,25 +134,25 @@ public abstract class ScreenMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "extractRenderStateWithTooltipAndSubtitles(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IIF)V", at = @At("HEAD"))
|
||||
private void combatant$beginButtonQueue(GuiGraphicsExtractor ctx, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
private void lovisual$beginButtonQueue(GuiGraphicsExtractor ctx, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
BetterButtons.beginFrame(ctx);
|
||||
}
|
||||
|
||||
@Inject(method = "extractRenderStateWithTooltipAndSubtitles(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IIF)V", at = @At("HEAD"))
|
||||
private void combatant$phaseScreenHead(GuiGraphicsExtractor ctx, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
private void lovisual$phaseScreenHead(GuiGraphicsExtractor ctx, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
Screen self = (Screen) (Object) this;
|
||||
String label = "2d:screen:" + self.getClass().getSimpleName();
|
||||
CombatantRenderSystem.ensureFrameContext();
|
||||
combatant$screenPhaseScope = CombatantRenderSystem.phase(RenderPhase.SCREEN, label);
|
||||
LoVisualRenderSystem.ensureFrameContext();
|
||||
lovisual$screenPhaseScope = LoVisualRenderSystem.phase(RenderPhase.SCREEN, label);
|
||||
}
|
||||
|
||||
@Inject(method = "extractRenderStateWithTooltipAndSubtitles(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IIF)V", at = @At("RETURN"))
|
||||
private void combatant$phaseScreenTail(GuiGraphicsExtractor ctx, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
private void lovisual$phaseScreenTail(GuiGraphicsExtractor ctx, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
Screen self = (Screen) (Object) this;
|
||||
String label = "2d:screen:" + self.getClass().getSimpleName();
|
||||
if (combatant$screenPhaseScope != null) {
|
||||
combatant$screenPhaseScope.close();
|
||||
combatant$screenPhaseScope = null;
|
||||
if (lovisual$screenPhaseScope != null) {
|
||||
lovisual$screenPhaseScope.close();
|
||||
lovisual$screenPhaseScope = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -33,7 +33,7 @@ public class ServerboundUseItemPacketMixin {
|
|||
private float xRot;
|
||||
|
||||
@Inject(method = "<init>(Lnet/minecraft/world/InteractionHand;IFF)V", at = @At("RETURN"))
|
||||
private void combatant$applyRotation(InteractionHand hand, int sequence, float yaw, float pitch, CallbackInfo ci) {
|
||||
private void lovisual$applyRotation(InteractionHand hand, int sequence, float yaw, float pitch, CallbackInfo ci) {
|
||||
Rotation rotation = RotationManager.INSTANCE.getCurrentRotation();
|
||||
if (rotation == null) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -25,7 +25,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import dev.loki.lovisual.mixins.accessors.ShaderLoaderDefinitionsAccessor;
|
||||
import dev.loki.lovisual.mixins.accessors.ShaderSourceKeyAccessor;
|
||||
import dev.loki.lovisual.render.engine.shader.CombatantShaderSources;
|
||||
import dev.loki.lovisual.render.engine.shader.LoVisualShaderSources;
|
||||
import dev.loki.lovisual.render.iris.IrisCompatibilityGuards;
|
||||
import dev.loki.lovisual.util.logging.DebugLog;
|
||||
import dev.loki.lovisual.util.resources.RenderResourceReadiness;
|
||||
|
|
@ -38,37 +38,37 @@ import java.util.Map;
|
|||
@Mixin(ShaderManager.class)
|
||||
public abstract class ShaderLoaderMixin {
|
||||
@Unique
|
||||
private static final Identifier COMBATANT_ENTITY_VERTEX = Identifier.fromNamespaceAndPath("lovisual", "shaders/core/entity_dither.vsh");
|
||||
private static final Identifier LOVISUAL_ENTITY_VERTEX = Identifier.fromNamespaceAndPath("lovisual", "shaders/core/entity_dither.vsh");
|
||||
@Unique
|
||||
private static final Identifier COMBATANT_ENTITY_FRAGMENT = Identifier.fromNamespaceAndPath("lovisual", "shaders/core/entity_dither.fsh");
|
||||
private static final Identifier LOVISUAL_ENTITY_FRAGMENT = Identifier.fromNamespaceAndPath("lovisual", "shaders/core/entity_dither.fsh");
|
||||
@Unique
|
||||
private static final Identifier VANILLA_ENTITY_ID = Identifier.withDefaultNamespace("core/entity");
|
||||
@Unique
|
||||
private static boolean combatant$loggedEntityOverride;
|
||||
private static boolean lovisual$loggedEntityOverride;
|
||||
@Unique
|
||||
private static boolean combatant$loggedExtendedShaderSources;
|
||||
private static boolean lovisual$loggedExtendedShaderSources;
|
||||
@Unique
|
||||
private static boolean combatant$loggedShaderLoadError;
|
||||
private static boolean lovisual$loggedShaderLoadError;
|
||||
@Unique
|
||||
private static Constructor<?> combatant$shaderSourceKeyConstructor;
|
||||
private static Constructor<?> lovisual$shaderSourceKeyConstructor;
|
||||
|
||||
@Unique
|
||||
private static int combatant$shaderLoadFailCount;
|
||||
private static int lovisual$shaderLoadFailCount;
|
||||
|
||||
@WrapOperation(
|
||||
method = "prepare",
|
||||
at = @At(value = "INVOKE",
|
||||
target = "Lnet/minecraft/client/renderer/ShaderManager;loadShader(Lnet/minecraft/resources/Identifier;Lnet/minecraft/server/packs/resources/Resource;Lcom/mojang/blaze3d/shaders/ShaderType;Ljava/util/Map;Lcom/google/common/collect/ImmutableMap$Builder;)V")
|
||||
)
|
||||
private static void combatant$wrapLoadShader(Identifier id, Resource resource, ShaderType type,
|
||||
private static void lovisual$wrapLoadShader(Identifier id, Resource resource, ShaderType type,
|
||||
Map<?, ?> allResources, ImmutableMap.Builder<?, ?> builder,
|
||||
Operation<Void> original) {
|
||||
try {
|
||||
original.call(id, resource, type, allResources, builder);
|
||||
} catch (Throwable t) {
|
||||
combatant$shaderLoadFailCount++;
|
||||
if (!combatant$loggedShaderLoadError) {
|
||||
combatant$loggedShaderLoadError = true;
|
||||
lovisual$shaderLoadFailCount++;
|
||||
if (!lovisual$loggedShaderLoadError) {
|
||||
lovisual$loggedShaderLoadError = true;
|
||||
DebugLog.error("[Shader] Failed to load shader", t);
|
||||
}
|
||||
DebugLog.warn("[Shader] Skipping shader {}: {}", id, t.getMessage());
|
||||
|
|
@ -76,8 +76,8 @@ public abstract class ShaderLoaderMixin {
|
|||
}
|
||||
|
||||
@Unique
|
||||
private static boolean combatant$addExtendedShaderSources(ResourceManager resourceManager, Map<Object, String> shaderSources) {
|
||||
Map<Identifier, Resource> resources = resourceManager.listResources("shaders", CombatantShaderSources::isCombatantExtendedSource);
|
||||
private static boolean lovisual$addExtendedShaderSources(ResourceManager resourceManager, Map<Object, String> shaderSources) {
|
||||
Map<Identifier, Resource> resources = resourceManager.listResources("shaders", LoVisualShaderSources::isLoVisualExtendedSource);
|
||||
if (resources.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -85,30 +85,30 @@ public abstract class ShaderLoaderMixin {
|
|||
int added = 0;
|
||||
for (Map.Entry<Identifier, Resource> entry : resources.entrySet()) {
|
||||
Identifier resourceId = entry.getKey();
|
||||
ShaderType type = CombatantShaderSources.typeByLocation(resourceId);
|
||||
ShaderType type = LoVisualShaderSources.typeByLocation(resourceId);
|
||||
if (type == null) continue;
|
||||
|
||||
String source = CombatantShaderSources.load(resourceManager, resourceId, entry.getValue());
|
||||
shaderSources.put(combatant$newShaderSourceKey(resourceId, type), source);
|
||||
String source = LoVisualShaderSources.load(resourceManager, resourceId, entry.getValue());
|
||||
shaderSources.put(lovisual$newShaderSourceKey(resourceId, type), source);
|
||||
added++;
|
||||
|
||||
Identifier canonicalId = CombatantShaderSources.canonicalShaderId(resourceId);
|
||||
Identifier canonicalId = LoVisualShaderSources.canonicalShaderId(resourceId);
|
||||
if (!canonicalId.equals(resourceId)) {
|
||||
shaderSources.put(combatant$newShaderSourceKey(canonicalId, type), source);
|
||||
shaderSources.put(lovisual$newShaderSourceKey(canonicalId, type), source);
|
||||
added++;
|
||||
}
|
||||
}
|
||||
|
||||
if (added > 0 && !combatant$loggedExtendedShaderSources) {
|
||||
combatant$loggedExtendedShaderSources = true;
|
||||
DebugLog.renderThread("[ShaderSource] registered Combatant .vert/.frag sources in ShaderManager: " + added + " keys");
|
||||
if (added > 0 && !lovisual$loggedExtendedShaderSources) {
|
||||
lovisual$loggedExtendedShaderSources = true;
|
||||
DebugLog.renderThread("[ShaderSource] registered LoVisual .vert/.frag sources in ShaderManager: " + added + " keys");
|
||||
}
|
||||
return added > 0;
|
||||
}
|
||||
|
||||
@Unique
|
||||
private static boolean combatant$allowVanillaEntityShaderOverride() {
|
||||
if (IrisCompatibilityGuards.suppressCombatantTerrainShaderOverrides()) {
|
||||
private static boolean lovisual$allowVanillaEntityShaderOverride() {
|
||||
if (IrisCompatibilityGuards.suppressLoVisualTerrainShaderOverrides()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -116,12 +116,12 @@ public abstract class ShaderLoaderMixin {
|
|||
}
|
||||
|
||||
@Unique
|
||||
private static boolean combatant$applyEntityOverride(ResourceManager resourceManager, Map<Object, String> shaderSources) {
|
||||
String entityFragmentSrc = combatant$loadShaderSource(resourceManager, COMBATANT_ENTITY_FRAGMENT);
|
||||
String entityVertexSrc = combatant$loadShaderSource(resourceManager, COMBATANT_ENTITY_VERTEX);
|
||||
if (((entityFragmentSrc == null || entityFragmentSrc.isEmpty()) || (entityVertexSrc == null || entityVertexSrc.isEmpty())) && !combatant$loggedEntityOverride) {
|
||||
combatant$loggedEntityOverride = true;
|
||||
DebugLog.warn("[ShaderOverride] entity fade override skipped: combatant entity_dither shader missing");
|
||||
private static boolean lovisual$applyEntityOverride(ResourceManager resourceManager, Map<Object, String> shaderSources) {
|
||||
String entityFragmentSrc = lovisual$loadShaderSource(resourceManager, LOVISUAL_ENTITY_FRAGMENT);
|
||||
String entityVertexSrc = lovisual$loadShaderSource(resourceManager, LOVISUAL_ENTITY_VERTEX);
|
||||
if (((entityFragmentSrc == null || entityFragmentSrc.isEmpty()) || (entityVertexSrc == null || entityVertexSrc.isEmpty())) && !lovisual$loggedEntityOverride) {
|
||||
lovisual$loggedEntityOverride = true;
|
||||
DebugLog.warn("[ShaderOverride] entity fade override skipped: lovisual entity_dither shader missing");
|
||||
}
|
||||
|
||||
if ((entityFragmentSrc == null || entityFragmentSrc.isEmpty()) || (entityVertexSrc == null || entityVertexSrc.isEmpty())) {
|
||||
|
|
@ -133,46 +133,46 @@ public abstract class ShaderLoaderMixin {
|
|||
|
||||
for (Map.Entry<Object, String> entry : shaderSources.entrySet()) {
|
||||
Object key = entry.getKey();
|
||||
if (entityVertexSrc != null && !entityVertexSrc.isEmpty() && combatant$isEntityVertexKey(key)) {
|
||||
if (entityVertexSrc != null && !entityVertexSrc.isEmpty() && lovisual$isEntityVertexKey(key)) {
|
||||
entry.setValue(entityVertexSrc);
|
||||
entityVertexChanged = true;
|
||||
continue;
|
||||
}
|
||||
if (entityFragmentSrc != null && !entityFragmentSrc.isEmpty() && combatant$isEntityFragmentKey(key)) {
|
||||
if (entityFragmentSrc != null && !entityFragmentSrc.isEmpty() && lovisual$isEntityFragmentKey(key)) {
|
||||
entry.setValue(entityFragmentSrc);
|
||||
entityFragmentChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ((!entityFragmentChanged || !entityVertexChanged) && !combatant$loggedEntityOverride) {
|
||||
combatant$loggedEntityOverride = true;
|
||||
if ((!entityFragmentChanged || !entityVertexChanged) && !lovisual$loggedEntityOverride) {
|
||||
lovisual$loggedEntityOverride = true;
|
||||
DebugLog.warn("[ShaderOverride] entity fade override skipped: entity shader key not found");
|
||||
}
|
||||
|
||||
if (entityFragmentChanged && entityVertexChanged && !combatant$loggedEntityOverride) {
|
||||
combatant$loggedEntityOverride = true;
|
||||
DebugLog.renderThread("[ShaderOverride] override applied: core/entity -> combatant entity_dither");
|
||||
if (entityFragmentChanged && entityVertexChanged && !lovisual$loggedEntityOverride) {
|
||||
lovisual$loggedEntityOverride = true;
|
||||
DebugLog.renderThread("[ShaderOverride] override applied: core/entity -> lovisual entity_dither");
|
||||
}
|
||||
|
||||
return entityFragmentChanged || entityVertexChanged;
|
||||
}
|
||||
|
||||
@Unique
|
||||
private static boolean combatant$isEntityFragmentKey(Object key) {
|
||||
private static boolean lovisual$isEntityFragmentKey(Object key) {
|
||||
if (!(key instanceof ShaderSourceKeyAccessor accessor)) return false;
|
||||
return VANILLA_ENTITY_ID.equals(accessor.combatant$getId()) && accessor.combatant$getType() == ShaderType.FRAGMENT;
|
||||
return VANILLA_ENTITY_ID.equals(accessor.lovisual$getId()) && accessor.lovisual$getType() == ShaderType.FRAGMENT;
|
||||
}
|
||||
|
||||
@Unique
|
||||
private static boolean combatant$isEntityVertexKey(Object key) {
|
||||
private static boolean lovisual$isEntityVertexKey(Object key) {
|
||||
if (!(key instanceof ShaderSourceKeyAccessor accessor)) return false;
|
||||
return VANILLA_ENTITY_ID.equals(accessor.combatant$getId()) && accessor.combatant$getType() == ShaderType.VERTEX;
|
||||
return VANILLA_ENTITY_ID.equals(accessor.lovisual$getId()) && accessor.lovisual$getType() == ShaderType.VERTEX;
|
||||
}
|
||||
|
||||
@Unique
|
||||
private static String combatant$loadShaderSource(ResourceManager resourceManager, Identifier id) {
|
||||
private static String lovisual$loadShaderSource(ResourceManager resourceManager, Identifier id) {
|
||||
try {
|
||||
return CombatantShaderSources.load(resourceManager, id);
|
||||
return LoVisualShaderSources.load(resourceManager, id);
|
||||
} catch (Exception e) {
|
||||
DebugLog.error("[ShaderOverride] read shader override failed: " + id, e);
|
||||
return null;
|
||||
|
|
@ -180,22 +180,22 @@ public abstract class ShaderLoaderMixin {
|
|||
}
|
||||
|
||||
@Unique
|
||||
private static Object combatant$newShaderSourceKey(Identifier id, ShaderType type) {
|
||||
private static Object lovisual$newShaderSourceKey(Identifier id, ShaderType type) {
|
||||
try {
|
||||
if (combatant$shaderSourceKeyConstructor == null) {
|
||||
if (lovisual$shaderSourceKeyConstructor == null) {
|
||||
Class<?> keyClass = Class.forName("net.minecraft.client.renderer.ShaderManager$ShaderSourceKey");
|
||||
Constructor<?> constructor = keyClass.getDeclaredConstructor(Identifier.class, ShaderType.class);
|
||||
constructor.setAccessible(true);
|
||||
combatant$shaderSourceKeyConstructor = constructor;
|
||||
lovisual$shaderSourceKeyConstructor = constructor;
|
||||
}
|
||||
return combatant$shaderSourceKeyConstructor.newInstance(id, type);
|
||||
return lovisual$shaderSourceKeyConstructor.newInstance(id, type);
|
||||
} catch (ReflectiveOperationException e) {
|
||||
throw new IllegalStateException("Failed to create ShaderManager shader source key for " + type + " " + id, e);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "apply", at = @At("HEAD"))
|
||||
private void combatant$beforeShaderReload(ShaderManager.Configs definitions,
|
||||
private void lovisual$beforeShaderReload(ShaderManager.Configs definitions,
|
||||
ResourceManager resourceManager,
|
||||
ProfilerFiller profiler,
|
||||
CallbackInfo ci) {
|
||||
|
|
@ -203,7 +203,7 @@ public abstract class ShaderLoaderMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "apply", at = @At("TAIL"))
|
||||
private void combatant$afterShaderReload(ShaderManager.Configs definitions,
|
||||
private void lovisual$afterShaderReload(ShaderManager.Configs definitions,
|
||||
ResourceManager resourceManager,
|
||||
ProfilerFiller profiler,
|
||||
CallbackInfo ci) {
|
||||
|
|
@ -211,24 +211,24 @@ public abstract class ShaderLoaderMixin {
|
|||
}
|
||||
|
||||
@ModifyReturnValue(method = "prepare", at = @At("RETURN"))
|
||||
private ShaderManager.Configs combatant$extendShaderSources(ShaderManager.Configs definitions,
|
||||
private ShaderManager.Configs lovisual$extendShaderSources(ShaderManager.Configs definitions,
|
||||
ResourceManager resourceManager,
|
||||
ProfilerFiller profiler) {
|
||||
ShaderLoaderDefinitionsAccessor accessor = (ShaderLoaderDefinitionsAccessor) (Object) definitions;
|
||||
Map<?, String> shaderSources = accessor.combatant$getShaderSources();
|
||||
Map<?, String> shaderSources = accessor.lovisual$getShaderSources();
|
||||
Map<Object, String> replaced = new LinkedHashMap<>(shaderSources.size() + 64);
|
||||
replaced.putAll(shaderSources);
|
||||
|
||||
boolean changed = combatant$addExtendedShaderSources(resourceManager, replaced);
|
||||
if (combatant$allowVanillaEntityShaderOverride()) {
|
||||
changed |= combatant$applyEntityOverride(resourceManager, replaced);
|
||||
boolean changed = lovisual$addExtendedShaderSources(resourceManager, replaced);
|
||||
if (lovisual$allowVanillaEntityShaderOverride()) {
|
||||
changed |= lovisual$applyEntityOverride(resourceManager, replaced);
|
||||
}
|
||||
|
||||
if (!changed) {
|
||||
return definitions;
|
||||
}
|
||||
|
||||
Map<Identifier, PostChainConfig> postChains = accessor.combatant$getPostChains();
|
||||
Map<Identifier, PostChainConfig> postChains = accessor.lovisual$getPostChains();
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
ShaderManager.Configs updated = new ShaderManager.Configs((Map) replaced, postChains);
|
||||
return updated;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -40,7 +40,7 @@ public abstract class SkyRendererMixin {
|
|||
opcode = Opcodes.GETFIELD
|
||||
)
|
||||
)
|
||||
private RenderTarget combatant$currentWorldTarget(SkyRenderer instance) {
|
||||
private RenderTarget lovisual$currentWorldTarget(SkyRenderer instance) {
|
||||
RenderTarget msaa = MsaaWorldTarget.getFramebufferOverride();
|
||||
return msaa != null ? msaa : renderTarget;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -16,18 +16,12 @@ 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 dev.loki.lovisual.features.module.Modules;
|
||||
import dev.loki.lovisual.features.module.modules.movement.NoStun;
|
||||
|
||||
@Mixin(SlimeBlock.class)
|
||||
public class SlimeBlockMixin {
|
||||
|
||||
@Inject(method = "stepOn", at = @At("HEAD"), cancellable = true)
|
||||
private void nostun$onSteppedOn(Level world, BlockPos pos, BlockState state, Entity entity, CallbackInfo ci) {
|
||||
NoStun ns = Modules.get(NoStun.class);
|
||||
if (ns == null || !ns.isEnabled()) return;
|
||||
if (!ns.isFunctionEnabled(NoStun.fnEnvBlocks())) return;
|
||||
if (!ns.isEnvBlockEnabled(NoStun.envSlime())) return;
|
||||
ci.cancel();
|
||||
// NoStun module removed; no slime-block override remains.
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -23,7 +23,7 @@ import dev.loki.lovisual.features.gui.hud.nondraggable.impl.BetterButtons;
|
|||
public abstract class SpriteIconButtonCenteredIconMixin {
|
||||
|
||||
@Inject(method = "extractContents(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IIF)V", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$drawIcon(GuiGraphicsExtractor ctx, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
private void lovisual$drawIcon(GuiGraphicsExtractor ctx, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
BetterButtons buttons = BetterButtons.get();
|
||||
if (buttons == null || !buttons.useUiButtons()) return;
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -23,7 +23,7 @@ import dev.loki.lovisual.features.gui.hud.nondraggable.impl.BetterButtons;
|
|||
public abstract class SpriteIconButtonTextAndIconMixin {
|
||||
|
||||
@Inject(method = "extractContents(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IIF)V", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$drawIcon(GuiGraphicsExtractor ctx, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
private void lovisual$drawIcon(GuiGraphicsExtractor ctx, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
BetterButtons buttons = BetterButtons.get();
|
||||
if (buttons == null || !buttons.useUiButtons()) return;
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -15,14 +15,13 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import dev.loki.lovisual.features.gui.mainmenu.LoVisualMainMenuScreen;
|
||||
import dev.loki.lovisual.runtime.RuntimeGate;
|
||||
|
||||
@Mixin(TitleScreen.class)
|
||||
public abstract class TitleScreenMixin {
|
||||
|
||||
@Inject(method = "init", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$replaceTitleScreen(CallbackInfo ci) {
|
||||
if (RuntimeGate.isPanic()) return;
|
||||
private void lovisual$replaceTitleScreen(CallbackInfo ci) {
|
||||
|
||||
if (LoVisualMainMenuScreen.shouldUseVanillaTitleScreen()) return;
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc == null) return;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -20,7 +20,7 @@ import dev.loki.lovisual.features.module.modules.visuals.NoRender;
|
|||
public abstract class ToastManagerMixin {
|
||||
|
||||
@Inject(method = "addToast(Lnet/minecraft/client/gui/components/toasts/Toast;)V", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$noRender$hideToasts(Toast toast, CallbackInfo ci) {
|
||||
private void lovisual$noRender$hideToasts(Toast toast, CallbackInfo ci) {
|
||||
NoRender module = Modules.get(NoRender.class);
|
||||
if (module != null && module.hideToastHints()) {
|
||||
ci.cancel();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -23,7 +23,7 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import dev.loki.lovisual.render.engine.core.CombatantRenderSystem;
|
||||
import dev.loki.lovisual.render.engine.core.LoVisualRenderSystem;
|
||||
import dev.loki.lovisual.render.engine.rhi.backend.vulkan.clip.VulkanShapeClipBridge;
|
||||
import dev.loki.lovisual.render.engine.rhi.backend.vulkan.msaa.VulkanMsaaResolveBridge;
|
||||
import dev.loki.lovisual.render.engine.rhi.backend.vulkan.util.VulkanRenderStateBridge;
|
||||
|
|
@ -33,7 +33,7 @@ import static org.lwjgl.vulkan.VK12.*;
|
|||
@Mixin(VulkanCommandEncoder.class)
|
||||
public abstract class VulkanCommandEncoderMixin {
|
||||
@Inject(method = "createRenderPass", at = @At("HEAD"))
|
||||
private void combatant$beginVulkanRenderPassState(RenderPassDescriptor descriptor, CallbackInfoReturnable<RenderPassBackend> cir) {
|
||||
private void lovisual$beginVulkanRenderPassState(RenderPassDescriptor descriptor, CallbackInfoReturnable<RenderPassBackend> cir) {
|
||||
VulkanMsaaResolveBridge.beginRenderPass();
|
||||
VulkanRenderStateBridge.beginRenderPass(descriptor);
|
||||
}
|
||||
|
|
@ -43,7 +43,7 @@ public abstract class VulkanCommandEncoderMixin {
|
|||
method = "createRenderPass",
|
||||
at = @At(value = "INVOKE", target = "Lorg/lwjgl/vulkan/KHRDynamicRendering;vkCmdBeginRenderingKHR(Lorg/lwjgl/vulkan/VkCommandBuffer;Lorg/lwjgl/vulkan/VkRenderingInfo;)V", shift = At.Shift.BEFORE)
|
||||
)
|
||||
private void combatant$configureAttachments(RenderPassDescriptor descriptor,
|
||||
private void lovisual$configureAttachments(RenderPassDescriptor descriptor,
|
||||
CallbackInfoReturnable<RenderPassBackend> cir,
|
||||
@Local MemoryStack stack,
|
||||
@Local VkRenderingInfo renderingInfo) {
|
||||
|
|
@ -83,10 +83,10 @@ public abstract class VulkanCommandEncoderMixin {
|
|||
|
||||
|
||||
@Inject(method = "submitRenderPass", at = @At("TAIL"))
|
||||
private void combatant$endVulkanRenderPassState(CallbackInfo ci) {
|
||||
private void lovisual$endVulkanRenderPassState(CallbackInfo ci) {
|
||||
VulkanMsaaResolveBridge.finishRenderPass();
|
||||
try {
|
||||
CombatantRenderSystem.rhi().shapeClip().endRenderPass();
|
||||
LoVisualRenderSystem.rhi().shapeClip().endRenderPass();
|
||||
} catch (Throwable ignored) {
|
||||
// Render pass teardown must never make Vulkan submission fail.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -46,13 +46,13 @@ public abstract class VulkanDeviceMixin {
|
|||
private ShaderSource defaultShaderSource;
|
||||
|
||||
@Unique
|
||||
private final Map<VulkanRenderStateBridge.PipelineVariantKey, VulkanRenderPipeline> combatant$pipelineVariants = new HashMap<>();
|
||||
private final Map<VulkanRenderStateBridge.PipelineVariantKey, VulkanRenderPipeline> lovisual$pipelineVariants = new HashMap<>();
|
||||
|
||||
@Invoker("compilePipeline")
|
||||
protected abstract VulkanRenderPipeline combatant$compilePipelineVariant(RenderPipeline pipeline, ShaderSource source);
|
||||
protected abstract VulkanRenderPipeline lovisual$compilePipelineVariant(RenderPipeline pipeline, ShaderSource source);
|
||||
|
||||
@Inject(method = "<init>", at = @At("RETURN"))
|
||||
private void combatant$captureMsaaCapabilities(ShaderSource shaderSource,
|
||||
private void lovisual$captureMsaaCapabilities(ShaderSource shaderSource,
|
||||
VulkanInstance instance,
|
||||
VulkanPhysicalDevice physicalDevice,
|
||||
Set<String> enabledExtensions,
|
||||
|
|
@ -71,19 +71,19 @@ public abstract class VulkanDeviceMixin {
|
|||
| GpuTexture.USAGE_COPY_SRC
|
||||
| GpuTexture.USAGE_TEXTURE_BINDING
|
||||
| GpuTexture.USAGE_RENDER_ATTACHMENT;
|
||||
framebufferSamples &= combatant$imageSampleCounts(
|
||||
framebufferSamples &= lovisual$imageSampleCounts(
|
||||
stack,
|
||||
physicalDevice,
|
||||
GpuFormat.RGBA8_UNORM,
|
||||
VulkanConst.textureUsageToVk(textureUsage, GpuFormat.RGBA8_UNORM)
|
||||
);
|
||||
framebufferSamples &= combatant$imageSampleCounts(
|
||||
framebufferSamples &= lovisual$imageSampleCounts(
|
||||
stack,
|
||||
physicalDevice,
|
||||
GpuFormat.D32_FLOAT,
|
||||
VulkanConst.textureUsageToVk(textureUsage, GpuFormat.D32_FLOAT)
|
||||
);
|
||||
framebufferSamples &= combatant$imageSampleCounts(
|
||||
framebufferSamples &= lovisual$imageSampleCounts(
|
||||
stack,
|
||||
physicalDevice,
|
||||
GpuFormat.S8_UINT,
|
||||
|
|
@ -114,7 +114,7 @@ public abstract class VulkanDeviceMixin {
|
|||
}
|
||||
|
||||
@Unique
|
||||
private static int combatant$imageSampleCounts(MemoryStack stack,
|
||||
private static int lovisual$imageSampleCounts(MemoryStack stack,
|
||||
VulkanPhysicalDevice physicalDevice,
|
||||
GpuFormat format,
|
||||
int usage) {
|
||||
|
|
@ -132,23 +132,23 @@ public abstract class VulkanDeviceMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "getOrCompilePipeline", at = @At("HEAD"), cancellable = true)
|
||||
private void combatant$getOrCompilePipelineVariant(RenderPipeline pipeline,
|
||||
private void lovisual$getOrCompilePipelineVariant(RenderPipeline pipeline,
|
||||
CallbackInfoReturnable<VulkanRenderPipeline> cir) {
|
||||
if (!VulkanRenderStateBridge.needsPipelineVariant(pipeline)) return;
|
||||
|
||||
VulkanRenderStateBridge.PipelineVariantKey key = VulkanRenderStateBridge.pipelineVariantKey(pipeline);
|
||||
VulkanRenderPipeline variant = combatant$pipelineVariants.get(key);
|
||||
VulkanRenderPipeline variant = lovisual$pipelineVariants.get(key);
|
||||
if (variant != null) {
|
||||
cir.setReturnValue(variant);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
variant = combatant$compilePipelineVariant(pipeline, defaultShaderSource);
|
||||
variant = lovisual$compilePipelineVariant(pipeline, defaultShaderSource);
|
||||
if (variant == null || !variant.isValid()) {
|
||||
throw new IllegalStateException("Vulkan returned an invalid pipeline variant");
|
||||
}
|
||||
combatant$pipelineVariants.put(key, variant);
|
||||
lovisual$pipelineVariants.put(key, variant);
|
||||
DebugLog.stencilOnChange(
|
||||
"vulkan.pipeline.variant.compile",
|
||||
key.toString(),
|
||||
|
|
@ -173,9 +173,9 @@ public abstract class VulkanDeviceMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "clearPipelineCache", at = @At("RETURN"))
|
||||
private void combatant$clearPipelineVariants(CallbackInfo ci) {
|
||||
if (combatant$pipelineVariants.isEmpty()) return;
|
||||
for (VulkanRenderPipeline pipeline : combatant$pipelineVariants.values()) {
|
||||
private void lovisual$clearPipelineVariants(CallbackInfo ci) {
|
||||
if (lovisual$pipelineVariants.isEmpty()) return;
|
||||
for (VulkanRenderPipeline pipeline : lovisual$pipelineVariants.values()) {
|
||||
try {
|
||||
pipeline.destroy();
|
||||
} catch (Throwable t) {
|
||||
|
|
@ -188,6 +188,6 @@ public abstract class VulkanDeviceMixin {
|
|||
);
|
||||
}
|
||||
}
|
||||
combatant$pipelineVariants.clear();
|
||||
lovisual$pipelineVariants.clear();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* This file is part of the Combatant Client distribution.
|
||||
* This file is part of the LoVisual Client distribution.
|
||||
* Copyright (c) 2026 pivosos2007.
|
||||
*
|
||||
* Licensed under the GNU General Public License v3.0.
|
||||
|
|
@ -26,7 +26,7 @@ import static org.lwjgl.vulkan.VK12.*;
|
|||
@Mixin(VulkanGpuTexture.class)
|
||||
public abstract class VulkanGpuTextureMixin implements IMsaaTexture {
|
||||
@Unique
|
||||
private int combatant$samples = 1;
|
||||
private int lovisual$samples = 1;
|
||||
|
||||
/**
|
||||
* Mojang 26.2 maps render-attachment usage only for color/depth aspects. Pure S8_UINT
|
||||
|
|
@ -37,7 +37,7 @@ public abstract class VulkanGpuTextureMixin implements IMsaaTexture {
|
|||
method = "<init>",
|
||||
at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/vulkan/VulkanConst;textureUsageToVk(ILcom/mojang/blaze3d/GpuFormat;)I")
|
||||
)
|
||||
private int combatant$stencilAttachmentUsage(int usage, GpuFormat format) {
|
||||
private int lovisual$stencilAttachmentUsage(int usage, GpuFormat format) {
|
||||
int vkUsage = com.mojang.blaze3d.vulkan.VulkanConst.textureUsageToVk(usage, format);
|
||||
if (format != null && format.hasStencilAspect() && (usage & com.mojang.blaze3d.textures.GpuTexture.USAGE_RENDER_ATTACHMENT) != 0) {
|
||||
vkUsage |= VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
|
||||
|
|
@ -54,7 +54,7 @@ public abstract class VulkanGpuTextureMixin implements IMsaaTexture {
|
|||
method = "<init>",
|
||||
at = @At(value = "INVOKE", target = "Lorg/lwjgl/vulkan/VkImageSubresourceRange;aspectMask(I)Lorg/lwjgl/vulkan/VkImageSubresourceRange;")
|
||||
)
|
||||
private VkImageSubresourceRange combatant$stencilImageAspect(VkImageSubresourceRange range,
|
||||
private VkImageSubresourceRange lovisual$stencilImageAspect(VkImageSubresourceRange range,
|
||||
int original,
|
||||
VulkanDevice device,
|
||||
int usage,
|
||||
|
|
@ -75,12 +75,12 @@ public abstract class VulkanGpuTextureMixin implements IMsaaTexture {
|
|||
at = @At(value = "INVOKE", target = "Lorg/lwjgl/vulkan/VkImageCreateInfo;samples(I)Lorg/lwjgl/vulkan/VkImageCreateInfo;"),
|
||||
index = 0
|
||||
)
|
||||
private int combatant$useRequestedMsaaSamples(int original) {
|
||||
private int lovisual$useRequestedMsaaSamples(int original) {
|
||||
return VulkanRenderStateBridge.requestedTextureSamples();
|
||||
}
|
||||
|
||||
@Inject(method = "<init>", at = @At("RETURN"))
|
||||
private void combatant$rememberSamples(VulkanDevice device,
|
||||
private void lovisual$rememberSamples(VulkanDevice device,
|
||||
int usage,
|
||||
String label,
|
||||
GpuFormat format,
|
||||
|
|
@ -89,26 +89,26 @@ public abstract class VulkanGpuTextureMixin implements IMsaaTexture {
|
|||
int depthOrLayers,
|
||||
int mipLevels,
|
||||
CallbackInfo ci) {
|
||||
combatant$samples = VulkanRenderStateBridge.requestedTextureSamples();
|
||||
lovisual$samples = VulkanRenderStateBridge.requestedTextureSamples();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void combatant$setSamples(int samples) {
|
||||
combatant$samples = VulkanRenderStateBridge.normalizeSamples(samples);
|
||||
public void lovisual$setSamples(int samples) {
|
||||
lovisual$samples = VulkanRenderStateBridge.normalizeSamples(samples);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int combatant$getSamples() {
|
||||
return combatant$samples;
|
||||
public int lovisual$getSamples() {
|
||||
return lovisual$samples;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean combatant$isMsaa() {
|
||||
return combatant$samples > 1;
|
||||
public boolean lovisual$isMsaa() {
|
||||
return lovisual$samples > 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int combatant$getGlId() {
|
||||
public int lovisual$getGlId() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue