Skip to content

Commit

Permalink
Overhaul tweak system
Browse files Browse the repository at this point in the history
  • Loading branch information
Lassebq committed Sep 6, 2024
1 parent 5fc8b6d commit 338f55c
Show file tree
Hide file tree
Showing 61 changed files with 2,970 additions and 3,109 deletions.
34 changes: 20 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,36 @@

LaunchWrapper is bundled in [BetterJSONs](https://github.com/MCPHackers/BetterJSONs) which are meant for official Minecraft Launcher.

## Supported versions
- All versions from rd-132211 to 1.12.2
- [Better Than Adventure](https://www.betterthanadventure.net/)
- Babric and OrnitheMC instances

## Features
- Does not depend on any hard-coded obfuscated names and is mostly compatible with every Minecraft version
- This also includes modded versions
- Strips game window from Java **AWT** (**Abstract Window Toolkit**) and lets the game use internal **LWJGL** frame
- BitDepthFix for versions before Beta 1.8
- BitDepthFix
- Online mode authentication fix
- LaunchWrapper works with Risugami's Modloader so long as you're using Java 8
- Allows changing assets directory in 1.6 snapshots (the game didn't have a parameter to do that yet)
- Allows changing game directory in versions before 1.6
- Built-in [Modloader Fix](https://github.com/coffeenotfound/ModloaderFix-b1.7.3)
- Replaces mouse input code with **LWJGL** calls (Fixes any mouse input issues in classic, indev and infdev)
- Allows changing game directory in versions before 1.6
- Makes save slots in classic and indev functional and saves to `.minecraft/levels` directory
- Adds ability to launch classic and pre-classic at custom resolution or in fullscreen
- Fixes TimSort crash when using Java 8+
- Proxies all requests from old skin servers to the current skin API and converts skins to required format
- Skins don't work in Java versions before 8u181, due to the requrement of TLS 1.2 support
- Adds ability to customize built-in **LWJGL** frame
- Changing display title
- Setting icon
- Proxies all requests from old skin servers to the current skin API and converts skins to required format
- Skins don't work in Java versions before 8u181, due to the requrement of TLS 1.2 support
- Uses Betacraft proxy to download sounds for versions before 1.6
- Adds ability to launch classic and pre-classic at custom resolution and fullscreen
- Makes save slots in classic and indev functional and saves to `.minecraft/levels` directory
- A launcher for isometric level viewer (IsomPreviewApplet)
- A VSync toggle (Used to prevent extreme framerate in early versions which causes **coil whine**)
- Does not depend on any hard-coded obfuscated names and is mostly compatible with every Minecraft version
- This also includes modded versions
- A parameter to automatically download `minecraft_server.jar` for snapshots: `12w18a`, `12w19a`, `12w21a`
- Fixes sounds by using sounds from `.minecraft/assets`
- Enabling VSync for versions without that option
- The wrapper is fully compatible with Java 5+ if the game is vanilla
- The wrapper also fixes Beta 1.3, Pre-classic and Classic compatibility with Java 5
- Built-in [Modloader Fix](https://github.com/coffeenotfound/ModloaderFix-b1.7.3)
- Added parameter to automatically download `minecraft_server.jar` for snapshots: `12w18a`, `12w19a`, `12w21a`
- A launcher for isometric level viewer (IsomPreviewApplet)
- Allows changing assets directory in 1.6 snapshots (the game didn't have a parameter to do that yet)

## How to use
***There will be an installer eventually.***<br>
Expand Down
95 changes: 63 additions & 32 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,51 @@
plugins {
id 'java-library'
id 'maven-publish'
}

archivesBaseName = 'launchwrapper'

project.ext.asm_version = 9.7

dependencies {
implementation 'org.mcphackers.rdi:rdi:1.0'
implementation "org.ow2.asm:asm:${project.asm_version}"
implementation "org.ow2.asm:asm-tree:${project.asm_version}"
implementation 'org.json:json:20230311'
// I'll bring discord RPC support later, when I have an environment to compile natives

testRuntimeOnly('org.junit.platform:junit-platform-launcher:1.5.2')
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.0.0'
}

test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
events = ["passed", "failed", "skipped"]
showStandardStreams = true
}
}

allprojects {
apply plugin: 'java'
apply plugin: 'maven-publish'


group = 'org.mcphackers'
version = '1.0-SNAPSHOT'

repositories {
flatDir {
dirs "libs"
}
maven {
url "https://mcphackers.github.io/libraries/"
url "https://libraries.minecraft.net/"
}
maven {
url "https://libraries.minecraft.net/"
url "https://maven.glass-launcher.net/releases"
}
maven {
url "https://mcphackers.github.io/libraries/"
}
mavenCentral()
}
Expand All @@ -27,10 +60,36 @@ allprojects {
archives sourcesJar
}

tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"

// Not possible due to unsafe usage
// if (JavaVersion.current().isJava9Compatible()) {
// it.options.release.set(8)
// }
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

compileJava {
// Minecraft is mostly compatible with java 5 up until the version we support, so why not?
if (JavaVersion.current().ordinal() <= JavaVersion.VERSION_1_8.ordinal()) {
sourceCompatibility = JavaVersion.VERSION_1_5
targetCompatibility = JavaVersion.VERSION_1_5
}
}

compileTestJava {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

publishing {
publications {
mavenJava(MavenPublication) {
artifactId = archivesBaseName
groupId = "${project.group}"
artifactId = "${project.archivesBaseName}"
version = "${project.version}"

artifact jar
artifact sourcesJar
Expand All @@ -54,32 +113,4 @@ allprojects {
}
}
}

}

group = 'org.mcphackers'
archivesBaseName = 'launchwrapper'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

project.ext.asm_version = 9.6

dependencies {
implementation 'org.mcphackers.rdi:rdi:1.0'
implementation "org.ow2.asm:asm:${project.asm_version}"
implementation "org.ow2.asm:asm-tree:${project.asm_version}"
implementation 'org.json:json:20230311'
// I'll bring discord RPC support later, when I have an environment to compile natives

testRuntimeOnly('org.junit.platform:junit-platform-launcher:1.5.2')
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.0.0'
}

test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
events = ["passed", "failed", "skipped"]
showStandardStreams = true
}
}
8 changes: 4 additions & 4 deletions launchwrapper-fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
apply plugin: 'java'
apply plugin: 'maven-publish'

repositories {
maven {
Expand All @@ -8,12 +7,13 @@ repositories {
maven {
url "https://maven.glass-launcher.net/babric/"
}
mavenCentral()
}

archivesBaseName = 'launchwrapper-fabric'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
compileJava {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

dependencies {
implementation rootProject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import org.mcphackers.launchwrapper.Launch;
import org.mcphackers.launchwrapper.LaunchConfig;
import org.mcphackers.launchwrapper.loader.LaunchClassLoader;

public class FabricBridge extends Launch {
private static final String FABRIC_KNOT_CLIENT = "net/fabricmc/loader/impl/launch/knot/KnotClient";
Expand Down Expand Up @@ -32,9 +33,10 @@ public static void main(String[] args) {
}

public void launch() {
CLASS_LOADER.overrideClassSource(FABRIC_KNOT, gameProdiverSource());
CLASS_LOADER.overrideClassSource(FABRIC_KNOT_CLIENT, gameProdiverSource());
CLASS_LOADER.invokeMain(FABRIC_KNOT_CLIENT, config.getArgs());
LaunchClassLoader loader = getLoader();
loader.overrideClassSource(FABRIC_KNOT, gameProdiverSource());
loader.overrideClassSource(FABRIC_KNOT_CLIENT, gameProdiverSource());
loader.invokeMain(FABRIC_KNOT_CLIENT, config.getArgs());
}

public static FabricBridge getInstance() {
Expand Down
Loading

0 comments on commit 338f55c

Please sign in to comment.