forked from CCBlueX/LiquidBounce
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a couple options on NoSlow module. (CCBlueX#641)
* Added a couple options on NoSlow module. * Improved description.
- Loading branch information
Showing
7 changed files
with
111 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
.../java/net/ccbluex/liquidbounce/injection/mixins/minecraft/block/MixinPowderSnowBlock.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package net.ccbluex.liquidbounce.injection.mixins.minecraft.block; | ||
|
||
import net.ccbluex.liquidbounce.features.module.modules.movement.ModuleNoSlow; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.block.PowderSnowBlock; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.World; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(PowderSnowBlock.class) | ||
public class MixinPowderSnowBlock { | ||
|
||
@Inject(method = "onEntityCollision", at = @At("HEAD"), cancellable = true) | ||
private void hookEntityCollision(BlockState state, World world, BlockPos pos, Entity entity, CallbackInfo ci) { | ||
if (ModuleNoSlow.INSTANCE.getEnabled() && ModuleNoSlow.PowderSnow.INSTANCE.getEnabled()) { | ||
ci.cancel(); | ||
entity.setVelocity(entity.getVelocity().x * ModuleNoSlow.PowderSnow.INSTANCE.getMultiplier(), entity.getVelocity().y, entity.getVelocity().z * ModuleNoSlow.PowderSnow.INSTANCE.getMultiplier()); | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/java/net/ccbluex/liquidbounce/injection/mixins/minecraft/block/MixinSlimeBlock.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package net.ccbluex.liquidbounce.injection.mixins.minecraft.block; | ||
|
||
import net.ccbluex.liquidbounce.features.module.modules.movement.ModuleNoSlow; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.block.SlimeBlock; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.World; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(SlimeBlock.class) | ||
public class MixinSlimeBlock { | ||
|
||
@Inject(method = "bounce", at = @At("HEAD"), cancellable = true) | ||
private void hookBounce(Entity entity, CallbackInfo ci) { | ||
if (ModuleNoSlow.INSTANCE.getEnabled() && ModuleNoSlow.Slime.INSTANCE.getEnabled()) { | ||
if (entity.getVelocity().y == -0.0784000015258789 || entity.getVelocity().y == -0.001567998535156222) { | ||
ci.cancel(); | ||
} | ||
} | ||
} | ||
|
||
@Inject(method = "onSteppedOn", at = @At("HEAD"), cancellable = true) | ||
private void hookStep(World world, BlockPos pos, BlockState state, Entity entity, CallbackInfo ci) { | ||
if (ModuleNoSlow.INSTANCE.getEnabled() && ModuleNoSlow.Slime.INSTANCE.getEnabled()) { | ||
ci.cancel(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters