Skip to content

Commit

Permalink
8
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbudda committed Apr 28, 2017
1 parent 8a7d1b8 commit 3b4f1ca
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 53 deletions.
2 changes: 1 addition & 1 deletion installer/Installer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1526,7 +1526,7 @@ public Installer(File targetDir)


this.add(Box.createVerticalGlue());
JLabel github = linkify("Vivecraft is open source. find it on Github","https://github.com/jrbudda/Vivecraft_111","Vivecraft 1.11 Github");
JLabel github = linkify("Vivecraft is open source. find it on Github","https://github.com/jrbudda/Vivecraft_110","Vivecraft 1.10 Github");
JLabel wiki = linkify("Vivecraft home page","http://www.vivecraft.org","Vivecraft Home");
JLabel donate = linkify("If you think Vivecraft is awesome, please consider donating.","https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=JVBJLN5HJJS52&lc=US&item_name=jrbudda&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted)","jrbudda's Paypal");
JLabel optifine = linkify("Vivecraft includes OptiFine for performance. Consider donating to them as well.","http://optifine.net/donate.php","http://optifine.net/donate.php");
Expand Down
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.10.2_HD_U_C2"
of_file_md5 = "0f7c2a9b052a750aa4e3551125c7d216"
minecrift_version_num = "1.10.2"
minecrift_build = "Vivecraft-jrbudda-8alpha2"
minecrift_build = "Vivecraft-jrbudda-8"
of_file_extension = ".jar"
mcp_version = "mcp931"
mcp_uses_generics = True
Expand Down
135 changes: 87 additions & 48 deletions patches/net/minecraft/client/Minecraft.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,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 Vivecraft-jrbudda-8alpha2";
+ public final String minecriftVerString = "Vivecraft 1.10.2 Vivecraft-jrbudda-8";
+ /* end version */
+ /** END MINECRIFT */
+
Expand Down Expand Up @@ -405,15 +405,15 @@
ImageIO.setUseCache(false);
Bootstrap.register();
this.dataFixer = DataFixesManager.createFixer();
+
+ /** MINECRIFT **/
+ VRSettings.initSettings(this, this.mcDataDir);
+ if (!vrSettings.badStereoProviderPluginID.isEmpty()) {
+ vrSettings.stereoProviderPluginID = vrSettings.badStereoProviderPluginID;
+ vrSettings.badStereoProviderPluginID = "";
+ vrSettings.saveOptions();
+ }
+ /** END MINECRIFT **/
+
+ /** MINECRIFT **/
+ VRSettings.initSettings(this, this.mcDataDir);
+ if (!vrSettings.badStereoProviderPluginID.isEmpty()) {
+ vrSettings.stereoProviderPluginID = vrSettings.badStereoProviderPluginID;
+ vrSettings.badStereoProviderPluginID = "";
+ vrSettings.saveOptions();
+ }
+ /** END MINECRIFT **/
}

