diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 98b3f6d..c1b0523 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,3 @@ -# Automatically build the project and run any configured tests for every push -# and submitted pull request. This can help catch issues that only occur on -# certain platforms or Java versions, and provides a first line of defence -# against bad commits. - name: build on: [pull_request, push] @@ -10,12 +5,11 @@ jobs: build: strategy: matrix: - # Use these Java versions java: [ - 21, # Current Java LTS & minimum supported by Minecraft + 21, # java version used since 1.20.5 ] - # and run on both Linux and Windows - os: [ubuntu-22.04] + # only linux + os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: - name: checkout repository @@ -28,12 +22,10 @@ jobs: java-version: ${{ matrix.java }} distribution: 'microsoft' - name: make gradle wrapper executable - if: ${{ runner.os != 'Windows' }} run: chmod +x ./gradlew - name: build run: ./gradlew build - name: capture build artifacts - if: ${{ runner.os == 'Linux' && matrix.java == '21' }} # Only upload artifacts built from latest java on one OS uses: actions/upload-artifact@v3 with: name: Artifacts diff --git a/build.gradle b/build.gradle index e20e0f0..87ccbb0 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '1.6-SNAPSHOT' + id 'fabric-loom' version '1.8-SNAPSHOT' id 'maven-publish' } diff --git a/gradle.properties b/gradle.properties index bb44ae8..75e0f60 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,9 +4,9 @@ org.gradle.parallel=true # Fabric Properties # check these on https://fabricmc.net/develop - minecraft_version=1.21.1 - yarn_mappings=1.21.1+build.3 - loader_version=0.16.3 + minecraft_version=1.21.3 + yarn_mappings=1.21.3+build.2 + loader_version=0.16.9 # Mod Properties mod_version = 0.4.0 @@ -14,4 +14,4 @@ org.gradle.parallel=true archives_base_name = moonlight # Dependencies - fabric_version=0.103.0+1.21.1 + fabric_version=0.107.3+1.21.3 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a80b22c..9355b41 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/main/java/me/kawaiizenbo/moonlight/module/modules/NoFall.java b/src/main/java/me/kawaiizenbo/moonlight/module/modules/NoFall.java index 2e2b160..102dc8c 100644 --- a/src/main/java/me/kawaiizenbo/moonlight/module/modules/NoFall.java +++ b/src/main/java/me/kawaiizenbo/moonlight/module/modules/NoFall.java @@ -14,6 +14,6 @@ public class NoFall extends Module @Override public void tick() { - if(mc.player.fallDistance >= 2.5) mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.OnGroundOnly(true)); + if(mc.player.fallDistance >= 2.5) mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.OnGroundOnly(true, false)); } } diff --git a/src/main/java/me/kawaiizenbo/moonlight/module/modules/Reach.java b/src/main/java/me/kawaiizenbo/moonlight/module/modules/Reach.java index 2a6a078..af245ab 100644 --- a/src/main/java/me/kawaiizenbo/moonlight/module/modules/Reach.java +++ b/src/main/java/me/kawaiizenbo/moonlight/module/modules/Reach.java @@ -23,22 +23,22 @@ public class Reach extends Module public void onEnable() { super.onEnable(); - oldBe = mc.player.getAttributeInstance(EntityAttributes.PLAYER_BLOCK_INTERACTION_RANGE).getBaseValue(); - oldEe = mc.player.getAttributeInstance(EntityAttributes.PLAYER_ENTITY_INTERACTION_RANGE).getBaseValue(); + oldBe = mc.player.getAttributeInstance(EntityAttributes.BLOCK_INTERACTION_RANGE).getBaseValue(); + oldEe = mc.player.getAttributeInstance(EntityAttributes.ENTITY_INTERACTION_RANGE).getBaseValue(); } @Override public void tick() { - mc.player.getAttributeInstance(EntityAttributes.PLAYER_BLOCK_INTERACTION_RANGE).setBaseValue(blockRange.value); - mc.player.getAttributeInstance(EntityAttributes.PLAYER_ENTITY_INTERACTION_RANGE).setBaseValue(entityRange.value); + mc.player.getAttributeInstance(EntityAttributes.BLOCK_INTERACTION_RANGE).setBaseValue(blockRange.value); + mc.player.getAttributeInstance(EntityAttributes.ENTITY_INTERACTION_RANGE).setBaseValue(entityRange.value); } @Override public void onDisable() { super.onDisable(); - mc.player.getAttributeInstance(EntityAttributes.PLAYER_BLOCK_INTERACTION_RANGE).setBaseValue(oldBe); - mc.player.getAttributeInstance(EntityAttributes.PLAYER_ENTITY_INTERACTION_RANGE).setBaseValue(oldEe); + mc.player.getAttributeInstance(EntityAttributes.BLOCK_INTERACTION_RANGE).setBaseValue(oldBe); + mc.player.getAttributeInstance(EntityAttributes.ENTITY_INTERACTION_RANGE).setBaseValue(oldEe); } } diff --git a/src/main/java/me/kawaiizenbo/moonlight/module/modules/Speed.java b/src/main/java/me/kawaiizenbo/moonlight/module/modules/Speed.java index e14ae48..385f571 100644 --- a/src/main/java/me/kawaiizenbo/moonlight/module/modules/Speed.java +++ b/src/main/java/me/kawaiizenbo/moonlight/module/modules/Speed.java @@ -20,20 +20,20 @@ public class Speed extends Module public void onEnable() { super.onEnable(); - old = mc.player.getAttributeInstance(EntityAttributes.GENERIC_MOVEMENT_SPEED).getBaseValue(); + old = mc.player.getAttributeInstance(EntityAttributes.MOVEMENT_SPEED).getBaseValue(); } @Override public void tick() { - mc.player.getAttributeInstance(EntityAttributes.GENERIC_MOVEMENT_SPEED).setBaseValue(speed.value/10d); + mc.player.getAttributeInstance(EntityAttributes.MOVEMENT_SPEED).setBaseValue(speed.value/10d); } @Override public void onDisable() { super.onDisable(); - mc.player.getAttributeInstance(EntityAttributes.GENERIC_MOVEMENT_SPEED).setBaseValue(old); + mc.player.getAttributeInstance(EntityAttributes.MOVEMENT_SPEED).setBaseValue(old); } } diff --git a/src/main/java/me/kawaiizenbo/moonlight/module/modules/Step.java b/src/main/java/me/kawaiizenbo/moonlight/module/modules/Step.java index 5b57ad4..ac115d1 100644 --- a/src/main/java/me/kawaiizenbo/moonlight/module/modules/Step.java +++ b/src/main/java/me/kawaiizenbo/moonlight/module/modules/Step.java @@ -20,19 +20,19 @@ public class Step extends Module public void onEnable() { super.onEnable(); - old = mc.player.getAttributeInstance(EntityAttributes.GENERIC_STEP_HEIGHT).getBaseValue(); + old = mc.player.getAttributeInstance(EntityAttributes.STEP_HEIGHT).getBaseValue(); } @Override public void tick() { - mc.player.getAttributeInstance(EntityAttributes.GENERIC_STEP_HEIGHT).setBaseValue(stepHeight.value); + mc.player.getAttributeInstance(EntityAttributes.STEP_HEIGHT).setBaseValue(stepHeight.value); } @Override public void onDisable() { super.onDisable(); - mc.player.getAttributeInstance(EntityAttributes.GENERIC_STEP_HEIGHT).setBaseValue(old); + mc.player.getAttributeInstance(EntityAttributes.STEP_HEIGHT).setBaseValue(old); } } diff --git a/src/main/java/me/kawaiizenbo/moonlight/ui/clickgui/CategoryPane.java b/src/main/java/me/kawaiizenbo/moonlight/ui/clickgui/CategoryPane.java index 7f5a51c..61100e6 100644 --- a/src/main/java/me/kawaiizenbo/moonlight/ui/clickgui/CategoryPane.java +++ b/src/main/java/me/kawaiizenbo/moonlight/ui/clickgui/CategoryPane.java @@ -9,6 +9,7 @@ import me.kawaiizenbo.moonlight.util.DrawUtils; import me.kawaiizenbo.moonlight.module.Module; import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.render.RenderLayer; import net.minecraft.util.Identifier; public class CategoryPane @@ -46,7 +47,7 @@ public class CategoryPane } drawContext.fill(x, y, x+width, collapsed ? y+16 : y+height, Moonlight.THEME.themedWindowBorders ? Moonlight.THEME.border.getRGB() : category.color); //drawContext.fill(x+2, y+2, x+(width-2), y+14, hovered(mouseX, mouseY) ? Moonlight.THEME.hover.getRGB() : Moonlight.THEME.background.getRGB()); - drawContext.drawGuiTexture(icon, x+2, y+2, 12, 12); + drawContext.drawGuiTexture(RenderLayer::getGuiTextured, icon, x+2, y+2, 12, 12); drawContext.drawText(textRenderer, category.name, x+16, y+4, Moonlight.THEME.headerText.getRGB(), false); if (!collapsed) { diff --git a/src/main/java/me/kawaiizenbo/moonlight/ui/hud/editor/HUDModuleButton.java b/src/main/java/me/kawaiizenbo/moonlight/ui/hud/editor/HUDModuleButton.java index 6e228d1..cd09ee1 100644 --- a/src/main/java/me/kawaiizenbo/moonlight/ui/hud/editor/HUDModuleButton.java +++ b/src/main/java/me/kawaiizenbo/moonlight/ui/hud/editor/HUDModuleButton.java @@ -5,6 +5,7 @@ import me.kawaiizenbo.moonlight.ui.hud.HUDModule; import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.render.RenderLayer; import net.minecraft.util.Identifier; public class HUDModuleButton @@ -25,7 +26,7 @@ public class HUDModuleButton this.y = y; drawContext.fill(x, y, x + width, y + height, hovered(mouseX, mouseY) ? Moonlight.THEME.hover.getRGB() : Moonlight.THEME.background.getRGB()); drawContext.drawText(textRenderer, module.name, x+2, y+2, module.enabled ? Moonlight.THEME.accent.getRGB() : Moonlight.THEME.text.getRGB(), false); - if (!module.settings.isEmpty()) drawContext.drawGuiTexture(Identifier.of("moonlight", "settings"), x+width-12, y, 12, 12); + if (!module.settings.isEmpty()) drawContext.drawGuiTexture(RenderLayer::getGuiTextured, Identifier.of("moonlight", "settings"), x+width-12, y, 12, 12); } public boolean hovered(int mouseX, int mouseY) diff --git a/src/main/java/me/kawaiizenbo/moonlight/ui/hud/editor/HUDModuleList.java b/src/main/java/me/kawaiizenbo/moonlight/ui/hud/editor/HUDModuleList.java index 7748f05..f9cfdad 100644 --- a/src/main/java/me/kawaiizenbo/moonlight/ui/hud/editor/HUDModuleList.java +++ b/src/main/java/me/kawaiizenbo/moonlight/ui/hud/editor/HUDModuleList.java @@ -8,6 +8,8 @@ import me.kawaiizenbo.moonlight.ui.hud.HUDModuleManager; import me.kawaiizenbo.moonlight.util.DrawUtils; import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.render.RenderLayer; +import net.minecraft.util.Identifier; public class HUDModuleList { @@ -40,7 +42,7 @@ public class HUDModuleList } drawContext.fill(x, y, x+width, collapsed ? y+16 : y+height, Moonlight.THEME.themedWindowBorders ? Moonlight.THEME.border.getRGB() : Moonlight.THEME.accent.getRGB()); //drawContext.fill(x+2, y+2, x+(width-2), y+14, hovered(mouseX, mouseY) ? Moonlight.THEME.hover.getRGB() : Moonlight.THEME.background.getRGB()); - drawContext.drawGuiTexture(DrawUtils.getThemedGUIIcon("hud"), x+2, y+2, 12, 12); + drawContext.drawGuiTexture(RenderLayer::getGuiTextured, DrawUtils.getThemedGUIIcon("hud"), x+2, y+2, 12, 12); drawContext.drawText(textRenderer, "HUD Modules", x+16, y+4, Moonlight.THEME.headerText.getRGB(), false); if (!collapsed) { diff --git a/src/main/java/me/kawaiizenbo/moonlight/ui/hud/modules/ArmorDisplay.java b/src/main/java/me/kawaiizenbo/moonlight/ui/hud/modules/ArmorDisplay.java index 52da48f..8c3bf83 100644 --- a/src/main/java/me/kawaiizenbo/moonlight/ui/hud/modules/ArmorDisplay.java +++ b/src/main/java/me/kawaiizenbo/moonlight/ui/hud/modules/ArmorDisplay.java @@ -24,7 +24,7 @@ public class ArmorDisplay extends HUDModule { ItemStack piece = mc.player.getInventory().getStack(i); drawContext.drawItem(piece, x, y+yOffset); - drawContext.drawItemInSlot(textRenderer, piece, x, y+yOffset); + drawContext.drawStackOverlay(textRenderer, piece, x, y+yOffset); yOffset += 16; } } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 8946d2f..d09ff4b 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -29,9 +29,9 @@ ], "depends": { - "fabricloader": ">=0.16.3", + "fabricloader": ">=0.16.9", "fabric-api": "*", - "minecraft": "~1.21.1", + "minecraft": "~1.21.3", "java": ">=21" } }