Skip to content

Commit

Permalink
36 pre
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbudda committed Jan 21, 2017
1 parent f6a6b01 commit 235222e
Show file tree
Hide file tree
Showing 10 changed files with 399 additions and 152 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.7.10_HD_U_D1"
of_file_md5 = "57c724fe8335c82aef8d54c101043e60"
minecrift_version_num = "1.7.10"
minecrift_build = "jrbudda-35r3"
minecrift_build = "jrbudda-36pre"
of_file_extension = ".jar"
mcp_version = "mcp908"
mcp_uses_generics = False
Expand Down
10 changes: 7 additions & 3 deletions patches/net/minecraft/client/Minecraft.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.WorldProviderEnd;
import net.minecraft.world.WorldProviderHell;
@@ -150,2988 +225,4883 @@
@@ -150,2988 +225,4887 @@
import net.minecraft.world.storage.ISaveFormat;
import net.minecraft.world.storage.ISaveHandler;
import net.minecraft.world.storage.WorldInfo;
Expand Down Expand Up @@ -1245,7 +1245,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.7.10 jrbudda-35r3";
+ public final String minecriftVerString = "Vivecraft 1.7.10 jrbudda-36pre";
+ private boolean trigger;
+ /* end version */
+ /** END MINECRIFT */
Expand Down Expand Up @@ -3224,6 +3224,10 @@
+
+ this.mcProfiler.endSection();
+
+ //VIVECRAFT
+ vrPlayer.preTick();
+ //
+
+ if (this.rightClickDelayTimer > 0)
+ {
+ --this.rightClickDelayTimer;
Expand Down Expand Up @@ -5308,7 +5312,7 @@
+ // Lanczos downsample FBOs
+ fsaaFirstPassResultFBO = new Framebuffer("FSAA Pass1 FBO",EyeTextureSize.w, displayFBHeight,false, false,false, 0, -1);
+ //TODO: ugh, support multiple color attachments in Framebuffer....
+ fsaaLastPassResultFBO = new Framebuffer("FSAA Pass2 FBO",displayFBWidth, displayFBHeight,false, false,false, 0, -1);
+ fsaaLastPassResultFBO = new Framebuffer("FSAA Pass2 FBO",EyeTextureSize.w, EyeTextureSize.h,false, false,false, 0, -1);
+
+ print(this.fsaaFirstPassResultFBO.toString());
+
Expand Down
33 changes: 20 additions & 13 deletions patches/net/minecraft/client/entity/EntityPlayerSP.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@
this.worldObj.playSound(this.posX, this.posY - (double)this.yOffset, this.posZ, name, volume, pitch, false);
}

@@ -662,4 +853,283 @@
@@ -662,4 +853,290 @@
}