public void run()
Expand All @@ -423,7 +423,7 @@
{
- this.gameSettings = new GameSettings(this, this.mcDataDir);
+ //VIVECRAFT DONT DO THIS CAUSE ??? (DO IT IN 1.10 CAUSE NULL!!!)
+ this.gameSettings = new GameSettings(this, this.mcDataDir);
+ //this.gameSettings = new GameSettings(this, this.mcDataDir);
this.defaultResourcePacks.add(this.mcDefaultResourcePack);
this.startTimerHackThread();

Expand Down Expand Up @@ -761,24 +761,6 @@
{
- long i = System.nanoTime();
- this.mcProfiler.startSection("root");
-
- if (Display.isCreated() && Display.isCloseRequested())
- {
- this.shutdown();
- }
-
- if (this.isGamePaused && this.world != null)
- {
- float f = this.timer.renderPartialTicks;
- this.timer.updateTimer();
- this.timer.renderPartialTicks = f;
- }
- else
- {
- this.timer.updateTimer();
- }
-
- this.mcProfiler.startSection("scheduledExecutables");
+ mcProfiler.endSection(); //idle
+ try {
+
Expand Down Expand Up @@ -847,6 +829,24 @@
+// this.refreshResources();
+// }

- if (Display.isCreated() && Display.isCloseRequested())
- {
- this.shutdown();
- }
-
- if (this.isGamePaused && this.world != null)
- {
- float f = this.timer.renderPartialTicks;
- this.timer.updateTimer();
- this.timer.renderPartialTicks = f;
- }
- else
- {
- this.timer.updateTimer();
- }
-
- this.mcProfiler.startSection("scheduledExecutables");
-
- synchronized (this.scheduledTasks)
+
+ synchronized (this.scheduledTasks)
Expand Down Expand Up @@ -1377,17 +1377,17 @@
{
return;
}
@@ -1616,25 +2210,22 @@
@@ -1616,25 +2210,20 @@
case BLOCK:
BlockPos blockpos = this.objectMouseOver.getBlockPos();

- if (this.world.getBlockState(blockpos).getMaterial() != Material.AIR)
+ if (!this.world.isAirBlock(blockpos)) //Forge DOES NOT change this to isairblock but it prolly is supposed to... right?
{
- int i = itemstack != null ? itemstack.stackSize : 0;
+ int i = itemstack.stackSize;
EnumActionResult enumactionresult = this.playerController.processRightClickBlock(this.player, this.world, itemstack, blockpos, this.objectMouseOver.sideHit, this.objectMouseOver.hitVec, enumhand);
- EnumActionResult enumactionresult = this.playerController.processRightClickBlock(this.player, this.world, itemstack, blockpos, this.objectMouseOver.sideHit, this.objectMouseOver.hitVec, enumhand);
-
+ int i = itemstack != null ? itemstack.stackSize : 0; EnumActionResult enumactionresult = this.playerController.processRightClickBlock(this.player, this.world, itemstack, blockpos, this.objectMouseOver.sideHit, this.objectMouseOver.hitVec, enumhand);
if (enumactionresult == EnumActionResult.SUCCESS)
{
this.player.swingArm(enumhand);
Expand All @@ -1411,7 +1411,7 @@
}

return;
@@ -1643,9 +2234,7 @@
@@ -1643,9 +2232,7 @@
}
}

Expand All @@ -1422,7 +1422,7 @@
{
this.entityRenderer.itemRenderer.resetEquippedProgress(enumhand);
return;
@@ -1720,29 +2309,14 @@
@@ -1720,29 +2307,14 @@
/**
* Called to resize the current screen.
*/
Expand Down Expand Up @@ -1455,7 +1455,7 @@
}

/**
@@ -1758,11 +2332,21 @@
@@ -1758,11 +2330,21 @@
*/
public void runTick() throws IOException
{
Expand All @@ -1477,7 +1477,7 @@
this.mcProfiler.startSection("gui");

if (!this.isGamePaused)
@@ -1861,12 +2445,23 @@
@@ -1861,12 +2443,23 @@

this.mcProfiler.endStartSection("keyboard");
this.runTickKeyboard();
Expand All @@ -1501,7 +1501,7 @@
++this.joinPlayerCounter;

if (this.joinPlayerCounter == 30)
@@ -1874,6 +2469,10 @@
@@ -1874,6 +2467,10 @@
this.joinPlayerCounter = 0;
this.world.joinEntityInSurroundings(this.player);
}
Expand All @@ -1512,7 +1512,7 @@
}

this.mcProfiler.endStartSection("gameRenderer");
@@ -1907,6 +2506,9 @@
@@ -1907,6 +2504,9 @@
this.entityRenderer.stopUseShader();
}

Expand All @@ -1522,7 +1522,7 @@
if (!this.isGamePaused)
{
this.mcMusicTicker.update();
@@ -1960,8 +2562,12 @@
@@ -1960,8 +2560,12 @@
this.mcProfiler.endStartSection("pendingConnection");
this.myNetworkManager.processReceivedPackets();
}
Expand All @@ -1536,7 +1536,7 @@
this.systemTime = getSystemTime();
}

@@ -1996,6 +2602,14 @@
@@ -1996,8 +2600,15 @@
this.currentScreen.handleKeyboardInput();
}

Expand All @@ -1549,9 +1549,11 @@
+ /** END MINECRIFT */
+
boolean flag = Keyboard.getEventKeyState();
-
if (flag)
@@ -2005,6 +2619,8 @@
{
if (i == 62 && this.entityRenderer != null)
@@ -2005,6 +2616,8 @@
this.entityRenderer.switchUseShader();
}

Expand All @@ -1560,15 +1562,15 @@
boolean flag1 = false;

if (this.currentScreen == null)
@@ -2012,6 +2628,7 @@
@@ -2012,6 +2625,7 @@
if (i == 1)
{
this.displayInGameMenu();
+
}

flag1 = Keyboard.isKeyDown(61) && this.processKeyF3(i);
@@ -2019,7 +2636,9 @@
@@ -2019,7 +2633,9 @@

if (i == 59)
{
Expand All @@ -1579,7 +1581,24 @@
}
}

@@ -2067,6 +2686,11 @@
@@ -2032,6 +2648,7 @@
KeyBinding.setKeyBindState(i, true);
KeyBinding.onTick(i);
}
+

