aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/djtheredstoner/perspectivemod/PerspectiveMod.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/me/djtheredstoner/perspectivemod/PerspectiveMod.java')
-rw-r--r--src/main/java/me/djtheredstoner/perspectivemod/PerspectiveMod.java22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/main/java/me/djtheredstoner/perspectivemod/PerspectiveMod.java b/src/main/java/me/djtheredstoner/perspectivemod/PerspectiveMod.java
index 7adc1f5..dd48d4c 100644
--- a/src/main/java/me/djtheredstoner/perspectivemod/PerspectiveMod.java
+++ b/src/main/java/me/djtheredstoner/perspectivemod/PerspectiveMod.java
@@ -75,15 +75,13 @@ public class PerspectiveMod {
public void onPressed(boolean state) {
if (config.modEnabled) {
if (state) {
- perspectiveToggled = !perspectiveToggled;
cameraYaw = mc.thePlayer.rotationYaw;
cameraPitch = mc.thePlayer.rotationPitch;
if (perspectiveToggled) {
- previousPerspective = mc.gameSettings.thirdPersonView;
- mc.gameSettings.thirdPersonView = 1;
+ resetPerspective();
} else {
- mc.gameSettings.thirdPersonView = previousPerspective;
+ enterPerspective();
}
} else if (config.holdMode) {
resetPerspective();
@@ -93,6 +91,17 @@ public class PerspectiveMod {
}
}
+ public void enterPerspective() {
+ perspectiveToggled = true;
+ previousPerspective = mc.gameSettings.thirdPersonView;
+ mc.gameSettings.thirdPersonView = 1;
+ }
+
+ public void resetPerspective() {
+ perspectiveToggled = false;
+ mc.gameSettings.thirdPersonView = previousPerspective;
+ }
+
public boolean overrideMouse() {
if (mc.inGameHasFocus && Display.isActive()) {
if (!perspectiveToggled) {
@@ -120,9 +129,4 @@ public class PerspectiveMod {
return false;
}
-
- public void resetPerspective() {
- perspectiveToggled = false;
- mc.gameSettings.thirdPersonView = previousPerspective;
- }
}