V0.4.0 #4
13 changed files with 32 additions and 36 deletions
14
.github/workflows/build.yml
vendored
14
.github/workflows/build.yml
vendored
|
@ -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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
plugins {
|
||||
id 'fabric-loom' version '1.6-SNAPSHOT'
|
||||
id 'fabric-loom' version '1.8-SNAPSHOT'
|
||||
id 'maven-publish'
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue