File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
java/com/lambda/mixin/entity
kotlin/com/lambda/module/modules/movement Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 2121import com .lambda .event .EventFlow ;
2222import com .lambda .event .events .MovementEvent ;
2323import com .lambda .interaction .request .rotating .RotationManager ;
24+ import com .lambda .module .modules .movement .Velocity ;
2425import com .lambda .module .modules .render .ViewModel ;
26+ import com .llamalad7 .mixinextras .injector .wrapmethod .WrapMethod ;
27+ import com .llamalad7 .mixinextras .injector .wrapoperation .Operation ;
28+ import net .minecraft .client .network .ClientPlayerEntity ;
29+ import net .minecraft .entity .Entity ;
2530import net .minecraft .entity .LivingEntity ;
2631import net .minecraft .util .math .MathHelper ;
2732import net .minecraft .util .math .Vec3d ;
@@ -167,4 +172,12 @@ private int getHandSwingDuration(int constant) {
167172
168173 return ViewModel .INSTANCE .getSwingDuration ();
169174 }
175+
176+ @ WrapMethod (method = "pushAwayFrom" )
177+ private void wrapPushAwayFrom (Entity entity , Operation <Void > original ) {
178+ if (((Entity ) ((Object ) this )) instanceof ClientPlayerEntity &&
179+ Velocity .INSTANCE .isEnabled () &&
180+ Velocity .getPushed ()) return ;
181+ original .call (entity );
182+ }
170183}
Original file line number Diff line number Diff line change @@ -28,9 +28,9 @@ object Velocity : Module(
2828 description = " Modifies your velocity" ,
2929 tag = ModuleTag .MOVEMENT ,
3030) {
31- private val knockback by setting(" Knockback " , true )
32-
33- @JvmStatic val explosion by setting(" Explosion" , true )
31+ @JvmStatic val pushed by setting(" Pushed " , true , " Prevents the player from getting pushed by other entities " )
32+ private val knockback by setting( " Knockback " , true , " Prevents the player from taking knockback when being attacked " )
33+ @JvmStatic val explosion by setting(" Explosion" , true , " Prevents the player from taking knockback from explosions " )
3434
3535 init {
3636 listen<PacketEvent .Receive .Pre > { event ->
You can’t perform that action at this time.
0 commit comments