Skip to content

Commit

Permalink
BTW CE 1.5.2 port
Browse files Browse the repository at this point in the history
  • Loading branch information
Arminias committed Nov 15, 2023
1 parent 4c3b249 commit d70f7b7
Show file tree
Hide file tree
Showing 81 changed files with 1,328 additions and 1,418 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# These are explicitly windows files and should use crlf
*.bat text eol=crlf

47 changes: 17 additions & 30 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,35 +1,22 @@
# mac os
.DS_Store

# forge / gradle
# Ignore Gradle project-specific cache directory
.gradle
build/
out/
classes/
run/

# eclipse
*.launch
.settings
.classpath
.project
.metadata
eclipse
*.launch
# Ignore Gradle build output directories
**/build/
!src/**/build/

# idea
.idea/
*.iml
*.ipr
*.iws
# Screws up the MC dev plugin for IntelliJ..
# src/btw/**

# vscode
.settings/
.vscode/
bin/
.classpath
# Ignore local Minecraft folder
.minecraft

# other
bin/
jars/
/.nb-gradle/
# IntelliJ
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
.idea/jarRepositories.xml
194 changes: 176 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,178 @@
/** The root of the build. Exposed for flexibility, but you shouldn't edit it
unless you have to. Edit project.gradle instead. */
import net.fabricmc.loom.task.RunClientTask
import net.fabricmc.loom.task.RunServerTask

buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "https://maven.minecraftforge.net/"
}
maven {
url = "https://jitpack.io"
}
}
dependencies {
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.11'
}
}

apply from: "buildscript/forge-1.7.gradle"
dependencies {
classpath fileTree(dir: "libs", include: "fabric-loom-0.7.local.jar")
}
}

plugins {
id 'maven-publish'
id 'fabric-loom' version "0.7-SNAPSHOT"
}

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group

repositories {
maven {
name = 'legacy-fabric'
url = 'https://maven.legacyfabric.net'
}
maven {
url 'https://jitpack.io'
}
maven {
name 'HalfOf2'
url 'https://storage.googleapis.com/devan-maven/'
}
}

sourceSets {
btw {
java {
srcDirs = ['src/btw/java']
}
resources {
srcDirs = ['src/btw/resources']
}
}
}

def lwjglVersion = System.getProperty("os.name").toLowerCase().contains("mac") ? "2.9.1" : "2.9.0"

dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
implementation 'org.apache.logging.log4j:log4j-core:2.17.0'
implementation 'org.apache.logging.log4j:log4j-api:2.17.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")
compileOnly fileTree(dir: "$projectDir/BTW_dev", include: "*.zip")
compileOnly fileTree(dir: "$buildDir/BTW_dev", include: "**.jar")

runtimeClasspath fileTree(dir: "$buildDir/dev_run", include: "dev.jar")

mappings fileTree(dir: "custom_mappings", include: "**.zip")
modImplementation("io.github.minecraft-cursed-legacy:cursed-fabric-loader:${loader_version}") {
transitive false
}

implementation 'org.apache.commons:commons-lang3:3.13.0'

}

configurations {
btwCompileClasspath.extendsFrom implementation, modImplementation
}

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"
if (JavaVersion.current().isJava9Compatible()) it.options.release = 8
}

java {
withSourcesJar()
}

compileJava {
dependsOn('btwJar')
}

task devPackMod(type:Copy) {
dependsOn('jar')
from sourceSets.main.output.classesDirs
into file("$buildDir/classes/java/btw")
}

task devPackBTW(type:Copy) {
dependsOn('devPackMod')
dependsOn('btwJar')
}

task devPackRun(type:Jar) {
dependsOn('devPackBTW')
from fileTree("$buildDir/classes/java/btw")
from fileTree("$projectDir/BTW_dev/")
from sourceSets.btw.output.resourcesDir
destinationDirectory = file("$buildDir/dev_run")
archiveFileName = "dev.jar"
}

jar {
from sourceSets.main.output.resourcesDir
from sourceSets.main.output.classesDirs
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
}
}

task btwJar(type:Jar) {
from fileTree("$projectDir/BTW_dev/")
from sourceSets.btw.output.resourcesDir
from sourceSets.btw.output.classesDirs
destinationDirectory = file("$buildDir/BTW_dev")
archiveFileName = "BTW_dev.jar"
}

remapJar {
dependsOn(jar)
input.set jar.archiveFile.get()
destinationDirectory = file("$rootDir/release")
}

reobfuscateJar {
dependsOn(jar)
input.set jar.archiveFile.get()
destinationDirectory = file("$rootDir/reobfuscated")
}

task safeRunClient(type:RunClientTask) {
mustRunAfter('clean')
dependsOn('clean')
dependsOn('devPackRun')
}

task safeRunServer(type:RunServerTask) {
mustRunAfter('clean')
dependsOn('clean')
dependsOn('devPackRun')
}

runClient {
dependsOn('devPackRun')
}

runServer {
dependsOn('devPackRun')
}

clean.doFirst {
delete "$buildDir/dev_run"
delete "$buildDir/BTW_dev"
}
54 changes: 0 additions & 54 deletions buildscript/forge-1.7-mixin.gradle

This file was deleted.

Loading

0 comments on commit d70f7b7

Please sign in to comment.