1.21 update

update to 1.21, remove timer
This commit is contained in:
kawaiizenbo 2024-06-15 16:38:24 -07:00
parent c68631010d
commit 69b444c3c2
11 changed files with 36 additions and 31 deletions

View file

@ -1,10 +1,10 @@
plugins { plugins {
id 'fabric-loom' version '1.4-SNAPSHOT' id 'fabric-loom' version '1.6-SNAPSHOT'
id 'maven-publish' id 'maven-publish'
} }
sourceCompatibility = JavaVersion.VERSION_17 sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_21
archivesBaseName = project.archives_base_name archivesBaseName = project.archives_base_name
version = project.mod_version version = project.mod_version
@ -47,7 +47,7 @@ processResources {
tasks.withType(JavaCompile).configureEach { tasks.withType(JavaCompile).configureEach {
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17. // Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17 it.options.release = 21
} }
java { java {

View file

@ -4,9 +4,9 @@ org.gradle.parallel=true
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/develop # check these on https://fabricmc.net/develop
minecraft_version=1.20.4 minecraft_version=1.21
yarn_mappings=1.20.4+build.2 yarn_mappings=1.21+build.2
loader_version=0.15.1 loader_version=0.15.11
# Mod Properties # Mod Properties
mod_version = 0.2.0 mod_version = 0.2.0
@ -14,4 +14,4 @@ org.gradle.parallel=true
archives_base_name = moonlight archives_base_name = moonlight
# Dependencies # Dependencies
fabric_version=0.91.2+1.20.4 fabric_version=0.100.1+1.21

View file

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

View file

@ -34,9 +34,9 @@ public class DeathPos extends Command
} }
ChatUtils.sendMsg(ColorUtils.reset + "You last died at: " + ChatUtils.sendMsg(ColorUtils.reset + "You last died at: " +
ColorUtils.aqua + " X: " + ColorUtils.gray + pos.getPos().getX() + ColorUtils.aqua + " X: " + ColorUtils.gray + pos.pos().getX() +
ColorUtils.aqua + " Y: " + ColorUtils.gray + pos.getPos().getY() + ColorUtils.aqua + " Y: " + ColorUtils.gray + pos.pos().getY() +
ColorUtils.aqua + " Z: " + ColorUtils.gray + pos.getPos().getZ() ColorUtils.aqua + " Z: " + ColorUtils.gray + pos.pos().getZ()
); );
return SINGLE_SUCCESS; return SINGLE_SUCCESS;
}); });

View file

@ -11,18 +11,16 @@ import me.kawaiizenbo.moonlight.ui.HUDOverlay;
import me.kawaiizenbo.moonlight.ui.ModulesListOverlay; import me.kawaiizenbo.moonlight.ui.ModulesListOverlay;
import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.hud.InGameHud; import net.minecraft.client.gui.hud.InGameHud;
import net.minecraft.client.render.RenderTickCounter;
@Mixin(InGameHud.class) @Mixin(InGameHud.class)
public class InGameHudMixin { public class InGameHudMixin {
@Shadow private int scaledWidth;
@Shadow private int scaledHeight;
@Inject(at = @At("TAIL"), method = "render") @Inject(at = @At("TAIL"), method = "render")
public void onRender (DrawContext drawContext, float tickDelta, CallbackInfo info) public void onRender (DrawContext drawContext, RenderTickCounter tickCounter, CallbackInfo info)
{ {
if (ModuleManager.INSTANCE.getModuleByName("HUD").enabled) HUDOverlay.INSTANCE.render(drawContext, scaledWidth, scaledHeight); if (ModuleManager.INSTANCE.getModuleByName("HUD").enabled) HUDOverlay.INSTANCE.render(drawContext, drawContext.getScaledWindowWidth(), drawContext.getScaledWindowHeight());
if (ModuleManager.INSTANCE.getModuleByName("ModulesList").enabled) ModulesListOverlay.INSTANCE.render(drawContext, scaledWidth, scaledHeight); if (ModuleManager.INSTANCE.getModuleByName("ModulesList").enabled) ModulesListOverlay.INSTANCE.render(drawContext, drawContext.getScaledWindowWidth(), drawContext.getScaledWindowHeight());
} }
} }

View file

