Skip to content

Commit d70f7b7

Browse files
committed
BTW CE 1.5.2 port
1 parent 4c3b249 commit d70f7b7

File tree

81 files changed

+1328
-1418
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1328
-1418
lines changed

.gitattributes

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# These are explicitly windows files and should use crlf
5+
*.bat text eol=crlf
6+

.gitignore

+17-30
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,22 @@
1-
# mac os
2-
.DS_Store
3-
4-
# forge / gradle
1+
# Ignore Gradle project-specific cache directory
52
.gradle
6-
build/
7-
out/
8-
classes/
9-
run/
103

11-
# eclipse
12-
*.launch
13-
.settings
14-
.classpath
15-
.project
16-
.metadata
17-
eclipse
18-
*.launch
4+
# Ignore Gradle build output directories
5+
**/build/
6+
!src/**/build/
197

20-
# idea
21-
.idea/
22-
*.iml
23-
*.ipr
24-
*.iws
8+
# Screws up the MC dev plugin for IntelliJ..
9+
# src/btw/**
2510

26-
# vscode
27-
.settings/
28-
.vscode/
29-
bin/
30-
.classpath
11+
# Ignore local Minecraft folder
12+
.minecraft
3113

32-
# other
33-
bin/
34-
jars/
35-
/.nb-gradle/
14+
# IntelliJ
15+
*.iml
16+
.idea/workspace.xml
17+
.idea/tasks.xml
18+
.idea/gradle.xml
19+
.idea/assetWizardSettings.xml
20+
.idea/dictionaries
21+
.idea/libraries
22+
.idea/jarRepositories.xml

build.gradle

+176-18
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,178 @@
1-
/** The root of the build. Exposed for flexibility, but you shouldn't edit it
2-
unless you have to. Edit project.gradle instead. */
1+
import net.fabricmc.loom.task.RunClientTask
2+
import net.fabricmc.loom.task.RunServerTask
33

