Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
No-Eul committed Aug 22, 2024
0 parents commit e7baf18
Show file tree
Hide file tree
Showing 30 changed files with 1,140 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = tab
indent_size = 4

ij_continuation_indent_size = 8

[*.md]
indent_style = space
indent_size = 2
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
* text=auto eol=lf

*.sh text eol=lf
gradlew text eol=lf
*.bat text eol=crlf

*.jar binary
44 changes: 44 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
run/

### IntelliJ IDEA ###
.idea/
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2024 NoEul

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# MinecartMaxSpeedAttribute
Add max_speed, the attribute version of minecartMaxSpeed gamerule, to the entire minecart entities.
143 changes: 143 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
plugins {
id("java")
id("fabric-loom") version "latest.release"
id("maven-publish")
}

group = "dev.noeul.fabricmod"
version = property("mod_version")!!

repositories {
mavenCentral()
maven("https://maven.terraformersmc.com/releases")
maven("https://maven.shedaniel.me/")
maven("https://api.modrinth.com/maven") { name = "Modrinth" }
maven("https://jitpack.io")
}


dependencies {
minecraft("com.mojang:minecraft:${property("minecraft_version")}")
mappings("net.fabricmc:yarn:${property("yarn_mappings")}:v2")
modImplementation("net.fabricmc:fabric-loader:${property("loader_version")}")

// modImplementation("com.terraformersmc:modmenu:${property("mod_menu_version")}")

modRuntimeOnly("maven.modrinth:mixintrace:1.1.1+1.17") // https://modrinth.com/mod/mixintrace/versions
/*modRuntimeOnly("maven.modrinth:language-reload:1.6.1+1.21") // https://modrinth.com/mod/language-reload/versions
modRuntimeOnly("maven.modrinth:ferrite-core:7.0.0") // https://modrinth.com/mod/ferrite-core/versions
modRuntimeOnly("maven.modrinth:auth-me:8.0.0+1.21") { // https://modrinth.com/mod/auth-me/versions
// https://linkie.shedaniel.dev/dependencies?loader=fabric&version=1.21#dep-2
modRuntimeOnly("me.shedaniel.cloth:cloth-config-fabric:15.+")
}*/
}

loom {
sourceSets.forEach {
it.resources.files
.find { file -> file.name.endsWith(".accesswidener") }
?.let(accessWidenerPath::set)
}

@Suppress("UnstableApiUsage")
mixin {
defaultRefmapName.set("${property("mod_id")}.refmap.json")
}

runs {
getByName("client") {
configName = "Minecraft Client"
runDir = "run/client"
client()
}

getByName("server") {
configName = "Minecraft Server"
runDir = "run/server"
server()
}
}
}

val targetJavaVersion: JavaVersion = JavaVersion.toVersion(property("target_java_version")!!)
java {
targetCompatibility = targetJavaVersion
sourceCompatibility = targetJavaVersion
if (JavaVersion.current() < targetJavaVersion)
toolchain.languageVersion.set(JavaLanguageVersion.of(targetJavaVersion.majorVersion.toInt()))
}

tasks {
compileJava {
if (targetJavaVersion.majorVersion.toInt() >= 10 || JavaVersion.current().isJava10Compatible)
options.release.set(targetJavaVersion.majorVersion.toInt())
this.options.encoding = "UTF-8"
}

processResources {
val inputs = mapOf(
"mod_id" to project.property("mod_id"),
"version" to project.version,
"name" to project.property("mod_name"),
"minecraft_version" to project.property("minecraft_version"),
"loader_version" to project.property("loader_version"),
)
this.inputs.properties(inputs)
filesMatching("fabric.mod.json") {
expand(inputs)
}
}

jar {
from("LICENSE.txt")
archiveBaseName.set("${project.property("archive_base_name")}")
archiveAppendix.set("fabric")
archiveVersion.set("${project.version}+mc${project.property("minecraft_version")}")
}

remapJar {
archiveBaseName.set("${project.property("archive_base_name")}")
archiveAppendix.set("fabric")
archiveVersion.set("${project.version}+mc${project.property("minecraft_version")}")
}
}

afterEvaluate {
loom.runs.configureEach {
vmArgs(
"-Dfabric.systemLibraries=${System.getProperty("java.home")}/lib/hotswap/hotswap-agent.jar",
"-Dfabric.development=true",
"-Dfabric.fabric.debug.deobfuscateWithClasspath",
"-Dmixin.debug.export=true",
"-Dmixin.debug.verify=true",
// "-Dmixin.debug.strict=true",
"-Dmixin.debug.countInjections=true",
"-Dmixin.hotSwap=true",
"-XX:+AllowEnhancedClassRedefinition",
"-XX:HotswapAgent=fatjar",
"-XX:+IgnoreUnrecognizedVMOptions",
"-javaagent:${
configurations.compileClasspath.get()
.files { it.group == "net.fabricmc" && it.name == "sponge-mixin" }
.first()
}"
)
}
}

// configure the maven publication
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
}
}

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}
24 changes: 24 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties
org.gradle.parallel=true
org.gradle.caching=true

# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# https://fabricmc.net/develop/
minecraft_version=24w33a
yarn_mappings=24w33a+build.17
loader_version=0.15.11

# Mod Properties
mod_name=MinecartMaxSpeed Attribute
mod_id=minecart-max-speed
mod_version=1.0.0
target_java_version=17
archive_base_name=MinecartMaxSpeedAttribute

# Dependencies
# Fabric API - https://fabricmc.net/develop/
# Mod Menu - https://modrinth.com/mod/modmenu/versions
mod_menu_version=11.+
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-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit e7baf18

Please sign in to comment.