Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
rfresh2 committed Oct 4, 2024
1 parent 2906541 commit 2b6e324
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 56 deletions.
2 changes: 1 addition & 1 deletion src/main/java/xaeroplus/mixin/client/MixinMapWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ public boolean fastMap(final MapWriter instance,
final Long cacheable = ChunkUtils.chunkPosToLong(chunkX, chunkZ);
final Long cacheValue = tileUpdateCache.getIfPresent(cacheable);
if (nonNull(cacheValue)) {
if (cacheValue < System.currentTimeMillis() - 250L) {
if (cacheValue < System.currentTimeMillis() - 50L) {
tileUpdateCache.put(cacheable, System.currentTimeMillis());
} else {
return false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,44 +1,16 @@
package xaeroplus.mixin.client;

import com.llamalad7.mixinextras.sugar.Local;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
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.hud.minimap.module.MinimapSession;
import xaero.hud.minimap.world.state.MinimapWorldStateUpdater;
import xaero.hud.path.XaeroPath;
import xaeroplus.settings.XaeroPlusSettingRegistry;
import xaeroplus.util.ChunkUtils;
import xaeroplus.util.DataFolderResolveUtil;

@Mixin(value = MinimapWorldStateUpdater.class, remap = false)
public class MixinMinimapWorldStateUpdater {

@Unique private int currentDim = 0;
@Shadow @Final private MinimapSession session;

@Inject(method = "update()V", at = @At(
value = "INVOKE",
target = "Lxaero/hud/minimap/world/state/MinimapWorldState;setAutoWorldPath(Lxaero/hud/path/XaeroPath;)V"
))
public void preferOwWpSetCustomPathOnDimUpdate(final CallbackInfo ci, @Local(name = "potentialAutoContainerPath") String potentialAutoWorldNode) {
if (XaeroPlusSettingRegistry.owAutoWaypointDimension.getValue()) {
int actualDimension = ChunkUtils.getActualDimension();
if (actualDimension == -1 && currentDim != actualDimension) {
XaeroPath overworldWpXaeroPath = session.getWorldState().getAutoRootContainerPath()
.resolve(session.getDimensionHelper().getDimensionDirectoryName(0))
.resolve(potentialAutoWorldNode); // todo: probably not quite correct with all multiworld configs
session.getWorldState().setCustomWorldPath(overworldWpXaeroPath);
}
}
currentDim = ChunkUtils.getActualDimension();
}

@Inject(method = "getAutoRootContainerPath(I)Lxaero/hud/path/XaeroPath;", at = @At("HEAD"), cancellable = true)
public void customDataFolderResolve(final int version, final CallbackInfoReturnable<XaeroPath> cir) {
CallbackInfoReturnable<String> customCir = new CallbackInfoReturnable<String>("a", true);
Expand Down
20 changes: 0 additions & 20 deletions src/main/java/xaeroplus/mixin/client/MixinSupportXaeroMinimap.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,6 @@ public final class XaeroPlusSettingRegistry {
ColorHelper.HighlightColor.values(),
ColorHelper.HighlightColor.GREEN,
SettingLocation.WORLD_MAP_MAIN);
public static final XaeroPlusBooleanSetting owAutoWaypointDimension = XaeroPlusBooleanSetting.create(
"Prefer Overworld Waypoints",
"setting.world_map.ow_auto_waypoint_dimension",
"setting.world_map.ow_auto_waypoint_dimension.tooltip",
true,
SettingLocation.WORLD_MAP_MAIN);
public static final XaeroPlusBooleanSetting showWaypointDistances = XaeroPlusBooleanSetting.create(
"Show Waypoint Distances",
"setting.world_map.show_waypoint_distances",
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/mixins.xaeroplus.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"MixinPixelBuffers",
"MixinRadarRenderContext",
"MixinRadarRenderProvider",
"MixinSupportXaeroMinimap",
"MixinSupportXaeroWorldmap",
"MixinWaypointReader",
"MixinWaypointsIngameRenderer",
Expand Down

0 comments on commit 2b6e324

Please sign in to comment.