Skip to content

Commit

Permalink
Register quickTeleport hotkey only when xaeroworldmap is loaded (Rela…
Browse files Browse the repository at this point in the history
…ted to #9)
  • Loading branch information
Hendrix-Shen committed Mar 19, 2024
1 parent a8b6703 commit e92eafd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/main/java/com/plusls/xma/config/Configs.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import top.hendrixshen.magiclib.malilib.api.annotation.Config;
import top.hendrixshen.magiclib.malilib.api.annotation.Hotkey;
import top.hendrixshen.magiclib.malilib.impl.ConfigManager;
import top.hendrixshen.magiclib.util.FabricUtil;

public class Configs {
@Config(category = ConfigCategory.GENERIC)
Expand Down Expand Up @@ -57,8 +58,10 @@ public static void init(@NotNull ConfigManager cm) {
return true;
});

quickTeleport.getKeybind().setSettings(KeybindSettings.GUI);
quickTeleport.getKeybind().setCallback(QuickTeleportUtil::teleport);
if (FabricUtil.isModLoaded("xaeroworldmap")) {
quickTeleport.getKeybind().setSettings(KeybindSettings.GUI);
quickTeleport.getKeybind().setCallback(QuickTeleportUtil::teleport);
}

cm.setValueChangeCallback("debug", option -> {
Configurator.setLevel(ModInfo.getModIdentifier(), debug ? Level.DEBUG : Level.INFO);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import xaero.common.graphics.renderer.multitexture.MultiTextureRenderTypeRendererProvider;
import xaero.common.minimap.element.render.over.MinimapElementOverMapRendererHandler;
import xaero.common.minimap.render.MinimapRendererHelper;
import xaero.minimap.XaeroMinimap;
//#else
//$$ import net.minecraft.client.Minecraft;
//#endif
Expand Down

0 comments on commit e92eafd

Please sign in to comment.