Skip to content

Commit

Permalink
更改
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlimiter committed May 3, 2024
0 parents commit 8f17621
Show file tree
Hide file tree
Showing 25 changed files with 1,053 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Copyright (c) 2024
All rights reserved.
128 changes: 128 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
plugins {
id 'idea'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '5.1.+'
id 'org.spongepowered.mixin' version '0.7-SNAPSHOT'
}

base {
archivesName = "${mod_name}-forge-${minecraft_version}"
}

minecraft {
mappings channel: 'stable', version: '39-1.12'

accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

runs {
client {
workingDirectory project.file('run')
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
property 'mixin.hotSwap', "true"
}

server {
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
property 'mixin.hotSwap', "true"
}
}
}

configurations {
embed
implementation.extendsFrom(embed)
}

repositories {
maven {
name 'CleanroomMC Maven'
url 'https://maven.cleanroommc.com'
}
maven {
name 'SpongePowered Maven'
url 'https://repo.spongepowered.org/maven'
}
mavenLocal() // Must be last for caching to work
}

dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-14.23.5.2860"

annotationProcessor 'org.ow2.asm:asm-debug-all:5.2'

// Apply Mixin AP.
implementation ('zone.rong:mixinbooter:9.1') {
transitive = false
}
annotationProcessor ('zone.rong:mixinbooter:9.1') {
transitive = false
}
compileOnly ("org.projectlombok:lombok:1.18.24")
annotationProcessor ("org.projectlombok:lombok:1.18.24")
}

mixin {
//config("${mod_id}.mixins.json")
add(sourceSets.main, "${mod_id}.refmap.json")
debug.export = true
disableTargetExport = false
}

jar {
manifest {
attributes([
"FMLCorePlugin": "cn.evole.mods.offhandbanning.EarlyMixinInit",
"FMLCorePluginContainsFMLMod": true,
"Specification-Title" : "${mod_name}",
"Specification-Vendor" : "${mod_author}",
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : "${mod_author}",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
])
}
from(provider { configurations.embed.collect { it.isDirectory() ? it : zipTree(it) } })
}

processResources {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
inputs.property "version", project.version

from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version': project.version
}

from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}

jar.finalizedBy('reobfJar')

tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
maven {
name = "release"
url = 'https://maven.nova-committee.cn/releases'
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}
20 changes: 20 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Important Notes:
# Every field you add must be added to the root build.gradle expandProps map.

# Project
version=0.1.0
group=cn.evole.mods

# Common
minecraft_version=1.12.2
mod_name=OffHandBanning
mod_author=cnlimiter
mod_id=offhandbanning
license=ARR
credits=
description=The description of your mod. \nAccepts multilines.
minecraft_version_range=[1.12, 1.13)

# Gradle
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 8f17621

Please sign in to comment.