Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
persist-credentials: false

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
uses: gradle/actions/setup-gradle@v5

- name: Set up Java
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
java-version: '25'

- name: Set up Node JS
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: 22
node-version: 24

- name: Get current build number
id: build-number
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/issue-moderator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
persist-credentials: false

- name: Set Up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: 22
node-version: 24

- name: Install Dependencies
working-directory: .github/moderation
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
persist-credentials: false

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
uses: gradle/actions/setup-gradle@v5

- name: Set up Java
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
java-version: '25'

- name: Build
run: ./gradlew build

- name: Upload Artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: pull-request-build
path: build/libs/
71 changes: 33 additions & 38 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ val jij: Configuration by configurations.creating

configurations {
// include mods
modImplementation.configure {
implementation.configure {
extendsFrom(modInclude)
}
include.configure {
Expand All @@ -67,23 +67,24 @@ configurations {
dependencies {
// Fabric
minecraft(libs.minecraft)
mappings(variantOf(libs.yarn) { classifier("v2") })
modImplementation(libs.fabric.loader)
implementation(libs.fabric.loader)

val fapiVersion = libs.versions.fabric.api.get()
modInclude(fabricApi.module("fabric-api-base", fapiVersion))
modInclude(fabricApi.module("fabric-resource-loader-v1", fapiVersion))

// Compat fixes
modCompileOnly(fabricApi.module("fabric-renderer-indigo", fapiVersion))
modCompileOnly(libs.sodium) { isTransitive = false }
modCompileOnly(libs.lithium) { isTransitive = false }
modCompileOnly(libs.iris) { isTransitive = false }
modCompileOnly(libs.viafabricplus) { isTransitive = false }
modCompileOnly(libs.viafabricplus.api) { isTransitive = false }

modCompileOnly(libs.baritone)
modCompileOnly(libs.modmenu)
compileOnly(fabricApi.module("fabric-renderer-indigo", fapiVersion))
compileOnly(libs.sodium) { isTransitive = false }
compileOnly(libs.lithium) { isTransitive = false }
compileOnly(libs.iris) { isTransitive = false }
compileOnly(libs.viafabricplus) { isTransitive = false }
compileOnly(libs.viafabricplus.api) { isTransitive = false }

val localBaritone = files("../baritone-1.21.11/fabric/build/libs/baritone-fabric-${libs.versions.baritone.get()}.jar")
compileOnly(localBaritone)
runtimeOnly(localBaritone)
compileOnly(libs.modmenu)

// Libraries (JAR-in-JAR)
jij(libs.orbit)
Expand All @@ -104,8 +105,9 @@ sourceSets {
}

java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
toolchain {
languageVersion.set(JavaLanguageVersion.of(libs.versions.jdk.get().toInt()))
}

if (System.getenv("CI")?.toBoolean() == true) {
withSourcesJar()
Expand All @@ -114,32 +116,24 @@ java {
}

// Handle transitive dependencies for jar-in-jar
// Based on implementation from BaseProject by FlorianMichael/EnZaXD
// Source: https://github.com/FlorianMichael/BaseProject/blob/main/src/main/kotlin/de/florianmichael/baseproject/Fabric.kt
// Based on implementation from BaseProject by florianreuth/EnZaXD
// Source: https://github.com/florianreuth/BaseProject/blob/main/src/main/kotlin/de/florianreuth/baseproject/Fabric.kt
// Licensed under Apache License 2.0
afterEvaluate {
val jijConfig = configurations.findByName("jij") ?: return@afterEvaluate

// Dependencies to exclude from jar-in-jar
val excluded = setOf(
"org.slf4j", // Logging provided by Minecraft
"jsr305" // Compile time annotations only
)

jijConfig.incoming.resolutionResult.allDependencies.forEach { dep ->
val requested = dep.requested.displayName

if (excluded.any { requested.contains(it) }) return@forEach

val compileOnlyDep = dependencies.create(requested) {
isTransitive = false
val jijExcluded = setOf("org.slf4j", "jsr305")
listOf("jij", "implementation", "include").forEach { configName ->
configurations.named(configName).configure {
defaultDependencies {
configurations.getByName("jij").incoming.resolutionResult.allComponents
.mapNotNull { it.id as? ModuleComponentIdentifier }
.forEach { id ->
val notation = "${id.group}:${id.module}:${id.version}"
if (jijExcluded.none { notation.contains(it) }) {
add(project.dependencies.create(notation) {
isTransitive = false
})
}
}
}

val implDep = dependencies.create(compileOnlyDep)

dependencies.add("compileOnlyApi", compileOnlyDep)
dependencies.add("implementation", implDep)
dependencies.add("include", compileOnlyDep)
}
}

Expand All @@ -156,6 +150,7 @@ tasks {
"version" to project.version,
"build_number" to buildNumber,
"commit" to commit,
"jdk_version" to libs.versions.jdk.get(),
"minecraft_version" to libs.versions.minecraft.get(),
"loader_version" to libs.versions.fabric.loader.get()
)
Expand Down
31 changes: 15 additions & 16 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
[versions]
# Fabric (https://fabricmc.net/develop)
minecraft = "1.21.11"
yarn-mappings = "1.21.11+build.3"
fabric-loader = "0.18.2"
fabric-api = "0.140.0+1.21.11"
jdk = "25"
minecraft = "26.1.1"
fabric-loader = "0.18.6"
fabric-api = "0.145.2+26.1.1"

# Plugins
# Loom (https://github.com/FabricMC/fabric-loom)
loom = "1.14-SNAPSHOT"
loom = "1.15-SNAPSHOT"

# Mods
# Baritone (https://github.com/MeteorDevelopment/baritone)
baritone = "1.21.10-SNAPSHOT"
baritone = "26.1.1-SNAPSHOT"
# Sodium (https://github.com/CaffeineMC/sodium-fabric)
sodium = "mc1.21.11-0.8.0-fabric"
sodium = "mc26.1-0.8.7-fabric"
# Lithium (https://github.com/CaffeineMC/lithium-fabric)
lithium = "mc1.21.11-0.21.3-fabric"
lithium = "mc26.1.1-0.23.0-fabric"
# Iris (https://github.com/IrisShaders/Iris)
iris = "1.10.2+1.21.11-fabric"
iris = "1.10.8+26.1-fabric"
# ModMenu (https://github.com/TerraformersMC/ModMenu)
modmenu = "15.0.0"
modmenu = "18.0.0-alpha.8"
# Orbit (https://github.com/MeteorDevelopment/orbit)
orbit = "0.2.4"
# Starscript (https://github.com/MeteorDevelopment/starscript)
Expand All @@ -31,14 +31,13 @@ reflections = "0.10.2"
# Netty (https://github.com/netty/netty)
netty = "4.2.7.Final"
# ViaFabricPlus (https://github.com/ViaVersion/ViaFabricPlus)
viafabricplus = "4.4.0"
# WaybackAuthLib (https://github.com/FlorianMichael/WaybackAuthLib)
waybackauthlib = "1.0.1"
viafabricplus = "4.5.0"
# WaybackAuthLib (https://github.com/florianreuth/WaybackAuthLib)
waybackauthlib = "1.1.0"

[libraries]
# Fabric base
minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" }
yarn = { module = "net.fabricmc:yarn", version.ref = "yarn-mappings" }
fabric-loader = { module = "net.fabricmc:fabric-loader", version.ref = "fabric-loader" }

# Mods
Expand All @@ -57,7 +56,7 @@ discord-ipc = { module = "meteordevelopment:discord-ipc", version.ref = "discord
reflections = { module = "org.reflections:reflections", version.ref = "reflections" }
netty-handler-proxy = { module = "io.netty:netty-handler-proxy", version.ref = "netty" }
netty-codec-socks = { module = "io.netty:netty-codec-socks", version.ref = "netty" }
waybackauthlib = { module = "de.florianmichael:WaybackAuthLib", version.ref = "waybackauthlib" }
waybackauthlib = { module = "de.florianreuth:waybackauthlib", version.ref = "waybackauthlib" }

[plugins]
fabric-loom = { id = "fabric-loom", version.ref = "loom" }
fabric-loom = { id = "net.fabricmc.fabric-loom", version.ref = "loom" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
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-9.2.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions src/main/java/meteordevelopment/meteorclient/MeteorClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import meteordevelopment.meteorclient.addons.AddonManager;
import meteordevelopment.meteorclient.addons.MeteorAddon;
import meteordevelopment.meteorclient.events.game.OpenScreenEvent;
import meteordevelopment.meteorclient.events.meteor.KeyEvent;
import meteordevelopment.meteorclient.events.meteor.KeyInputEvent;
import meteordevelopment.meteorclient.events.meteor.MouseClickEvent;
import meteordevelopment.meteorclient.events.world.TickEvent;
import meteordevelopment.meteorclient.gui.GuiThemes;
Expand All @@ -35,9 +35,9 @@
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.metadata.ModMetadata;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.ChatScreen;
import net.minecraft.util.Identifier;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.ChatScreen;
import net.minecraft.resources.Identifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.spongepowered.asm.mixin.MixinEnvironment;
Expand All @@ -55,7 +55,7 @@ public class MeteorClient implements ClientModInitializer {
public static MeteorClient INSTANCE;
public static MeteorAddon ADDON;

public static MinecraftClient mc;
public static Minecraft mc;
public static final IEventBus EVENT_BUS = new EventBus();
public static final File FOLDER = FabricLoader.getInstance().getGameDir().resolve(MOD_ID).toFile();
public static final Logger LOG;
Expand Down Expand Up @@ -84,7 +84,7 @@ public void onInitializeClient() {
}

// Global minecraft client accessor
mc = MinecraftClient.getInstance();
mc = Minecraft.getInstance();

if (FabricLoader.getInstance().isDevelopmentEnvironment()) {
LOG.info("Force loading mixins");
Expand Down Expand Up @@ -149,14 +149,14 @@ public void onInitializeClient() {

@EventHandler
private void onTick(TickEvent.Post event) {
if (mc.currentScreen == null && mc.getOverlay() == null && KeyBinds.OPEN_COMMANDS.wasPressed()) {
if (mc.screen == null && mc.getOverlay() == null && KeyBinds.OPEN_COMMANDS.consumeClick()) {
mc.setScreen(new ChatScreen(Config.get().prefix.get(), true));
}
}

@EventHandler
private void onKey(KeyEvent event) {
if (event.action == KeyAction.Press && KeyBinds.OPEN_GUI.matchesKey(event.input)) {
private void onKey(KeyInputEvent event) {
if (event.action == KeyAction.Press && KeyBinds.OPEN_GUI.matches(event.input)) {
toggleGui();
}
}
Expand All @@ -169,7 +169,7 @@ private void onMouseClick(MouseClickEvent event) {
}

private void toggleGui() {
if (Utils.canCloseGui()) mc.currentScreen.close();
if (Utils.canCloseGui()) mc.screen.onClose();
else if (Utils.canOpenGui()) Tabs.get().getFirst().openScreen(GuiThemes.get());
}

Expand All @@ -180,21 +180,21 @@ private void toggleGui() {
@EventHandler(priority = EventPriority.LOWEST)
private void onOpenScreen(OpenScreenEvent event) {
if (event.screen instanceof WidgetScreen) {
if (!wasWidgetScreen) wasHudHiddenRoot = mc.options.hudHidden;
if (!wasWidgetScreen) wasHudHiddenRoot = mc.options.hideGui;
if (GuiThemes.get().hideHUD() || wasHudHiddenRoot) {
// Always show the MC HUD in the HUD editor screen since people like
// to align some items with the hotbar or chat
mc.options.hudHidden = !(event.screen instanceof HudEditorScreen);
mc.options.hideGui = !(event.screen instanceof HudEditorScreen);
}
} else {
if (wasWidgetScreen) mc.options.hudHidden = wasHudHiddenRoot;
wasHudHiddenRoot = mc.options.hudHidden;
if (wasWidgetScreen) mc.options.hideGui = wasHudHiddenRoot;
wasHudHiddenRoot = mc.options.hideGui;
}

wasWidgetScreen = event.screen instanceof WidgetScreen;
}

public static Identifier identifier(String path) {
return Identifier.of(MeteorClient.MOD_ID, path);
return Identifier.fromNamespaceAndPath(MeteorClient.MOD_ID, path);
}
}
Loading