if (this.gameSettings.showDebugProfilerChart)
{
@@ -2052,7 +2669,7 @@
else
{
KeyBinding.setKeyBindState(i, false);
-
+ if(i == 18) System.out.println("unpress 18");
if (i == 61)
{
if (this.actionKeyF3)
@@ -2067,6 +2684,11 @@
}
}
}
Expand All @@ -1591,7 +1610,7 @@
}

this.processKeyBinds();
@@ -2171,20 +2795,35 @@
@@ -2171,20 +2793,35 @@
{
for (; this.gameSettings.keyBindTogglePerspective.isPressed(); this.renderGlobal.setDisplayListEntitiesDirty())
{
Expand Down Expand Up @@ -1641,6 +1660,26 @@
}
}

@@ -2207,9 +2844,10 @@
}
}
}
-
+
while (this.gameSettings.keyBindInventory.isPressed())
{
+ System.out.print("WHAT!!!!!");
this.getConnection().sendPacket(new CPacketClientStatus(CPacketClientStatus.State.OPEN_INVENTORY_ACHIEVEMENT));

if (this.playerController.isRidingHorse())
@@ -2218,6 +2856,7 @@
}
else
{
+ System.out.print("WHAT!!");
this.displayGuiScreen(new GuiInventory(this.player));
}
}
@@ -2242,11 +2881,26 @@

if (flag)
Expand Down Expand Up @@ -1834,7 +1873,7 @@
*/
public void loadWorld(@Nullable WorldClient worldClientIn, String loadingMessage)
{
+ if (worldClientIn != null && Reflector.EventBus.exists())
+ if (world != null && Reflector.EventBus.exists())
+ {
+ Reflector.postForgeBusEvent(Reflector.ForgeWorldEvent_Unload_Constructor, new Object[] {this.world});
+ }
Expand Down
9 changes: 9 additions & 0 deletions patches/net/minecraft/client/entity/EntityPlayerSP.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@
import net.minecraft.util.SoundEvent;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
@@ -85,7 +104,7 @@
* to be re-trasmitted
*/
private double lastReportedPosX;
-
+
/**
* The last Y position which was transmitted to the server, used to determine when the Y position changes and needs
* to be re-transmitted
@@ -134,6 +153,21 @@
*/
protected int sprintToggleTimer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
+ event = Reflector.newInstance(Reflector.EnderTeleportEvent_Constuctor, new Object[] {this,x,y,z,0});
+ if (Reflector.postForgeBusEvent(event))
+ return false;
+ flag = this.attemptTeleport(Reflector.callDouble(Reflector.EnderTeleportEvent_getTargetX),Reflector.callDouble(Reflector.EnderTeleportEvent_getTargetY),Reflector.callDouble(Reflector.EnderTeleportEvent_getTargetZ));
+ flag = this.attemptTeleport(Reflector.callDouble(event, Reflector.EnderTeleportEvent_getTargetX),Reflector.callDouble(event, Reflector.EnderTeleportEvent_getTargetY),Reflector.callDouble(event, Reflector.EnderTeleportEvent_getTargetZ));
+ } else {
+ flag = this.attemptTeleport(x, y, z);
+ }
Expand Down
3 changes: 2 additions & 1 deletion patches/net/minecraft/src/Reflector.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import net.minecraft.client.renderer.tileentity.RenderItemFrame;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.client.renderer.vertex.VertexFormatElement;
@@ -26,896 +32,1064 @@
@@ -26,896 +32,1065 @@
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.item.EntityItemFrame;
Expand Down Expand Up @@ -1119,6 +1119,7 @@
+ public static ReflectorField KeyModifier_NONE = new ReflectorField(KeyModifier, "NONE");
+
+ //Vivecraft Forge
+ public static ReflectorMethod ForgeKeyBinding_getKeyConflictContext= new ReflectorMethod(ForgeKeyBinding, "getKeyConflictContext");
+ public static ReflectorMethod FMLClientHandler_beginMinecraftLoading = new ReflectorMethod(FMLClientHandler, "beginMinecraftLoading"); //
+ public static ReflectorMethod FMLClientHandler_finishMinecraftLoading = new ReflectorMethod(FMLClientHandler, "finishMinecraftLoading");
+ public static ReflectorMethod FMLClientHandler_connectToServerAtStartup = new ReflectorMethod(FMLClientHandler, "connectToServerAtStartup");
Expand Down
2 changes: 1 addition & 1 deletion src/com/mtbs3d/minecrift/gameplay/BowTracker.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ else if (this.isArrow(player.getHeldItem(EnumHand.MAIN_HAND)))

protected boolean isArrow(ItemStack stack)
{
return stack.getItem() instanceof ItemArrow;
return stack !=null && stack.getItem() instanceof ItemArrow;
}

}
Expand Down

0 comments on commit 3b4f1ca

Please sign in to comment.