44
buildscript {
5-
repositories {
6-
mavenCentral()
7-
maven {
8-
name = "forge"
9-
url = "https://maven.minecraftforge.net/"
10-
}
11-
maven {
12-
url = "https://jitpack.io"
13-
}
14-
}
15-
dependencies {
16-
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.11'
17-
}
18-
}
19-
20-
apply from: "buildscript/forge-1.7.gradle"
5+
dependencies {
6+
classpath fileTree(dir: "libs", include: "fabric-loom-0.7.local.jar")
7+
}
8+
}
9+
10+
plugins {
11+
id 'maven-publish'
12+
id 'fabric-loom' version "0.7-SNAPSHOT"
13+
}
14+
15+
sourceCompatibility = JavaVersion.VERSION_1_8
16+
targetCompatibility = JavaVersion.VERSION_1_8
17+
18+
archivesBaseName = project.archives_base_name
19+
version = project.mod_version
20+
group = project.maven_group
21+
22+
repositories {
23+
maven {
24+
name = 'legacy-fabric'
25+
url = 'https://maven.legacyfabric.net'
26+
}
27+
maven {
28+
url 'https://jitpack.io'
29+
}
30+
maven {
31+
name 'HalfOf2'
32+
url 'https://storage.googleapis.com/devan-maven/'
33+
}
34+
}
35+
36+
sourceSets {
37+
btw {
38+
java {
39+
srcDirs = ['src/btw/java']
40+
}
41+
resources {
42+
srcDirs = ['src/btw/resources']
43+
}
44+
}
45+
}
46+
47+
def lwjglVersion = System.getProperty("os.name").toLowerCase().contains("mac") ? "2.9.1" : "2.9.0"
48+
49+
dependencies {
50+
minecraft "com.mojang:minecraft:${project.minecraft_version}"
51+
implementation 'org.apache.logging.log4j:log4j-core:2.17.0'
52+
implementation 'org.apache.logging.log4j:log4j-api:2.17.0'
53+
54+
implementation "org.lwjgl.lwjgl:lwjgl_util:${lwjglVersion}"
55+
implementation "org.lwjgl.lwjgl:lwjgl:${lwjglVersion}"
56+
implementation "org.lwjgl.lwjgl:lwjgl-platform:${lwjglVersion}"
57+
58+
implementation fileTree(dir: "libs", include: "**.zip")
59+
compileOnly fileTree(dir: "$projectDir/BTW_dev", include: "*.zip")
60+
compileOnly fileTree(dir: "$buildDir/BTW_dev", include: "**.jar")
61+
62+
runtimeClasspath fileTree(dir: "$buildDir/dev_run", include: "dev.jar")
63+
64+
mappings fileTree(dir: "custom_mappings", include: "**.zip")
65+
modImplementation("io.github.minecraft-cursed-legacy:cursed-fabric-loader:${loader_version}") {
66+
transitive false
67+
}
68+
69+
implementation 'org.apache.commons:commons-lang3:3.13.0'
70+
71+
}
72+
73+
configurations {
74+
btwCompileClasspath.extendsFrom implementation, modImplementation
75+
}
76+
77+
configurations.all {
78+
resolutionStrategy {
79+
dependencySubstitution {
80+
substitute module('org.lwjgl.lwjgl:lwjgl_util:2.9.1-nightly-20130708-debug3') with module("org.lwjgl.lwjgl:lwjgl_util:${lwjglVersion}")
81+
substitute module('org.lwjgl.lwjgl:lwjgl:2.9.1-nightly-20130708-debug3') with module("org.lwjgl.lwjgl:lwjgl:${lwjglVersion}")
82+
}
83+
force "org.lwjgl.lwjgl:lwjgl-platform:${lwjglVersion}"
84+
}
85+
}
86+
87+
processResources {
88+
inputs.property "version", project.version
89+
filesMatching("fabric.mod.json") {
90+
expand "version": project.version
91+
}
92+
}
93+
94+
tasks.withType(JavaCompile).configureEach {
95+
it.options.encoding = "UTF-8"
96+
if (JavaVersion.current().isJava9Compatible()) it.options.release = 8
97+
}
98+
99+
java {
100+
withSourcesJar()
101+
}
102+
103+
compileJava {
104+
dependsOn('btwJar')
105+
}
106+
107+
task devPackMod(type:Copy) {
108+
dependsOn('jar')
109+
from sourceSets.main.output.classesDirs
110+
into file("$buildDir/classes/java/btw")
111+
}
112+
113+
task devPackBTW(type:Copy) {
114+
dependsOn('devPackMod')
115+
dependsOn('btwJar')
116+
}
117+
118+
task devPackRun(type:Jar) {
119+
dependsOn('devPackBTW')
120+
from fileTree("$buildDir/classes/java/btw")
121+
from fileTree("$projectDir/BTW_dev/")
122+
from sourceSets.btw.output.resourcesDir
123+
destinationDirectory = file("$buildDir/dev_run")
124+
archiveFileName = "dev.jar"
125+
}
126+
127+
jar {
128+
from sourceSets.main.output.resourcesDir
129+
from sourceSets.main.output.classesDirs
130+
from("LICENSE") {
131+
rename { "${it}_${project.archivesBaseName}"}
132+
}
133+
}
134+
135+
task btwJar(type:Jar) {
136+
from fileTree("$projectDir/BTW_dev/")
137+
from sourceSets.btw.output.resourcesDir
138+
from sourceSets.btw.output.classesDirs
139+
destinationDirectory = file("$buildDir/BTW_dev")
140+
archiveFileName = "BTW_dev.jar"
141+
}
142+
143+
remapJar {
144+
dependsOn(jar)
145+
input.set jar.archiveFile.get()
146+
destinationDirectory = file("$rootDir/release")
147+
}
148+
149+
reobfuscateJar {
150+
dependsOn(jar)
151+
input.set jar.archiveFile.get()
152+
destinationDirectory = file("$rootDir/reobfuscated")
153+
}
154+
155+
task safeRunClient(type:RunClientTask) {
156+
mustRunAfter('clean')
157+
dependsOn('clean')
158+
dependsOn('devPackRun')
159+
}
160+
161+
task safeRunServer(type:RunServerTask) {
162+
mustRunAfter('clean')
163+
dependsOn('clean')
164+
dependsOn('devPackRun')
165+
}
166+
167+
runClient {
168+
dependsOn('devPackRun')
169+
}
170+
171+
runServer {
172+
dependsOn('devPackRun')
173+
}
174+
175+
clean.doFirst {
176+
delete "$buildDir/dev_run"
177+
delete "$buildDir/BTW_dev"
178+
}

buildscript/forge-1.7-mixin.gradle

-54
This file was deleted.

0 commit comments

Comments
 (0)