@ -21,8 +21,8 @@ public class ModuleManager
new ModulesList(), new ModulesList(),
new ChatSpammer(), new ChatSpammer(),
new Rotation(), new Rotation(),
new AutoJump(), new AutoJump()
new Timer() /*new Timer()*/
); );
} }

View file

@ -3,10 +3,12 @@ package me.kawaiizenbo.moonlight.module.modules;
import me.kawaiizenbo.moonlight.module.Category; import me.kawaiizenbo.moonlight.module.Category;
import me.kawaiizenbo.moonlight.module.Module; import me.kawaiizenbo.moonlight.module.Module;
import me.kawaiizenbo.moonlight.module.settings.DoubleSetting; import me.kawaiizenbo.moonlight.module.settings.DoubleSetting;
import net.minecraft.entity.attribute.EntityAttributes;
public class Step extends Module public class Step extends Module
{ {
DoubleSetting stepHeight = new DoubleSetting("Height", 1, 1, 10, 0); DoubleSetting stepHeight = new DoubleSetting("Height", 1, 1, 10, 0);
double old = 0.6;
public Step() public Step()
{ {
@ -14,16 +16,23 @@ public class Step extends Module
settings.add(stepHeight); settings.add(stepHeight);
} }
@Override
public void onEnable()
{
super.onEnable();
old = mc.player.getAttributeInstance(EntityAttributes.GENERIC_STEP_HEIGHT).getBaseValue();
}
@Override @Override
public void tick() public void tick()
{ {
mc.player.setStepHeight((float)stepHeight.value); mc.player.getAttributeInstance(EntityAttributes.GENERIC_STEP_HEIGHT).setBaseValue(stepHeight.value);
} }
@Override @Override
public void onDisable() public void onDisable()
{ {
super.onDisable(); super.onDisable();
mc.player.setStepHeight(0.6f); mc.player.getAttributeInstance(EntityAttributes.GENERIC_STEP_HEIGHT).setBaseValue(old);
} }
} }

View file

@ -19,7 +19,7 @@ public class Timer extends Module
public void onEnable() public void onEnable()
{ {
super.onEnable(); super.onEnable();
mc.renderTickCounter = new RenderTickCounter((float)(20.0*speed.value), 0L, this::targetTickRate); //mc.renderTickCounter = new RenderTickCounter((float)(20.0*speed.value), 0L, this::targetTickRate);
current = speed.value; current = speed.value;
} }
@ -33,7 +33,7 @@ public class Timer extends Module
public void onDisable() public void onDisable()
{ {
super.onDisable(); super.onDisable();
mc.renderTickCounter = new RenderTickCounter(20.0f, 0L, this::targetTickRate); //mc.renderTickCounter = new RenderTickCounter(20.0f, 0L, this::targetTickRate);
} }
public float targetTickRate(float millis) public float targetTickRate(float millis)

View file

@ -26,7 +26,7 @@ public class CategoryPane
this.y = initialY; this.y = initialY;
this.collapsed = collapsed; this.collapsed = collapsed;
moduleButtons = new ArrayList<ModuleButton>(); moduleButtons = new ArrayList<ModuleButton>();
icon = new Identifier("moonlight", category.name.toLowerCase()); icon = Identifier.of("moonlight", category.name.toLowerCase());
for (Module m : ModuleManager.INSTANCE.getModulesByCategory(category)) for (Module m : ModuleManager.INSTANCE.getModulesByCategory(category))
{ {
moduleButtons.add(new ModuleButton(m)); moduleButtons.add(new ModuleButton(m));

View file

@ -29,9 +29,9 @@
], ],
"depends": { "depends": {
"fabricloader": ">=0.15.1", "fabricloader": ">=0.15.11",
"fabric-api": "*", "fabric-api": "*",
"minecraft": "~1.20", "minecraft": "~1.21",
"java": ">=17" "java": ">=21"
} }
} }

View file

@ -1,4 +1,2 @@
accessWidener v1 named accessWidener v1 named
accessible method net/minecraft/client/gui/DrawContext fillGradient (IIIIIII)V accessible method net/minecraft/client/gui/DrawContext fillGradient (IIIIIII)V
accessible field net/minecraft/client/MinecraftClient renderTickCounter Lnet/minecraft/client/render/RenderTickCounter;
mutable field net/minecraft/client/MinecraftClient renderTickCounter Lnet/minecraft/client/render/RenderTickCounter;