Skip to content

Commit

Permalink
MM24.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rfresh2 committed Oct 31, 2024
1 parent 66d1d57 commit 52d4150
Show file tree
Hide file tree
Showing 16 changed files with 155 additions and 302 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/1.12.2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
WORLDMAP_VERSION: "1.39.0"
MINIMAP_VERSION: "24.5.0"
MINIMAP_VERSION: "24.6.1"
MINECRAFT_VERSION: "1.12.2"
MINECRAFT_VERSION_SHORT: "1.12"
MOD_LOADER: "Forge"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

env:
WORLDMAP_VERSION: "1.39.0"
MINIMAP_VERSION: "24.5.0"
MINIMAP_VERSION: "24.6.1"
MINECRAFT_VERSION: "1.12.2"
MINECRAFT_VERSION_SHORT: "1.12"
MOD_LOADER: "Forge"
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ dependencies {
jarLibs 'org.xerial:sqlite-jdbc:3.45.0.0'

implementation(fg.deobf("maven.modrinth:xaeros-world-map:1.39.0_Forge_1.12"))
implementation(fg.deobf("maven.modrinth:xaeros-minimap:24.5.0_Forge_1.12"))
implementation(fg.deobf("maven.modrinth:xaeros-minimap:24.6.1_Forge_1.12"))
implementation(fg.deobf('cabaletta:baritone-deobf-unoptimized-mcp-dev:1.2')).setChanging(true)
compileOnly(fg.deobf("curse.maven:waystones-245755:2859589"))
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/xaeroplus/XaeroPlus.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
modid = XaeroPlus.MODID,
name = XaeroPlus.NAME,
version = XaeroPlus.VERSION,
dependencies = "required:mixinbooter@[9.4,);after:xaerominimap@[24.5.0];required-after:xaeroworldmap@[1.39.0];"
dependencies = "required:mixinbooter@[9.4,);after:xaerominimap@[24.6.1];required-after:xaeroworldmap@[1.39.0];"
)
public class XaeroPlus {
public static final String MODID = "xaeroplus";
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/xaeroplus/event/ForgeEventHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import xaero.common.HudMod;
import xaero.common.minimap.waypoints.render.WaypointsIngameRenderer;
import xaero.hud.minimap.BuiltInHudModules;
import xaero.hud.minimap.Minimap;
import xaero.hud.minimap.module.MinimapSession;
import xaero.hud.minimap.waypoint.render.world.WaypointWorldRenderer;
import xaeroplus.XaeroPlus;
import xaeroplus.settings.XaeroPlusSettingRegistry;
import xaeroplus.util.CustomWaypointsIngameRenderer;
import xaeroplus.util.WaypointBeaconRenderer;

public class ForgeEventHandler {
int errorCount = 0;
Expand All @@ -20,12 +20,12 @@ public void onRenderWorldLastEvent(final RenderWorldLastEvent event) {
if (hudMod == null) return;
Minimap minimap = hudMod.getMinimap();
if (minimap == null) return;
WaypointsIngameRenderer waypointsIngameRenderer = minimap.getWaypointsIngameRenderer();
WaypointWorldRenderer waypointsIngameRenderer = minimap.getWaypointWorldRenderer();
if (waypointsIngameRenderer == null) return;
MinimapSession minimapSession = BuiltInHudModules.MINIMAP.getCurrentSession();
if (minimapSession == null) return;
try {
((CustomWaypointsIngameRenderer) waypointsIngameRenderer).renderWaypointBeacons(minimapSession, event.getContext(), event.getPartialTicks());
WaypointBeaconRenderer.INSTANCE.renderWaypointBeacons(event.getPartialTicks());
} catch (final Exception e) {
if (errorCount++ < 2) {
XaeroPlus.LOGGER.info("Error rendering waypoints", e);
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public void reloadMapFrameBuffers() {

@ModifyArg(method = "renderChunks", at = @At(
value = "INVOKE",
target = "Lxaero/common/minimap/render/MinimapFBORenderer;renderChunksToFBO(Lxaero/hud/minimap/module/MinimapSession;Lxaero/common/minimap/MinimapProcessor;Lnet/minecraft/entity/player/EntityPlayer;Lnet/minecraft/entity/Entity;Lnet/minecraft/util/math/Vec3d;DDIIFFIZZZIDDZZLnet/minecraft/client/gui/ScaledResolution;)V"
), index = 8)
target = "Lxaero/common/minimap/render/MinimapFBORenderer;renderChunksToFBO(Lxaero/hud/minimap/module/MinimapSession;Lxaero/common/minimap/MinimapProcessor;Lnet/minecraft/util/math/Vec3d;IDIFIZZIDDZLnet/minecraft/client/gui/ScaledResolution;)V"
), index = 5)
public int modifyViewW(final int viewW) {
return viewW * Globals.minimapScalingFactor;
}
Expand Down
43 changes: 19 additions & 24 deletions src/main/java/xaeroplus/mixin/client/MixinMinimapRenderer.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package xaeroplus.mixin.client;

import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.shader.Framebuffer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.math.Vec3d;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
Expand Down Expand Up @@ -46,33 +44,30 @@ public void renderMinimap(

@Redirect(method = "renderMinimap", at = @At(
value = "INVOKE",
target = "Lxaero/hud/minimap/element/render/over/MinimapElementOverMapRendererHandler;render(Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/player/EntityPlayer;Lnet/minecraft/util/math/Vec3d;DDDDZFLnet/minecraft/client/shader/Framebuffer;Lnet/minecraft/client/gui/ScaledResolution;)D"
target = "Lxaero/hud/minimap/element/render/over/MinimapElementOverMapRendererHandler;prepareRender(DDDIIIIZF)V"
))
public double editOvermapRender(final MinimapElementOverMapRendererHandler instance,
Entity renderEntity,
EntityPlayer player,
Vec3d renderPos,
double playerDimDiv,
double ps,
double pc,
double zoom,
boolean cave,
float partialTicks,
Framebuffer framebuffer,
ScaledResolution scaledRes) {
public void editOvermapRender(
final MinimapElementOverMapRendererHandler instance,
double ps,
double pc,
double zoom,
int specW,
int specH,
int halfViewW,
int halfViewH,
boolean circle,
float minimapScale) {
double customZoom = zoom / Globals.minimapScalingFactor;
return instance.render(
renderEntity,
player,
renderPos,
playerDimDiv,
instance.prepareRender(
ps,
pc,
customZoom,
cave,
partialTicks,
framebuffer,
scaledRes
specW,
specH,
halfViewW,
halfViewH,
circle,
minimapScale
);
}

Expand Down
21 changes: 0 additions & 21 deletions src/main/java/xaeroplus/mixin/client/MixinRadarRenderContext.java

This file was deleted.

35 changes: 9 additions & 26 deletions src/main/java/xaeroplus/mixin/client/MixinRadarRenderProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,28 @@
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
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 xaero.hud.minimap.element.render.MinimapElementRenderLocation;
import xaeroplus.settings.XaeroPlusSettingRegistry;
import xaeroplus.util.Globals;
import xaeroplus.util.IScreenRadarRenderContext;

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/entity/Entity;",
@Inject(method = "setupContextAndGetNext(Lxaero/hud/minimap/element/render/MinimapElementRenderLocation;Lxaero/common/minimap/render/radar/element/RadarRenderContext;)Lnet/minecraft/entity/Entity;",
at = @At(value = "RETURN"))
public void setupContextAndGetNextInject(final int location, final RadarRenderContext context, final CallbackInfoReturnable<Entity> cir) {
public void forceEntityRadarRenderSettings(final MinimapElementRenderLocation location, final RadarRenderContext context, final CallbackInfoReturnable<Entity> cir) {
final Entity e = cir.getReturnValue();
if (e instanceof EntityPlayer) {
if (!Objects.equals(e, Minecraft.getMinecraft().player)) {
if (XaeroPlusSettingRegistry.alwaysRenderPlayerIconOnRadar.getValue()) {
context.icon = true;
}
if (XaeroPlusSettingRegistry.alwaysRenderPlayerWithNameOnRadar.getValue()) {
context.name = true;
}
}
if (!(e instanceof EntityPlayer)) return;
if (e == Minecraft.getMinecraft().player) return;
if (XaeroPlusSettingRegistry.alwaysRenderPlayerIconOnRadar.getValue()) {
context.icon = true;
}

if (!((IScreenRadarRenderContext) (Object) context).isWorldMap()) {
context.nameScale = HudSession.getCurrentSession().getHudMod().getSettings().getDotNameScale() * Globals.minimapScalingFactor;
context.iconScale = this.currentList.getCategory().getSettingValue(EntityRadarCategorySettings.ICON_SCALE) * Globals.minimapScalingFactor;
if (XaeroPlusSettingRegistry.alwaysRenderPlayerWithNameOnRadar.getValue()) {
context.name = true;
}
}
}
Loading

0 comments on commit 52d4150

Please sign in to comment.