Skip to content

Commit cb29aba

Browse files
committed
Sync with Framework
1 parent 7d2050a commit cb29aba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+585
-181
lines changed

.github/workflows/check-build.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ on:
55
push:
66
paths: [
77
'**src/**',
8-
'**/*gradle*',
9-
LICENSE
8+
'**/*gradle*'
109
]
1110
pull_request:
1211
paths: [
1312
'**src/**',
14-
'**/*gradle*',
15-
LICENSE
13+
'**/*gradle*'
1614
]
1715
workflow_dispatch:
1816

.github/workflows/sync-labels.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
# Synchronizes the repo's labels with labels.yml
1+
# Synchronizes the repo's labels with a centralized labels.yml
22
# Requires GITHUB_TOKEN to have write permissions; if not, replace it with a custom token
33
name: Sync Labels
44

55
on:
66
push:
7-
paths: ['.github/labels.yml', '.github/workflows/sync-labels.yml']
87
workflow_dispatch:
98

109
permissions:

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ run/
88
runs/
99
out/
1010
classes/
11+
.eclipse/
1112

1213
# IDEA
1314
.idea/
@@ -22,5 +23,4 @@ classes/
2223
.project
2324

2425
# Other
25-
.env
26-
/neoforge/.eclipse/
26+
.env

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
## 1.5.10
4+
5+
- Added Russian translation (rfin0)

LICENSE LICENSE.txt

File renamed without changes.

README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ thinking of.
2727
With this mod, wonder no more! A toast will pop up in the top right corner of your screen or just
2828
above your hotbar (configurable), telling you what song you're about to listen to.
2929

