From 8de4e5e56783b2ef4c8cdbb60d2d4443d2df224c Mon Sep 17 00:00:00 2001 From: jrbudda Date: Fri, 22 Sep 2017 13:59:09 -0400 Subject: [PATCH] 1122 fix some thigns --- build.py | 2 +- .../client/gui/GuiOptions.java.patch | 27 +- .../client/renderer/ItemRenderer.java.patch | 566 +++++++++++++++++- .../renderer/chunk/RenderChunk.java.patch | 9 + .../entity/projectile/EntityArrow.java.patch | 17 + src/com/mtbs3d/minecrift/asm/ObfNames.java | 10 +- 6 files changed, 618 insertions(+), 13 deletions(-) diff --git a/build.py b/build.py index f695603..6d94c14 100644 --- a/build.py +++ b/build.py @@ -74,7 +74,7 @@ def create_install(mcp_dir): # continue #if cur_file in {'aej.class', 'aej$1.class', 'aej$2.class', 'aej$3.class', 'aej$4.class', 'aej$5.class', 'aej$6.class', 'aej$7.class', 'aej$8.class', 'aej$9.class', 'aej$10.class', 'aej$11.class', 'aej$12.class'}: #skip creativetabs - wtf # continue - if cur_file in {'bme.class', 'bmn.class', 'bmn$a.class','bmn$b.class', 'bmn$c.class'}: #skip guicontainer and guicontainercreative - asm + if cur_file in {'bmg.class', 'bmp.class', 'bmp$a.class', 'bmp$b.class', 'bmp$c.class'}: #skip guicontainer and guicontainercreative - asm continue if cur_file in {'Matrix4f.class'}: #why continue diff --git a/patches/net/minecraft/client/gui/GuiOptions.java.patch b/patches/net/minecraft/client/gui/GuiOptions.java.patch index 0d847c3..bb15788 100644 --- a/patches/net/minecraft/client/gui/GuiOptions.java.patch +++ b/patches/net/minecraft/client/gui/GuiOptions.java.patch @@ -26,7 +26,32 @@ this.title = I18n.format("options.title"); int i = 0; -@@ -199,6 +204,14 @@ +@@ -38,11 +43,21 @@ + { + if (gamesettings$options.isFloat()) + { +- this.buttonList.add(new GuiOptionSlider(gamesettings$options.getOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1), gamesettings$options)); +- } ++ /** MINECRIFT */ ++ if (gamesettings$options.getTranslation().equalsIgnoreCase("options.fov")) ++ { ++ GuiOptionButton var7 = new GuiOptionButton(666, this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 - 12 + 24 * (var1 >> 1), "VR Settings..."); ++ this.buttonList.add(var7); ++ } ++ else ++ { ++ this.buttonList.add(new GuiOptionSlider(gamesettings$options.getOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 - 12 + 24 * (var1 >> 1), gamesettings$options)); ++ } ++ /** END MINECRIFT */ } ++ + else + { +- GuiOptionButton guioptionbutton = new GuiOptionButton(gamesettings$options.getOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1), gamesettings$options, this.settings.getKeyBinding(gamesettings$options)); ++ GuiOptionButton guioptionbutton = new GuiOptionButton(gamesettings$options.getOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1), gamesettings$options, this.settings.getKeyBinding(gamesettings$options)); + this.buttonList.add(guioptionbutton); + } + +@@ -199,6 +214,14 @@ this.mc.gameSettings.saveOptions(); this.mc.displayGuiScreen(new GuiScreenOptionsSounds(this, this.settings)); } diff --git a/patches/net/minecraft/client/renderer/ItemRenderer.java.patch b/patches/net/minecraft/client/renderer/ItemRenderer.java.patch index 5f35591..1bd7ebb 100644 --- a/patches/net/minecraft/client/renderer/ItemRenderer.java.patch +++ b/patches/net/minecraft/client/renderer/ItemRenderer.java.patch @@ -165,7 +165,61 @@ private void renderArm(EnumHandSide p_187455_1_) { this.mc.getTextureManager().bindTexture(this.mc.player.getLocationSkin()); -@@ -204,14 +251,17 @@ +@@ -174,29 +221,31 @@ + + private void renderMapFirstPersonSide(float p_187465_1_, EnumHandSide hand, float p_187465_3_, ItemStack stack) + { +- float f = hand == EnumHandSide.RIGHT ? 1.0F : -1.0F; +- GlStateManager.translate(f * 0.125F, -0.125F, 0.0F); ++ float f = hand == EnumHandSide.RIGHT ? 1.0F : -1.0F; + +- if (!this.mc.player.isInvisible()) +- { +- GlStateManager.pushMatrix(); +- GlStateManager.rotate(f * 10.0F, 0.0F, 0.0F, 1.0F); +- this.renderArmFirstPerson(p_187465_1_, p_187465_3_, hand); +- GlStateManager.popMatrix(); +- } +- +- GlStateManager.pushMatrix(); +- GlStateManager.translate(f * 0.51F, -0.08F + p_187465_1_ * -1.2F, -0.75F); +- float f1 = MathHelper.sqrt(p_187465_3_); +- float f2 = MathHelper.sin(f1 * (float)Math.PI); +- float f3 = -0.5F * f2; +- float f4 = 0.4F * MathHelper.sin(f1 * ((float)Math.PI * 2F)); +- float f5 = -0.3F * MathHelper.sin(p_187465_3_ * (float)Math.PI); +- GlStateManager.translate(f * f3, f4 - 0.3F * f2, f5); +- GlStateManager.rotate(f2 * -45.0F, 1.0F, 0.0F, 0.0F); +- GlStateManager.rotate(f * f2 * -30.0F, 0.0F, 1.0F, 0.0F); +- this.renderMapFirstPerson(stack); +- GlStateManager.popMatrix(); ++ if (!this.mc.player.isInvisible()) ++ { ++ // GlStateManager.pushMatrix(); ++ // GlStateManager.rotate(f * 10.0F, 0.0F, 0.0F, 1.0F); ++ // this.renderArmFirstPerson(p_187465_1_, p_187465_3_, p_187465_2_); ++ // GlStateManager.popMatrix(); ++ } ++ ++ GlStateManager.pushMatrix(); ++ GlStateManager.translate(-f * 0F, 0.225F, -0.1F); ++ GlStateManager.rotate(-30.0F, 1.0F, 0.0F, 0.0F); ++ GlStateManager.rotate(-30.0F*f, 0.0F, 1.0F, 0.0F); ++ // GlStateManager.translate(f * 0.51F, -0.08F + p_187465_1_ * -1.2F, -0.75F); ++ float f1 = MathHelper.sqrt(p_187465_3_); ++ float f2 = MathHelper.sin(f1 * (float)Math.PI); ++ float f3 = -0.5F * f2; ++ float f4 = 0.4F * MathHelper.sin(f1 * ((float)Math.PI * 2F)); ++ float f5 = -0.3F * MathHelper.sin(p_187465_3_ * (float)Math.PI); ++ // GlStateManager.translate(f * f3, f4 - 0.3F * f2, f5); ++ // GlStateManager.rotate(f2 * -45.0F, 1.0F, 0.0F, 0.0F); ++ // GlStateManager.rotate(f * f2 * -30.0F, 0.0F, 1.0F, 0.0F); ++ this.renderMapFirstPerson(stack); ++ GlStateManager.popMatrix(); + } + + private void renderMapFirstPerson(float p_187463_1_, float p_187463_2_, float p_187463_3_) +@@ -204,14 +253,17 @@ float f = MathHelper.sqrt(p_187463_3_); float f1 = -0.2F * MathHelper.sin(p_187463_3_ * (float)Math.PI); float f2 = -0.4F * MathHelper.sin(f * (float)Math.PI); @@ -189,7 +243,507 @@ this.renderMapFirstPerson(this.itemStackMainHand); } -@@ -379,56 +429,173 @@ +@@ -242,76 +294,104 @@ + GlStateManager.enableLighting(); + } + +- private void renderArmFirstPerson(float p_187456_1_, float p_187456_2_, EnumHandSide p_187456_3_) +- { +- boolean flag = p_187456_3_ != EnumHandSide.LEFT; ++ private void renderArmFirstPerson(float equipProgress, float swingProgress, EnumHandSide side) ++ { //render arm ++ ++ boolean flag = side != EnumHandSide.LEFT; + float f = flag ? 1.0F : -1.0F; +- float f1 = MathHelper.sqrt(p_187456_2_); +- float f2 = -0.3F * MathHelper.sin(f1 * (float)Math.PI); +- float f3 = 0.4F * MathHelper.sin(f1 * ((float)Math.PI * 2F)); +- float f4 = -0.4F * MathHelper.sin(p_187456_2_ * (float)Math.PI); +- GlStateManager.translate(f * (f2 + 0.64000005F), f3 + -0.6F + p_187456_1_ * -0.6F, f4 + -0.71999997F); +- GlStateManager.rotate(f * 45.0F, 0.0F, 1.0F, 0.0F); +- float f5 = MathHelper.sin(p_187456_2_ * p_187456_2_ * (float)Math.PI); +- float f6 = MathHelper.sin(f1 * (float)Math.PI); +- GlStateManager.rotate(f * f6 * 70.0F, 0.0F, 1.0F, 0.0F); +- GlStateManager.rotate(f * f5 * -20.0F, 0.0F, 0.0F, 1.0F); + AbstractClientPlayer abstractclientplayer = this.mc.player; + this.mc.getTextureManager().bindTexture(abstractclientplayer.getLocationSkin()); +- GlStateManager.translate(f * -1.0F, 3.6F, 3.5F); +- GlStateManager.rotate(f * 120.0F, 0.0F, 0.0F, 1.0F); +- GlStateManager.rotate(200.0F, 1.0F, 0.0F, 0.0F); +- GlStateManager.rotate(f * -135.0F, 0.0F, 1.0F, 0.0F); +- GlStateManager.translate(f * 5.6F, 0.0F, 0.0F); +- RenderPlayer renderplayer = (RenderPlayer)this.renderManager.getEntityRenderObject(abstractclientplayer); +- GlStateManager.disableCull(); +- +- if (flag) +- { +- renderplayer.renderRightArm(abstractclientplayer); +- } +- else +- { +- renderplayer.renderLeftArm(abstractclientplayer); +- } +- ++ ++// float f1 = MathHelper.sqrt_float(swingProgress); ++// float f2 = -0.3F * MathHelper.sin(f1 * (float)Math.PI); ++// float f3 = 0.4F * MathHelper.sin(f1 * ((float)Math.PI * 2F)); ++// float f4 = -0.4F * MathHelper.sin(swingProgress * (float)Math.PI); ++// GlStateManager.translate(f * (f2 + 0.64000005F), f3 + -0.6F + equipProgress * -0.6F, f4 + -0.71999997F); ++// GlStateManager.rotate(f * 45.0F, 0.0F, 1.0F, 0.0F); ++// float f5 = MathHelper.sin(swingProgress * swingProgress * (float)Math.PI); ++// float f6 = MathHelper.sin(f1 * (float)Math.PI); ++// GlStateManager.rotate(f * f6 * 70.0F, 0.0F, 1.0F, 0.0F); ++// GlStateManager.rotate(f * f5 * -20.0F, 0.0F, 0.0F, 1.0F); ++// GlStateManager.translate(f * -1.0F, 3.6F, 3.5F); ++// GlStateManager.rotate(f * 120.0F, 0.0F, 0.0F, 1.0F); ++// GlStateManager.rotate(200.0F, 1.0F, 0.0F, 0.0F); ++// GlStateManager.rotate(f * -135.0F, 0.0F, 1.0F, 0.0F); ++// GlStateManager.translate(f * 5.6F, 0.0F, 0.0F); ++ //VIVE this is all thats needed to align hands with controllers. ++ //TODO: Animation. ++ ++ GlStateManager.pushMatrix(); ++ ++ this.transformFirstPerson(side, swingProgress); ++ ++ GlStateManager.scale(0.4f, 0.4F, 0.4F); ++ GlStateManager.translate(0.375*-f, 0, .75); ++ GlStateManager.rotate(-90, 1, 0,0); ++ GlStateManager.disableCull(); ++ ++ GlStateManager.rotate(180, 0, 1, 0); ++ ++ if (flag) ++ { ++ myRenderVRPlayer.renderRightArm(abstractclientplayer); ++ } ++ else ++ { ++ myRenderVRPlayer.renderLeftArm(abstractclientplayer); ++ } ++ GlStateManager.popMatrix(); + GlStateManager.enableCull(); + } +- +- private void transformEatFirstPerson(float p_187454_1_, EnumHandSide hand, ItemStack stack) ++ ++ private void transformEatFirstPerson(float progress, EnumHandSide side, ItemStack item) + { +- float f = (float)this.mc.player.getItemInUseCount() - p_187454_1_ + 1.0F; +- float f1 = f / (float)stack.getMaxItemUseDuration(); ++ float f = (float)this.mc.player.getItemInUseCount() - progress + 1.0F; ++ float f1 = f / (float)item.getMaxItemUseDuration(); + + if (f1 < 0.8F) + { + float f2 = MathHelper.abs(MathHelper.cos(f / 4.0F * (float)Math.PI) * 0.1F); +- GlStateManager.translate(0.0F, f2, 0.0F); ++ // GlStateManager.translate(0.0F, f2, 0.0F); + } + +- float f3 = 1.0F - (float)Math.pow((double)f1, 27.0D); +- int i = hand == EnumHandSide.RIGHT ? 1 : -1; +- GlStateManager.translate(f3 * 0.6F * (float)i, f3 * -0.5F, f3 * 0.0F); +- GlStateManager.rotate((float)i * f3 * 90.0F, 0.0F, 1.0F, 0.0F); +- GlStateManager.rotate(f3 * 10.0F, 1.0F, 0.0F, 0.0F); +- GlStateManager.rotate((float)i * f3 * 30.0F, 0.0F, 0.0F, 1.0F); ++ if(!Minecraft.getMinecraft().autoFood.isEating()) { ++ float f3 = 1.0F - (float) Math.pow((double) f1, 27.0D); ++ int i = side == EnumHandSide.RIGHT ? 1 : -1; ++ // GlStateManager.translate(f3 * 0.6F * (float)i, f3 * -0.5F, f3 * 0.0F); ++ GlStateManager.rotate((float) i * f3 * 90.0F, 0.0F, 1.0F, 0.0F); ++ GlStateManager.rotate(f3 * 10.0F, 1.0F, 0.0F, 0.0F); ++ GlStateManager.rotate((float) i * f3 * 30.0F, 0.0F, 0.0F, 1.0F); ++ } else { //OM NOM NOM NOM ++ long t = this.mc.player.getItemInUseCount(); ++ GlStateManager.translate(0,0.006*Math.sin(t), 0); ++ } + } + +- private void transformFirstPerson(EnumHandSide hand, float p_187453_2_) +- { +- int i = hand == EnumHandSide.RIGHT ? 1 : -1; +- float f = MathHelper.sin(p_187453_2_ * p_187453_2_ * (float)Math.PI); +- GlStateManager.rotate((float)i * (45.0F + f * -20.0F), 0.0F, 1.0F, 0.0F); +- float f1 = MathHelper.sin(MathHelper.sqrt(p_187453_2_) * (float)Math.PI); +- GlStateManager.rotate((float)i * f1 * -20.0F, 0.0F, 0.0F, 1.0F); +- GlStateManager.rotate(f1 * -80.0F, 1.0F, 0.0F, 0.0F); +- GlStateManager.rotate((float)i * -45.0F, 0.0F, 1.0F, 0.0F); +- } + +- private void transformSideFirstPerson(EnumHandSide hand, float p_187459_2_) +- { +- int i = hand == EnumHandSide.RIGHT ? 1 : -1; +- GlStateManager.translate((float)i * 0.56F, -0.52F + p_187459_2_ * -0.6F, -0.72F); ++ private void transformFirstPerson(EnumHandSide side, float swingprogress) ++ { ++ if(swingprogress == 0) return; ++ //VIVE TODO: SOMETHING ++ int i = side == EnumHandSide.RIGHT ? 1 : -1; ++ float f = MathHelper.sin(swingprogress * swingprogress * (float)Math.PI); ++ // GlStateManager.rotate((float)i * (45.0F + f * -20.0F), 0.0F, 1.0F, 0.0F); ++ float f1 = 0.5f * MathHelper.sin(MathHelper.sqrt(swingprogress) * (float)Math.PI); ++ float f2= MathHelper.sin((float) (swingprogress *3*Math.PI)); ++ if(swingprogress > 0.5) { ++ f2= MathHelper.sin((float) (swingprogress *Math.PI + Math.PI)); ++ } ++ GlStateManager.translate(0,0,-f1); ++ // GlStateManager.rotate((float)i * f1 * -20.0F, 0.0F, 0.0F, 1.0F); ++ GlStateManager.rotate((f2) * 45.0F , 1.0F, 0.0F, 0.0F); ++ // GlStateManager.rotate((float)i * -45.0F, 0.0F, 1.0F, 0.0F); ++ } ++ ++ //better name would be doEquipItemAnimation ++ private void transformSideFirstPerson(EnumHandSide side, float equippingprogress) ++ { ++ //VIVE NOOP ++// int i = side == EnumHandSide.RIGHT ? 1 : -1; ++// GlStateManager.translate((float)i * 0.56F, -0.52F + equippingprogress * -0.6F, -0.72F); + } + + /** +@@ -370,8 +450,338 @@ + RenderHelper.disableStandardItemLighting(); + } + +- public void renderItemInFirstPerson(AbstractClientPlayer player, float p_187457_2_, float p_187457_3_, EnumHand hand, float p_187457_5_, ItemStack stack, float p_187457_7_) ++ public void renderItemInFirstPerson(AbstractClientPlayer player, float partialTicks, float bodyPitch, EnumHand hand, float swingProgress, @Nullable ItemStack itemstack, float equippingprogress) + { ++ boolean mainHand = hand == EnumHand.MAIN_HAND; ++ EnumHandSide enumhandside = mainHand ? player.getPrimaryHand() : player.getPrimaryHand().opposite(); ++ equippingprogress = getEquipProgress(hand, partialTicks); ++ //VIVE ++ // if (itemstack == null) ++ // { ++ // if (mainHand && !player.isInvisible()) ++ // { ++ // this.renderArmFirstPerson(equippingprogress, swingProgress, enumhandside); ++ // } ++ // } ++ ++ boolean shouldrenderhand = true; ++ ++ if(itemstack!=null){ ++ GlStateManager.pushMatrix(); ++ boolean thing = false; ++ ++ if (itemstack.getItem() instanceof ItemMap) ++ { ++ if (mainHand && this.itemStackOffHand == null) ++ { ++ this.renderMapFirstPerson(bodyPitch, equippingprogress, swingProgress); ++ } ++ else ++ { ++ this.renderMapFirstPersonSide(equippingprogress, enumhandside, swingProgress, itemstack); ++ } ++ } ++ else ++ { ++ boolean rightSide = enumhandside == EnumHandSide.RIGHT; ++ int i = rightSide ? 1 : -1; ++ ++ if (player.isHandActive() && player.getItemInUseCount() > 0 && player.getActiveHand() == hand) ++ { //using animations ++ int j = rightSide ? 1 : -1; ++ ++ switch (itemstack.getItemUseAction()) ++ { ++ case NONE: ++ this.transformSideFirstPerson(enumhandside, equippingprogress); ++ break; ++ ++ case EAT: ++ case DRINK: ++ this.transformEatFirstPerson(partialTicks, enumhandside, itemstack); ++ this.transformSideFirstPerson(enumhandside, equippingprogress); ++ break; ++ ++ case BLOCK: ++ GlStateManager.scale(1.2, 1.2, 1.2); ++ if(player.isActiveItemStackBlocking()){ ++ GlStateManager.rotate(i*90.0F, 0.0F, 1.0F, 0.0F); ++ } else{ ++ GlStateManager.rotate((1-equippingprogress)*i*90.0F, 0.0F, 1.0F, 0.0F); ++ } ++ ++ this.transformSideFirstPerson(enumhandside, equippingprogress); ++ break; ++ ++ case BOW: ++ // this.doEquipItemAnimation(enumhandside, equippingprogress); ++ // GlStateManager.translate((float)j * -0.2785682F, 0.18344387F, 0.15731531F); ++ // GlStateManager.rotate(-13.935F, 1.0F, 0.0F, 0.0F); ++ // GlStateManager.rotate((float)j * 35.3F, 0.0F, 1.0F, 0.0F); ++ // GlStateManager.rotate((float)j * -9.785F, 0.0F, 0.0F, 1.0F); ++ // float f5 = (float)itemstack.getMaxItemUseDuration() - ((float)this.mc.player.getItemInUseCount() - partialTicks + 1.0F); ++ // float f6 = f5 / 20.0F; ++ // f6 = (f6 * f6 + f6 * 2.0F) / 3.0F; ++ // ++ // if (f6 > 1.0F) ++ // { ++ // f6 = 1.0F; ++ // } ++ // ++ // if (f6 > 0.1F) ++ // { ++ // float f7 = MathHelper.sin((f5 - 0.1F) * 1.3F); ++ // float f3 = f6 - 0.1F; ++ // float f4 = f7 * f3; ++ // GlStateManager.translate(f4 * 0.0F, f4 * 0.004F, f4 * 0.0F); ++ // } ++ // ++ // GlStateManager.translate(f6 * 0.0F, f6 * 0.0F, f6 * 0.04F); ++ // GlStateManager.scale(1.0F, 1.0F, 1.0F + f6 * 0.2F); ++ // GlStateManager.rotate((float)j * 45.0F, 0.0F, -1.0F, 0.0F); ++ break; ++ default: ++ break; ++ } ++ } ++ ++ { ++ float f = -0.4F * MathHelper.sin(MathHelper.sqrt(swingProgress) * (float)Math.PI); ++ float f1 = 0.2F * MathHelper.sin(MathHelper.sqrt(swingProgress) * ((float)Math.PI * 2F)); ++ float f2 = -0.2F * MathHelper.sin(swingProgress * (float)Math.PI); ++ ++ //GlStateManager.translate((float)i * f, f1, f2); ++ this.transformSideFirstPerson(enumhandside, equippingprogress); ++ ++ if(player.swingingHand == hand) ++ this.transformFirstPerson(enumhandside, swingProgress); ++ ++ //VIVE manually adjust items based on type... no other choice :( ++ ++ Item item = itemstack.getItem(); ++ ++ boolean vive = MCOpenVR.isVive(); ++ ++ boolean sword = false, tool = false; ++ boolean bow = BowTracker.isBow(itemstack); ++ ++ if(bow && item.getClass().getName().equals("FryPan")){ ++ bow = false; ++ tool = true; ++ } ++ ++ if(!bow && Reflector.forgeExists()){ //tinkers ++ String t = item.getClass().getSuperclass().getName().toLowerCase(); ++ if (t.contains("weapon") || t.contains("sword")) { ++ sword = true; ++ tool = true; ++ } else if (t.contains("tool")){ ++ tool = true; ++ } ++ } ++ ++ if(item instanceof ItemBlock){ ++ ++ if (this.itemRenderer.shouldRenderItemIn3D(itemstack)){ ++ GlStateManager.translate(0f, 0f, -0.1f); ++ GlStateManager.scale(0.2, 0.2, 0.2); ++ }else if(((ItemBlock) item).getBlock() == Blocks.TORCH) { ++ GlStateManager.translate(0f, 0.05f, -0.2f); ++ GlStateManager.scale(0.6, 0.6, 0.6); ++ GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F); ++ GlStateManager.rotate(-75.0F, 0.0F, 0.0F, 1.0F); ++ }else{ ++ GlStateManager.translate(0f, 0f, -0.15f); ++ GlStateManager.scale(0.3, 0.3, 0.3); ++ GlStateManager.rotate(-i*45.0F, 0.0F, 1.0F, 0.0F); ++ } ++ } ++ else if(item instanceof ItemSword || sword) ++ { ++ if(vive){ ++ GlStateManager.translate(0f, 0f, -0.2f); ++ GlStateManager.scale(0.6, 0.6, 0.6); ++ GlStateManager.rotate(-45F, 1.0F, 0.0F, 0.0F); ++ GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F); ++ } else { ++ GlStateManager.translate(0f, 0.10f, -0.125f); ++ GlStateManager.scale(0.6, 0.6, 0.6); ++ GlStateManager.rotate(-45F + 39.4f, 1.0F, 0.0F, 0.0F); ++ GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F); ++ } ++ ++ } ++ else if(item instanceof ItemTool || ++ item instanceof ItemArrow || ++ item instanceof ItemHoe || ++ item instanceof ItemFishingRod || ++ item instanceof ItemCarrotOnAStick || ++ item instanceof ItemShears|| ++ item instanceof ItemFlintAndSteel || ++ tool) ++ ++ { ++ ++ if(mc.climbTracker.isClaws(itemstack) && mc.climbTracker.isClimbeyClimb()){ ++ ++ GlStateManager.scale(0.3, 0.3, 0.3); ++ GlStateManager.translate(-.025f, .12f, .25f); ++ GlStateManager.rotate(90, 0, 0, 1); ++ ++ if((mc.gameSettings.keyBindAttack.isKeyDown() && rightSide) || ++ ((mc.climbTracker.isGrabbingLadder() || !mc.player.onGround) && mc.gameSettings.keyBindForward.isKeyDown() && !rightSide)) { ++ GlStateManager.translate(0f, 0f, -.2f); ++ } ++ ++ } ++ ++ if(vive){ ++ GlStateManager.translate(0f, -.025f, -0.1f); ++ GlStateManager.scale(0.6, 0.6, 0.6); ++ if(item instanceof ItemCarrotOnAStick || item instanceof ItemFishingRod) {} ++ else ++ GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); ++ GlStateManager.rotate(-45F, 1.0F, 0.0F, 0.0F); ++ GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F); ++ } else { ++ GlStateManager.translate(0f, 0.035, -0.1f); ++ GlStateManager.scale(0.6, 0.6, 0.6); ++ if(item instanceof ItemCarrotOnAStick || item instanceof ItemFishingRod) { ++ GlStateManager.rotate(39.4f, 1.0F, 0.0F, 0.0F); ++ } ++ else ++ GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); ++ GlStateManager.rotate(-45F - 39.4f, 1.0F, 0.0F, 0.0F); ++ GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F); ++ } ++ ++ ++ } ++ else if(item instanceof ItemShield){ ++ GlStateManager.scale(0.4, 0.4, 0.4); ++ GlStateManager.rotate(i*90.0F, 0.0F, 1.0F, 0.0F); ++ GlStateManager.translate(.5,0.5,.6); ++ } ++ else if(bow){ ++ //shouldrenderhand = false; ++ GlStateManager.scale(1.0f, 1.0f, 1.0f); ++ shouldrenderhand = false; ++ if(mc.bowTracker.isDrawing){ //here there be dragons ++ ++ int c = 0; ++ if (mc.vrSettings.vrReverseShootingEye) c = 1; ++ ++ Vec3d aim = mc.bowTracker.getAimVector(); ++ Vec3d a = new Vec3d(aim.x, aim.y, aim.z); ++ //a.rotateAroundY(-mc.vrSettings.vrWorldRotation); ++ Vector3f aimCopy = new Vector3f((float)a.x,(float) a.y, (float)a.z); ++ ++ //Matrix4f left = mc.lookaimController.getAimRotation(1); ++ ++ Vec3d lup = mc.vrPlayer.getCustomHandVector(1, new Vec3d(0, -1, 0)); ++ Vector3f current = new Vector3f((float)lup.x, (float)lup.y, (float)lup.z); ++ Vec3d lback = mc.vrPlayer.getCustomHandVector(1, new Vec3d(0, 0, -1)); ++ ++ Vector3f currentfore = new Vector3f((float)lback.x, (float)lback.y, (float)lback.z); ++ ++ Vector3f v = aimCopy.cross(current); ++ double d = 180 / Math.PI * Math.acos(aimCopy.dot(current)); ++ ++ float pitch = (float)Math.toDegrees(Math.asin(aimCopy.y/aimCopy.length())); ++ float yaw = (float)Math.toDegrees(Math.atan2(aimCopy.x, aimCopy.z)); ++ ++ Vector3f up = new Vector3f(0,1,0); ++ ++ Vector3f pAim2 = new Vector3f(0,0,0); ++ ++ aimCopy.y = 0 ; // we want the normal to a aiming plane, but vertical. ++ ++ float porjaim = currentfore.dot(aimCopy); //angle between controller up and aim, just for ortho check ++ if(porjaim !=0) { //check to make sure we arent holding the bow perfectly straight up. ++ pAim2 = aimCopy.divide(1/porjaim); //projection of l_controller_up onto aim vector ... why is there no multiply? ++ } ++ ++ float dot =0; ++ Vector3f proj = currentfore.subtract(pAim2).normalised(); //subtract to get projection of LCU onto vertical aim plane ++ ++ dot = proj.dot(up); //angle between our projection and straight up (the default bow render pos.) ++ ++ float dot2 = aimCopy.dot(proj.cross(up)); //angle sign test, negative is left roll ++ ++ float angle; ++ ++ if (dot2 < 0) ++ angle = -(float) Math.acos(dot); ++ else angle = (float) Math.acos(dot); ++ ++ float roll = (float) (180 / Math.PI * angle); //calulate bow model roll. ++ ++ GlStateManager.rotate(yaw, 0.0F,1.0F, 0.0F); ++ GlStateManager.rotate(-pitch, 1.0F, 0.0F, 0.0F); ++ ++ GlStateManager.rotate(-roll, 0.0F, 0.0F, 1.0F); ++ GlStateManager.rotate(90f, 1.0F, 0.0F, 0.0F); ++ // GlStateManager.rotate(-180.0F, 0.0F, 0.0F, 1.0F); ++ ++ if(mc.bowTracker.isCharged()){ ++ long t = Minecraft.getSystemTime() - mc.bowTracker.startDrawTime; ++ GlStateManager.translate(0.003*Math.sin(t),0, 0); ++ } ++ GlStateManager.scale(1,mc.bowTracker.getDrawPercent()*0.15+1,1); ++ ++ ++ } ++ else if(mc.vrSettings.seated){ ++ GlStateManager.rotate(90f, 1.0F, 0.0F, 0.0F); ++ } ++ ++ if(vive || mc.bowTracker.isDrawing){ ++ GlStateManager.translate(-0.012, 0.2, 00); ++ GlStateManager.rotate(-45F, 1.0F, 0.0F, 0.0F); ++ } else { ++ GlStateManager.translate(-0.012, 0.17, .100); ++ GlStateManager.rotate(-45F + 39.4f, 1.0F, 0.0F, 0.0F ); ++ } ++ ++ GlStateManager.rotate(-90.0F, 0.0F, 1.0F, 0.0F); ++ GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F); ++ ++ } ++ else { //NORMAL ITEMS ++ GlStateManager.translate(0f, 0f, -0.1f); ++ GlStateManager.scale(0.3, 0.3, 0.3); ++ GlStateManager.rotate(-i*45.0F, 0.0F, 1.0F, 0.0F); ++ } ++ } ++ ++ this.itemRenderer.ismainhand = mainHand; ++ this.itemRenderer.isfphand = true; ++ ++ //VIVE use 'NONE' transforms. ++ if(!thing) ++ this.renderItemSide(partialTicks,player, itemstack, rightSide ? ItemCameraTransforms.TransformType.NONE : ItemCameraTransforms.TransformType.NONE, !rightSide); ++ else ++ this.renderItemSide(partialTicks,player, itemstack, rightSide ? ItemCameraTransforms.TransformType.THIRD_PERSON_RIGHT_HAND : ItemCameraTransforms.TransformType.THIRD_PERSON_LEFT_HAND, !rightSide); ++ ++ this.itemRenderer.ismainhand = false; ++ this.itemRenderer.isfphand = false; ++ ++ } ++ GlStateManager.popMatrix(); ++ } ++ if(mc.player.isSneaking()) GlStateManager.color(1, 1, 1, 0.5f); ++ ++ if(mc.currentPass ==renderPass.Third && mc.vrSettings.mixedRealityRenderHands == false) ++ shouldrenderhand = false; ++ ++ if (shouldrenderhand && !player.isInvisible()) ++ { ++ GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); ++ this.renderArmFirstPerson(equippingprogress, player.swingingHand == hand ? swingProgress : 0, enumhandside); ++ } ++ ++ GlStateManager.color(1, 1, 1, 1); ++ + } + + /** +@@ -379,56 +789,173 @@ */ public void renderOverlays(float partialTicks) { @@ -306,8 +860,8 @@ + GlStateManager.enableDepth(); GlStateManager.enableAlpha(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - } - ++ } ++ + public boolean isInsideOfMaterial(Vec3d pos, Material materialIn) + { + BlockPos blockpos = new BlockPos(pos); @@ -388,8 +942,8 @@ + + return false; + -+ } -+ + } + + /** * Render the block in the player's hand diff --git a/patches/net/minecraft/client/renderer/chunk/RenderChunk.java.patch b/patches/net/minecraft/client/renderer/chunk/RenderChunk.java.patch index 174b596..e60a5f4 100644 --- a/patches/net/minecraft/client/renderer/chunk/RenderChunk.java.patch +++ b/patches/net/minecraft/client/renderer/chunk/RenderChunk.java.patch @@ -28,3 +28,12 @@ IBlockState iblockstate = chunkcacheof.getBlockState(blockposm); Block block = iblockstate.getBlock(); +@@ -276,7 +279,7 @@ + + if (flag1) + { +- Reflector.callVoid(Reflector.ForgeHooksClient_setRenderLayer, null); ++ Reflector.callVoid(Reflector.ForgeHooksClient_setRenderLayer, (Object[]) null); + } + } + diff --git a/patches/net/minecraft/entity/projectile/EntityArrow.java.patch b/patches/net/minecraft/entity/projectile/EntityArrow.java.patch index a2ee855..9670ccc 100644 --- a/patches/net/minecraft/entity/projectile/EntityArrow.java.patch +++ b/patches/net/minecraft/entity/projectile/EntityArrow.java.patch @@ -23,3 +23,20 @@ this.pickupStatus = EntityArrow.PickupStatus.ALLOWED; } } +@@ -122,6 +131,16 @@ + float f = -MathHelper.sin(yaw * 0.017453292F) * MathHelper.cos(pitch * 0.017453292F); + float f1 = -MathHelper.sin(pitch * 0.017453292F); + float f2 = MathHelper.cos(yaw * 0.017453292F) * MathHelper.cos(pitch * 0.017453292F); ++ ++ //VIVE SET VELOCITY ++ if(shooter.getEntityId() == Minecraft.getMinecraft().player.getEntityId()){ ++ if(!Minecraft.getMinecraft().vrSettings.seated ){ ++ velocity = (float) (Minecraft.getMinecraft().bowTracker.getDrawPercent() * 3f); ++ this.damage *= 2; ++ } ++ } ++ /// ++ + this.shoot((double)f, (double)f1, (double)f2, velocity, inaccuracy); + this.motionX += shooter.motionX; + this.motionZ += shooter.motionZ; diff --git a/src/com/mtbs3d/minecrift/asm/ObfNames.java b/src/com/mtbs3d/minecrift/asm/ObfNames.java index 765da16..6f2c8b2 100644 --- a/src/com/mtbs3d/minecrift/asm/ObfNames.java +++ b/src/com/mtbs3d/minecrift/asm/ObfNames.java @@ -1,8 +1,8 @@ package com.mtbs3d.minecrift.asm; public class ObfNames { - public static final String GUICONTAINER = "bme"; - public static final String GUICONTAINERCREATIVE = "bmn"; - public static final String GLSTATEMANAGER = "buq"; - public static final String SLOT = "agp"; -} + public static final String GUICONTAINER = "bmg"; + public static final String GUICONTAINERCREATIVE = "bmp"; + public static final String GLSTATEMANAGER = "bus"; + public static final String SLOT = "agr"; +} \ No newline at end of file