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 gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx2G
# boilerplate
modId = pmr
modName = PerspectiveModRedux
version = 0.0.4
version = 0.0.5
acceptedMinecraftVersions = [1.8.9]
minecraftVersion = 1.8.9
forgeVersion = 11.15.1.2318-1.8.9
Expand Down
15 changes: 12 additions & 3 deletions src/main/java/pm/c7/pmr/PerspectiveMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class PerspectiveMod
private boolean showConfig = false;

private static boolean holdToUse = false;
private static boolean lookForwards = false;

public boolean perspectiveEnabled = false;
public float cameraPitch;
Expand Down Expand Up @@ -109,7 +110,11 @@ public void onKey(InputEvent.KeyInputEvent event) {
this.held = true;

this.cameraPitch = this.client.thePlayer.rotationPitch;
this.cameraYaw = this.client.thePlayer.rotationYaw + 180.0F;
if(lookForwards) {
this.cameraYaw = this.client.thePlayer.rotationYaw - 180.0F;
} else {
this.cameraYaw = this.client.thePlayer.rotationYaw;
}

this.client.gameSettings.thirdPersonView = 1;
}
Expand All @@ -118,7 +123,11 @@ public void onKey(InputEvent.KeyInputEvent event) {
this.perspectiveEnabled = !this.perspectiveEnabled;

this.cameraPitch = this.client.thePlayer.rotationPitch;
this.cameraYaw = this.client.thePlayer.rotationYaw;
if(lookForwards) {
this.cameraYaw = this.client.thePlayer.rotationYaw - 180.0F;
} else {
this.cameraYaw = this.client.thePlayer.rotationYaw;
}

this.client.gameSettings.thirdPersonView = this.perspectiveEnabled ? 1 : 0;
}
Expand All @@ -136,7 +145,7 @@ public void cameraSetup(EntityViewRenderEvent.CameraSetup event) {

public static void saveConfig() {
holdToUse = config.getBoolean("Hold To Use", "main", false, null);

lookForwards = config.getBoolean("Look Forwards", "main", true, null);
config.save();
}

Expand Down