Skip to content

Commit 1978c74

Browse files
committed
Merge branch 'master' into feature/taskflow
2 parents 09d037f + c5627d6 commit 1978c74

File tree

176 files changed

+4683
-1433
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+4683
-1433
lines changed

.gitignore

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,50 @@
1+
.gradle
2+
build/
3+
!gradle/wrapper/gradle-wrapper.jar
4+
!**/src/main/**/build/
5+
!**/src/test/**/build/
6+
7+
### IntelliJ IDEA ###
8+
.idea/modules.xml
9+
.idea/jarRepositories.xml
10+
.idea/compiler.xml
11+
.idea/libraries/
112
.idea/
2-
.gradle/
13+
*.iws
14+
*.iml
15+
*.ipr
16+
out/
17+
!**/src/main/**/out/
18+
!**/src/test/**/out/
319

4-
build/
20+
### Eclipse ###
21+
.apt_generated
22+
.classpath
23+
.factorypath
24+
.project
25+
.settings
26+
.springBeans
27+
.sts4-cache
28+
bin/
29+
!**/src/main/**/bin/
30+
!**/src/test/**/bin/
31+
32+
### NetBeans ###
33+
/nbproject/private/
34+
/nbbuild/
35+
/dist/
36+
/nbdist/
37+
/.nb-gradle/
38+
39+
### VS Code ###
40+
.vscode/
41+
42+
### Mac OS ###
43+
.DS_Store
44+
45+
### Minecraft ###
546
run/
47+
logs/
48+
49+
### Architectury ###
50+
.architectury-transformer/

build.gradle.kts

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2-
import net.fabricmc.loom.api.LoomGradleExtensionAPI
32
import net.fabricmc.loom.task.RemapJarTask
3+
import java.util.*
44

5-
val modId = property("mod_id").toString()
6-
val modVersion = property("mod_version").toString()
7-
val mavenGroup = property("maven_group").toString()
8-
val minecraftVersion = property("minecraft_version").toString()
9-
val yarnMappings = property("yarn_mappings").toString()
5+
val targets = listOf("META-INF/*.toml", "fabric.mod.json")
6+
val replacements = file("gradle.properties").inputStream().use { stream ->
7+
Properties().apply { load(stream) }
8+
}.map { (k, v) -> k.toString() to v.toString() }.toMap()
9+
10+
val modId: String by project
11+
val modVersion: String by project
12+
val mavenGroup: String by project
13+
val minecraftVersion: String by project
14+
val yarnMappings: String by project
1015

1116
val libs = file("libs")
12-
val Project.loom: LoomGradleExtensionAPI
13-
get() = (this as ExtensionAware).extensions.getByName("loom") as LoomGradleExtensionAPI
1417

1518
plugins {
16-
kotlin("jvm") version "1.9.23"
19+
kotlin("jvm") version "1.9.24"
1720
id("org.jetbrains.dokka") version "1.9.20"
1821
id("architectury-plugin") version "3.4-SNAPSHOT"
19-
id("dev.architectury.loom") version "1.5-SNAPSHOT" apply false
22+
id("dev.architectury.loom") version "1.6-SNAPSHOT" apply false
2023
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
2124
}
2225

