From a4171eeaa1f5ac7ad431814b5de1374cb754166f Mon Sep 17 00:00:00 2001 From: jrbudda Date: Thu, 22 Jun 2017 20:37:22 -0400 Subject: [PATCH] 10finalr2 --- minecriftversion.py | 2 +- .../net/minecraft/client/Minecraft.java.patch | 4 +- .../client/renderer/EntityRenderer.java.patch | 75 ++++++++++--------- .../entity/layers/LayerElytra.java.patch | 7 +- .../control/VRControllerButtonMapping.java | 2 +- .../minecrift/gameplay/BackpackTracker.java | 4 +- .../mtbs3d/minecrift/provider/MCOpenVR.java | 13 +++- .../minecrift/utils/KeyboardSimulator.java | 6 +- 8 files changed, 62 insertions(+), 51 deletions(-) diff --git a/minecriftversion.py b/minecriftversion.py index c0c5a39..4448dec 100644 --- a/minecriftversion.py +++ b/minecriftversion.py @@ -4,7 +4,7 @@ of_json_name = "1.10.2_HD_U_D8" of_file_md5 = "d2a99a8d96d1067cb9e384bbdc560c70" minecrift_version_num = "1.10.2" -minecrift_build = "jrbudda-10-final" +minecrift_build = "jrbudda-10-finalr2" of_file_extension = ".jar" mcp_version = "mcp931" mcp_uses_generics = True diff --git a/patches/net/minecraft/client/Minecraft.java.patch b/patches/net/minecraft/client/Minecraft.java.patch index 24aaeb3..cf00f4d 100644 --- a/patches/net/minecraft/client/Minecraft.java.patch +++ b/patches/net/minecraft/client/Minecraft.java.patch @@ -306,7 +306,7 @@ + * The minecriftVerString will be automatically updated by the build scripts, do not modify here. + * Modify minecriftversion.py in root minecrift dir. + */ -+ public final String minecriftVerString = "Vivecraft 1.10.2 jrbudda-10-final"; ++ public final String minecriftVerString = "Vivecraft 1.10.2 jrbudda-10-finalr2"; + /* end version */ + /** END MINECRIFT */ + @@ -1772,7 +1772,7 @@ } - this.sendClickBlockToController(this.currentScreen == null && this.gameSettings.keyBindAttack.isKeyDown() && this.inGameHasFocus); -+ if(!nope) this.sendClickBlockToController(this.currentScreen == null && this.gameSettings.keyBindAttack.isKeyDown() && this.inGameHasFocus); ++ if(!nope) this.sendClickBlockToController(this.currentScreen == null && this.gameSettings.keyBindAttack.isKeyDown()); } private void runTickMouse() throws IOException diff --git a/patches/net/minecraft/client/renderer/EntityRenderer.java.patch b/patches/net/minecraft/client/renderer/EntityRenderer.java.patch index d63bd8e..9e011b9 100644 --- a/patches/net/minecraft/client/renderer/EntityRenderer.java.patch +++ b/patches/net/minecraft/client/renderer/EntityRenderer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/renderer/EntityRenderer.java +++ b/net/minecraft/client/renderer/EntityRenderer.java -@@ -2,39 +2,54 @@ +@@ -2,39 +2,55 @@ import com.google.common.base.Predicate; import com.google.common.base.Predicates; @@ -38,6 +38,7 @@ import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiDownloadTerrain; ++import net.minecraft.client.gui.GuiGameOver; import net.minecraft.client.gui.GuiMainMenu; +import net.minecraft.client.gui.GuiWinGame; import net.minecraft.client.gui.MapItemRenderer; @@ -57,7 +58,7 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.client.resources.I18n; import net.minecraft.client.resources.IResourceManager; -@@ -45,6 +60,7 @@ +@@ -45,6 +61,7 @@ import net.minecraft.crash.CrashReport; import net.minecraft.crash.CrashReportCategory; import net.minecraft.crash.ICrashReportDetail; @@ -65,7 +66,7 @@ import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; -@@ -54,10 +70,14 @@ +@@ -54,10 +71,14 @@ import net.minecraft.entity.monster.EntitySpider; import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.entity.player.EntityPlayer; @@ -80,7 +81,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.server.integrated.IntegratedServer; import net.minecraft.src.Config; -@@ -65,11 +85,13 @@ +@@ -65,11 +86,13 @@ import net.minecraft.src.Lagometer; import net.minecraft.src.RandomMobs; import net.minecraft.src.Reflector; @@ -94,7 +95,7 @@ import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MouseFilter; import net.minecraft.util.ReportedException; -@@ -80,24 +102,63 @@ +@@ -80,24 +103,63 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.RayTraceResult; @@ -159,7 +160,7 @@ public class EntityRenderer implements IResourceManagerReloadListener { private static final Logger LOGGER = LogManager.getLogger(); -@@ -108,6 +169,45 @@ +@@ -108,6 +170,45 @@ /** Anaglyph field (0=R, 1=GB) */ public static int anaglyphField; @@ -205,7 +206,7 @@ /** A reference to the Minecraft object. */ private final Minecraft mc; private final IResourceManager resourceManager; -@@ -204,7 +304,11 @@ +@@ -204,7 +305,11 @@ private double cameraZoom = 1.0D; private double cameraYaw; private double cameraPitch; @@ -218,7 +219,7 @@ private static final ResourceLocation[] SHADERS_TEXTURES = new ResourceLocation[] {new ResourceLocation("shaders/post/notch.json"), new ResourceLocation("shaders/post/fxaa.json"), new ResourceLocation("shaders/post/art.json"), new ResourceLocation("shaders/post/bumpy.json"), new ResourceLocation("shaders/post/blobs2.json"), new ResourceLocation("shaders/post/pencil.json"), new ResourceLocation("shaders/post/color_convolve.json"), new ResourceLocation("shaders/post/deconverge.json"), new ResourceLocation("shaders/post/flip.json"), new ResourceLocation("shaders/post/invert.json"), new ResourceLocation("shaders/post/ntsc.json"), new ResourceLocation("shaders/post/outline.json"), new ResourceLocation("shaders/post/phosphor.json"), new ResourceLocation("shaders/post/scan_pincushion.json"), new ResourceLocation("shaders/post/sobel.json"), new ResourceLocation("shaders/post/bits.json"), new ResourceLocation("shaders/post/desaturate.json"), new ResourceLocation("shaders/post/green.json"), new ResourceLocation("shaders/post/blur.json"), new ResourceLocation("shaders/post/wobble.json"), new ResourceLocation("shaders/post/blobs.json"), new ResourceLocation("shaders/post/antialias.json"), new ResourceLocation("shaders/post/creeper.json"), new ResourceLocation("shaders/post/spider.json")}; public static final int SHADER_COUNT = SHADERS_TEXTURES.length; private int shaderIndex; -@@ -212,9 +316,7 @@ +@@ -212,9 +317,7 @@ public int frameCount; private boolean initialized = false; private World updatedWorld = null; @@ -228,7 +229,7 @@ private long lastServerTime = 0L; private int lastServerTicks = 0; private int serverWaitTime = 0; -@@ -223,8 +325,14 @@ +@@ -223,8 +326,14 @@ private float avgServerTickDiff = 0.0F; private long lastErrorCheckTimeMs = 0L; private ShaderGroup[] fxaaShaders = new ShaderGroup[10]; @@ -244,7 +245,7 @@ public EntityRenderer(Minecraft mcIn, IResourceManager resourceManagerIn) { this.shaderIndex = SHADER_COUNT; -@@ -236,6 +344,7 @@ +@@ -236,6 +345,7 @@ this.locationLightMap = mcIn.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture); this.lightmapColors = this.lightmapTexture.getTextureData(); this.theShaderGroup = null; @@ -252,7 +253,7 @@ for (int i = 0; i < 32; ++i) { -@@ -274,7 +383,7 @@ +@@ -274,7 +384,7 @@ /** * What shader to use when spectating this entity */ @@ -261,7 +262,7 @@ { if (OpenGlHelper.shadersSupported) { -@@ -304,7 +413,7 @@ +@@ -304,7 +414,7 @@ } } @@ -270,7 +271,7 @@ { if (OpenGlHelper.isFramebufferEnabled()) { -@@ -388,7 +497,7 @@ +@@ -388,7 +498,7 @@ Entity entity = this.mc.getRenderViewEntity(); double d2 = entity.posX; @@ -279,7 +280,7 @@ double d1 = entity.posZ; float f2 = this.mc.world.getLightBrightness(new BlockPos(d2, d0, d1)); float f3 = (float)this.mc.gameSettings.renderDistanceChunks / 16.0F; -@@ -413,6 +522,16 @@ +@@ -413,6 +523,16 @@ { this.bossColorModifier -= 0.0125F; } @@ -296,7 +297,7 @@ } public ShaderGroup getShaderGroup() -@@ -438,112 +557,112 @@ +@@ -438,112 +558,112 @@ */ public void getMouseOver(float partialTicks) { @@ -515,7 +516,7 @@ } /** -@@ -611,7 +730,6 @@ +@@ -611,7 +731,6 @@ { Config.zoomMode = true; this.mc.gameSettings.smoothCamera = true; @@ -523,7 +524,7 @@ } if (Config.zoomMode) -@@ -634,14 +752,14 @@ +@@ -634,14 +753,14 @@ f /= (1.0F - 500.0F / (f1 + 500.0F)) * 2.0F + 1.0F; } @@ -541,7 +542,7 @@ } } -@@ -696,244 +814,239 @@ +@@ -696,244 +815,239 @@ */ private void orientCamera(float partialTicks) { @@ -1011,7 +1012,7 @@ /** * Render player hand -@@ -942,88 +1055,67 @@ +@@ -942,88 +1056,67 @@ { this.renderHand(partialTicks, pass, true, true, false); } @@ -1160,7 +1161,7 @@ public void disableLightmap() { GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit); -@@ -1039,12 +1131,12 @@ +@@ -1039,12 +1132,12 @@ public void enableLightmap() { GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit); @@ -1175,7 +1176,7 @@ this.mc.getTextureManager().bindTexture(this.locationLightMap); GlStateManager.glTexParameteri(3553, 10241, 9729); GlStateManager.glTexParameteri(3553, 10240, 9729); -@@ -1220,708 +1312,819 @@ +@@ -1220,708 +1313,819 @@ } } @@ -2638,7 +2639,7 @@ private void addRainParticles() { float f = this.mc.world.getRainStrength(1.0F); -@@ -2013,7 +2216,7 @@ +@@ -2013,7 +2217,7 @@ if (Reflector.ForgeWorldProvider_getWeatherRenderer.exists()) { WorldProvider worldprovider = this.mc.world.provider; @@ -2647,7 +2648,7 @@ if (object != null) { -@@ -2216,7 +2419,7 @@ +@@ -2216,7 +2420,7 @@ double d0 = MathHelper.sin(world.getCelestialAngleRadians(partialTicks)) > 0.0F ? -1.0D : 1.0D; Vec3d vec3d2 = new Vec3d(d0, 0.0D, 0.0D); float f5 = (float)entity.getLook(partialTicks).dotProduct(vec3d2); @@ -2656,7 +2657,7 @@ if (f5 < 0.0F) { f5 = 0.0F; -@@ -2260,8 +2463,9 @@ +@@ -2260,8 +2464,9 @@ this.fogColorBlue *= f11; } @@ -2668,7 +2669,7 @@ if (this.cloudFog) { Vec3d vec3d3 = world.getCloudColour(partialTicks); -@@ -2269,7 +2473,7 @@ +@@ -2269,7 +2474,7 @@ this.fogColorGreen = (float)vec3d3.yCoord; this.fogColorBlue = (float)vec3d3.zCoord; } @@ -2677,7 +2678,7 @@ { float f12 = 0.0F; -@@ -2295,7 +2499,7 @@ +@@ -2295,7 +2500,7 @@ this.fogColorBlue = (float)vec3d4.zCoord; } } @@ -2686,7 +2687,7 @@ { this.fogColorRed = 0.6F; this.fogColorGreen = 0.1F; -@@ -2373,16 +2577,15 @@ +@@ -2373,16 +2578,15 @@ this.fogColorBlue = f7; } @@ -2711,7 +2712,7 @@ } /** -@@ -2396,7 +2599,13 @@ +@@ -2396,7 +2600,13 @@ GlStateManager.glFog(2918, this.setFogColorBuffer(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 1.0F)); GlStateManager.glNormal3f(0.0F, -1.0F, 0.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); @@ -2726,7 +2727,7 @@ float f = -1.0F; if (Reflector.ForgeHooksClient_getFogDensity.exists()) -@@ -2456,7 +2665,7 @@ +@@ -2456,7 +2666,7 @@ GlStateManager.setFogDensity(0.1F); } @@ -2735,7 +2736,7 @@ { if (Config.isShaders()) { -@@ -2488,7 +2697,7 @@ +@@ -2488,7 +2698,7 @@ GlStateManager.setFogDensity(0.02F); } } @@ -2744,7 +2745,7 @@ { if (Config.isShaders()) { -@@ -2550,12 +2759,24 @@ +@@ -2550,12 +2760,24 @@ Reflector.callVoid(Reflector.ForgeHooksClient_onFogRender, new Object[] {this, entity, iblockstate, Float.valueOf(partialTicks), Integer.valueOf(startCoords), Float.valueOf(f1)}); } } @@ -2770,7 +2771,7 @@ /** * Update and return fogColorBuffer with the RGBA values passed as arguments */ -@@ -2572,6 +2793,12 @@ +@@ -2572,6 +2794,12 @@ return this.fogColorBuffer; } @@ -2783,7 +2784,7 @@ public MapItemRenderer getMapItemRenderer() { return this.theMapItemRenderer; -@@ -2716,10 +2943,12 @@ +@@ -2716,10 +2944,12 @@ this.updatedWorld = world; } @@ -2800,7 +2801,7 @@ } private void frameFinish() -@@ -2743,39 +2972,6 @@ +@@ -2743,39 +2973,6 @@ } } @@ -2840,7 +2841,7 @@ public boolean setFxaaShader(int p_setFxaaShader_1_) { if (!OpenGlHelper.isFramebufferEnabled()) -@@ -2815,75 +3011,6 @@ +@@ -2815,75 +3012,6 @@ } } @@ -2916,7 +2917,7 @@ public static void drawNameplate(FontRenderer fontRendererIn, String str, float x, float y, float z, int verticalShift, float viewerYaw, float viewerPitch, boolean isThirdPersonFrontal, boolean isSneaking) { GlStateManager.pushMatrix(); -@@ -2927,4 +3054,2340 @@ +@@ -2927,4 +3055,2340 @@ GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.popMatrix(); } @@ -3559,7 +3560,7 @@ + + Vec3d pos = mc.entityRenderer.getEyeRenderPos(mc.currentPass); + -+ if (inMenuRoom || !this.mc.vrSettings.hudOcclusion || itemRenderer.isInsideOpaqueBlock(pos, false)){ ++ if (inMenuRoom || mc.currentScreen instanceof GuiGameOver || !this.mc.vrSettings.hudOcclusion || itemRenderer.isInsideOpaqueBlock(pos, false)){ + // Never use depth test for in game menu - so you can always see it! + GlStateManager.disableDepth(); + GlStateManager.depthFunc(GL11.GL_ALWAYS); diff --git a/patches/net/minecraft/client/renderer/entity/layers/LayerElytra.java.patch b/patches/net/minecraft/client/renderer/entity/layers/LayerElytra.java.patch index 465c1c9..2173d1c 100644 --- a/patches/net/minecraft/client/renderer/entity/layers/LayerElytra.java.patch +++ b/patches/net/minecraft/client/renderer/entity/layers/LayerElytra.java.patch @@ -8,7 +8,7 @@ import net.minecraft.client.renderer.entity.RenderPlayer; import net.minecraft.entity.player.EnumPlayerModelParts; import net.minecraft.init.Items; -@@ -18,14 +19,14 @@ +@@ -18,14 +19,19 @@ private static final ResourceLocation TEXTURE_ELYTRA = new ResourceLocation("textures/entity/elytra.png"); /** Instance of the player renderer. */ @@ -22,6 +22,11 @@ + public LayerElytra(RenderLivingBase p_i47185_1_) { - this.renderPlayer = renderPlayerIn; ++ this.renderPlayer = p_i47185_1_; ++ } ++ ++ public LayerElytra(RenderPlayer p_i47185_1_) ++ { + this.renderPlayer = p_i47185_1_; } diff --git a/src/com/mtbs3d/minecrift/control/VRControllerButtonMapping.java b/src/com/mtbs3d/minecrift/control/VRControllerButtonMapping.java index 598aa14..7963c13 100644 --- a/src/com/mtbs3d/minecrift/control/VRControllerButtonMapping.java +++ b/src/com/mtbs3d/minecrift/control/VRControllerButtonMapping.java @@ -71,7 +71,7 @@ public void unpress(){ this.unpress = true; } - private void actuallyUnpress() { + public void actuallyUnpress() { if(this.FunctionDesc.equals("none")) return; if(key!=null) { unpressKey(key); diff --git a/src/com/mtbs3d/minecrift/gameplay/BackpackTracker.java b/src/com/mtbs3d/minecrift/gameplay/BackpackTracker.java index f9a6fa0..43c9167 100644 --- a/src/com/mtbs3d/minecrift/gameplay/BackpackTracker.java +++ b/src/com/mtbs3d/minecrift/gameplay/BackpackTracker.java @@ -15,7 +15,7 @@ public class BackpackTracker { public boolean[] wasIn = new boolean[2]; - public int previousSlot = -1; + public int previousSlot = 0; public boolean isActive(EntityPlayerSP p){ if(Minecraft.getMinecraft().vrSettings.seated) @@ -57,7 +57,7 @@ public void doProcess(Minecraft minecraft, EntityPlayerSP player){ player.inventory.currentItem = 0; } else { player.inventory.currentItem = previousSlot; - previousSlot = -1; + previousSlot = 0; }} else { //offhand ItemStack of = player.getHeldItemOffhand(); diff --git a/src/com/mtbs3d/minecrift/provider/MCOpenVR.java b/src/com/mtbs3d/minecrift/provider/MCOpenVR.java index 6b259e3..97dcae8 100644 --- a/src/com/mtbs3d/minecrift/provider/MCOpenVR.java +++ b/src/com/mtbs3d/minecrift/provider/MCOpenVR.java @@ -2234,10 +2234,15 @@ static EulerOrient getOrientationEuler() static void onGuiScreenChanged(GuiScreen previousScreen, GuiScreen newScreen) { KeyBinding.unPressAllKeys(); - KeyboardSimulator.robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); - KeyboardSimulator.robot.mouseRelease(InputEvent.BUTTON2_DOWN_MASK); - KeyboardSimulator.robot.mouseRelease(InputEvent.BUTTON3_DOWN_MASK); - KeyboardSimulator.robot.keyRelease(KeyEvent.VK_SHIFT); + if(Display.isActive()){ + KeyboardSimulator.robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + KeyboardSimulator.robot.mouseRelease(InputEvent.BUTTON2_DOWN_MASK); + KeyboardSimulator.robot.mouseRelease(InputEvent.BUTTON3_DOWN_MASK); + KeyboardSimulator.robot.keyRelease(KeyEvent.VK_SHIFT); + for (VRControllerButtonMapping mapping : mc.vrSettings.buttonMappings) { + mapping.actuallyUnpress(); + } + } if(newScreen == null || (mc.player!=null && !mc.player.isEntityAlive())){ guiPos_Room = null; diff --git a/src/com/mtbs3d/minecrift/utils/KeyboardSimulator.java b/src/com/mtbs3d/minecrift/utils/KeyboardSimulator.java index c0cc894..b9824ef 100644 --- a/src/com/mtbs3d/minecrift/utils/KeyboardSimulator.java +++ b/src/com/mtbs3d/minecrift/utils/KeyboardSimulator.java @@ -195,7 +195,7 @@ public static int translateToAWT(int code) { case Keyboard.KEY_LBRACKET: return KeyEvent.VK_OPEN_BRACKET; case Keyboard.KEY_RBRACKET: return KeyEvent.VK_CLOSE_BRACKET; case Keyboard.KEY_RETURN: return KeyEvent.VK_ENTER; - case Keyboard.KEY_LCONTROL: return KeyEvent.VK_CONTROL; + //case Keyboard.KEY_LCONTROL: return KeyEvent.VK_CONTROL; case Keyboard.KEY_A: return KeyEvent.VK_A; case Keyboard.KEY_S: return KeyEvent.VK_S; case Keyboard.KEY_D: return KeyEvent.VK_D; @@ -208,7 +208,7 @@ public static int translateToAWT(int code) { case Keyboard.KEY_SEMICOLON: return KeyEvent.VK_SEMICOLON; case Keyboard.KEY_APOSTROPHE: return KeyEvent.VK_QUOTE; case Keyboard.KEY_GRAVE: return KeyEvent.VK_DEAD_GRAVE; - case Keyboard.KEY_LSHIFT: return KeyEvent.VK_SHIFT; + //case Keyboard.KEY_LSHIFT: return KeyEvent.VK_SHIFT; case Keyboard.KEY_BACKSLASH: return KeyEvent.VK_BACK_SLASH; case Keyboard.KEY_Z: return KeyEvent.VK_Z; case Keyboard.KEY_X: return KeyEvent.VK_X; @@ -221,7 +221,7 @@ public static int translateToAWT(int code) { case Keyboard.KEY_PERIOD: return KeyEvent.VK_PERIOD; case Keyboard.KEY_SLASH: return KeyEvent.VK_SLASH; case Keyboard.KEY_MULTIPLY: return KeyEvent.VK_MULTIPLY; - case Keyboard.KEY_LMENU: return KeyEvent.VK_ALT; + //case Keyboard.KEY_LMENU: return KeyEvent.VK_ALT; case Keyboard.KEY_SPACE: return KeyEvent.VK_SPACE; case Keyboard.KEY_CAPITAL: return KeyEvent.VK_CAPS_LOCK; case Keyboard.KEY_F1: return KeyEvent.VK_F1;