Skip to content

Commit

Permalink
Merge branch '1.20.2' into 1.20.4
Browse files Browse the repository at this point in the history
  • Loading branch information
rfresh2 committed Jul 3, 2024
2 parents ea50ef0 + d1ccd2c commit 8ac75a8
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import net.fabricmc.loom.api.LoomGradleExtensionAPI

plugins {
id("architectury-plugin") version "3.4-SNAPSHOT"
id("dev.architectury.loom") version "1.6-SNAPSHOT" apply false
id("dev.architectury.loom") version "1.7-SNAPSHOT" apply false
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
idea
}
Expand Down
2 changes: 1 addition & 1 deletion fabric/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dependencies {
modCompileOnly(libs.balm.fabric)
modCompileOnly(libs.fabric.waystones)
modRuntimeOnly(libs.immediatelyfast)
modRuntimeOnly(libs.modmenu)
modImplementation(libs.modmenu)
modCompileOnly(libs.sodium)
// modRuntimeOnly(libs.fpsdisplay)
modRuntimeOnly(libs.cloth.config.fabric) {
Expand Down
4 changes: 4 additions & 0 deletions fabric/src/main/java/xaeroplus/fabric/XaeroPlusFabric.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.fabricmc.loader.api.Version;
import net.minecraft.client.KeyMapping;
import net.minecraft.client.Minecraft;
import xaeroplus.Globals;
Expand Down Expand Up @@ -39,6 +40,9 @@ public void onInitializeClient() {
// needed as we can either accept Xaero's Minimap or BetterPVP but can't describe this in the fabric.mod.json
var versionCheckResult = MinimapBaseVersionCheck.versionCheck();
if (versionCheckResult.minimapCompatible()) return;
XaeroPlus.LOGGER.error("Incompatible Xaero Minimap version detected! Expected: {} Actual: {}",
versionCheckResult.expectedVersion().getFriendlyString(),
versionCheckResult.anyPresentMinimapVersion().map(Version::getFriendlyString).orElse("None!"));
var anyPresentVersion = versionCheckResult.minimapVersion().or(versionCheckResult::betterPvpVersion);
Minecraft.getInstance().setScreen(
new IncompatibleMinimapWarningScreen(anyPresentVersion, versionCheckResult.expectedVersion()));
Expand Down
13 changes: 13 additions & 0 deletions fabric/src/main/java/xaeroplus/fabric/XaeroPlusModMenu.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package xaeroplus.fabric;

import com.terraformersmc.modmenu.api.ConfigScreenFactory;
import com.terraformersmc.modmenu.api.ModMenuApi;
import xaero.map.gui.GuiWorldMapSettings;
import xaeroplus.feature.extensions.GuiXaeroPlusWorldMapSettings;

public class XaeroPlusModMenu implements ModMenuApi {
@Override
public ConfigScreenFactory<?> getModConfigScreenFactory() {
return screen -> new GuiXaeroPlusWorldMapSettings(new GuiWorldMapSettings(screen), screen);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ public String getRefMapperConfig() {
public boolean shouldApplyMixin(final String targetClassName, final String mixinClassName) {
if (FabricLoader.getInstance().getEnvironmentType() != EnvType.CLIENT) return true;
if (versionCheckResult.minimapCompatible()) return true;
return !mixinClassName.startsWith("xaeroplus");
if (mixinClassName.startsWith("xaeroplus")) {
return mixinClassName.contains("MixinMinecraftClientFabric");
} else {
return true;
}
}

@Override
Expand Down
3 changes: 3 additions & 0 deletions fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
"entrypoints": {
"client": [
"xaeroplus.fabric.XaeroPlusFabric"
],
"modmenu": [
"xaeroplus.fabric.XaeroPlusModMenu"
]
},
"mixins": [
Expand Down
3 changes: 0 additions & 3 deletions forge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ loom {
mixinConfigs.set(listOf("xaeroplus.mixins.json", "xaeroplus-forge.mixins.json"))
convertAccessWideners = true
extraAccessWideners.add(loom.accessWidenerPath.get().asFile.name)
mixin {
defaultRefmapName.set("xaeroplus-refmap.json")
}
}
runs {
getByName("client") {
Expand Down
8 changes: 8 additions & 0 deletions forge/src/main/java/xaeroplus/forge/XaeroPlusForge.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@
import net.minecraft.client.KeyMapping;
import net.minecraft.commands.CommandSourceStack;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.ConfigScreenHandler;
import net.minecraftforge.client.event.RegisterClientCommandsEvent;
import net.minecraftforge.client.event.RegisterKeyMappingsEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import xaero.map.gui.GuiWorldMapSettings;
import xaeroplus.Globals;
import xaeroplus.XaeroPlus;
import xaeroplus.feature.extensions.GuiXaeroPlusWorldMapSettings;
import xaeroplus.module.ModuleManager;
import xaeroplus.settings.XaeroPlusSettingRegistry;
import xaeroplus.settings.XaeroPlusSettingsReflectionHax;
Expand All @@ -39,6 +43,10 @@ public XaeroPlusForge() {
FORGE_EVENT_BUS.addListener(this::onRegisterClientCommandsEvent);
FORGE_EVENT_BUS.register(modEventBus);
RemovalCause explicit = RemovalCause.EXPLICIT; // force class load to stop forge shitting itself at runtime??
ModLoadingContext.get().registerExtensionPoint(
ConfigScreenHandler.ConfigScreenFactory.class,
() -> new ConfigScreenHandler.ConfigScreenFactory((mc, screen) -> new GuiXaeroPlusWorldMapSettings(new GuiWorldMapSettings(screen), screen))
);
};
});
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down
8 changes: 8 additions & 0 deletions neo/src/main/java/xaeroplus/neo/XaeroPlusNeo.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@
import net.minecraft.client.KeyMapping;
import net.minecraft.commands.CommandSourceStack;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.ModLoadingContext;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
import net.neoforged.fml.loading.FMLEnvironment;
import net.neoforged.neoforge.client.ConfigScreenHandler;
import net.neoforged.neoforge.client.event.RegisterClientCommandsEvent;
import net.neoforged.neoforge.client.event.RegisterKeyMappingsEvent;
import net.neoforged.neoforge.common.NeoForge;
import xaero.map.gui.GuiWorldMapSettings;
import xaeroplus.Globals;
import xaeroplus.XaeroPlus;
import xaeroplus.feature.extensions.GuiXaeroPlusWorldMapSettings;
import xaeroplus.module.ModuleManager;
import xaeroplus.settings.XaeroPlusSettingRegistry;
import xaeroplus.settings.XaeroPlusSettingsReflectionHax;
Expand All @@ -30,6 +34,10 @@ public XaeroPlusNeo(IEventBus modEventBus) {
FORGE_EVENT_BUS.addListener(this::onRegisterClientCommandsEvent);
// FORGE_EVENT_BUS.register(modEventBus);
RemovalCause explicit = RemovalCause.EXPLICIT; // force class load to stop forge shitting itself at runtime??
ModLoadingContext.get().registerExtensionPoint(
ConfigScreenHandler.ConfigScreenFactory.class,
() -> new ConfigScreenHandler.ConfigScreenFactory((mc, screen) -> new GuiXaeroPlusWorldMapSettings(new GuiWorldMapSettings(screen), screen))
);
}
}

Expand Down
4 changes: 2 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ dependencyResolutionManagement {
library("minimap-fabric", "maven.modrinth:xaeros-minimap:${gradle.extra.get("minimap_version_fabric")}_Fabric_${gradle.extra.get("minecraft_version")}")
library("minimap-forge", "maven.modrinth:xaeros-minimap:${gradle.extra.get("minimap_version_forge")}_Forge_${gradle.extra.get("minecraft_version")}")
library("minimap-neo", "maven.modrinth:xaeros-minimap:${gradle.extra.get("minimap_version_neo")}_NeoForge_${gradle.extra.get("minecraft_version")}")
library("mixinextras-common", "io.github.llamalad7:mixinextras-common:0.3.5")
library("mixinextras-forge", "io.github.llamalad7:mixinextras-forge:0.3.5")
library("mixinextras-common", "io.github.llamalad7:mixinextras-common:0.3.6")
library("mixinextras-forge", "io.github.llamalad7:mixinextras-forge:0.3.6")
library("caffeine", "com.github.ben-manes.caffeine:caffeine:3.1.8")
library("lambdaEvents", "net.lenni0451:LambdaEvents:2.4.2")
library("waystones-fabric", "maven.modrinth:waystones:16.0.5+fabric-1.20.4")
Expand Down

0 comments on commit 8ac75a8

Please sign in to comment.