protected void sendHorseJump() {}
Expand Down Expand Up @@ -616,7 +616,7 @@
+ {
+ super.setPositionAndRotation(x, y, z, yaw, pitch);
+
+ OpenVRPlayer.get().snapRoomOriginToPlayerEntity(this, true, false);
+ OpenVRPlayer.get().snapRoomOriginToPlayerEntity(this, true, false, 1);
+
+ if(initFromServer == false){
+ initFromServer = true;
Expand All @@ -643,7 +643,7 @@
+
+ if(!initFromServer) return;
+ else { //still init.
+ mc.vrPlayer.snapRoomOriginToPlayerEntity(this, true, false);
+ mc.vrPlayer.snapRoomOriginToPlayerEntity(this, true, false, 1);
+
+// OpenVRPlayer.get().setRoomOrigin(
+// posX + ox,
Expand All @@ -655,28 +655,35 @@
+ // VIVE START - update room origin when player entity is moved
+ public void setPosition(double x, double y, double z)
+ { //this is also called when riding to move this around.
+
+ super.setPosition(x, y, z);
+
+ if(this.isRiding()){
+
+ Vec3 roomOrigin = OpenVRPlayer.get().getRoomOriginPos_World();
+ double ox = roomOrigin.xCoord - posX;
+ double oz = roomOrigin.zCoord - posZ;
+ super.setPosition(x, y, z);
+ Vec3 me = OpenVRPlayer.get().getHMDPos_World();
+ double ox = roomOrigin.xCoord - me.xCoord;
+ double oy = roomOrigin.yCoord - me.yCoord;
+ double oz = roomOrigin.zCoord - me.zCoord;
+
+ OpenVRPlayer.get().setRoomOrigin(
+ posX + ox,
+ this.ridingEntity.boundingBox.minY,
+ posZ + oz, false, false);
+
+ } else
+ super.setPosition(x, y, z);
+ this.ridingEntity.posX + ox,
+ this.ridingEntity.posY + (this.ridingEntity instanceof EntityHorse ? this.ridingEntity.getMountedYOffset() : 0 ),
+ this.ridingEntity.posZ + oz, false, false);
+
+ }
+
+
+ }
+
+ @Override
+ public void moveEntity(double x, double y, double z)
+ {
+ if(this.isRiding())return;
+ boolean client = this instanceof EntityPlayerSP;
+ boolean freemove = OpenVRPlayer.get().getFreeMoveMode();
+ boolean doY = freemove || (Minecraft.getMinecraft().vrSettings.simulateFalling && !this.isOnLadder()) && !this.isSneaking();
+
+ if(mc.climbTracker.isActive(this)) doY = true;
+ Vec3 roomOrigin = OpenVRPlayer.get().getRoomOriginPos_World();
+ // Vec3 camloc = Minecraft.getMinecraft().roomScale.getHMDPos_World();
+
Expand Down
61 changes: 17 additions & 44 deletions patches/net/minecraft/client/gui/GuiScreen.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import net.minecraft.util.EnumChatFormatting;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
@@ -44,13 +49,22 @@
@@ -44,13 +49,17 @@
public boolean allowUserInput;

/** The FontRenderer used by GuiScreen */
Expand All @@ -29,19 +29,14 @@
private int eventButton;
private long lastMouseEvent;

+ /** MINECRIFT */
+ public static int mouseOffsetX = 0;
+ public static int mouseOffsetY = 0;
+ /** END MINECRIFT */
+
+ //VIVECRAFT
+ public boolean pressShiftFake;
+
+ public int mouseX, mouseY;
+ ///
+
/**
* Incremented when the game is in touchscreen mode and the screen is tapped, decremented if the screen isn't
* tapped. Does not appear to be used.
@@ -84,6 +98,10 @@
@@ -84,6 +93,10 @@
{
if (keyCode == 1)
{
Expand All @@ -52,7 +47,7 @@
this.mc.displayGuiScreen((GuiScreen)null);
this.mc.setIngameFocus();
}
@@ -142,21 +160,37 @@
@@ -142,21 +155,37 @@
var4.set(var5, EnumChatFormatting.GRAY + (String)var4.get(var5));
}
}
Expand Down Expand Up @@ -94,7 +89,7 @@
if (!textLines.isEmpty())
{
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
@@ -169,7 +203,9 @@
@@ -169,7 +198,9 @@
while (var5.hasNext())
{
String var6 = (String)var5.next();
Expand All @@ -105,7 +100,7 @@

if (var7 > var4)
{
@@ -214,7 +250,9 @@
@@ -214,7 +245,9 @@
for (int var12 = 0; var12 < textLines.size(); ++var12)
{
String var13 = (String)textLines.get(var12);
Expand All @@ -116,7 +111,7 @@

if (var12 == 0)
{
@@ -246,10 +284,26 @@
@@ -246,10 +279,26 @@

if (var5.mousePressed(this.mc, mouseX, mouseY))
{
Expand Down Expand Up @@ -147,7 +142,7 @@
}
}
}
@@ -285,8 +339,22 @@
@@ -285,8 +334,22 @@
this.fontRendererObj = mc.fontRendererObj;
this.width = width;
this.height = height;
Expand All @@ -172,7 +167,7 @@
}

/**
@@ -302,7 +370,14 @@
@@ -302,7 +365,14 @@
if (Mouse.isCreated())
{
while (Mouse.next())
Expand All @@ -188,7 +183,7 @@
this.handleMouseInput();
}
}
@@ -321,9 +396,23 @@
@@ -321,9 +391,19 @@
*/
public void handleMouseInput()
{
Expand All @@ -203,18 +198,14 @@
+ }
+ }
+
+ // Reset mouse offset
+ mouseOffsetX = -1;
+ mouseOffsetY = -1;
+
+ int var1 =mouseX = getMouseX();
+ int var2 = mouseY= getMouseY();
+ int var1 = getMouseXPos();
+ int var2 = getMouseYPos();
int var3 = Mouse.getEventButton();
+ /** END MINECRIFT */

if (Mouse.getEventButtonState())
{
@@ -388,8 +477,17 @@
@@ -388,8 +468,17 @@
{
if (this.mc.theWorld != null)
{
Expand All @@ -232,7 +223,7 @@
else
{
this.drawBackground(tint);
@@ -441,4 +539,82 @@
@@ -441,4 +530,64 @@
{
return Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54);
}
Expand Down Expand Up @@ -284,34 +275,16 @@
+ this.mouseClickMove(guiX, guiY, this.eventButton, var3);
+ }
+
+ public int getMouseX()
+ public int getMouseXPos()
+ {
+ int mX = Mouse.getX() * this.mc.currentScreen.width / this.mc.displayWidth;
+ mX += (this.mouseOffsetX == -1 ? 0 : this.mouseOffsetX);
+ return mX;
+ }
+
+ public int getMouseY()
+ {
+ int mY = this.mc.currentScreen.height - Mouse.getY() * this.mc.currentScreen.height / this.mc.displayHeight - 1;
+ mY += (this.mouseOffsetY == -1 ? 0 : this.mouseOffsetY);
+ return mY;
+ }
+
+ public int getActualMouseX()
+ {
+ int mX = Mouse.getX() * this.mc.currentScreen.width / this.mc.displayHeight;
+ return mX;
+ }
+
+ public int getActualMouseY()
+ public int getMouseYPos()
+ {
+ int mY = this.mc.currentScreen.height - Mouse.getY() * this.mc.currentScreen.height / this.mc.displayHeight - 1;
+ return mY;
+ }
+
+ public List getButtonList()
+ {
+ return this.buttonList;
+ }
}
9 changes: 8 additions & 1 deletion patches/net/minecraft/client/gui/GuiTextField.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,19 @@
}

/**
@@ -673,6 +683,11 @@
@@ -673,6 +683,18 @@
}

this.isFocused = p_146195_1_;
+
+ // VIVE START - show keyboard
+
+ //Pixelmon hax
+ for (StackTraceElement ste : Thread.currentThread().getStackTrace()) {
+ if(ste.getClassName().contains("GuiChattableCamera")) return;
+ }
+ //
+
+ if(p_146195_1_) MCOpenVR.setKeyboardOverlayShowing(p_146195_1_, this);
+ // VIVE END - show keyboard
+
Expand Down
13 changes: 8 additions & 5 deletions patches/net/minecraft/client/renderer/EntityRenderer.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
import net.minecraft.util.MathHelper;
import net.minecraft.util.MouseFilter;
import net.minecraft.util.MovingObjectPosition;
@@ -61,2593 +104,5048 @@
@@ -61,2593 +104,5051 @@
import net.minecraft.world.World;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.biome.BiomeGenBase;
Expand Down Expand Up @@ -1329,6 +1329,7 @@
+ */
+ private void orientCamera(float par1)
+ {
+ this.mc.gameSettings.thirdPersonView = 0;
+ EntityLivingBase var2 = this.mc.renderViewEntity;
+// float var3 = var2.yOffset - 1.62F;
+ double var4 = var2.posX;
Expand Down Expand Up @@ -2168,6 +2169,8 @@
+// {
+ this.prevFrameTime = Minecraft.getSystemTime();
+// }
+
+ mc.vrPlayer.checkandUpdateRotateScale(true, par1);
+
+
+ /** END MINECRIFT */
Expand Down Expand Up @@ -4762,8 +4765,8 @@
+ if (this.mc.currentScreen != null /*&& !this.blankGUIUntilWorldValid*/)
+ {
+
+ final int mouseX1 = mouseX = this.mc.currentScreen.getMouseX();
+ final int mouseY1 = mouseY = this.mc.currentScreen.getMouseY();
+ final int mouseX1 = mouseX = this.mc.currentScreen.getMouseXPos();
+ final int mouseY1 = mouseY = this.mc.currentScreen.getMouseYPos();
+
+ try
+ {
Expand All @@ -4789,9 +4792,9 @@
+ // Draw GUI crosshair
+ if (mc.stereoProvider.isStereo()){
+ if(MCOpenVR.controllerMouseValid){
+ mc.ingameGUI.drawMouseMenuQuad(this.mc.currentScreen.getMouseX(),this.mc.currentScreen.getMouseY());
+ mc.ingameGUI.drawMouseMenuQuad(this.mc.currentScreen.getMouseXPos(),this.mc.currentScreen.getMouseYPos());
+ }
+ } else mc.ingameGUI.drawMouseMenuQuad(this.mc.currentScreen.getMouseX(),this.mc.currentScreen.getMouseY());
+ } else mc.ingameGUI.drawMouseMenuQuad(this.mc.currentScreen.getMouseXPos(),this.mc.currentScreen.getMouseYPos());
+ }
+ }
+ catch (Throwable throwable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,14 @@
}

if (p_147938_6_.thirdPersonView == 2)
@@ -254,6 +262,10 @@

public boolean renderEntityStatic(Entity p_147936_1_, float p_147936_2_, boolean p_147936_3_)
{
+
+ //pixelmon no 1st person model
+ if(p_147936_1_ == Minecraft.getMinecraft().thePlayer) return true;
+
if (p_147936_1_.ticksExisted == 0)
{
p_147936_1_.lastTickPosX = p_147936_1_.posX;
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@

- this.jump = this.gameSettings.keyBindJump.getIsKeyPressed();
- this.sneak = this.gameSettings.keyBindSneak.getIsKeyPressed();
+
+ boolean ok = Minecraft.getMinecraft().currentScreen==null;
+ Minecraft mc = Minecraft.getMinecraft();
+ boolean ok = Minecraft.getMinecraft().currentScreen==null && (mc.vrPlayer.getFreeMoveMode() || mc.vrSettings.simulateFalling);
+
+ //VIVECRAFT DO ok.
+ this.jump = this.gameSettings.keyBindJump.getIsKeyPressed() && ok;
+ this.sneak = this.gameSettings.keyBindSneak.getIsKeyPressed() && ok;
+ this.sneak = this.gameSettings.keyBindSneak.getIsKeyPressed() && Minecraft.getMinecraft().currentScreen==null;

if (this.sneak)
{
Expand Down
Loading

0 comments on commit 235222e

Please sign in to comment.