Skip to content

Commit

Permalink
Updated to 1.20.1
Browse files Browse the repository at this point in the history
See Changelog.md
  • Loading branch information
arozx committed Aug 7, 2023
1 parent 3b38f17 commit 644ad67
Show file tree
Hide file tree
Showing 11 changed files with 200 additions and 134 deletions.
5 changes: 3 additions & 2 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]
## [1.0.2] - 2023-08-07

### Added

- New menu
- Slider for autoclicker value
- Re-written for 1.20.1

### Changed

Expand Down
50 changes: 22 additions & 28 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@ plugins {
version = project.mod_version
group = project.maven_group

base {
archivesName = project.archives_base_name
}

repositories {
maven { url "https://maven.shedaniel.me/" }
maven { url "https://maven.terraformersmc.com/releases/" }
maven { url 'https://maven.terraformersmc.com/' }
}

dependencies {
Expand All @@ -21,43 +16,46 @@ dependencies {
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

// Fabric API. This is technically optional, but you probably want it anyway.
// Fabric API
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

// Uncomment the following line to enable the deprecated Fabric API modules.
// These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time.

// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"

// Cloth config API
modApi "me.shedaniel.cloth:cloth-config-fabric:11.0.99"
}
// Mod menu
modImplementation "com.terraformersmc:modmenu:${project.mod_menu_version}"}

processResources {
inputs.property "version", project.version
inputs.property "minecraft_version", project.minecraft_version
inputs.property "loader_version", project.loader_version
filteringCharset "UTF-8"

filesMatching("fabric.mod.json") {
expand "version": project.version
expand "version": project.version,
"minecraft_version": project.minecraft_version,
"loader_version": project.loader_version
}
}

def targetJavaVersion = 17
tasks.withType(JavaCompile).configureEach {
it.options.release = 17
it.options.encoding = "UTF-8"
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
it.options.release = targetJavaVersion
}
}

java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
archivesBaseName = project.archives_base_name
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
rename { "${it}_${project.archivesBaseName}" }
}
}

Expand All @@ -71,9 +69,5 @@ publishing {

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}
}
18 changes: 8 additions & 10 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx11G

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.19.2
yarn_mappings=1.19.2+build.28
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.10
loader_version=0.14.21

# Mod Properties
mod_version=1.0.0
maven_group=arozx.mod
archives_base_name=arozxmod
mod_version=1.0.2
maven_group=arozxmod
archives_base_name=minecraft_hacks

# Dependencies
fabric_version=0.76.0+1.19.2
fabric_version=0.86.1+1.20.1
mod_menu_version=7.2.1
5 changes: 3 additions & 2 deletions src/main/java/arozxmod/Autoclicker.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.lwjgl.glfw.GLFW;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import arozxmod.screens.AutoclickerScreen;

import static arozxmod.ClientInitializer.count;

Expand All @@ -26,7 +27,7 @@ public class Autoclicker {
public static void onUpdate() {
assert MinecraftClient.getInstance().player != null;
if (Config.autoclickerEnabledL) {
if (Config.cpsEnabled) {
if (Config.cpsEnabled && Config.cps>0) {
if (count > 0) {
cps = 20/cps;
count--;
Expand Down Expand Up @@ -54,7 +55,7 @@ public static void onUpdate() {
}
// Right autoclicker
if (Config.autoclickerEnabledR) {
if (Config.cpsEnabled) {
if (Config.cpsEnabled && Config.cps>0) {
if (count > 0) {
count--;
} else {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/arozxmod/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ public class Config {
public static boolean autoclickerEnabledL = false;
public static boolean autoclickerEnabledR = false;
public static boolean cpsEnabled = false;
public static int cps = 20;
}
2 changes: 1 addition & 1 deletion src/main/java/arozxmod/mixin/FishingBobberEntityMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void onTrackedDataSet(TrackedData<?> data, CallbackInfo ci) {
client.interactionManager.interactItem(client.player, Hand.MAIN_HAND);

try {
Thread.sleep(1000);
Thread.sleep(2000);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
Expand Down
20 changes: 14 additions & 6 deletions src/main/java/arozxmod/mixin/GameMenuScreenMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.minecraft.client.gui.screen.GameMenuScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.text.MutableText;
import net.minecraft.text.Text;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -17,13 +18,20 @@ public abstract class GameMenuScreenMixin extends Screen {

@Inject(at = @At("HEAD"), method = "initWidgets")
private void initWidgets(CallbackInfo ci) {
this.addDrawableChild(new ButtonWidget(10, 10, 90, 20, Text.literal("Mod Menu"), (button) -> {

this.client.setScreen(new ArozxScreen(this, this.client.options));
}));
this.addDrawableChild(new ButtonWidget(10, 30, 90, 20, Text.literal("Autoclicker"), (button) -> {

this.client.setScreen(new AutoclickerScreen(this, this.client.options));
}));
addDrawableChild(ButtonWidget.builder(Text.of("Mode Menu"), button -> {
this.client.setScreen(new ArozxScreen(this, this.client.options));
}).dimensions(10, 10, 90, 20)
.position(10, 10)
.narrationSupplier((NarrationSupplier) -> (MutableText) Text.of("Toggle Setting 1"))
.build());

addDrawableChild(ButtonWidget.builder(Text.of("Autoclicker"), button -> {
this.client.setScreen(new AutoclickerScreen(this, this.client.options));
}).dimensions(10, 10, 90, 20)
.position(10, 40)
.narrationSupplier((NarrationSupplier) -> (MutableText) Text.of("Toggle Setting 1"))
.build());
}
}
91 changes: 63 additions & 28 deletions src/main/java/arozxmod/screens/ArozxScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.option.GameOptions;
import net.minecraft.screen.ScreenTexts;
import net.minecraft.text.Text;

@Environment(EnvType.CLIENT)
Expand All @@ -24,24 +23,28 @@ Text autoFishingText() {
else
return (Text.literal("Autofishing disabled"));
}

Text flyingText() {
if (Config.normalFlyingEnabled)
return (Text.literal("Flying enabled"));
else
return (Text.literal("Flying disabled"));
}

Text boatText() {
if (Config.flyingEnabled)
return (Text.literal("Boat flying enabled"));
else
return (Text.literal("Boat flying disabled"));
}

Text noFallText() {
if (Config.noFallEnabled)
return (Text.literal("No fall enabled"));
else
return (Text.literal("No fall disabled"));
}

Text nightVisionText() {
if (Config.nightVisionEnabled)
return (Text.literal("Night vision enabled"));
Expand All @@ -52,37 +55,69 @@ Text nightVisionText() {
@Override
protected void init() {
// Night vision button
this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, this.height / 6 + 6, 200, 20,
nightVisionText(), (button) -> {
Config.nightVisionEnabled = !Config.nightVisionEnabled;
button.setMessage(nightVisionText());
}));
this.addDrawableChild(
ButtonWidget.builder(
nightVisionText(), button -> {
Config.nightVisionEnabled = !Config.nightVisionEnabled;
button.setMessage(nightVisionText());
}
)
.dimensions(this.width / 2 - 102, this.height / 6 + 24, 204, 20)
.build());

// Autofishing button
this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, this.height / 6 + 34, 200, 20,
autoFishingText(), (button) -> {
Config.autoFishingEnabled = !Config.autoFishingEnabled;
button.setMessage(autoFishingText());
}));
this.addDrawableChild(
ButtonWidget.builder(
autoFishingText(), button -> {
Config.autoFishingEnabled = !Config.autoFishingEnabled;
button.setMessage(autoFishingText());
}
)
.dimensions(this.width / 2 - 102, this.height / 6 + 52, 204, 20)
.build());

// Flying button
this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, this.height / 6 + 62, 200, 20,
flyingText(), (button) -> {
Config.normalFlyingEnabled = !Config.normalFlyingEnabled;
button.setMessage(flyingText());
}));
this.addDrawableChild(
ButtonWidget.builder(
flyingText(), button -> {
Config.normalFlyingEnabled = !Config.normalFlyingEnabled;
button.setMessage(flyingText());
}
)
.dimensions(this.width / 2 - 102, this.height / 6 + 80, 204, 20)
.build());

// Boat flying button
this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, this.height / 6 + 90, 200, 20,
boatText(), (button) -> {
Config.flyingEnabled = !Config.flyingEnabled;
button.setMessage(boatText());
}));
this.addDrawableChild(
ButtonWidget.builder(
boatText(), button -> {
Config.flyingEnabled = !Config.flyingEnabled;
button.setMessage(boatText());
}
)
.dimensions(this.width / 2 - 102, this.height / 6 + 108, 204, 20)
.build());

// No fall button
this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, this.height / 6 + 118, 200, 20,
noFallText(), (button) -> {
Config.noFallEnabled = !Config.noFallEnabled;
button.setMessage(noFallText());
}));
this.addDrawableChild(
ButtonWidget.builder(
noFallText(), button -> {
Config.noFallEnabled = !Config.noFallEnabled;
button.setMessage(noFallText());
}
)
.dimensions(this.width / 2 - 102, this.height / 6 + 136, 204, 20)
.build());

// Back button
this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, this.height / 6 + 174, 200, 20,
ScreenTexts.BACK, (button) -> this.client.setScreen(this.parent)));
this.addDrawableChild(
ButtonWidget.builder(
Text.of("Back"), button -> {
this.client.setScreen(this.parent);
clearAndInit();
}
)
.dimensions(this.width / 2 - 102, this.height / 6 + 174, 204, 20)
.build());
}
}
Loading

0 comments on commit 644ad67

Please sign in to comment.