Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Xaero's minimap player entity dot rendering while disabled #419

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ dependencies {
transformedModCompileOnly(rfg.deobf("curse.maven:the-lord-of-the-rings-mod-legacy-423748:4091561"))
transformedModCompileOnly(deobfNotch("https://mediafiles.forgecdn.net/files/2462/146/mod_voxelMap_1.7.0b_for_1.7.10.litemod"))
transformedModCompileOnly(rfg.deobf("curse.maven:xaeros-world-map-317780:4716737"))
transformedModCompileOnly(rfg.deobf("curse.maven:xaeros-minimap-263420:5637000"))
transformedModCompileOnly(deobf("https://forum.industrial-craft.net/core/attachment/4316-advancedsolarpanel-1-7-10-3-5-1-jar/"))
transformedModCompileOnly(rfg.deobf("curse.maven:candycraft-251118:2330488"))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,12 @@ public class FixesConfig {
@Config.RequiresMcRestart
public static boolean fixWitcheryThunderDetection;

// Xaero's Minimap
@Config.Comment("Fixes the player entity dot rendering when arrow is chosen")
@Config.DefaultBoolean(true)
@Config.RequiresMcRestart
public static boolean fixXaerosMinimapEntityDot;

// Xaero's World Map

@Config.Comment("Fix scrolling in the world map screen")
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java
Original file line number Diff line number Diff line change
Expand Up @@ -618,12 +618,17 @@ public enum Mixins {
.setPhase(Phase.LATE).setSide(Side.CLIENT).addMixinClasses("journeymap.MixinWaypointManager")
.setApplyIf(() -> FixesConfig.fixJourneymapJumpyScrolling).addTargetedMod(TargetedMod.JOURNEYMAP)),

// Xaero's Map
// Xaero's World Map
FIX_XAEROS_WORLDMAP_SCROLL(
new Builder("Fix Xaero's World Map map screen scrolling").addMixinClasses("xaeroworldmap.MixinGuiMap")
.setPhase(Phase.LATE).setSide(Side.CLIENT).setApplyIf(() -> FixesConfig.fixXaerosWorldMapScroll)
.addTargetedMod(TargetedMod.XAEROWORLDMAP).addTargetedMod(TargetedMod.LWJGL3IFY)),

// Xaero's Minimap
FIX_XAEROS_MINIMAP_ENTITYDOT(new Builder("Fix Xaero's Minimap player entity dot rendering when arrow is chosen")
.addMixinClasses("xaerominimap.MixinMinimapRenderer").setPhase(Phase.LATE).setSide(Side.CLIENT)
.setApplyIf(() -> FixesConfig.fixXaerosMinimapEntityDot).addTargetedMod(TargetedMod.XAEROMINIMAP)),

// Pam's Harvest the Nether
FIX_IGNIS_FRUIT_AABB(new Builder("Ignis Fruit").setPhase(Phase.LATE).setSide(Side.BOTH)
.addMixinClasses("harvestthenether.MixinBlockPamFruit").setApplyIf(() -> FixesConfig.fixIgnisFruitAABB)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public enum TargetedMod {
VANILLA("Minecraft", null),
VOXELMAP("VoxelMap", "com.thevoxelbox.voxelmap.litemod.VoxelMapTransformer", "voxelmap"),
WITCHERY("Witchery", null, "witchery"),
XAEROMINIMAP("Xaero's Minimap", null, "XaeroMinimap"),
XAEROWORLDMAP("Xaero's World Map", null, "XaeroWorldMap"),
ZTONES("ZTones", null, "Ztones");

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.mitchej123.hodgepodge.mixins.late.xaerominimap;

import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;

import xaero.common.minimap.MinimapProcessor;
import xaero.common.minimap.MinimapRadar;
import xaero.common.minimap.render.MinimapFBORenderer;
import xaero.common.minimap.render.MinimapRenderer;
import xaero.common.settings.ModSettings;

@Mixin(value = MinimapRenderer.class, remap = false)
public abstract class MixinMinimapRenderer {

@WrapWithCondition(
method = "renderMinimap",
at = @At(
value = "INVOKE",
target = "Lxaero/common/minimap/render/MinimapFBORenderer;renderMainEntityDot(Lxaero/common/minimap/MinimapProcessor;Lnet/minecraft/entity/player/EntityPlayer;Lnet/minecraft/entity/Entity;DDDDFLxaero/common/minimap/MinimapRadar;ZIZZZDLxaero/common/settings/ModSettings;)V"))
private boolean hodgepodge$fixPlayerDotRenderCheck(MinimapFBORenderer instance, MinimapProcessor minimap,
EntityPlayer p, Entity renderEntity, double ps, double pc, double playerX, double playerZ, float partial,
MinimapRadar minimapRadar, boolean lockedNorth, int style, boolean smooth, boolean debug, boolean cave,
double dotNameScale, ModSettings settings) {
return !lockedNorth && settings.mainEntityAs == 1;
}
}