Skip to content

Commit

Permalink
Added the option to not change the target when in Freecam
Browse files Browse the repository at this point in the history
  • Loading branch information
vitphire committed May 23, 2023
1 parent 0f31ad7 commit b2b81f3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private void updateTargetedEntityInvoke(float tickDelta, CallbackInfo info) {
Freecam freecam = Modules.get().get(Freecam.class);
boolean highwayBuilder = Modules.get().isActive(HighwayBuilder.class);

if ((freecam.isActive() || highwayBuilder) && client.getCameraEntity() != null && !freecamSet) {
if ((freecam.shouldChangeTarget() || highwayBuilder) && client.getCameraEntity() != null && !freecamSet) {
info.cancel();
Entity cameraE = client.getCameraEntity();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,18 @@ public class Freecam extends Module {
.build()
);

private final Setting<Boolean> changeTarget = sgGeneral.add(new BoolSetting.Builder()
.name("change-target")
.description("Changes the target block or entity to the one you are looking at.")
.defaultValue(true)
.build()
);

private final Setting<Boolean> rotate = sgGeneral.add(new BoolSetting.Builder()
.name("rotate")
.description("Rotates to the block or entity you are looking at.")
.defaultValue(false)
.visible(changeTarget::get)
.build()
);

Expand Down Expand Up @@ -414,4 +422,8 @@ public double getYaw(float tickDelta) {
public double getPitch(float tickDelta) {
return MathHelper.lerp(tickDelta, prevPitch, pitch);
}

public boolean shouldChangeTarget() {
return isActive() && changeTarget.get();
}
}

0 comments on commit b2b81f3

Please sign in to comment.