-
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some code formatting and VehicleOneHit (#258)
- Loading branch information
1 parent
89832a6
commit 950dece
Showing
14 changed files
with
157 additions
and
225 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,39 @@ | ||
package anticope.rejects.modules; | ||
|
||
import anticope.rejects.MeteorRejectsAddon; | ||
import anticope.rejects.utils.RejectsUtils; | ||
import meteordevelopment.meteorclient.events.entity.player.PlayerMoveEvent; | ||
import meteordevelopment.meteorclient.mixininterface.IVec3d; | ||
import meteordevelopment.meteorclient.settings.BoolSetting; | ||
import meteordevelopment.meteorclient.settings.DoubleSetting; | ||
import meteordevelopment.meteorclient.settings.Setting; | ||
import meteordevelopment.meteorclient.settings.SettingGroup; | ||
import meteordevelopment.meteorclient.systems.modules.Module; | ||
import meteordevelopment.meteorclient.settings.*; | ||
import meteordevelopment.meteorclient.utils.Utils; | ||
import meteordevelopment.meteorclient.utils.player.PlayerUtils; | ||
import meteordevelopment.orbit.EventHandler; | ||
import net.minecraft.util.shape.VoxelShapes; | ||
|
||
public class FullNoClip extends Module { | ||
private final SettingGroup sgGeneral = settings.getDefaultGroup(); | ||
private final Setting<Double> speed = sgGeneral.add(new DoubleSetting.Builder() | ||
.name("speed") | ||
.description("Your speed when noclipping.") | ||
.defaultValue(0.3) | ||
.min(0.0) | ||
.sliderMax(10) | ||
.build() | ||
.name("speed") | ||
.description("Your speed when noclipping.") | ||
.defaultValue(0.3) | ||
.min(0.0) | ||
.sliderMax(10) | ||
.build() | ||
); | ||
|
||
private final Setting<Boolean> verticalSpeedMatch = sgGeneral.add(new BoolSetting.Builder() | ||
.name("vertical-speed-match") | ||
.description("Matches your vertical speed to your horizontal speed, otherwise uses vanilla ratio.") | ||
.defaultValue(false) | ||
.build() | ||
.name("vertical-speed-match") | ||
.description("Matches your vertical speed to your horizontal speed, otherwise uses vanilla ratio.") | ||
.defaultValue(false) | ||
.build() | ||
); | ||
|
||
public FullNoClip() { | ||
super(MeteorRejectsAddon.CATEGORY, "fullnoclip", "FullNoClip."); | ||
} | ||
|
||
private double getDir() { | ||
double dir = 0; | ||
|
||
if (Utils.canUpdate()) { | ||
dir = mc.player.getYaw() + ((mc.player.forwardSpeed < 0) ? 180 : 0); | ||
|
||
if (mc.player.sidewaysSpeed > 0) { | ||
dir += -90F * ((mc.player.forwardSpeed < 0) ? -0.5F : ((mc.player.forwardSpeed > 0) ? 0.5F : 1F)); | ||
} else if (mc.player.sidewaysSpeed < 0) { | ||
dir += 90F * ((mc.player.forwardSpeed < 0) ? -0.5F : ((mc.player.forwardSpeed > 0) ? 0.5F : 1F)); | ||
} | ||
} | ||
return dir; | ||
public FullNoClip() { | ||
super(MeteorRejectsAddon.CATEGORY, "fullnoclip", "FullNoClip."); | ||
} | ||
|
||
@EventHandler | ||
private void onPlayerMove(PlayerMoveEvent event) { | ||
if (PlayerUtils.isMoving()) { | ||
double dir = getDir(); | ||
|
||
double xDir = Math.cos(Math.toRadians(dir + 90)); | ||
double zDir = Math.sin(Math.toRadians(dir + 90)); | ||
|
||
((IVec3d) event.movement).setXZ(xDir * speed.get(), zDir * speed.get()); | ||
} | ||
else { | ||
((IVec3d) event.movement).setXZ(0, 0); | ||
} | ||
|
||
float ySpeed = 0; | ||
|
||
if (mc.options.jumpKey.isPressed()) | ||
ySpeed += speed.get(); | ||
if (mc.options.sneakKey.isPressed()) | ||
ySpeed -= speed.get(); | ||
((IVec3d) event.movement).setY(verticalSpeedMatch.get() ? ySpeed : ySpeed/2); | ||
} | ||
|
||
RejectsUtils.fullFlightMove(event, speed.get(), verticalSpeedMatch.get()); | ||
} | ||
} |
Oops, something went wrong.