Skip to content

Commit 5676225

Browse files
committed
Added explosion no render
1 parent 1a1b0c7 commit 5676225

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

common/src/main/java/com/lambda/mixin/network/ClientPlayNetworkHandlerMixin.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@
1919

2020
import com.lambda.event.EventFlow;
2121
import com.lambda.event.events.InventoryEvent;
22+
import com.lambda.module.modules.movement.Velocity;
2223
import com.lambda.module.modules.render.NoRender;
2324
import com.lambda.event.events.WorldEvent;
2425
import net.minecraft.client.network.ClientPlayNetworkHandler;
2526
import net.minecraft.client.network.PlayerListEntry;
26-
import net.minecraft.network.packet.s2c.play.GameJoinS2CPacket;
27-
import net.minecraft.network.packet.s2c.play.PlayerListS2CPacket;
28-
import net.minecraft.network.packet.s2c.play.ScreenHandlerSlotUpdateS2CPacket;
29-
import net.minecraft.network.packet.s2c.play.UpdateSelectedSlotS2CPacket;
27+
import net.minecraft.network.packet.s2c.play.*;
3028
import org.spongepowered.asm.mixin.Mixin;
3129
import org.spongepowered.asm.mixin.injection.At;
3230
import org.spongepowered.asm.mixin.injection.Inject;
@@ -67,4 +65,15 @@ private void onScreenHandlerSlotUpdate(ScreenHandlerSlotUpdateS2CPacket packet,
6765
public boolean onServerMetadata(ClientPlayNetworkHandler clientPlayNetworkHandler) {
6866
return NoRender.getNoChatVerificationToast();
6967
}
68+
69+
// Cancel player velocity if Velocity module is enabled
70+
// Reference net.minecraft.client.network.ClientPlayNetworkHandler.onExplosion
71+
//
72+
// Explosion explosion = new Explosion(this.client.world, (Entity)null, packet.getX(), packet.getY(), packet.getZ(), packet.getRadius(), packet.getAffectedBlocks(), packet.getDestructionType(), packet.getParticle(), packet.getEmitterParticle(), packet.getSoundEvent());
73+
// explosion.affectWorld(true);
74+
// this.client.player.setVelocity(this.client.player.getVelocity().add((double)packet.getPlayerVelocityX(), (double)packet.getPlayerVelocityY(), (double)packet.getPlayerVelocityZ()));
75+
@Inject(method = "onExplosion(Lnet/minecraft/network/packet/s2c/play/ExplosionS2CPacket;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;setVelocity(Lnet/minecraft/util/math/Vec3d;)V"), cancellable = true)
76+
void injectVelocity(ExplosionS2CPacket packet, CallbackInfo ci) {
77+
if (Velocity.INSTANCE.isEnabled()) ci.cancel();
78+
}
7079
}

common/src/main/kotlin/com/lambda/module/modules/render/NoRender.kt

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,11 @@ object NoRender : Module(
2525
description = "Disables rendering of certain things",
2626
defaultTags = setOf(ModuleTag.RENDER)
2727
) {
28-
@JvmStatic
29-
val noDarkness by setting("No Darkness", true)
30-
31-
@JvmStatic
32-
val noBurning by setting("No Burning Overlay", true)
33-
34-
@JvmStatic
35-
val fireOverlayYOffset by setting("Fire Overlay Y Offset", -0.3, -0.8..0.0, 0.1) { !noBurning }
36-
37-
@JvmStatic
38-
val noUnderwater by setting("No Underwater Overlay", true)
39-
40-
@JvmStatic
41-
val noInWall by setting("No In Wall Overlay", true)
42-
43-
@JvmStatic
44-
val noChatVerificationToast by setting("No Chat Verification Toast", true)
28+
@JvmStatic val noDarkness by setting("No Darkness", true)
29+
@JvmStatic val noBurning by setting("No Burning Overlay", true)
30+
@JvmStatic val fireOverlayYOffset by setting("Fire Overlay Y Offset", -0.3, -0.8..0.0, 0.1) { !noBurning }
31+
@JvmStatic val noUnderwater by setting("No Underwater Overlay", true)
32+
@JvmStatic val noInWall by setting("No In Wall Overlay", true)
33+
@JvmStatic val noChatVerificationToast by setting("No Chat Verification Toast", true)
34+
@JvmStatic val noExplosion by setting("No Explosions", true)
4535
}

0 commit comments

Comments
 (0)