Skip to content
This repository was archived by the owner on Dec 29, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repositories {
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
maven { url "https://maven.shedaniel.me/" }
maven { url "https://maven.terraformersmc.com/releases/" }
maven { url "https://raw.githubusercontent.com/TerraformersMC/Archive/main/releases/" }
}

dependencies {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/pm/c7/perspective/PerspectiveConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class PerspectiveConfig extends PartitioningSerializer.GlobalData {
@Config(name = "main")
public static class CategoryMain implements ConfigData {
public boolean holdMode = false;
public boolean lookForwards = true;
}

// https://github.com/shedaniel/RoughlyEnoughItems/blob/3.x/src/main/java/me/shedaniel/rei/impl/ConfigManagerImpl.java
Expand Down
15 changes: 13 additions & 2 deletions src/main/java/pm/c7/perspective/PerspectiveMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,26 @@ public void onInitializeClient() {
if (this.perspectiveEnabled && !this.held) {
this.held = true;
this.cameraPitch = this.client.player.getPitch();
this.cameraYaw = this.client.player.getYaw();

if (config.main.lookForwards) {
this.cameraYaw = this.client.player.getYaw();
} else {
this.cameraYaw = this.client.player.getYaw() - 180.0F;
}

this.client.options.setPerspective(Perspective.THIRD_PERSON_BACK);
}
} else {
if (toggleKey.wasPressed()) {
this.perspectiveEnabled = !this.perspectiveEnabled;

this.cameraPitch = this.client.player.getPitch();
this.cameraYaw = this.client.player.getYaw();

if (config.main.lookForwards) {
this.cameraYaw = this.client.player.getYaw();
} else {
this.cameraYaw = this.client.player.getYaw() - 180.0F;
}

this.client.options.setPerspective(this.perspectiveEnabled ? Perspective.THIRD_PERSON_BACK : Perspective.FIRST_PERSON);
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/assets/perspectivemod/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"key.perspectivemod.toggle": "Toggle Perspective",

"config.perspectivemod.title": "Perspective Mod Redux",
"config.perspectivemod.main.holdMode": "Hold to use"
"config.perspectivemod.main.holdMode": "Hold to use",
"config.perspectivemod.main.lookForwards": "Look Forwards"
}