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 5, 2023
0 parents commit 6c66923
Show file tree
Hide file tree
Showing 16 changed files with 718 additions and 0 deletions.
118 changes: 118 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# User-specific stuff
.idea/

*.iml
*.ipr
*.iws

# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

.gradle
build/

# Ignore Gradle GUI config
gradle-app.setting

# Cache of project
.gradletasknamecache

**/build/

# Common working directory
run/

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
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) 2023 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 @@
# Revert Stackable Curing Discount
Revert the villager curing discount system to before MC-181190 fix.
139 changes: 139 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
import java.nio.charset.StandardCharsets
import java.util.*

plugins {
id("java")
id("fabric-loom") version "1.3-SNAPSHOT"
id("maven-publish")
}

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

repositories {
mavenCentral()
maven("https://maven.terraformersmc.com/releases")
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")
// modRuntimeOnly("maven.modrinth:notenoughcrashes:4.4.5+1.20.1-fabric")
// modRuntimeOnly("maven.modrinth:language-reload:1.5.8+1.20.1")
// modRuntimeOnly("maven.modrinth:smoothboot-fabric:1.19.4-1.7.0")
// modRuntimeOnly("maven.modrinth:immediatelyfast:1.1.20+1.20.1")
modRuntimeOnly("com.github.LlamaLad7:MixinExtras:0.2.0-beta.9")
modRuntimeOnly("maven.modrinth:ferrite-core:6.0.0-fabric")
// modRuntimeOnly("maven.modrinth:lithium:mc1.20.1-0.11.2")
}

loom {
sourceSets["main"].resources.files
.find { file -> file.name.endsWith(".accesswidener") }
.let(accessWidenerPath::set)

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

runs {
val commonVmArgs = arrayOf(
"-Dfabric.systemLibraries=${System.getProperty("java.home")}/lib/hotswap/hotswap-agent.jar",
"-XX:+AllowEnhancedClassRedefinition",
"-XX:HotswapAgent=fatjar",
file(".gradle/loom-cache/remapClasspath.txt")
.takeIf { it.exists() && it.isFile && it.canRead() }
?.let { Scanner(it, StandardCharsets.UTF_8) }
?.use {
it.useDelimiter(File.pathSeparator)
while (it.hasNext()) {
val next = it.next()
if ("net.fabricmc${File.separator}sponge-mixin" in next)
return@use next
}
return@use null
}
?.let { "-javaagent:${it}" }
).filterNotNull()

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

getByName("server") {
configName = "Minecraft Server"
runDir = "run/server"
vmArgs(commonVmArgs)
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(
"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-mc${project.property("minecraft_version")}")
}

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

// 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.
}
}
18 changes: 18 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs = -Xmx1G

# Fabric Properties
# https://fabricmc.net/develop/
minecraft_version = 23w31a
yarn_mappings = 23w31a+build.4
loader_version = 0.14.22

# Mod Properties
mod_name = Revert Stackable Curing Discount
mod_id = rscd
mod_version = 1.0.0
target_java_version = 17
archive_base_name = rscd

# Dependencies
mod_menu_version = 7.2.1
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase = GRADLE_USER_HOME
distributionPath = wrapper/dists
distributionUrl = https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
zipStoreBase = GRADLE_USER_HOME
zipStorePath = wrapper/dists
Loading

0 comments on commit 6c66923

Please sign in to comment.