diff --git a/patches/net/minecraft/client/Minecraft.java.patch b/patches/net/minecraft/client/Minecraft.java.patch index 726c122..3a0ed43 100644 --- a/patches/net/minecraft/client/Minecraft.java.patch +++ b/patches/net/minecraft/client/Minecraft.java.patch @@ -893,7 +893,7 @@ - { - this.leftClickCounter = 10; - } -+ this.leftClickCounter = this.playerController.isNotCreative() ? 10 : 0; ++ this.leftClickCounter = 10; this.thePlayer.resetCooldown(); } diff --git a/patches/net/minecraft/client/gui/GuiScreen.java.patch b/patches/net/minecraft/client/gui/GuiScreen.java.patch index 6b00255..882f484 100644 --- a/patches/net/minecraft/client/gui/GuiScreen.java.patch +++ b/patches/net/minecraft/client/gui/GuiScreen.java.patch @@ -88,16 +88,29 @@ if (Mouse.getEventButtonState()) { if (this.mc.gameSettings.touchscreen && this.touchValue++ > 0) -@@ -629,6 +666,8 @@ +@@ -622,13 +659,20 @@ + */ + public void handleKeyboardInput() throws IOException + { +- char c0 = Keyboard.getEventCharacter(); ++ if(Keyboard.getEventKey()==1 && MCOpenVR.keyboardShowing){ ++ MCOpenVR.setKeyboardOverlayShowing(false, null); ++ return; ++ } ++ ++ char c0 = Keyboard.getEventCharacter(); + + if (Keyboard.getEventKey() == 0 && c0 >= 32 || Keyboard.getEventKeyState()) + { this.keyTyped(c0, Keyboard.getEventKey()); } -+ if(Keyboard.getEventKey()==1) MCOpenVR.setKeyboardOverlayShowing(false, null); ++ + this.mc.dispatchKeypresses(); } -@@ -658,7 +697,16 @@ +@@ -658,7 +702,16 @@ { if (this.mc.theWorld != null) { @@ -115,7 +128,7 @@ } else { -@@ -736,7 +784,7 @@ +@@ -736,7 +789,7 @@ */ public static boolean isShiftKeyDown() { @@ -124,7 +137,7 @@ } /** -@@ -774,4 +822,93 @@ +@@ -774,4 +827,93 @@ { this.setWorldAndResolution(mcIn, w, h); } diff --git a/patches/net/minecraft/client/renderer/EntityRenderer.java.patch b/patches/net/minecraft/client/renderer/EntityRenderer.java.patch index 273ce41..2c39011 100644 --- a/patches/net/minecraft/client/renderer/EntityRenderer.java.patch +++ b/patches/net/minecraft/client/renderer/EntityRenderer.java.patch @@ -2298,7 +2298,7 @@ public boolean setFxaaShader(int p_setFxaaShader_1_) { if (!OpenGlHelper.isFramebufferEnabled()) -@@ -2858,4 +2903,2152 @@ +@@ -2858,4 +2903,2151 @@ GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.popMatrix(); } @@ -3016,8 +3016,7 @@ + GlStateManager.enableDepth(); + GlStateManager.depthMask(true); + } -+ if(shaders) Shaders.useProgram(0); -+ ++ + GlStateManager.disableCull(); + + //Render framebuffer onto world projection diff --git a/patches/net/minecraft/client/renderer/RenderItem.java.patch b/patches/net/minecraft/client/renderer/RenderItem.java.patch index d4b5492..007b045 100644 --- a/patches/net/minecraft/client/renderer/RenderItem.java.patch +++ b/patches/net/minecraft/client/renderer/RenderItem.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/renderer/RenderItem.java +++ b/net/minecraft/client/renderer/RenderItem.java -@@ -166,16 +166,25 @@ +@@ -166,16 +166,27 @@ } } @@ -14,7 +14,9 @@ GlStateManager.pushMatrix(); GlStateManager.translate(-0.5F, -0.5F, -0.5F); -+ float fade = Minecraft.getMinecraft().thePlayer.getCooledAttackStrength(par1); ++ float fade = 1; ++ if(Minecraft.getMinecraft().thePlayer!=null) ++ fade= Minecraft.getMinecraft().thePlayer.getCooledAttackStrength(par1); + + if(fade < 0.1) fade = 0.1f; + if(!ismainhand) fade = 1; @@ -28,7 +30,7 @@ GlStateManager.enableRescaleNormal(); TileEntityItemStackRenderer.instance.renderByItem(stack); } -@@ -187,7 +196,13 @@ +@@ -187,7 +198,13 @@ this.modelLocation = null; } @@ -43,7 +45,7 @@ if (stack.hasEffect() && (!Config.isCustomItems() || !CustomItems.renderCustomEffect(this, stack, model))) { -@@ -304,7 +319,7 @@ +@@ -304,7 +321,7 @@ if (stack != null) { IBakedModel ibakedmodel = this.getItemModelWithOverrides(stack, (World)null, (EntityLivingBase)null); @@ -52,7 +54,7 @@ } } -@@ -333,16 +348,16 @@ +@@ -333,16 +350,16 @@ } } @@ -72,7 +74,7 @@ { if (stack.getItem() != null) { -@@ -370,7 +385,7 @@ +@@ -370,7 +387,7 @@ } } @@ -81,7 +83,7 @@ GlStateManager.cullFace(GlStateManager.CullFace.BACK); GlStateManager.popMatrix(); GlStateManager.disableRescaleNormal(); -@@ -415,7 +430,7 @@ +@@ -415,7 +432,7 @@ bakedmodel.getItemCameraTransforms().applyTransform(ItemCameraTransforms.TransformType.GUI); } diff --git a/src/com/mtbs3d/minecrift/provider/OpenVRPlayer.java b/src/com/mtbs3d/minecrift/provider/OpenVRPlayer.java index cfaa8ff..f59d0a4 100644 --- a/src/com/mtbs3d/minecrift/provider/OpenVRPlayer.java +++ b/src/com/mtbs3d/minecrift/provider/OpenVRPlayer.java @@ -826,6 +826,8 @@ private boolean checkAndSetTeleportDestination(Minecraft mc, Entity player, Vec3 } private boolean canStand(World w, BlockPos bp){ + if(w.getBlockState(bp).getBlock().isPassable(w, bp) && !w.getBlockState(bp).isFullBlock()) + bp = bp.down(); //raytrace hit snow or something... return !w.getBlockState(bp).getBlock().isPassable(w, bp) && w.getBlockState(bp.up()).getBlock().isPassable(w, bp.up()) && w.getBlockState(bp.up(2)).getBlock().isPassable(w, bp.up(2)); } diff --git a/src/com/mtbs3d/minecrift/tweaker/MinecriftClassTransformer.java b/src/com/mtbs3d/minecrift/tweaker/MinecriftClassTransformer.java index 2c0e2a5..841c319 100644 --- a/src/com/mtbs3d/minecrift/tweaker/MinecriftClassTransformer.java +++ b/src/com/mtbs3d/minecrift/tweaker/MinecriftClassTransformer.java @@ -87,12 +87,14 @@ public byte[] transform(String name, String transformedName, byte[] bytes) else { // Perform any additional mods using ASM minecriftClass = performAsmModification(minecriftClass, transformedName); + if(bytes.length != minecriftClass.length) debug(String.format("Minecrift: Overwrite " + name +" "+ transformedName + " " + bytes.length + " > " + minecriftClass.length)); //writeToFile("original", transformedName, name, bytes); //writeToFile("transformed", transformedName, name, minecriftClass); } + return minecriftClass != null ? minecriftClass : bytes; }