Skip to content

Commit

Permalink
Merge pull request #32 from jrbudda/optifinec7
Browse files Browse the repository at this point in the history
Optifinec7
  • Loading branch information
jrbudda authored Jan 6, 2018
2 parents e2510bc + 7faf14c commit d70fcfe
Show file tree
Hide file tree
Showing 15 changed files with 238 additions and 189 deletions.
3 changes: 2 additions & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ def create_install(mcp_dir):

# Add json files
install_out.writestr("version.json", process_json("", version,minecrift_version_num,"",of_file_name ))
install_out.writestr( "version-forge.json", process_json("-forge", version,minecrift_version_num,forge_version,of_file_name ))
install_out.writestr("version-forge.json", process_json("-forge", version,minecrift_version_num,forge_version,of_file_name ))
install_out.writestr("version-multimc.json", process_json("-multimc", version,minecrift_version_num,"",of_file_name ))

# Add release notes
install_out.write("CHANGES.md", "release_notes.txt")
Expand Down
53 changes: 46 additions & 7 deletions installer/Installer.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import org.json.JSONObject;
import org.json.*;
import java.awt.*;
import java.awt.TrayIcon.MessageType;
import java.awt.event.*;
Expand Down Expand Up @@ -1121,7 +1121,11 @@ private boolean ExtractVersion() {
if( jar_id != null )
{
InputStream version_json;
if(useForge.isSelected() /*&& forgeVersion.getSelectedItem() != forgeNotFound*/ )
if(isMultiMC) {
String filename = "version-multimc.json";
version_json = Installer.class.getResourceAsStream(filename);
}
else if(useForge.isSelected() /*&& forgeVersion.getSelectedItem() != forgeNotFound*/ )
{
String filename;

Expand Down Expand Up @@ -1188,10 +1192,27 @@ public int read(byte[] buff) throws IOException {
String json = readAsciiFile(fileJson);
json = json.replace("$FILE",jar_id);
JSONObject root = new JSONObject(json);
String args = (String)root.get("minecraftArguments");
if(katvr.isSelected()) args += " --katvr";
if(kiosk.isSelected()) args += " --kiosk";
root.put("minecraftArguments", args);

String args = (String)root.opt("minecraftArguments");

if(args!=null) {
if(katvr.isSelected()) args += " --katvr";
if(kiosk.isSelected()) args += " --kiosk";
root.put("minecraftArguments", args);
}

if(isMultiMC)
root.remove("id");

if(isMultiMC && useForge.isSelected()) {
JSONArray tw = (JSONArray) root.get("+tweakers");
tw = new JSONArray();
tw.put("com.mtbs3d.minecrift.tweaker.MinecriftForgeTweaker");
tw.put("net.minecraftforge.fml.common.launcher.FMLTweaker");
tw.put("optifine.OptiFineForgeTweaker");
root.put("+tweakers", tw);
}

FileWriter fwJson = new FileWriter(fileJson);
fwJson.write(root.toString(jsonIndentSpaces));
fwJson.flush();
Expand Down Expand Up @@ -1321,7 +1342,7 @@ private boolean updateLauncherJson(File mcBaseDirFile, String minecriftVer)
} else {
prof.remove("gameDir");
}

FileWriter fwJson = new FileWriter(fileJson);
fwJson.write(root.toString(jsonIndentSpaces));
fwJson.flush();
Expand Down Expand Up @@ -1386,6 +1407,24 @@ private boolean updateMMCInst(File mcBaseDirFile, String minecriftVer)

w.close();

File mmcpack = new File(mcBaseDirFile, "mmc-pack.json");
if(!mmcpack.exists()) return result;
String json = readAsciiFile(mmcpack);

JSONObject root = new JSONObject(json);
JSONArray components = (JSONArray)root.get("components");

JSONObject v = new JSONObject();
v.put("cachedName", "Vivecraft");
v.put("uid", "vivecraft");

components.put(v);

FileWriter fwJson = new FileWriter(mmcpack);
fwJson.write(root.toString(2));
fwJson.flush();
fwJson.close();

result = true;
}
catch (Exception e) {
Expand Down
26 changes: 0 additions & 26 deletions installer/vivecraft-1.12.2-forge - Inheritable.json

This file was deleted.

36 changes: 36 additions & 0 deletions installer/vivecraft-1.12.2-multimc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"+tweakers": [
"optifine.OptiFineTweaker",
"com.mtbs3d.minecrift.tweaker.MinecriftVanillaTweaker"
],
"libraries": [
{
"name": "org.json:json:20140107",
"url": "http://central.maven.org/maven2/"
},
{
"name": "com.sun:jna:4.2.1",
"url": "http://vivecraft.org/jar/"
},
{
"name": "de.fruitfly.ovr:JRift:0.8.0.0.1",
"url": "http://vivecraft.org/jar/"
},
{
"name": "org.ow2.asm:asm-all:5.2",
"url": "http://files.minecraftforge.net/maven/"
},
{
"name": "net.minecraft:launchwrapper:1.12"
},
{
"name": "optifine:OptiFine:$OFVERSION",
"MMC-hint": "local"
}
],
"mainClass": "net.minecraft.launchwrapper.Launch",
"name": "Vivecraft",
"releaseTime": "2017-09-21T12:32:20+00:00",
"uid": "vivecraft",
"version": "4"
}
4 changes: 2 additions & 2 deletions minecriftversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
of_json_name = "1.12.2_HD_U_C7"
of_file_md5 = "349b644370e7a8460482d1479ebcbde1"
minecrift_version_num = "1.12.2"
minecrift_build = "jrbudda-6-alpha"
minecrift_build = "jrbudda-6-alpha2"
of_file_extension = ".jar"
mcp_version = "mcp940"
mcp_uses_generics = True
mcp_download_url = "http://www.modcoderpack.com/website/sites/default/files/releases/mcp940.zip"
forge_version = "14.23.1.2583test!"
forge_version = "14.23.1.2583"
8 changes: 4 additions & 4 deletions patches/net/minecraft/client/Minecraft.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,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-6-alpha";
+ public final String minecriftVerString = "Vivecraft 1.12.2 jrbudda-6-alpha2";
+ /* end version */
+ /** END MINECRIFT */
+
Expand Down Expand Up @@ -2889,7 +2889,7 @@
+ float time = (float) (System.currentTimeMillis() - usageSnooper.getMinecraftStartTimeMillis()) / 1000;
+ if (player!=null && world !=null) {
+
+ if(entityRenderer.itemRenderer.inwater){
+ if(entityRenderer.inwater){
+ watereffect = 1.3f;
+ } else {
+ if(watereffect == 1.3f) watereffect = 2.3f;
Expand All @@ -2899,7 +2899,7 @@
+
+ if(Config.isShaders()) watereffect = 0; //dont stack.
+
+ if(entityRenderer.itemRenderer.inportal){
+ if(entityRenderer.inportal){
+ portaleffect = 1f;
+ } else {
+ portaleffect -= (1f/60f);
Expand All @@ -2921,7 +2921,7 @@
+ if (player.isCreative()) r = 0;
+ }
+
+ if(entityRenderer.itemRenderer.inblock && player.isDead == false){
+ if(entityRenderer.inblock && player.isDead == false){
+ //k = (float) entityRenderer.itemRenderer.inBlock;
+
+ }
Expand Down
35 changes: 0 additions & 35 deletions patches/net/minecraft/client/renderer/ActiveRenderInfo.java.patch

This file was deleted.

Loading

0 comments on commit d70fcfe

Please sign in to comment.