Port freelook
This commit is contained in:
parent
80903274f0
commit
3db8057542
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,6 +1,13 @@
|
|||
package net.minecraft.client;
|
||||
|
||||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
|
||||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_BACK;
|
||||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_COLOR_BUFFER_BIT;
|
||||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_DEPTH_BUFFER_BIT;
|
||||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_GREATER;
|
||||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_LEQUAL;
|
||||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_MODELVIEW;
|
||||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_PROJECTION;
|
||||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_SMOOTH;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
@ -16,7 +23,9 @@ import org.apache.commons.lang3.Validate;
|
|||
import com.google.common.collect.Lists;
|
||||
|
||||
import dev.resent.Resent;
|
||||
import dev.resent.event.impl.EventKey;
|
||||
import dev.resent.ui.mods.ClickGUI;
|
||||
import dev.resent.util.misc.W;
|
||||
import net.lax1dude.eaglercraft.v1_8.Display;
|
||||
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
|
||||
import net.lax1dude.eaglercraft.v1_8.HString;
|
||||
|
@ -25,7 +34,6 @@ import net.lax1dude.eaglercraft.v1_8.Keyboard;
|
|||
import net.lax1dude.eaglercraft.v1_8.Mouse;
|
||||
import net.lax1dude.eaglercraft.v1_8.futures.Executors;
|
||||
import net.lax1dude.eaglercraft.v1_8.futures.FutureTask;
|
||||
import net.lax1dude.eaglercraft.v1_8.futures.Futures;
|
||||
import net.lax1dude.eaglercraft.v1_8.futures.ListenableFuture;
|
||||
import net.lax1dude.eaglercraft.v1_8.futures.ListenableFutureTask;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformType;
|
||||
|
@ -106,7 +114,6 @@ import net.minecraft.client.resources.data.TextureMetadataSectionSerializer;
|
|||
import net.minecraft.client.resources.model.ModelManager;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.client.stream.IStream;
|
||||
import net.minecraft.crash.CrashReport;
|
||||
import net.minecraft.crash.CrashReportCategory;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
@ -1322,6 +1329,9 @@ public class Minecraft implements IThreadListener {
|
|||
KeyBinding.onTick(k);
|
||||
}
|
||||
|
||||
EventKey event = new EventKey(k);
|
||||
Resent.INSTANCE.events().post(event);
|
||||
|
||||
if (this.debugCrashKeyPressTime > 0L) {
|
||||
if (getSystemTime() - this.debugCrashKeyPressTime >= 6000L) {
|
||||
throw new ReportedException(new CrashReport("Manually triggered debug crash", new Throwable()));
|
||||
|
@ -1343,6 +1353,11 @@ public class Minecraft implements IThreadListener {
|
|||
if (this.currentScreen != null) {
|
||||
this.currentScreen.handleKeyboardInput();
|
||||
} else {
|
||||
|
||||
Resent.INSTANCE.modManager.onKey(Keyboard.getEventKey());
|
||||
if(Keyboard.getEventKey() == this.gameSettings.keyBindFreelook.keyCode)
|
||||
W.freelook().smh();
|
||||
|
||||
if (k == 1 || (k > -1 && k == this.gameSettings.keyBindClose.getKeyCode())) {
|
||||
this.displayInGameMenu();
|
||||
}
|
||||
|
@ -2116,6 +2131,6 @@ public class Minecraft implements IThreadListener {
|
|||
* Used in the usage snooper.
|
||||
*/
|
||||
public static int getGLMaximumTextureSize() {
|
||||
return EaglercraftGPU.glGetInteger(GL_MAX_TEXTURE_SIZE);
|
||||
return EaglercraftGPU.glGetInteger(3379);
|
||||
}
|
||||
}
|
|
@ -11,6 +11,8 @@ import java.util.concurrent.Callable;
|
|||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
|
||||
import dev.resent.Resent;
|
||||
import dev.resent.module.base.ModManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.Display;
|
||||
import net.lax1dude.eaglercraft.v1_8.Mouse;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||
|
@ -484,11 +486,11 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
}
|
||||
|
||||
GlStateManager.rotate(
|
||||
entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks + 180.0F,
|
||||
0.0F, -1.0F, 0.0F);
|
||||
ModManager.freelook.getCameraYaw() + (ModManager.freelook.getCameraYaw() - ModManager.freelook.getCameraYaw()) * partialTicks + 180.0F,
|
||||
0.0F, -1.0F, 0.0F);
|
||||
GlStateManager.rotate(
|
||||
entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks,
|
||||
-1.0F, 0.0F, 0.0F);
|
||||
ModManager.freelook.getCameraPitch() + (ModManager.freelook.getCameraPitch() - ModManager.freelook.getCameraPitch()) * partialTicks,
|
||||
-1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
} else if (this.mc.gameSettings.thirdPersonView > 0) {
|
||||
double d3 = (double) (this.thirdPersonDistanceTemp
|
||||
|
@ -496,8 +498,8 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
if (this.mc.gameSettings.debugCamEnable) {
|
||||
GlStateManager.translate(0.0F, 0.0F, (float) (-d3));
|
||||
} else {
|
||||
float f1 = entity.rotationYaw;
|
||||
float f2 = entity.rotationPitch;
|
||||
float f1 = ModManager.freelook.getCameraYaw();
|
||||
float f2 = ModManager.freelook.getCameraPitch();
|
||||
if (this.mc.gameSettings.thirdPersonView == 2) {
|
||||
f2 += 180.0F;
|
||||
}
|
||||
|
@ -530,11 +532,11 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
|
||||
GlStateManager.rotate(entity.rotationPitch - f2, 1.0F, 0.0F, 0.0F);
|
||||
GlStateManager.rotate(entity.rotationYaw - f1, 0.0F, 1.0F, 0.0F);
|
||||
GlStateManager.rotate(ModManager.freelook.getCameraPitch() - f2, 1.0F, 0.0F, 0.0F);
|
||||
GlStateManager.rotate(ModManager.freelook.getCameraYaw() - f1, 0.0F, 1.0F, 0.0F);
|
||||
GlStateManager.translate(0.0F, 0.0F, (float) (-d3));
|
||||
GlStateManager.rotate(f1 - entity.rotationYaw, 0.0F, 1.0F, 0.0F);
|
||||
GlStateManager.rotate(f2 - entity.rotationPitch, 1.0F, 0.0F, 0.0F);
|
||||
GlStateManager.rotate(f1 - ModManager.freelook.getCameraYaw(), 0.0F, 1.0F, 0.0F);
|
||||
GlStateManager.rotate(f2 - ModManager.freelook.getCameraPitch(), 1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
} else {
|
||||
GlStateManager.translate(0.0F, 0.0F, -0.1F);
|
||||
|
@ -542,7 +544,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
|
||||
if (!this.mc.gameSettings.debugCamEnable) {
|
||||
GlStateManager.rotate(
|
||||
entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks, 1.0F,
|
||||
ModManager.freelook.getCameraPitch() + (ModManager.freelook.getCameraPitch() - ModManager.freelook.getCameraPitch()) * partialTicks, 1.0F,
|
||||
0.0F, 0.0F);
|
||||
if (entity instanceof EntityAnimal) {
|
||||
EntityAnimal entityanimal = (EntityAnimal) entity;
|
||||
|
@ -551,7 +553,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
0.0F, 1.0F, 0.0F);
|
||||
} else {
|
||||
GlStateManager.rotate(
|
||||
entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks + 180.0F,
|
||||
ModManager.freelook.getCameraYaw() + (ModManager.freelook.getCameraYaw() - ModManager.freelook.getCameraYaw()) * partialTicks + 180.0F,
|
||||
0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
}
|
||||
|
@ -590,7 +592,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
}
|
||||
|
||||
this.hurtCameraEffect(partialTicks);
|
||||
if (this.mc.gameSettings.viewBobbing) {
|
||||
if (this.mc.gameSettings.viewBobbing && !Resent.INSTANCE.modManager.minimalViewBobbing.isEnabled()) {
|
||||
this.setupViewBobbing(partialTicks);
|
||||
}
|
||||
|
||||
|
@ -653,7 +655,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
|
||||
GlStateManager.pushMatrix();
|
||||
this.hurtCameraEffect(partialTicks);
|
||||
if (this.mc.gameSettings.viewBobbing) {
|
||||
if (this.mc.gameSettings.viewBobbing || Resent.INSTANCE.modManager.minimalViewBobbing.isEnabled()) {
|
||||
this.setupViewBobbing(partialTicks);
|
||||
}
|
||||
|
||||
|
@ -672,7 +674,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
this.hurtCameraEffect(partialTicks);
|
||||
}
|
||||
|
||||
if (this.mc.gameSettings.viewBobbing) {
|
||||
if (this.mc.gameSettings.viewBobbing || Resent.INSTANCE.modManager.minimalViewBobbing.isEnabled()) {
|
||||
this.setupViewBobbing(partialTicks);
|
||||
}
|
||||
|
||||
|
@ -854,7 +856,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
|||
|
||||
this.mc.mcProfiler.startSection("mouse");
|
||||
|
||||
if (this.mc.inGameHasFocus && flag) {
|
||||
if (this.mc.inGameHasFocus && flag && ModManager.freelook.overriderMouse()) {
|
||||
this.mc.mouseHelper.mouseXYChange();
|
||||
float f = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F;
|
||||
if (this.mc.gameSettings.keyBindZoomCamera.isKeyDown()) {
|
||||
|
|
|
@ -166,6 +166,7 @@ public class GameSettings {
|
|||
public KeyBinding keyBindFunction = new KeyBinding("key.function", KeyboardConstants.KEY_F, "key.categories.misc");
|
||||
public KeyBinding keyBindClose = new KeyBinding("key.close", KeyboardConstants.KEY_GRAVE, "key.categories.misc");
|
||||
public KeyBinding keyBindClickGui = new KeyBinding("Click Gui", KeyboardConstants.KEY_RSHIFT, "Resent");
|
||||
public KeyBinding keyBindFreelook = new KeyBinding("Freelook", KeyboardConstants.KEY_L, "Resent");
|
||||
public KeyBinding[] keyBindsHotbar = new KeyBinding[] {
|
||||
new KeyBinding("key.hotbar.1", 2, "key.categories.inventory"),
|
||||
new KeyBinding("key.hotbar.2", 3, "key.categories.inventory"),
|
||||
|
|
Loading…
Reference in New Issue
Block a user