-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c3a5b22
Showing
34 changed files
with
14,620 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# gradle | ||
.gradle/ | ||
build/ | ||
out/ | ||
classes/ | ||
|
||
# eclipse | ||
*.launch | ||
|
||
# idea | ||
.idea/ | ||
*.iml | ||
*.ipr | ||
*.iws | ||
|
||
# vscode | ||
.settings/ | ||
.vscode/ | ||
bin/ | ||
.classpath | ||
.project | ||
|
||
# fabric | ||
run/ | ||
|
||
# macos | ||
*.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# FreeCam Mod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
import net.fabricmc.loom.api.processor.MinecraftJarProcessor | ||
import net.fabricmc.loom.api.processor.ProcessorContext | ||
import net.fabricmc.loom.api.processor.SpecContext | ||
|
||
import java.nio.file.Files | ||
import java.nio.file.Paths | ||
import java.nio.file.StandardCopyOption; | ||
plugins { | ||
id 'maven-publish' | ||
id 'fabric-loom' version "1.4-SNAPSHOT" | ||
} | ||
|
||
archivesBaseName = project.archives_base_name | ||
version = project.mod_version | ||
group = project.maven_group | ||
|
||
repositories { | ||
maven { | ||
name = 'legacy-fabric' | ||
url = 'https://maven.legacyfabric.net' | ||
} | ||
// Fixed LWJGL on Linux | ||
maven { | ||
name = 'Babric' | ||
url = 'https://maven.glass-launcher.net/babric' | ||
} | ||
maven { | ||
url file('mavenRepo') | ||
} | ||
mavenCentral() //For fastutil | ||
} | ||
|
||
loom { | ||
setIntermediaryUrl('https://maven.legacyfabric.net/net/legacyfabric/intermediary/%1$s/intermediary-%1$s-v2.jar'); | ||
//accessWidenerPath = file('src/main/resources/<NAME>.accesswidener') | ||
addMinecraftJarProcessor( | ||
BTWJarReplacer, "BTWJarReplacer", projectDir.toString() | ||
) | ||
} | ||
|
||
def lwjglVersion = System.getProperty("os.name").toLowerCase().contains("mac") ? "2.9.1" : "2.9.0" | ||
|
||
dependencies { | ||
minecraft "com.mojang:minecraft:${project.minecraft_version}" | ||
mappings "btw.community:mappings:1.0.3" | ||
|
||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" | ||
|
||
implementation 'net.fabricmc:fabric-loom:1.4-SNAPSHOT' | ||
|
||
implementation 'org.apache.logging.log4j:log4j-core:2.19.0' | ||
implementation 'org.apache.logging.log4j:log4j-api:2.19.0' | ||
|
||
implementation "org.lwjgl.lwjgl:lwjgl_util:${lwjglVersion}" | ||
implementation "org.lwjgl.lwjgl:lwjgl:${lwjglVersion}" | ||
implementation "org.lwjgl.lwjgl:lwjgl-platform:${lwjglVersion}" | ||
|
||
implementation fileTree(dir: "libs", include: "**.zip") | ||
|
||
implementation 'com.google.guava:guava:14.0.1' | ||
|
||
// This is what MC 1.6 uses | ||
implementation 'com.google.code.gson:gson:2.2.2' | ||
|
||
implementation group: 'it.unimi.dsi', name: 'fastutil', version: '8.5.12' | ||
} | ||
|
||
configurations.all { | ||
resolutionStrategy { | ||
dependencySubstitution { | ||
substitute module('org.lwjgl.lwjgl:lwjgl_util:2.9.1-nightly-20130708-debug3') with { | ||
module("org.lwjgl.lwjgl:lwjgl_util:${lwjglVersion}") | ||
} | ||
substitute module('org.lwjgl.lwjgl:lwjgl:2.9.1-nightly-20130708-debug3') with { | ||
module("org.lwjgl.lwjgl:lwjgl:${lwjglVersion}") | ||
} | ||
} | ||
force "org.lwjgl.lwjgl:lwjgl-platform:${lwjglVersion}" | ||
} | ||
} | ||
|
||
processResources { | ||
inputs.property "version", project.version | ||
filesMatching("fabric.mod.json") { | ||
expand "version": project.version | ||
} | ||
} | ||
|
||
tasks.withType(JavaCompile).configureEach { | ||
it.options.encoding = "UTF-8" | ||
} | ||
|
||
java { | ||
withSourcesJar() | ||
} | ||
|
||
jar { | ||
from sourceSets.main.output.resourcesDir | ||
from sourceSets.main.output.classesDirs | ||
from("LICENSE") { | ||
rename { "${it}_${project.archivesBaseName}"} | ||
} | ||
} | ||
|
||
loom { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
|
||
runClient { | ||
dependsOn(jar) | ||
} | ||
|
||
runServer { | ||
dependsOn(jar) | ||
} | ||
|
||
class BTWJarReplacer implements MinecraftJarProcessor<Spec> { | ||
String name | ||
String path | ||
|
||
@javax.inject.Inject | ||
BTWJarReplacer(String name, String path) { | ||
this.name = name | ||
this.path = path | ||
} | ||
|
||
@Override | ||
Spec buildSpec(SpecContext context) { | ||
return new Spec(path) | ||
} | ||
|
||
@Override | ||
void processJar(java.nio.file.Path jar, Spec spec, ProcessorContext context) throws IOException { | ||
// Replace the Minecraft jar with the custom one from BTW_dev. | ||
// This is just a straight up file replacement, no remapping or anything. | ||
if (!Files.exists(Paths.get(path, "build_BTW/BTW_dev/BTW_dev.zip"))) { | ||
// Print a warning if the BTW_dev zip doesn't exist. | ||
System.err.println("BTW_dev zip not found, skipping BTWJarReplacer") | ||
} else { | ||
System.out.println("BTW_dev zip found, replacing Minecraft jar with BTW_dev jar.") | ||
Files.copy(Paths.get(path, "build_BTW/BTW_dev/BTW_dev.zip"), jar, StandardCopyOption.REPLACE_EXISTING) | ||
// Add Javadocs | ||
Files.copy(Paths.get(path, "build_BTW/BTW_dev/BTW_dev-javadoc.jar"), jar.resolveSibling(jar.getFileName().toString().replace(".jar", "-javadoc.jar")), StandardCopyOption.REPLACE_EXISTING) | ||
} | ||
} | ||
|
||
@Override | ||
String getName() { | ||
return name | ||
} | ||
|
||
class Spec implements MinecraftJarProcessor.Spec { | ||
String path | ||
|
||
Spec(String path) { | ||
this.path = path | ||
} | ||
|
||
@Override | ||
int hashCode() { | ||
if (!Files.exists(Paths.get(path, "build_BTW/BTW_dev/BTW_dev.zip"))) { | ||
return name.hashCode() | ||
} else { | ||
return Files.getLastModifiedTime(Paths.get(path, "build_BTW/BTW_dev/BTW_dev.zip")).hashCode() ^ name.hashCode() | ||
} | ||
} | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Manifest-Version: 1.0 | ||
Minecraft-Version-Id: 1.6.4 | ||
|
Oops, something went wrong.