@@ -30,18 +33,15 @@ subprojects {
3033

3134
dependencies {
3235
"minecraft"("com.mojang:minecraft:$minecraftVersion")
33-
"mappings"("net.fabricmc:yarn:$yarnMappings:v2")
34-
}
35-
36-
repositories {
37-
maven("https://babbaj.github.io/maven/")
36+
"mappings"("net.fabricmc:yarn:$minecraftVersion+$yarnMappings:v2")
3837
}
3938

4039
if (path == ":common") return@subprojects
4140

4241
apply(plugin = "com.github.johnrengelman.shadow")
4342

4443
val versionWithMCVersion = "$modVersion+$minecraftVersion"
44+
4545
tasks {
4646
val shadowCommon by configurations.creating {
4747
isCanBeConsumed = false
@@ -64,6 +64,13 @@ subprojects {
6464
jar {
6565
enabled = false
6666
}
67+
68+
processResources {
69+
// Replaces placeholders in the mod info files
70+
filesMatching(targets) {
71+
expand(replacements)
72+
}
73+
}
6774
}
6875
}
6976

@@ -73,25 +80,26 @@ allprojects {
7380
apply(plugin = "maven-publish")
7481
apply(plugin = "org.jetbrains.kotlin.jvm")
7582

76-
base.archivesName.set(modId)
7783
group = mavenGroup
7884
version = modVersion
7985

86+
base.archivesName = modId
87+
8088
repositories {
8189
maven("https://api.modrinth.com/maven")
8290
maven("https://jitpack.io")
8391
maven("https://maven.shedaniel.me/") { name = "Architectury" }
8492
maven("https://maven.terraformersmc.com/releases/")
93+
maven("https://babbaj.github.io/maven/")
8594

95+
// Allow the use of local libraries
8696
flatDir {
8797
dirs(libs)
8898
}
8999
}
90100

91101
java {
92-
// Uncomment these lines when the plugin system is ready
93-
// withSourcesJar()
94-
// withJavadocJar()
102+
withSourcesJar()
95103

96104
sourceCompatibility = JavaVersion.VERSION_17
97105
targetCompatibility = JavaVersion.VERSION_17

common/build.gradle.kts

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
import java.util.Properties
1+
val modId: String by project
2+
val fabricLoaderVersion: String by project
3+
val kotlinVersion: String by project
4+
val kotlinxCoroutinesVersion: String by project
25

3-
val fabricLoaderVersion = property("fabric_loader_version").toString()
4-
val mixinExtrasVersion = property("mixinextras_version").toString()
5-
val kotlinVersion = property("kotlin_version").toString()
6-
val kotlinxCoroutinesVersion = property("kotlinx_coroutines_version").toString()
7-
8-
architectury { common("fabric", "forge", "neoforge", "quilt") }
6+
architectury { common("fabric", "forge", "neoforge") }
97

108
loom {
119
silentMojangMappingsLicense()
12-
accessWidenerPath.set(File("src/main/resources/lambda.accesswidener"))
10+
accessWidenerPath = File("src/main/resources/$modId.accesswidener")
1311
}
1412

1513
repositories {
@@ -26,23 +24,9 @@ dependencies {
2624

2725
// Add Kotlin
2826
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesVersion")
27+
implementation(kotlin("reflect"))
2928

3029
// Baritone
3130
modImplementation("baritone-api:baritone-api:1.10.2")
3231
modImplementation("baritone-api:baritone-unoptimized-fabric:1.10.2")
3332
}
34-
35-
tasks {
36-
remapJar {
37-
enabled = false
38-
}
39-
40-
processResources {
41-
Properties().apply {
42-
load(project.rootProject.file("gradle.properties").inputStream())
43-
}.forEach { key, value ->
44-
inputs.property(key.toString(), value)
45-
}
46-
}
47-
}
48-

common/src/main/java/com/lambda/mixin/entity/ClientPlayerEntityMixin.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ void processMovement(Input input, boolean slowDown, float slowDownFactor) {
6161
EventFlow.post(new MovementEvent.InputUpdate(input, slowDown, slowDownFactor));
6262
}
6363

64+
@Redirect(method = "tickMovement", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;isSprinting()Z"))
65+
boolean isSprinting(ClientPlayerEntity entity) {
66+
return EventFlow.post(new MovementEvent.Sprint(entity.isSprinting())).getSprint();
67+
}
68+
6469
@Inject(method = "sendMovementPackets", at = @At(value = "HEAD"), cancellable = true)
6570
void sendBegin(CallbackInfo ci) {
6671
ci.cancel();
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.lambda.mixin.items;
2+
3+
import com.lambda.module.modules.render.BlockESP;
4+
import net.minecraft.block.BarrierBlock;
5+
import net.minecraft.block.BlockRenderType;
6+
import net.minecraft.block.BlockState;
7+
import net.minecraft.block.Blocks;
8+
import org.spongepowered.asm.mixin.Mixin;
9+
import org.spongepowered.asm.mixin.injection.At;
10+
import org.spongepowered.asm.mixin.injection.Inject;
11+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
12+
13+
@Mixin(BarrierBlock.class)
14+
public class BarrierBlockMixin {
15+
16+
@Inject(method = "getRenderType", at = @At(value = "RETURN"), cancellable = true)
17+
private void getRenderType(BlockState state, CallbackInfoReturnable<BlockRenderType> cir) {
18+
if (BlockESP.INSTANCE.isEnabled()
19+
&& BlockESP.getBarrier()
20+
&& state.getBlock() == Blocks.BARRIER
21+
) cir.setReturnValue(BlockRenderType.MODEL);
22+
}
23+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.lambda.mixin.render;
2+
3+
import com.lambda.module.modules.render.BlockESP;
4+
import net.minecraft.block.BlockState;
5+
import net.minecraft.block.Blocks;
6+
import net.minecraft.client.render.block.BlockRenderManager;
7+
import net.minecraft.client.render.model.BakedModel;
8+
import org.spongepowered.asm.mixin.Mixin;
9+
import org.spongepowered.asm.mixin.injection.At;
10+
import org.spongepowered.asm.mixin.injection.Inject;
11+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
12+
13+
@Mixin(BlockRenderManager.class)
14+
public abstract class BlockRenderManagerMixin {
15+
@Inject(method = "getModel", at = @At("HEAD"), cancellable = true)
16+
private void getModel(BlockState state, CallbackInfoReturnable<BakedModel> cir) {
17+
if (BlockESP.INSTANCE.isEnabled()
18+
&& BlockESP.getBarrier()
19+
&& state.getBlock() == Blocks.BARRIER
20+
) cir.setReturnValue(BlockESP.getModel());
21+
}
22+
}

common/src/main/java/com/lambda/mixin/render/GameRendererMixin.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
import com.lambda.event.EventFlow;
44
import com.lambda.event.events.RenderEvent;
5+
import com.lambda.graphics.RenderMain;
56
import net.minecraft.client.render.GameRenderer;
7+
import net.minecraft.client.util.math.MatrixStack;
68
import org.spongepowered.asm.mixin.Mixin;
79
import org.spongepowered.asm.mixin.injection.At;
810
import org.spongepowered.asm.mixin.injection.Inject;
@@ -16,4 +18,9 @@ private void updateTargetedEntityInvoke(float tickDelta, CallbackInfo info) {
1618
info.cancel();
1719
}
1820
}
21+
22+
@Inject(method = "renderWorld", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/WorldRenderer;render(Lnet/minecraft/client/util/math/MatrixStack;FJZLnet/minecraft/client/render/Camera;Lnet/minecraft/client/render/GameRenderer;Lnet/minecraft/client/render/LightmapTextureManager;Lorg/joml/Matrix4f;)V", shift = At.Shift.AFTER))
23+
private void onRenderWorld(float tickDelta, long limitTime, MatrixStack matrix, CallbackInfo ci) {
24+
RenderMain.render3D(matrix.peek().getPositionMatrix());
25+
}
1926
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package com.lambda.mixin.render;
2+
3+
import com.lambda.module.modules.render.NoRender;
4+
import net.minecraft.client.MinecraftClient;
5+
import net.minecraft.client.gui.hud.InGameOverlayRenderer;
6+
import net.minecraft.client.texture.Sprite;
7+
import net.minecraft.client.util.math.MatrixStack;
8+
import org.spongepowered.asm.mixin.Mixin;
9+
import org.spongepowered.asm.mixin.injection.At;
10+
import org.spongepowered.asm.mixin.injection.Inject;
11+
import org.spongepowered.asm.mixin.injection.ModifyArg;
12+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
13+
14+
@Mixin(InGameOverlayRenderer.class)
15+
public class InGameOverlayRendererMixin {
16+
@Inject(method = "renderFireOverlay", at = @At("HEAD"), cancellable = true)
17+
private static void onRenderFireOverlay(
18+
MinecraftClient mc,
19+
MatrixStack matrixStack,
20+
CallbackInfo ci
21+
) {
22+
if (NoRender.INSTANCE.isEnabled() && NoRender.getNoBurning()) ci.cancel();
23+
}
24+
25+
@ModifyArg(method = "renderFireOverlay", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/math/MatrixStack;translate(FFF)V"), index = 1)
26+
private static float onRenderFireOverlayTranslate(float x) {
27+
if (NoRender.INSTANCE.isEnabled()) {
28+
return (float) NoRender.getFireOverlayYOffset();
29+
} else {
30+
return -0.3f;
31+
}
32+
}
33+
34+
@Inject(method = "renderUnderwaterOverlay", at = @At("HEAD"), cancellable = true)
35+
private static void onRenderUnderwaterOverlay(
36+
MinecraftClient mc,
37+
MatrixStack matrixStack,
38+
CallbackInfo ci
39+
) {
40+
if (NoRender.INSTANCE.isEnabled() && NoRender.getNoUnderwater()) ci.cancel();
41+
}
42+
43+
@Inject(method = "renderInWallOverlay", at = @At("HEAD"), cancellable = true)
44+
private static void onRenderInWallOverlay(
45+
Sprite sprite,
46+
MatrixStack matrices,
47+
CallbackInfo ci
48+
) {
49+
if (NoRender.INSTANCE.isEnabled() && NoRender.getNoInWall()) ci.cancel();
50+
}
51+
}

common/src/main/java/com/lambda/mixin/render/LightmapTextureManagerMixin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
@Mixin(LightmapTextureManager.class)
1414
public class LightmapTextureManagerMixin {
1515
@ModifyArg(method = "update", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/texture/NativeImage;setColor(III)V"), index = 2)
16-
private int updateModify(int x) {
16+
private int updateModify(int color) {
1717
if (Fullbright.INSTANCE.isEnabled() || XRay.INSTANCE.isEnabled()) {
1818
return 0xFFFFFFFF;
1919
}
20-
return x;
20+
return color;
2121
}
2222

2323
@Inject(method = "getDarknessFactor(F)F", at = @At("HEAD"), cancellable = true)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.lambda.mixin.render;
2+
3+
import com.lambda.module.modules.render.XRay;
4+
import net.minecraft.block.BlockState;
5+
import net.minecraft.client.render.RenderLayer;
6+
import net.minecraft.client.render.RenderLayers;
7+
import org.spongepowered.asm.mixin.Mixin;
8+
import org.spongepowered.asm.mixin.injection.At;
9+
import org.spongepowered.asm.mixin.injection.Inject;
10+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
11+
12+
@Mixin(RenderLayers.class)
13+
public class RenderLayersMixin {
14+
@Inject(method = "getBlockLayer", at = @At("HEAD"), cancellable = true)
15+
private static void onGetBlockLayer(BlockState state, CallbackInfoReturnable<RenderLayer> cir) {
16+
if (XRay.INSTANCE.isDisabled()) return;
17+
18+
if (!XRay.isSelected(state)) cir.setReturnValue(RenderLayer.getTranslucent());
19+
}
20+
}

0 commit comments

Comments
 (0)