Skip to content

Commit

Permalink
7 release
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbudda committed May 25, 2018
1 parent a633afc commit 618ec21
Show file tree
Hide file tree
Showing 17 changed files with 189 additions and 208 deletions.
2 changes: 1 addition & 1 deletion minecriftversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
of_json_name = "1.12.2_HD_U_D3"
of_file_md5 = "374a1e03b490afc539dabc04b29b49e6"
minecrift_version_num = "1.12.2"
minecrift_build = "jrbudda-7-RC6"
minecrift_build = "jrbudda-7"
of_file_extension = ".jar"
mcp_version = "mcp940"
mcp_uses_generics = True
Expand Down
11 changes: 10 additions & 1 deletion patches/net/minecraft/client/Minecraft.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,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.12.2 jrbudda-7-RC6";
+ public final String minecriftVerString = "Vivecraft 1.12.2 jrbudda-7";
+ /* end version */
+ /** END MINECRIFT */
+
Expand Down Expand Up @@ -1111,6 +1111,15 @@
{
if (this.mcProfiler.profilingEnabled)
{
@@ -1432,7 +1960,7 @@
GlStateManager.matrixMode(5889);
GlStateManager.enableColorMaterial();
GlStateManager.loadIdentity();
- GlStateManager.ortho(0.0D, (double)this.displayWidth, (double)this.displayHeight, 0.0D, 1000.0D, 3000.0D);
+ GlStateManager.ortho(displayWidth/2, (double)this.displayWidth, (double)this.displayHeight, dispLastHeight/3, 1000.0D, 3000.0D);
GlStateManager.matrixMode(5888);
GlStateManager.loadIdentity();
GlStateManager.translate(0.0F, 0.0F, -2000.0F);
@@ -1559,7 +2087,8 @@
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,7 @@
public boolean startRiding(Entity entityIn, boolean force)
{
if (!super.startRiding(entityIn, force))
@@ -200,26 +270,51 @@
this.mc.getSoundHandler().playSound(new MovingSoundMinecartRiding(this, (EntityMinecart)entityIn));
}

- if (entityIn instanceof EntityBoat)
+ if (entityIn instanceof EntityBoat || entityIn instanceof AbstractHorse)
@@ -204,22 +274,47 @@
{
this.prevRotationYaw = entityIn.rotationYaw;
this.rotationYaw = entityIn.rotationYaw;
Expand Down
12 changes: 4 additions & 8 deletions patches/net/minecraft/client/model/ModelBoat.java.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/model/ModelBoat.java
+++ b/net/minecraft/client/model/ModelBoat.java
@@ -1,114 +1,179 @@
@@ -1,114 +1,175 @@
package net.minecraft.client.model;

+import com.mtbs3d.minecrift.gameplay.OpenVRPlayer;
Expand Down Expand Up @@ -223,6 +223,7 @@
+
+ Vec3d rArm = null;
+ Vec3d lArm = null;
+
+ if (boat.getControllingPassenger() instanceof EntityPlayer) {
+ UUID playerId = ((EntityPlayer) boat.getControllingPassenger()).getGameProfile().getId();
+ if (Minecraft.getMinecraft().player.getUniqueID().equals(playerId)) {
Expand All @@ -231,20 +232,17 @@
+ } else {
+ PlayerModelController.RotInfo rotInfo = PlayerModelController.getInstance().getRotationsForPlayer(playerId);
+ if (rotInfo != null) {
+ //TODO get room origin
+ rArm = rotInfo.rightArmPos;
+ lArm = rotInfo.leftArmPos;
+ }
+ }
+
+ }
+
+ if (rArm != null && lArm != null) {
+ Debug debug=new Debug(boat.getPositionVector());
+ if (rArm != null && lArm != null && Minecraft.getMinecraft().rowTracker.isActive(Minecraft.getMinecraft().player)) {
+ //Debug debug=new Debug(boat.getPositionVector());
+ //Attachment point converted from Model coordinates to boat-relative World coordinates
+ Vec3d attachmentPoint = new Vec3d(paddles[paddle].rotationPointZ * scale, (paddles[paddle].rotationPointY + 15) * scale, paddles[paddle].rotationPointX * scale);
+
+
+ Vec3d arm = paddle == 0 ? lArm : rArm;
+
+ Quaternion boatRot = new Quaternion(boat.rotationPitch, -boat.rotationYaw, 0).normalized();
Expand All @@ -259,10 +257,8 @@
+ Vector3 checkDir = paddle == 0 ? new Vector3(1, 0, 0) : new Vector3(-1, 0, 0);
+ Quaternion toForward=Quaternion.createFromToVector(checkDir,new Vector3(0,0,1));
+
+
+ Quaternion rotation = Quaternion.createFromToVector(new Vector3(0,0,1), new Vector3(toForward.multiply(boatRot.inverse().multiply(armToPaddle.normalize()))));
+
+
+ float mult = paddle == 0 ? -1 : 1;
+
+ Color c=paddle==0? Color.red: Color.green;
Expand Down
101 changes: 52 additions & 49 deletions patches/net/minecraft/client/model/ModelHorse.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
if (flag1)
{
this.horseFaceRopes.render(scale);
@@ -236,8 +250,77 @@
@@ -236,8 +250,80 @@

if (flag4)
{
Expand All @@ -65,77 +65,80 @@
+ //this.horseRightRein.render(scale);
+
+ //VIVECRAFT START
+ if (abstracthorse.getControllingPassenger() instanceof EntityPlayer) {
+ Debug debugAbs=new Debug(Vec3d.ZERO);
+ Debug debug=new Debug(abstracthorse.getPositionVector());
+ PlayerModelController.RotInfo rotInfo = PlayerModelController.getInstance().getRotationFromEntity((EntityPlayer) abstracthorse.getControllingPassenger());
+ if (abstracthorse.getControllingPassenger() instanceof EntityPlayer) {
+ EntityPlayer p = (EntityPlayer) abstracthorse.getControllingPassenger();
+
+ float partialTick=Minecraft.getMinecraft().timer.renderPartialTicks;
+ Debug debugAbs=new Debug(Vec3d.ZERO);
+ Debug debug=new Debug(abstracthorse.getPositionVector());
+ PlayerModelController.RotInfo rotInfo = PlayerModelController.getInstance().getRotationFromEntity((EntityPlayer) abstracthorse.getControllingPassenger());
+
+ Vec3d position=new Vec3d(abstracthorse.prevPosX+partialTick*(abstracthorse.posX-abstracthorse.prevPosX),
+ abstracthorse.prevPosY+partialTick*(abstracthorse.posY-abstracthorse.prevPosY),
+ abstracthorse.prevPosZ+partialTick*(abstracthorse.posZ-abstracthorse.prevPosZ));
+ if(rotInfo != null && !rotInfo.seated) {
+
+ Vec3d delta=new Vec3d((partialTick-1)*(abstracthorse.posX-abstracthorse.prevPosX),
+ (partialTick-1)*(abstracthorse.posY-abstracthorse.prevPosY),
+ (partialTick-1)*(abstracthorse.posZ-abstracthorse.prevPosZ));
+ float partialTick=Minecraft.getMinecraft().timer.renderPartialTicks;
+
+ float prevYaw=(abstracthorse.prevRenderYawOffset+360) % 360;
+ float yaw=(abstracthorse.renderYawOffset+360) % 360;
+ Vec3d position=new Vec3d(abstracthorse.prevPosX+partialTick*(abstracthorse.posX-abstracthorse.prevPosX),
+ abstracthorse.prevPosY+partialTick*(abstracthorse.posY-abstracthorse.prevPosY),
+ abstracthorse.prevPosZ+partialTick*(abstracthorse.posZ-abstracthorse.prevPosZ));
+
+ Quaternion bodyRot=new Quaternion(0,-(prevYaw + partialTick*(yaw-prevYaw)),0);
+ Vec3d delta=new Vec3d((partialTick-1)*(abstracthorse.posX-abstracthorse.prevPosX),
+ (partialTick-1)*(abstracthorse.posY-abstracthorse.prevPosY),
+ (partialTick-1)*(abstracthorse.posZ-abstracthorse.prevPosZ));
+
+ float prevYaw=(abstracthorse.prevRenderYawOffset+360) % 360;
+ float yaw=(abstracthorse.renderYawOffset+360) % 360;
+
+ Quaternion reinRot=new Quaternion((float) Math.toDegrees(horseLeftFaceMetal.rotateAngleX),
+ (float) -Math.toDegrees(horseLeftFaceMetal.rotateAngleY),
+ (float) Math.toDegrees(horseLeftFaceMetal.rotateAngleZ));
+ Quaternion bodyRot=new Quaternion(0,-(prevYaw + partialTick*(yaw-prevYaw)),0);
+
+ Vec3d reinStart=new Vec3d(horseLeftFaceMetal.rotationPointX*scale,
+ -horseLeftFaceMetal.rotationPointY*scale + abstracthorse.height -0.1,
+ -horseLeftFaceMetal.rotationPointZ*scale);
+ Quaternion reinRot=new Quaternion((float) Math.toDegrees(horseLeftFaceMetal.rotateAngleX),
+ (float) -Math.toDegrees(horseLeftFaceMetal.rotateAngleY),
+ (float) Math.toDegrees(horseLeftFaceMetal.rotateAngleZ));
+
+ ModelBox cubeFaceMetalL=horseLeftFaceMetal.cubeList.get(0);
+ ModelBox cubeFaceMetalR=horseRightFaceMetal.cubeList.get(0);
+ Vec3d reinStart=new Vec3d(horseLeftFaceMetal.rotationPointX*scale,
+ -horseLeftFaceMetal.rotationPointY*scale + abstracthorse.height -0.1,
+ -horseLeftFaceMetal.rotationPointZ*scale);
+
+ Vec3d reinOffsetL=new Vec3d(cubeFaceMetalL.posX2*scale,-(cubeFaceMetalL.posY2-1)*scale,-(cubeFaceMetalL.posZ2-1)*scale);
+ Vec3d reinOffsetR=new Vec3d((cubeFaceMetalR.posX2-1)*scale,-(cubeFaceMetalR.posY2-1)*scale,-(cubeFaceMetalR.posZ2-1)*scale);
+ ModelBox cubeFaceMetalL=horseLeftFaceMetal.cubeList.get(0);
+ ModelBox cubeFaceMetalR=horseRightFaceMetal.cubeList.get(0);
+
+ Vec3d attchL=position.add(bodyRot.multiply(reinStart).add(bodyRot.multiply(reinRot.multiply(reinOffsetL))));
+ Vec3d attchR=position.add(bodyRot.multiply(reinStart).add(bodyRot.multiply(reinRot.multiply(reinOffsetR))));
+ Vec3d reinOffsetL=new Vec3d(cubeFaceMetalL.posX2*scale,-(cubeFaceMetalL.posY2-1)*scale,-(cubeFaceMetalL.posZ2-1)*scale);
+ Vec3d reinOffsetR=new Vec3d((cubeFaceMetalR.posX2-1)*scale,-(cubeFaceMetalR.posY2-1)*scale,-(cubeFaceMetalR.posZ2-1)*scale);
+
+ HorseTracker.ModelInfo info=Minecraft.getMinecraft().horseTracker.getModelInfo();
+ info.leftReinPos=attchL;
+ info.rightReinPos=attchR;
+ Vec3d attchL=position.add(bodyRot.multiply(reinStart).add(bodyRot.multiply(reinRot.multiply(reinOffsetL))));
+ Vec3d attchR=position.add(bodyRot.multiply(reinStart).add(bodyRot.multiply(reinRot.multiply(reinOffsetR))));
+
+ HorseTracker.ModelInfo info=Minecraft.getMinecraft().horseTracker.getModelInfo();
+ info.leftReinPos=attchL;
+ info.rightReinPos=attchR;
+
+ Quaternion worldRot = new Quaternion(0, VRSettings.inst.vrWorldRotation, 0);
+ Quaternion worldRot = new Quaternion(0, VRSettings.inst.vrWorldRotation, 0);
+
+ Vec3d vtHoldL= OpenVRPlayer.get().roomOrigin.add(delta).add(worldRot.multiply(rotInfo.leftArmPos));
+ Vec3d vtHoldR= OpenVRPlayer.get().roomOrigin.add(delta).add(worldRot.multiply(rotInfo.rightArmPos));
+ //Vec3d wat= p.getPositionVector().add(delta).add(worldRot.multiply(rotInfo.leftArmPos));
+ //Vec3d vtHoldR= p.getPositionVector().add(delta).add(worldRot.multiply(rotInfo.rightArmPos));
+ Vec3d vtHoldL = rotInfo.leftArmPos;
+ Vec3d vtHoldR = rotInfo.rightArmPos;
+
+ Vec3d ropeAttachMiddle=attchL.add(attchR).scale(0.5);
+
+ //Get the vector orthogonal to the vector pointing at the horse head
+ Vec3d ctrDirL=new Vec3d(0,-1,0).crossProduct(ropeAttachMiddle.subtract(vtHoldL));
+ Vec3d ctrDirR=new Vec3d(0,1,0).crossProduct(ropeAttachMiddle.subtract(vtHoldR));
+
+ Vec3d ropeAttachMiddle=attchL.add(attchR).scale(0.5);
+ BezierCurve.Node lReinNode= new BezierCurve.Node(attchL,reinRot.multiply(new Vec3d(0,0,1)),0.1,0.1);
+ BezierCurve.Node lArmNode=new BezierCurve.Node(vtHoldL, ctrDirL,0.1,0.1);
+ BezierCurve.Node rArmNode=new BezierCurve.Node(vtHoldR, ctrDirR,-0.1,-0.1);
+ BezierCurve.Node rReinNode= new BezierCurve.Node(attchR,reinRot.multiply(new Vec3d(0,0,-1)),0.1,0.1);
+
+ //Get the vector orthogonal to the vector pointing at the horse head
+ Vec3d ctrDirL=new Vec3d(0,-1,0).crossProduct(ropeAttachMiddle.subtract(vtHoldL));
+ Vec3d ctrDirR=new Vec3d(0,1,0).crossProduct(ropeAttachMiddle.subtract(vtHoldR));
+
+ BezierCurve.Node lReinNode= new BezierCurve.Node(attchL,reinRot.multiply(new Vec3d(0,0,1)),0.1,0.1);
+ BezierCurve.Node lArmNode=new BezierCurve.Node(vtHoldL, ctrDirL,0.1,0.1);
+ BezierCurve.Node rArmNode=new BezierCurve.Node(vtHoldR, ctrDirR,-0.1,-0.1);
+ BezierCurve.Node rReinNode= new BezierCurve.Node(attchR,reinRot.multiply(new Vec3d(0,0,-1)),0.1,0.1);
+
+ rope=new BezierCurve(new BezierCurve.Node[]{
+ lReinNode, lArmNode, rArmNode, rReinNode
+ },false);
+
+ }
+ rope=new BezierCurve(new BezierCurve.Node[]{
+ lReinNode, lArmNode, rArmNode, rReinNode
+ },false);
+ }
+ }
+ //VIVECRAFT END
+
}
}

@@ -316,6 +399,12 @@
@@ -316,6 +402,12 @@
this.muleLeftChest.render(scale);
this.muleRightChest.render(scale);
}
Expand Down
47 changes: 44 additions & 3 deletions patches/net/minecraft/entity/item/EntityBoat.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,27 @@
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.MoverType;
@@ -704,7 +706,7 @@
@@ -23,6 +25,7 @@
import net.minecraft.network.datasync.DataSerializers;
import net.minecraft.network.datasync.EntityDataManager;
import net.minecraft.network.play.client.CPacketSteerBoat;
+import net.minecraft.src.Reflector;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EntityDamageSourceIndirect;
import net.minecraft.util.EntitySelectors;
@@ -569,7 +572,10 @@

if (!list.isEmpty())
{
- f += iblockstate.getBlock().slipperiness;
+ if (Reflector.forgeExists())
+ f += Reflector.callFloat(iblockstate.getBlock(), Reflector.ForgeBlock_getSlipperiness, iblockstate, this.world, blockpos$pooledmutableblockpos, this);
+ else
+ f += iblockstate.getBlock().slipperiness;
++k1;
}

@@ -704,7 +710,7 @@
if (this.status == EntityBoat.Status.IN_WATER)
{
d2 = (this.waterLevel - this.getEntityBoundingBox().minY) / (double)this.height;
Expand All @@ -18,7 +38,7 @@
}
else if (this.status == EntityBoat.Status.UNDER_FLOWING_WATER)
{
@@ -732,7 +734,7 @@
@@ -732,7 +738,7 @@

this.motionX *= (double)this.momentum;
this.motionZ *= (double)this.momentum;
Expand All @@ -27,7 +47,7 @@
this.motionY += d1;

if (d2 > 0.0D)
@@ -746,42 +748,108 @@
@@ -746,42 +752,108 @@
}

private void controlBoat()
Expand Down Expand Up @@ -172,3 +192,24 @@
}

public void updatePassenger(Entity passenger)
@@ -1081,4 +1153,20 @@
return values()[0];
}
}
+
+ // Forge: Fix MC-119811 by instantly completing lerp on board
+ @Override
+ protected void addPassenger(Entity passenger)
+ {
+ super.addPassenger(passenger);
+ if(this.canPassengerSteer() && this.lerpSteps > 0)
+ {
+ this.lerpSteps = 0;
+ this.posX = this.lerpX;
+ this.posY = this.lerpY;
+ this.posZ = this.lerpZ;
+ this.rotationYaw = (float)this.lerpYaw;
+ this.rotationPitch = (float)this.lerpPitch;
+ }
+ }
}
47 changes: 0 additions & 47 deletions patches/net/minecraft/entity/passive/AbstractHorse.java.patch

This file was deleted.

Loading

0 comments on commit 618ec21

Please sign in to comment.