-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
96 lines (83 loc) · 2.35 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import org.objectweb.asm.ClassWriter
import java.time.Instant
import org.objectweb.asm.Opcodes as ops
buildscript {
dependencies {
classpath("org.ow2.asm:asm:9.3")
}
}
plugins {
id 'fabric-loom' version '0.12-SNAPSHOT'
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
version = '0.1.4'
group = 'xland.mcmod'
repositories {
maven {
url = 'https://lss233.littleservice.cn/repositories/minecraft'
name = 'Lss233'
}
maven { url = 'https://maven.aliyun.com/repository/public' }
}
dependencies {
minecraft "com.mojang:minecraft:1.19.1-rc2"
mappings loom.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:0.14.8"
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
tasks.withType(JavaCompile).configureEach {
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17
}
java {
withSourcesJar()
}
jar {
from("LICENSE") {
rename { "META-INF/LICENSE_${project.archivesBaseName}.txt"}
}
manifest {
attributes([
"Specification-Title": "Remove Sign Tips",
"Specification-Vendor": "teddyxlandlee",
"Specification-Version": "1",
"Implementation-Title": project.name,
"Implementation-Version": project.version,
"Implementation-Vendor": "teddyxlandlee,QWERTY770",
"Implementation-Timestamp": Instant.now(),
"MixinConfigs": "faqms-forge.mixins.json"
])
}
}
task generateModClass {
def className = "utio90j4kIJqJAV7zYH6o/A"
def modId = "nosigntip"
def file = new File(processResources.destinationDir, "${className}.class")
afterEvaluate {
file.parentFile.mkdirs()
file.createNewFile()
def writer = new ClassWriter(3)
writer.visit(ops.V1_6, ops.ACC_PUBLIC, className, null, "java/lang/Object", null)
writer.visitMethod(ops.ACC_PUBLIC, "<init>", "()V", null, null).with {
it.visitVarInsn(ops.ALOAD, 0)
it.visitMethodInsn(ops.INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false)
it.visitInsn(ops.RETURN)
it.visitMaxs(-1, -1)
}
writer.visitAnnotation("Lnet/minecraftforge/fml/common/Mod;", true).with {
it.visit("value", modId)
}
writer.visitSource(null, "ASM Generated")
file.newOutputStream().with {
it.write(writer.toByteArray())
it.close()
}
}
}
processResources.dependsOn(generateModClass)