Skip to content

Commit

Permalink
Chat Tools v2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
70CentsApple committed Jan 29, 2024
1 parent b2f5234 commit 69f4737
Show file tree
Hide file tree
Showing 71 changed files with 4,029 additions and 3,559 deletions.
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

79 changes: 79 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Bug Report
description: Something doesn't seem correct and it might be a bug
labels: []
body:
- type: textarea
id: description
attributes:
label: Bug description
description: |
A clear and concise description of what the bug is.
Is it a game crash, an unexpected behavior, or has something gone wrong?
If applicable, add screenshots to help explain the bug.
placeholder: Tell us what you see!
validations:
required: true
- type: textarea
id: to-reproduce
attributes:
label: Steps to reproduce
description: Steps to reproduce the bug
placeholder: |
1. Create a world
2. Wait until midnight
3. Hug a creeper
validations:
required: true
- type: textarea
id: expected-behavior
attributes:
label: Expected behavior
description: What did you expect to happen?
placeholder: The creeper explodes
- type: textarea
id: actual-behavior
attributes:
label: Actual behavior
description: What actually happened?
placeholder: The creeper launches itself into the sky
- type: textarea
id: logs
attributes:
label: Relevant logs
description: |-
If it's a crash, send the corresponding Minecraft log in the `logs` folder, or crash report in the `crash-reports` folder, here.
Please upload the log file as an attachment, or upload the log to [pastebin](https://pastebin.com/) / [mclo.gs](https://mclo.gs/) and paste the url here.
Please refrain from pasting the entire log file directly.
Leave empty if there is none.
placeholder: https://pastebin.com/******
- type: input
id: minecraft-version
attributes:
label: Minecraft version
description: The Minecraft version(s) where this bug occurs in.
placeholder: 1.15.2
validations:
required: true
- type: input
id: mod-version
attributes:
label: Mod version
description: The Mod version(s) where this bug occurs in.
placeholder: 1.0.0
validations:
required: true
- type: textarea
id: other-information
attributes:
label: Other information
description: Other useful information to this bug report, e.g. other related mod version(s). Leave empty if there is none.
placeholder: The issue only occurs if the player is in survival mode
- type: checkboxes
id: check-list
attributes:
label: Check list
options:
- label: I have verified that the issue persists in the latest version of the mod.
required: true
- label: I have searched the existing issues and confirmed that this is not a duplicate.
required: true
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Feature Request
description: Suggest an idea for this project
labels: []
body:
- type: textarea
id: motivation
attributes:
label: Motivation
description: Why do you want this feature? What problem do you want to solve? How can the suggested feature help with that?
placeholder: Tell us what you want!
validations:
required: true
- type: textarea
id: description
attributes:
label: Description
description: Describe the feature you want, as detailed as possible
placeholder: I want to see a fancy starry sky when I look up at midnight.
validations:
required: true
- type: textarea
id: other-information
attributes:
label: Other information
description: Other useful information to this feature request. Leave empty if there is none.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ bin/
# fabric

run/


logs/
artifacts/
105 changes: 38 additions & 67 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,81 +1,52 @@
plugins {
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'maven-publish'
}

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

archivesBaseName = project.archives_base_name + '-' + project.minecraft_version
version = project.mod_version
group = project.maven_group
id 'fabric-loom' version '1.2-SNAPSHOT' apply false

repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.

maven { url "https://maven.shedaniel.me/" } // Cloth Config
maven { url "https://maven.terraformersmc.com/releases/" } // Mod Menu
}

dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

// https://linkie.shedaniel.dev/dependencies
modApi ("me.shedaniel.cloth:cloth-config-fabric:13.0.114") {
exclude(group: "net.fabricmc.fabric-api")
}
modApi "com.terraformersmc:modmenu:9.0.0-pre.1"
}
// https://github.com/Juuxel/LoomQuiltflower
id 'io.github.juuxel.loom-quiltflower' version '1.10.0' apply false

processResources {
inputs.property "version", project.version
// https://github.com/ReplayMod/preprocessor
// https://github.com/Fallen-Breath/preprocessor
id 'com.replaymod.preprocess' version '20c7ec554a'

filesMatching("fabric.mod.json") {
expand "version": project.version
}
// https://github.com/Fallen-Breath/yamlang
id 'me.fallenbreath.yamlang' version '1.3.1'
}

tasks.withType(JavaCompile).configureEach {
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17
}
preprocess {
def mc116 = createNode('1.16.5' , 1_16_05, 'yarn')
def mc117 = createNode('1.17.1' , 1_17_01, 'yarn')
def mc118 = createNode('1.18.2' , 1_18_02, 'yarn')
def mc119 = createNode('1.19.4' , 1_19_04, 'yarn')
def mc120 = createNode('1.20.4' , 1_20_04, 'yarn')

java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
// withSourcesJar()
mc116.link(mc117, null)
mc117.link(mc118, null)
mc118.link(mc119, null)
mc119.link(mc120, null)
}

jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
tasks.register('buildAndGather') {
subprojects {
dependsOn project.tasks.named('build').get()
}
}

// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
doFirst {
println 'Gathering builds'
def buildLibs = {
p -> p.buildDir.toPath().resolve('libs')
}
delete fileTree(buildLibs(rootProject)) {
include '*'
}
subprojects {
copy {
from(buildLibs(project)) {
include '*.jar'
exclude '*-dev.jar', '*-sources.jar'
}
into buildLibs(rootProject)
duplicatesStrategy DuplicatesStrategy.INCLUDE
}
}
}

// 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.
}
}
146 changes: 146 additions & 0 deletions common.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
apply plugin: 'maven-publish'
apply plugin: 'fabric-loom'
apply plugin: 'io.github.juuxel.loom-quiltflower'
apply plugin: 'com.replaymod.preprocess'
apply plugin: 'me.fallenbreath.yamlang'

int mcVersion = project.mcVersion

preprocess {
tabIndentation = true
}

repositories {
maven {
url 'https://jitpack.io'
}
maven { url "https://maven.shedaniel.me/" } // Cloth Config
maven { url "https://maven.terraformersmc.com/releases/" } // Mod Menu
}

// https://github.com/FabricMC/fabric-loader/issues/783
configurations {
modApi.exclude group: 'net.fabricmc', module: 'fabric-loader'
}

dependencies {
// loom
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"

// https://linkie.shedaniel.dev/dependencies
modApi("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
modApi "com.terraformersmc:modmenu:${project.mod_menu_version}"
}

loom {
runConfigs.all {
// to make sure it generates all "Minecraft Client (:subproject_name)" applications
ideConfigGenerated = true
runDir '../../run'
vmArgs '-Dmixin.debug.export=true'
}
}

remapJar {
remapperIsolation = true
}

String FABRIC_API_MOD_ID
String CLOTH_CONFIG_MOD_ID
if (mcVersion >= 11800){
FABRIC_API_MOD_ID = 'fabric-api'
CLOTH_CONFIG_MOD_ID = 'cloth-config'
} else {
FABRIC_API_MOD_ID = 'fabric'
CLOTH_CONFIG_MOD_ID = 'cloth-config2'
}

JavaVersion JAVA_COMPATIBILITY
if (mcVersion >= 11800) {
JAVA_COMPATIBILITY = JavaVersion.VERSION_17
} else if (mcVersion >= 11700) {
JAVA_COMPATIBILITY = JavaVersion.VERSION_16
} else {
JAVA_COMPATIBILITY = JavaVersion.VERSION_1_8
}
sourceCompatibility = JAVA_COMPATIBILITY
targetCompatibility = JAVA_COMPATIBILITY

String versionSuffix = ''
String fullModVersion = project.mod_version + versionSuffix

version = 'v' + fullModVersion
group = project.maven_group
archivesBaseName = project.archives_base_name + '-' + project.minecraft_version

// See https://youtrack.jetbrains.com/issue/IDEA-296490
// if IDEA complains about "Cannot resolve resource filtering of MatchingCopyAction" and you want to know why
processResources {
inputs.property "id", project.mod_id
inputs.property "version", fullModVersion
inputs.property "minecraft_dependency", project.minecraft_dependency

filesMatching("fabric.mod.json") {
def valueMap = ["id" : project.mod_id,
"version" : fullModVersion,
"minecraft_dependency": project.minecraft_dependency]
expand valueMap
}
filesMatching('chattools.mixins.json') {
filter { s -> s.replace('{{COMPATIBILITY_LEVEL}}', "JAVA_${JAVA_COMPATIBILITY.ordinal() + 1}") }
}
filesMatching('fabric.mod.json') {
filter { s -> s.replace('{{FABRIC_API}}', "${FABRIC_API_MOD_ID}") }
filter { s -> s.replace('{{CLOTH_CONFIG}}', "${CLOTH_CONFIG_MOD_ID}") }
}
}

// https://github.com/Fallen-Breath/yamlang
yamlang {
targetSourceSets = [sourceSets.main]
inputDir = 'assets/chattools/lang'
}

// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
}

java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
// withSourcesJar()
}

jar {
from(rootProject.file('LICENSE')) {
rename { "${it}_${project.archives_base_name}" }
}
}

// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
artifactId archivesBaseName

from components.java
}
}

// select the repositories you want to publish to
repositories {
// uncomment to publish to the local maven
// mavenLocal()
}
}
Loading

0 comments on commit 69f4737

Please sign in to comment.