diff --git a/common/src/main/java/xaeroplus/feature/render/highlights/ChunkHighlightDatabase.java b/common/src/main/java/xaeroplus/feature/render/highlights/ChunkHighlightDatabase.java index c16008ba..72fb1837 100644 --- a/common/src/main/java/xaeroplus/feature/render/highlights/ChunkHighlightDatabase.java +++ b/common/src/main/java/xaeroplus/feature/render/highlights/ChunkHighlightDatabase.java @@ -65,10 +65,6 @@ private void createMetadataTable() { private void createHighlightsTableIfNotExists(ResourceKey dimension) { try (var statement = connection.createStatement()) { statement.executeUpdate("CREATE TABLE IF NOT EXISTS \"" + getTableName(dimension) + "\" (x INTEGER, z INTEGER, foundTime INTEGER)"); - - // cleanup oopsie typo in 2.15 v0 to v1 migration - statement.executeUpdate("DROP INDEX IF EXISTS \"unique_xz" + getTableName(dimension) + "\""); - statement.executeUpdate("CREATE UNIQUE INDEX IF NOT EXISTS \"unique_xz_" + getTableName(dimension) + "\" ON \"" + getTableName(dimension) + "\" (x, z)"); } catch (Exception e) { XaeroPlus.LOGGER.error("Error creating highlights table for db: {} in dimension: {}", databaseName, dimension.location()); diff --git a/common/src/main/java/xaeroplus/mixin/client/MixinRadarRenderProvider.java b/common/src/main/java/xaeroplus/mixin/client/MixinRadarRenderProvider.java index 706199bc..68b373e8 100644 --- a/common/src/main/java/xaeroplus/mixin/client/MixinRadarRenderProvider.java +++ b/common/src/main/java/xaeroplus/mixin/client/MixinRadarRenderProvider.java @@ -4,46 +4,28 @@ 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.CallbackInfoReturnable; -import xaero.common.minimap.radar.MinimapRadarList; -import xaero.common.minimap.radar.category.setting.EntityRadarCategorySettings; import xaero.common.minimap.render.radar.element.RadarRenderContext; import xaero.common.minimap.render.radar.element.RadarRenderProvider; -import xaero.hud.HudSession; -import xaeroplus.Globals; -import xaeroplus.feature.extensions.IScreenRadarRenderContext; +import xaero.hud.minimap.element.render.MinimapElementRenderLocation; import xaeroplus.settings.Settings; -import java.util.Objects; - @Mixin(value = RadarRenderProvider.class, remap = false) public class MixinRadarRenderProvider { - - @Shadow - private MinimapRadarList currentList; - - @Inject(method = "setupContextAndGetNext(ILxaero/common/minimap/render/radar/element/RadarRenderContext;)Lnet/minecraft/world/entity/Entity;", at = @At( + @Inject(method = "setupContextAndGetNext(Lxaero/hud/minimap/element/render/MinimapElementRenderLocation;Lxaero/common/minimap/render/radar/element/RadarRenderContext;)Lnet/minecraft/world/entity/Entity;", at = @At( value = "RETURN" ), remap = true) // $REMAP - public void setupContextAndGetNextInject(final int location, final RadarRenderContext context, final CallbackInfoReturnable cir) { + public void forceEntityRadarRenderSettings(final MinimapElementRenderLocation location, final RadarRenderContext context, final CallbackInfoReturnable cir) { final Entity e = cir.getReturnValue(); - if (e instanceof Player) { - if (!Objects.equals(e, Minecraft.getInstance().player)) { - if (Settings.REGISTRY.alwaysRenderPlayerIconOnRadar.get()) { - context.icon = true; - } - if (Settings.REGISTRY.alwaysRenderPlayerWithNameOnRadar.get()) { - context.name = true; - } - } + if (!(e instanceof Player)) return; + if (e == Minecraft.getInstance().player) return; + if (Settings.REGISTRY.alwaysRenderPlayerIconOnRadar.get()) { + context.icon = true; } - - if (!((IScreenRadarRenderContext) (Object) context).isWorldMap()) { - context.nameScale = HudSession.getCurrentSession().getHudMod().getSettings().getDotNameScale() * Globals.minimapScaleMultiplier / Globals.minimapSizeMultiplier; - context.iconScale = this.currentList.getCategory().getSettingValue(EntityRadarCategorySettings.ICON_SCALE) * Globals.minimapScaleMultiplier / Globals.minimapSizeMultiplier; + if (Settings.REGISTRY.alwaysRenderPlayerWithNameOnRadar.get()) { + context.name = true; } } }