Skip to content

Commit 4a2d128

Browse files
committed
Velocity module
1 parent 5676225 commit 4a2d128

File tree

3 files changed

+75
-1
lines changed

3 files changed

+75
-1
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Copyright 2025 Lambda
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
package com.lambda.mixin.world;
19+
20+
import com.lambda.module.modules.render.NoRender;
21+
import net.minecraft.particle.ParticleEffect;
22+
import net.minecraft.world.explosion.Explosion;
23+
import org.spongepowered.asm.mixin.Mixin;
24+
import org.spongepowered.asm.mixin.injection.At;
25+
import org.spongepowered.asm.mixin.injection.Inject;
26+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
27+
28+
@Mixin(Explosion.class)
29+
public class ExplosionMixin {
30+
// net.minecraft.world.explosion.Explosion.affectWorld
31+
// Cancel adding particles to the world if NoRender noExplosion == true
32+
// if (particles) {
33+
// ParticleEffect particleEffect;
34+
// if (!(this.power < 2.0F) && bl) {
35+
// particleEffect = this.emitterParticle;
36+
// } else {
37+
// particleEffect = this.particle;
38+
// }
39+
//
40+
// this.world.addParticle(particleEffect, this.x, this.y, this.z, 1.0, 0.0, 0.0);
41+
// }
42+
@Inject(method = "affectWorld(Z)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;addParticle(Lnet/minecraft/particle/ParticleEffect;DDDDDD)V"), cancellable = true)
43+
void injectParticles(boolean particles, CallbackInfo ci) {
44+
if (NoRender.getNoExplosion()) ci.cancel();
45+
}
46+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright 2025 Lambda
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
package com.lambda.module.modules.movement
19+
20+
import com.lambda.module.Module
21+
import com.lambda.module.tag.ModuleTag
22+
23+
object Velocity : Module(
24+
name = "Velocity",
25+
description = "Modifies your velocity",
26+
defaultTags = setOf(ModuleTag.MOVEMENT),
27+
)

common/src/main/resources/lambda.mixins.common.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
"world.ClientChunkManagerMixin",
5656
"world.ClientWorldMixin",
5757
"world.StructureTemplateMixin",
58-
"world.WorldMixin"
58+
"world.WorldMixin",
59+
"world.ExplosionMixin"
5960
],
6061
"injectors": {
6162
"defaultRequire": 1

0 commit comments

Comments
 (0)