30-
### License
31-
32-
[MIT](https://mit-license.org/)
33-
3430
### Contact
3531

3632
[![GitHub Issues](https://img.shields.io/github/issues/Scotsguy/now-playing?logo=github&label=Issues)](https://github.com/Scotsguy/now-playing/issues)
33+
34+
[![License](https://img.shields.io/github/license/scotsguy/now-playing?label=License&logo=github&logoColor=white)](https://github.com/scotsguy/now-playing/blob/HEAD/LICENSE.txt)

build.gradle

+55-10
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,31 @@ plugins {
55
id("net.darkhax.curseforgegradle") version("${curseforgegradle_version}")
66
id("com.github.breadmoirai.github-release") version("${githubrelease_version}")
77
id("org.ajoberstar.grgit.service") version("${grgitservice_version}")
8+
id("org.cadixdev.licenser") version("${licenser_version}")
89
}
910

1011
subprojects {
1112
version = mod_version
1213
group = mod_group
13-
14-
// Publishing
15-
if (name != "common") {
14+
15+
if (name == "common") {
16+
// License headers
17+
apply(plugin: "org.cadixdev.licenser")
18+
String licenseDir = "src/main/resources/assets/${mod_id}/license/"
19+
license {
20+
// This can be done in multiloader-common.gradle but only if the
21+
// "matching" method is not used (throws a pile of weird errors).
22+
// Also, NeoForge's update of the plugin can't handle matching at all.
23+
include("**/*.java") // Java files only
24+
header = project.file(licenseDir + "HEADER.txt")
25+
properties {
26+
project_name = mod_name
27+
owner_name = mod_owner
28+
year = java.time.LocalDate.now().getYear().toString()
29+
}
30+
}
31+
} else {
32+
// Publishing
1633
apply(plugin: "com.modrinth.minotaur")
1734
apply(plugin: "net.darkhax.curseforgegradle")
1835
apply(plugin: "com.github.breadmoirai.github-release")
@@ -24,8 +41,8 @@ subprojects {
2441
projectId = modrinth_id
2542
versionNumber = mod_version
2643
versionType = release_type
27-
versionName = "v${mod_version}-${capsLoader(name)}-${minecraft_version}"
28-
changelog = rootProject.file("changelog.md").text
44+
versionName = "v${mod_version}-${capsLoader(name)}"
45+
changelog = versionChangelog()
2946
uploadFile = name == "fabric" ? remapJar : jar
3047
loaders = project.property("release_mod_loaders_${name}").split(",") as List
3148
gameVersions = project.property("release_game_versions_${name}").split(",") as List
@@ -60,10 +77,10 @@ subprojects {
6077
String module = project.name
6178

6279
def file = upload(curseforge_id, module == "fabric" ? remapJar : jar)
63-
file.displayName = "v${mod_version}-${capsLoader(module)}-${minecraft_version}"
80+
file.displayName = "v${mod_version}-${capsLoader(module)}"
6481
file.releaseType = release_type
65-
file.changelog = rootProject.file("changelog.md").text
66-
file.changelogType = 'markdown'
82+
file.changelog = versionChangelog()
83+
file.changelogType = "markdown"
6784
project.property("release_mod_loaders_${module}").split(",").each { String id ->
6885
file.addModLoader(id)
6986
}
@@ -96,8 +113,18 @@ subprojects {
96113
repo = github_repo
97114
tagName = "v${mod_version}"
98115
prerelease = release_type == "alpha" || release_type == "beta"
99-
releaseName = "v${mod_version} for ${minecraft_version}"
100-
body = rootProject.file("changelog.md").text
116+
releaseName = "v${mod_version}"
117+
118+
String changelog = "\n\n## Changelog\n\n" + versionChangelog()
119+
String versions = "## MC versions\n\n"
120+
if (project.hasProperty("release_game_versions_fabric"))
121+
versions = String.format("%s - Fabric: %s\n", versions,
122+
project.property("release_game_versions_fabric"))
123+
if (project.hasProperty("release_game_versions_neoforge"))
124+
versions = String.format("%s - NeoForge: %s\n", versions,
125+
project.property("release_game_versions_neoforge"))
126+
body = versions + changelog
127+
101128
targetCommitish = grgitService.service.get().grgit.branch.current().name
102129
overwrite = false
103130
allowUploadToExisting = true
@@ -109,6 +136,24 @@ subprojects {
109136
}
110137
}
111138

139+
String versionChangelog() {
140+
List<String> lines = rootProject.file("CHANGELOG.md").readLines()
141+
StringBuilder builder = new StringBuilder()
142+
for (int i = 4; i < lines.size(); i++) {
143+
String line = lines.get(i)
144+
if (line.isBlank()) {
145+
// pass
146+
} else if (line.startsWith("## ")) {
147+
break
148+
}
149+
else {
150+
if (!builder.isEmpty()) builder.append("\n")
151+
builder.append(line)
152+
}
153+
}
154+
return builder.toString()
155+
}
156+
112157
static String capsLoader(String loader) {
113158
switch(loader) {
114159
case "fabric": return "Fabric"

buildSrc/src/main/groovy/multiloader-common.gradle

+18-19
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
base {
7-
archivesName = "${mod_id}-${project.name}-${minecraft_version}"
7+
archivesName = "${mod_id}-${project.name}"
88
}
99

1010
java {
@@ -19,32 +19,32 @@ repositories {
1919
exclusiveContent {
2020
forRepository {
2121
maven {
22-
name = 'Sponge'
23-
url = 'https://repo.spongepowered.org/repository/maven-public'
22+
name = "Sponge"
23+
url = "https://repo.spongepowered.org/repository/maven-public"
2424
}
2525
}
26-
filter { includeGroupAndSubgroups('org.spongepowered') }
26+
filter { includeGroupAndSubgroups("org.spongepowered") }
2727
}
2828
exclusiveContent {
2929
forRepositories(
30-
maven {
31-
name = 'ParchmentMC'
32-
url = 'https://maven.parchmentmc.org/'
33-
},
34-
maven {
35-
name = "NeoForge"
36-
url = 'https://maven.neoforged.net/releases'
37-
}
30+
maven {
31+
name = "ParchmentMC"
32+
url = "https://maven.parchmentmc.org"
33+
},
34+
maven {
35+
name = "NeoForge"
36+
url = "https://maven.neoforged.net/releases"
37+
}
3838
)
39-
filter { includeGroup('org.parchmentmc.data') }
39+
filter { includeGroup("org.parchmentmc.data") }
4040
}
4141
maven {
4242
name = "Modrinth"
4343
url = "https://api.modrinth.com/maven"
4444
}
4545
maven {
4646
name = "Shedaniel"
47-
url = "https://maven.shedaniel.me/"
47+
url = "https://maven.shedaniel.me"
4848
}
4949
}
5050

@@ -62,13 +62,13 @@ repositories {
6262
}
6363

6464
sourcesJar {
65-
from(rootProject.file("LICENSE")) {
65+
from(rootProject.file("LICENSE.txt")) {
6666
rename { "${it}_${mod_name}" }
6767
}
6868
}
6969

7070
jar {
71-
from(rootProject.file("LICENSE")) {
71+
from(rootProject.file("LICENSE.txt")) {
7272
rename { "${it}_${mod_name}" }
7373
}
7474

@@ -104,7 +104,6 @@ processResources {
104104
"mod_authors_string": mod_authors.replace(",", ", "),
105105
"mod_contributors_string": mod_contributors.replace(",", ", "),
106106
"mod_license": mod_license,
107-
"mod_environment": mod_environment,
108107
// Links
109108
"homepage_url": homepage_url,
110109
"sources_url": sources_url,
@@ -126,9 +125,9 @@ processResources {
126125
// Dependencies
127126
"clothconfig_versions_fabric_list": asJsonList(clothconfig_versions_fabric),
128127
"clothconfig_versions_neoforge": clothconfig_versions_neoforge,
129-
"modmenu_versions_fabric_list": asJsonList(modmenu_versions),
128+
"modmenu_versions_fabric_list": asJsonList(modmenu_versions_fabric),
130129
]
131-
filesMatching(["pack.mcmeta", "*.mod.json", "META-INF/*mods.toml", "*.mixins.json"]) {
130+
filesMatching(["pack.mcmeta", "*.mod.json", "META-INF/*mods.toml", "*.mixins.json", "assets/"+mod_id+"/lang/*.json"]) {
132131
expand expandProps
133132
}
134133
inputs.properties(expandProps)

changelog.md

-1
This file was deleted.

common/build.gradle

+4-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ plugins {
55

66
dependencies {
77
compileOnly("org.spongepowered:mixin:${mixin_version}")
8-
compileOnly("io.github.llamalad7:mixinextras-common:${mixinextras_version}")
9-
annotationProcessor("io.github.llamalad7:mixinextras-common:${mixinextras_version}")
10-
11-
// Mod dependencies use NeoForge version to avoid remapping complications
12-
implementation("me.shedaniel.cloth:cloth-config-neoforge:${clothconfig_version}")
8+
compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:${mixinextras_version}"))
9+
10+
// Cloth Config API
11+
api("me.shedaniel.cloth:cloth-config-neoforge:${clothconfig_version}")
1312
}
1413

1514
neoForge {

common/src/main/java/com/github/scotsguy/nowplaying/NowPlaying.java

+22
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
/*
2+
* Copyright (c) 2022-2024 AppleTheGolden
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in all
12+
* copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17+
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18+
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20+
* OR OTHER DEALINGS IN THE SOFTWARE.
21+
*/
22+
123
package com.github.scotsguy.nowplaying;
224

325
import com.github.scotsguy.nowplaying.config.Config;

common/src/main/java/com/github/scotsguy/nowplaying/command/Commands.java

+22
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
/*
2+
* Copyright (c) 2022-2024 AppleTheGolden
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in all
12+
* copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17+
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18+
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20+
* OR OTHER DEALINGS IN THE SOFTWARE.
21+
*/
22+
123
package com.github.scotsguy.nowplaying.command;
224

325
import com.github.scotsguy.nowplaying.NowPlaying;

common/src/main/java/com/github/scotsguy/nowplaying/config/Config.java

+22
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
/*
2+
* Copyright (c) 2022-2024 AppleTheGolden
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in all
12+
* copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17+
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18+
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20+
* OR OTHER DEALINGS IN THE SOFTWARE.
21+
*/
22+
123
package com.github.scotsguy.nowplaying.config;
224

325
import com.github.scotsguy.nowplaying.NowPlaying;

common/src/main/java/com/github/scotsguy/nowplaying/gui/screen/ClothConfigScreenProvider.java common/src/main/java/com/github/scotsguy/nowplaying/gui/screen/ClothScreenProvider.java

+23-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
/*
2+
* Copyright (c) 2022-2024 AppleTheGolden
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in all
12+
* copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17+
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18+
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
20+
* OR OTHER DEALINGS IN THE SOFTWARE.
21+
*/
22+
123
package com.github.scotsguy.nowplaying.gui.screen;
224

325
import com.github.scotsguy.nowplaying.config.Config;
@@ -8,7 +30,7 @@
830

931
import static com.github.scotsguy.nowplaying.util.Localization.localized;
1032

11-
public class ClothConfigScreenProvider {
33+
public class ClothScreenProvider {
1234
/**
1335
* Builds and returns a Cloth Config options screen.
1436
* @param parent the current screen.

0 commit comments

Comments
 (0)