Skip to content

Commit

Permalink
MM24.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rfresh2 committed Dec 28, 2024
1 parent 302d528 commit e97b1a9
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 126 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,21 @@

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.llamalad7.mixinextras.sugar.Local;
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.*;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import xaero.common.IXaeroMinimap;
import xaero.common.graphics.CustomVertexConsumers;
import xaero.common.minimap.MinimapProcessor;
import xaero.common.minimap.radar.MinimapRadar;
import xaero.common.minimap.render.MinimapFBORenderer;
import xaero.common.minimap.render.MinimapRenderer;
import xaero.common.settings.ModSettings;
import xaero.hud.minimap.Minimap;
import xaero.hud.minimap.element.render.over.MinimapElementOverMapRendererHandler;
import xaero.hud.minimap.module.MinimapSession;
Expand Down Expand Up @@ -155,57 +153,20 @@ public void editOvermapRender(
/**
* Inspiration for the below mods came from: https://github.com/Abbie5/xaeroarrowfix
*/

@Redirect(method = "renderMinimap", at = @At(
@WrapOperation(method = "renderMinimap", at = @At(
value = "INVOKE",
target = "Lxaero/common/minimap/render/MinimapFBORenderer;renderMainEntityDot(Lnet/minecraft/client/gui/GuiGraphics;Lxaero/common/minimap/MinimapProcessor;Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/entity/Entity;DDDDFLxaero/common/minimap/radar/MinimapRadar;ZIZZZDLxaero/common/settings/ModSettings;Lnet/minecraft/client/renderer/MultiBufferSource$BufferSource;F)V"),
target = "Lxaero/common/minimap/render/MinimapFBORenderer;renderMainEntityDot(Lnet/minecraft/client/gui/GuiGraphics;Lnet/minecraft/world/entity/Entity;ZLnet/minecraft/client/renderer/MultiBufferSource$BufferSource;)V"),
remap = true) // $REMAP
public void redirectRenderMainEntityDot(final MinimapFBORenderer instance,
final GuiGraphics guiGraphics,
final MinimapProcessor minimap,
final Player p,
final Entity renderEntity,
final double ps,
final double pc,
final double playerX,
final double playerZ,
final float partial,
final MinimapRadar minimapRadar,
final boolean lockedNorth,
final int style,
final boolean smooth,
final boolean debug,
final boolean cave,
final double dotNameScale,
final ModSettings settings,
final MultiBufferSource.BufferSource renderTypeBuffers,
final float minimapScale) {
public void redirectRenderMainEntityDot(
final MinimapFBORenderer instance, final GuiGraphics guiGraphics, final Entity renderEntity, final boolean cave, final MultiBufferSource.BufferSource renderTypeBuffers, final Operation<Void> original,
@Local(name = "lockedNorth") boolean lockedNorth
) {
if (Settings.REGISTRY.fixMainEntityDot.get()) {
if (!(modMain.getSettings().mainEntityAs != 2 && !lockedNorth)) {
return;
}
}
instance.renderMainEntityDot(
guiGraphics,
minimap,
p,
renderEntity,
ps,
pc,
playerX,
playerZ,
partial,
minimapRadar,
lockedNorth,
style,
smooth,
debug,
cave,
dotNameScale,
settings,
renderTypeBuffers,
minimapScale
);
original.call(instance, guiGraphics, renderEntity, cave, renderTypeBuffers);
}

@ModifyVariable(method = "drawArrow", name = "offsetY", ordinal = 0, at = @At(value = "STORE"))
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package xaeroplus.mixin.client;

import com.llamalad7.mixinextras.sugar.Local;
import com.llamalad7.mixinextras.sugar.ref.LocalFloatRef;
import com.llamalad7.mixinextras.sugar.ref.LocalRef;
import net.minecraft.client.Minecraft;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import org.spongepowered.asm.mixin.Mixin;
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 org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import xaero.common.minimap.element.render.MinimapElementReader;
import xaero.common.minimap.element.render.MinimapElementRenderProvider;
import xaero.common.minimap.element.render.MinimapElementRenderer;
import xaero.hud.minimap.element.render.MinimapElementRenderInfo;
import xaero.hud.minimap.element.render.MinimapElementRenderLocation;
import xaero.hud.minimap.radar.render.element.RadarRenderContext;
import xaero.hud.minimap.radar.render.element.RadarRenderer;
import xaeroplus.Globals;
import xaeroplus.settings.Settings;

@Mixin(value = RadarRenderer.class, remap = false)
public abstract class MixinRadarRenderer extends MinimapElementRenderer<Entity, RadarRenderContext> {
@Shadow private boolean name;

public MixinRadarRenderer(final MinimapElementReader<Entity, RadarRenderContext> elementReader, final MinimapElementRenderProvider<Entity, RadarRenderContext> provider, final RadarRenderContext context) {
super(elementReader, provider, context);
}

@Inject(method = "setupRenderForEntity", at = @At("RETURN"),
remap = true) // $REMAP
public void forceEntityRadarRenderSettings(final Entity e, final CallbackInfo ci) {
if (!(e instanceof Player)) return;
if (e == Minecraft.getInstance().player) return;
if (Settings.REGISTRY.alwaysRenderPlayerIconOnRadar.get()) {
context.icon = true;
}
if (Settings.REGISTRY.alwaysRenderPlayerWithNameOnRadar.get()) {
this.name = true;
}
}

@Inject(method = "renderElement(Lnet/minecraft/world/entity/Entity;ZZDFDDLxaero/hud/minimap/element/render/MinimapElementRenderInfo;Lnet/minecraft/client/gui/GuiGraphics;Lnet/minecraft/client/renderer/MultiBufferSource$BufferSource;)Z", at = @At("HEAD"),
remap = true) // $REMAP
public void adjustElementScaleForMinimapScaling(final CallbackInfoReturnable<Boolean> cir, @Local(argsOnly = true) LocalRef<MinimapElementRenderInfo> renderInfoRef, @Local(argsOnly = true) LocalFloatRef optionalScaleRef) {
if (renderInfoRef.get().location == MinimapElementRenderLocation.IN_MINIMAP) {
optionalScaleRef.set(optionalScaleRef.get() * Globals.minimapScaleMultiplier);
}
}
}
3 changes: 1 addition & 2 deletions common/src/main/resources/xaeroplus.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"MixinMapWorld",
"MixinMapWriter",
"MixinMinimap",
"MixinMinimapElementMapRendererHandler",
"MixinMinimapFBORenderer",
"MixinMinimapModSettings",
"MixinMinimapOption",
Expand All @@ -57,7 +56,7 @@
"MixinModClientEvents",
"MixinOverlay",
"MixinPatreon",
"MixinRadarRenderProvider",
"MixinRadarRenderer",
"MixinSupportXaeroMinimap",
"MixinSupportXaeroWorldmap",
"MixinWaypointReader",
Expand Down
6 changes: 3 additions & 3 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ pluginManagement {
}
}
gradle.extra.apply {
set("mod_version", "2.24.9")
set("mod_version", "2.25")
set("minecraft_version", "1.20.1")
set("parchment_version", "2023.09.03")
set("worldmap_version_fabric", "1.39.2")
set("minimap_version_fabric", "24.6.1")
set("minimap_version_fabric", "24.7.1")
set("worldmap_version_forge", "1.39.2")
set("minimap_version_forge", "24.6.1")
set("minimap_version_forge", "24.7.1")
}

dependencyResolutionManagement {
Expand Down

0 comments on commit e97b1a9

Please sign in to comment.