Skip to content

Commit f9fe8f5

Browse files
committed
Port to 1.21.1
1 parent 43df3d6 commit f9fe8f5

File tree

64 files changed

+729
-141
lines changed

Some content is hidden

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

64 files changed

+729
-141
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ replay_*.log
3939
*.hprof
4040
*.jfr
4141
/src/main/generated/.cache
42+
versions/*/src/main/generated/.cache

LICENSE

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
The MIT-0 License (MIT-0)
1+
MIT License
22

3-
Copyright (c) 2024-present ekulxam
3+
Copyright (c) 23:25 UTC 17 Nov 2025-present ekulxam
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
77
in the Software without restriction, including without limitation the rights
88
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
99
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so.
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
1114

1215
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1316
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1417
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1518
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1619
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
18-
THE SOFTWARE.
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

LICENSE-former

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
The MIT-0 License (MIT-0)
2+
3+
Copyright (c) 2024-23:24 UTC 17 Nov 2025 ekulxam
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so.
11+
12+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
18+
THE SOFTWARE.

build.gradle.kts

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import java.io.BufferedReader
2+
import java.io.FileReader
3+
14
plugins {
25
id("fabric-loom") version "1.13-SNAPSHOT"
36
id("maven-publish")
@@ -48,8 +51,9 @@ dependencies {
4851

4952
modImplementation("net.fabricmc.fabric-api:fabric-api:${project.property("deps.fabric_api")}")
5053

51-
bundleAPI("dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.property("deps.cca")}")
52-
bundleAPI("dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${project.property("deps.cca")}")
54+
val ccaPackage = if(stonecutter.eval(stonecutter.current.version, ">=1.20.5")) "org.ladysnake" else "dev.onyxstudios"
55+
bundleAPI("${ccaPackage}.cardinal-components-api:cardinal-components-base:${project.property("deps.cca")}")
56+
bundleAPI("${ccaPackage}.cardinal-components-api:cardinal-components-entity:${project.property("deps.cca")}")
5357

5458
modApi("dev.isxander:yet-another-config-lib:${project.property("deps.yacl")}")
5559
modApi("com.terraformersmc:modmenu:${project.property("deps.modmenu")}")
@@ -61,6 +65,13 @@ dependencies {
6165
compat("maven.modrinth:midnightlib:${project.property("deps.midnightlib")}")
6266
}
6367

68+
stonecutter {
69+
replacements.string {
70+
direction = eval(current.version, ">=1.20.5")
71+
replace("dev.onyxstudios", "org.ladysnake")
72+
}
73+
}
74+
6475
fletchingTable {
6576
mixins.create("main") {
6677
// Default matches the default value in the annotation
@@ -87,6 +98,29 @@ tasks.processResources {
8798
}
8899
}
89100

101+
tasks.named("build") {
102+
finalizedBy("autoVersionChangelog")
103+
}
104+
105+
tasks.register("autoVersionChangelog") {
106+
doLast {
107+
val changelog = File("changelog.md")
108+
val reader = BufferedReader(FileReader(changelog))
109+
val lines = reader.readLines().toMutableList()
110+
val title = "Laseredstone ${project.property("mod_version")}"
111+
lines[0] = title
112+
changelog.bufferedWriter().use { writer ->
113+
for (i in 0..<lines.size) {
114+
writer.write(lines[i])
115+
if (i != lines.size - 1) {
116+
writer.newLine()
117+
}
118+
}
119+
}
120+
println("Changelog header successfully replaced as $title")
121+
}
122+
}
123+
90124
loom {
91125
runConfigs.all {
92126
ideConfigGenerated(true)

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Shield Surf 1.0.2
2+
- Fix [#1](https://github.com/ekulxam/shield_surf/issues/1)
3+
- Port to stonecutter (multiversion)
4+
- Port to 1.21.1 (closes [#3](https://github.com/ekulxam/shield_surf/issues/3))

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
org.gradle.jvmargs=-Xmx1G
33
org.gradle.parallel=true
44
# Fabric Properties
5-
loader_version=0.16.9
5+
loader_version=0.17.3
66
# Mod Properties
7-
mod_version=1.0.1+1.20.1
7+
mod_version=1.0.2
88
maven_group=survivalblock.shield_surf
99
archives_base_name=shield_surf

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ stonecutter {
1818

1919
// Subproject configuration
2020
create(rootProject) {
21-
versions("1.20.1")
21+
versions("1.20.1", "1.21.1")
2222
vcsVersion = "1.20.1"
2323
}
2424
}

src/main/java/survivalblock/shield_surf/client/render/ProjectedShieldEntityRenderer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818

1919
public class ProjectedShieldEntityRenderer extends EntityRenderer<ProjectedShieldEntity> {
2020

21-
public static final Identifier TEXTURE = new Identifier("textures/entity/shield_base_nopattern.png");
21+
public static final Identifier TEXTURE = /*? >=1.21.1 {*/ /*Identifier.ofVanilla *//*?} else {*/ new Identifier /*?}*/("textures/entity/shield_base_nopattern.png");
22+
2223
public ProjectedShieldEntityRenderer(EntityRendererFactory.Context context) {
2324
super(context);
2425
}

src/main/java/survivalblock/shield_surf/client/render/ShieldboardEntityRenderer.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@
1919

2020
@Environment(value= EnvType.CLIENT)
2121
public class ShieldboardEntityRenderer extends EntityRenderer<ShieldboardEntity> {
22-
public static final Identifier TEXTURE = new Identifier("textures/entity/shield_base_nopattern.png");
23-
// private final ShieldEntityModel modelShield;
22+
23+
public static final Identifier TEXTURE = /*? >=1.21.1 {*/ /*Identifier.ofVanilla *//*?} else {*/ new Identifier /*?}*/("textures/entity/shield_base_nopattern.png");
2424

2525
public ShieldboardEntityRenderer(EntityRendererFactory.Context context) {
2626
super(context);
27-
// this.modelShield = new ShieldEntityModel(context.getPart(EntityModelLayers.SHIELD));
2827
}
2928

3029
@Override

src/main/java/survivalblock/shield_surf/common/ShieldSurf.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class ShieldSurf implements ModInitializer {
2020

2121
@Override
2222
public void onInitialize() {
23+
//? if <1.21
2324
ShieldSurfEnchantments.init();
2425
ShieldSurfEntityTypes.init();
2526
ShieldSurfSoundEvents.init();
@@ -35,7 +36,7 @@ public void onInitialize() {
3536
}
3637

3738
public static Identifier id(String value) {
38-
return new Identifier(MOD_ID, value);
39+
return /*? >=1.21.1 {*/ /*Identifier.of *//*?} else {*/ new Identifier /*?}*/(MOD_ID, value);
3940
}
4041

4142
@SuppressWarnings("UnusedReturnValue")

0 commit comments

Comments
 (0)