-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hide custom subworld mm text when Prefer Waypoints enabled
- Loading branch information
Showing
3 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
common/src/main/java/xaeroplus/mixin/client/MixinBuiltInInfoDisplays.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package xaeroplus.mixin.client; | ||
|
||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation; | ||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; | ||
import com.llamalad7.mixinextras.sugar.Local; | ||
import net.minecraft.resources.ResourceKey; | ||
import net.minecraft.world.level.Level; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import xaero.common.minimap.info.BuiltInInfoDisplays; | ||
import xaero.common.minimap.info.render.compile.InfoDisplayCompiler; | ||
import xaero.hud.minimap.world.MinimapWorld; | ||
import xaeroplus.settings.XaeroPlusSettingRegistry; | ||
import xaeroplus.util.ChunkUtils; | ||
|
||
@Mixin(value = BuiltInInfoDisplays.class, remap = false) | ||
public class MixinBuiltInInfoDisplays { | ||
|
||
@WrapOperation(method = "lambda$static$13", at = @At( | ||
value = "INVOKE", | ||
target = "Lxaero/common/minimap/info/render/compile/InfoDisplayCompiler;addWords(ILjava/lang/String;)V")) | ||
private static void hideAutoSubworldInfoWhenOwAutoWaypointsEnabled(final InfoDisplayCompiler instance, final int lineWidth, final String text, final Operation<Void> original, | ||
@Local(name = "currentWorld") MinimapWorld currentWorld) { | ||
if (XaeroPlusSettingRegistry.owAutoWaypointDimension.getValue()) { | ||
ResourceKey<Level> actualDimension = ChunkUtils.getActualDimension(); | ||
if (actualDimension == Level.NETHER && currentWorld.getDimId() == Level.OVERWORLD) return; | ||
} | ||
original.call(instance, lineWidth, text); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters