Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

Commit

Permalink
2.2 - Add ModMenu Config
Browse files Browse the repository at this point in the history
  • Loading branch information
CrossScarDev committed May 2, 2023
1 parent 5f7616b commit 00cde32
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 8 deletions.
8 changes: 8 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ repositories {
name = "Gegy"
url = "https://maven.gegy.dev"
}
maven {
name = "TerraformersMC"
url = "https://maven.terraformersmc.com/"
}
}

dependencies {
Expand All @@ -33,6 +37,10 @@ dependencies {

// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
include modImplementation("dev.lambdaurora:spruceui:${project.spruceui_version}")

modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}", {
exclude module: 'fabric-api'
}
}

base {
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ org.gradle.parallel=true
loader_version=0.14.17

# Mod Properties
mod_version = 2.1+1.19.4
mod_version = 2.2+1.19.4
maven_group = net.crossscar
archives_base_name = cshacks

# Dependencies
fabric_version=0.75.3+1.19.4
spruceui_version=4.2.0+1.19.4
modmenu_version=6.2.2
15 changes: 15 additions & 0 deletions src/main/java/net/crossscar/cshacks/CsModMenu.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package net.crossscar.cshacks;

import com.terraformersmc.modmenu.api.ConfigScreenFactory;
import com.terraformersmc.modmenu.api.ModMenuApi;

import net.crossscar.cshacks.gui.CsScreen;

public class CsModMenu implements ModMenuApi {
@Override
public ConfigScreenFactory<?> getModConfigScreenFactory() {
return parent -> {
return new CsScreen(parent);
};
}
}
7 changes: 3 additions & 4 deletions src/main/java/net/crossscar/cshacks/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;

import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.client.network.ClientPlayerEntity;

import org.lwjgl.glfw.GLFW;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -18,10 +17,10 @@ public class Main implements ClientModInitializer {

@Override
public void onInitializeClient() {
this.LOGGER.info("csHacks Client Initialized!");
Main.LOGGER.info("csHacks Client Initialized!");

ClientTickEvents.START_CLIENT_TICK.register(client -> {
PlayerEntity player = MinecraftClient.getInstance().player;
ClientPlayerEntity player = MinecraftClient.getInstance().player;

FlyHack.onUpdate(player, CsScreen.fly);
});
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/crossscar/cshacks/hacks/FlyHack.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package net.crossscar.cshacks.hacks;

import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.Vec3d;
import net.minecraft.client.network.ClientPlayerEntity;

public class FlyHack {
private static int tick = 0;

public static void onUpdate(PlayerEntity player, boolean fly) {
public static void onUpdate(ClientPlayerEntity player, boolean fly) {
if (player != null) {
if (player.getAbilities().creativeMode) {
return;
Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "cshacks",
"version": "2.1+1.19.4",
"version": "2.2+1.19.4",
"environment": "client",
"name": "csHacks",
"description": "A simple Minecraft hack client.",
Expand All @@ -19,6 +19,9 @@
"entrypoints": {
"client": [
"net.crossscar.cshacks.Main"
],
"modmenu": [
"net.crossscar.cshacks.CsModMenu"
]
},
"mixins": [
Expand Down

0 comments on commit 00cde32

Please sign in to comment.