Skip to content

Commit 64da37e

Browse files
committed
feat: Update to Minecraft 1.21.11
1 parent f91c0cf commit 64da37e

121 files changed

Lines changed: 1226 additions & 1120 deletions

File tree

Some content is hidden

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

.gitattributes

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
# Disable autocrlf on generated files, they always generate with LF
2-
# Add any extra files or paths here to make git stop saying they
3-
# are changed when only line endings change.
4-
src/generated/**/.cache/cache text eol=lf
5-
src/generated/**/*.json text eol=lf
1+
* text eol=lf
2+
*.bat text eol=crlf
3+
*.patch text eol=lf
4+
*.java text eol=lf
5+
*.gradle text eol=crlf
6+
*.png binary
7+
*.gif binary
8+
*.exe binary
9+
*.dll binary
10+
*.jar binary
11+
*.lzma binary
12+
*.zip binary
13+
*.pyd binary
14+
*.cfg text eol=lf
15+
*.jks binary
16+
*.ogg binary

.github/advanced-issue-labeler.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ policy:
44
- id: [minecraftVersion]
55
block-list: [other]
66
label:
7+
- name: Minecraft 1.21.11
8+
keys: ['1.21.11']
79
- name: Minecraft 1.21.10
810
keys: ['1.21.10']
911
- name: Minecraft 1.21.8

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
- Fixed doors and contents rendering with wrong rotation on some facings
1+
- Updated to Minecraft 1.21.11

buildSrc/src/main/groovy/multiloader-common.gradle renamed to build-logic/src/main/groovy/multiloader-common.gradle

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ plugins {
44
}
55

66
base {
7-
archivesName = "${mod_id}-${project.name}-${minecraft_version}"
8-
version = project.version
7+
archivesName = "${mod_id}-${project.name}-${libs.minecraft.get().version}"
98
}
109

1110
java {
@@ -26,37 +25,29 @@ repositories {
2625
}
2726
filter { includeGroupAndSubgroups("org.spongepowered") }
2827
}
29-
maven {
30-
url "https://maven.twelveiterations.com/repository/maven-public/"
31-
content {
32-
includeGroup "net.blay09.mods"
33-
}
34-
}
3528
exclusiveContent {
3629
forRepositories(
3730
maven {
3831
name = 'ParchmentMC'
3932
url = 'https://maven.parchmentmc.org/'
4033
},
4134
maven {
42-
name = "NeoForge"
35+
name = 'NeoForge'
4336
url = 'https://maven.neoforged.net/releases'
4437
}
4538
)
4639
filter { includeGroup('org.parchmentmc.data') }
4740
}
4841
}
4942

50-
dependencies {
51-
implementation 'org.jetbrains:annotations:24.1.0'
52-
}
53-
5443
// Declare capabilities on the outgoing configurations.
5544
// Read more about capabilities here: https://docs.gradle.org/current/userguide/component_capabilities.html#sec:declaring-additional-capabilities-for-a-local-component
5645
['apiElements', 'runtimeElements', 'sourcesElements', 'javadocElements'].each { variant ->
5746
configurations."$variant".outgoing {
58-
capability("$group:${mod_id.replace('_', '-')}-${project.name}:$version")
59-
capability("$group:${mod_id.replace('_', '-')}:$version")
47+
capability("$group:${project.name}:$version")
48+
capability("$group:${base.archivesName.get()}:$version")
49+
capability("$group:$mod_id-${project.name}-${libs.minecraft.get().version}:$version")
50+
capability("$group:$mod_id:$version")
6051
}
6152
publishing.publications.configureEach {
6253
suppressPomMetadataWarningsFor(variant)
@@ -82,7 +73,7 @@ jar {
8273
'Implementation-Title' : project.name,
8374
'Implementation-Version': project.jar.archiveVersion,
8475
'Implementation-Vendor' : mod_author,
85-
'Built-On-Minecraft' : minecraft_version,
76+
'Built-On-Minecraft' : libs.minecraft.get().version,
8677
'MixinConfigs' : "${mod_id}.mixins.json,${mod_id}.${project.name}.mixins.json",
8778
])
8879
}
@@ -92,45 +83,47 @@ processResources {
9283
def expandProps = [
9384
"version": version,
9485
"group": project.group, //Else we target the task's group.
95-
"minecraft_version": minecraft_version,
96-
"minimum_minecraft_version": minecraft_version_range.replaceAll("[\\[\\])]", "").split(",")[0],
97-
"forge_version": forge_version,
98-
"forge_loader_version_range": forge_loader_version_range,
99-
"forge_version_range": forge_version_range,
100-
"minecraft_version_range": minecraft_version_range,
101-
"fabric_version": fabric_version,
102-
"fabric_loader_version": fabric_loader_version,
86+
"minecraft_version": libs.minecraft.get().version.replace('-pre', '-beta.'),
87+
"forge_version": libs.forge.get().version,
88+
"fabric_api_version": libs.fabricApi.get().version,
89+
"fabric_loader_version": libs.fabricLoader.get().version,
10390
"mod_name": mod_name,
10491
"mod_main": mod_name.split(/\s+/).collect { word -> word.capitalize() }.join(""),
10592
"mod_author": mod_author,
10693
"mod_id": mod_id,
10794
"license": license,
10895
"description": project.description,
109-
"neoforge_version": neoforge_version,
110-
"neoforge_version_range": neoforge_version_range,
111-
"neoforge_loader_version_range": neoforge_loader_version_range,
96+
"neoforge_version": libs.neoForge.get().version,
11297
"credits": credits,
11398
"java_version": java_version,
11499
"homepage": homepage,
115100
"discord": discord,
116101
"issues": issues,
117102
"sources": sources,
118103
"pack_format_number": pack_format_number,
119-
"balm_version_range": balm_version_range,
120-
"minimum_balm_version": balm_version_range.replaceAll("[\\[\\])]", "").split(",")[0],
104+
"balm_version": libs.versions.balm.get().split('\\+')[0],
121105
]
122106

123-
filesMatching(['pack.mcmeta', 'fabric.mod.json', 'META-INF/mods.toml', 'META-INF/neoforge.mods.toml', '*.mixins.json']) {
107+
def jsonExpandProps = expandProps.collectEntries {
108+
key, value -> [(key): value instanceof String ? value.replace("\n", "\\\\n") : value]
109+
}
110+
111+
filesMatching(['META-INF/mods.toml', 'META-INF/neoforge.mods.toml']) {
124112
expand expandProps
125113
}
114+
115+
filesMatching(['pack.mcmeta', 'fabric.mod.json', '*.mixins.json']) {
116+
expand jsonExpandProps
117+
}
118+
126119
inputs.properties(expandProps)
127120
}
128121

129122
publishing {
130123
publications {
131124
register('mavenJava', MavenPublication) {
132-
version = project.version + (!project.version.endsWith("SNAPSHOT") ? "+" + minecraft_version : "")
133-
artifactId "${mod_id.replace('_', '-')}-${project.name}"
125+
version = project.version
126+
artifactId = "${mod_id.replace('_', '-')}-${project.name}"
134127
from components.java
135128
}
136129
}

buildSrc/src/main/groovy/multiloader-loader.gradle renamed to build-logic/src/main/groovy/multiloader-loader.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ configurations {
1717
dependencies {
1818
compileOnly(project(':common')) {
1919
capabilities {
20-
requireCapability "$group:${mod_id.replace('_', '-')}"
20+
requireCapability "$group:$mod_id"
21+
}
22+
def loaderAttribute = Attribute.of('io.github.mcgradleconventions.loader', String)
23+
attributes {
24+
attribute(loaderAttribute, 'common')
2125
}
2226
}
2327
commonJava project(path: ':common', configuration: 'commonJava')

build.gradle

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
plugins {
2-
id 'fabric-loom' version '1.11-SNAPSHOT' apply(false)
3-
id 'net.neoforged.moddev' version '2.0.107' apply(false)
4-
id 'net.darkhax.curseforgegradle' version '1.1.26' apply(false)
5-
id "com.modrinth.minotaur" version "2.+" apply(false)
2+
alias libs.plugins.fabricLoom apply(false)
3+
alias libs.plugins.modDevGradle apply(false)
4+
alias libs.plugins.curseForgeGradle apply(false)
5+
alias libs.plugins.modrinthMinotaur apply(false)
66
}
77

88
subprojects {
9-
configurations.all {
10-
resolutionStrategy {
11-
cacheChangingModulesFor 60, 'seconds'
12-
cacheDynamicVersionsFor 60, 'seconds'
13-
}
14-
}
9+
configurations.configureEach {
10+
resolutionStrategy {
11+
cacheChangingModulesFor 60, 'seconds'
12+
cacheDynamicVersionsFor 60, 'seconds'
13+
}
14+
}
1515
}

common/build.gradle

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,20 @@
11
plugins {
22
id 'multiloader-common'
3-
id 'net.neoforged.moddev'
4-
}
5-
6-
base {
7-
archivesName = "${mod_id}-common-${minecraft_version}"
3+
alias libs.plugins.modDevGradle
84
}
95

106
neoForge {
11-
neoFormVersion = neo_form_version
7+
neoFormVersion = libs.neoForm.get().version
128
// Automatically enable AccessTransformers if the file exists
139
def at = file('src/main/resources/META-INF/accesstransformer.cfg')
1410
if (at.exists()) {
1511
accessTransformers.from(at.absolutePath)
1612
}
17-
parchment {
18-
minecraftVersion = parchment_minecraft
19-
mappingsVersion = parchment_version
20-
}
13+
parchment.parchmentArtifact = libs.parchment.get().toString()
2114
}
2215

2316
dependencies {
24-
compileOnly "org.spongepowered:mixin:$mixin_version"
17+
compileOnly libs.mixin
2518
}
2619

2720
apply from: rootProject.file('repositories.gradle')
@@ -56,10 +49,21 @@ artifacts {
5649
commonGeneratedResources sourceSets.generated.resources.sourceDirectories.singleFile
5750
}
5851

59-
sourceSets {
60-
main {
61-
java {
62-
srcDir 'src/shell/java'
52+
// Implement mcgradleconventions loader attribute
53+
def loaderAttribute = Attribute.of('io.github.mcgradleconventions.loader', String)
54+
['apiElements', 'runtimeElements', 'sourcesElements', 'javadocElements'].each { variant ->
55+
configurations.named("$variant") {
56+
attributes {
57+
attribute(loaderAttribute, 'common')
6358
}
6459
}
65-
}
60+
}
61+
sourceSets.configureEach {
62+
[it.compileClasspathConfigurationName, it.runtimeClasspathConfigurationName].each { variant->
63+
configurations.named("$variant") {
64+
attributes {
65+
attribute(loaderAttribute, 'common')
66+
}
67+
}
68+
}
69+
}

common/dependencies.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
dependencies {
2-
implementation("net.blay09.mods:kuma-api-common:${kuma_version}")
3-
implementation("net.blay09.mods:balm-common:${balm_version}") {
4-
changing = balm_version.endsWith("SNAPSHOT")
2+
implementation(libs.balmCommon) {
3+
changing = libs.versions.balm.get().endsWith("SNAPSHOT")
54
}
65
compileOnly "mezz.jei:jei-$jei_minecraft_version-common-api:$jei_version"
76

common/src/main/java/net/blay09/mods/cookingforblockheads/CookingForBlockheads.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package net.blay09.mods.cookingforblockheads;
22

3-
import net.blay09.mods.balm.api.Balm;
4-
import net.blay09.mods.balm.api.event.LivingDamageEvent;
5-
import net.blay09.mods.balm.api.event.PlayerLoginEvent;
3+
import net.blay09.mods.balm.Balm;
64
import net.blay09.mods.balm.core.BalmRegistrars;
5+
import net.blay09.mods.balm.platform.event.callback.LivingEntityCallback;
6+
import net.blay09.mods.balm.platform.event.callback.ServerPlayerCallback;
77
import net.blay09.mods.cookingforblockheads.api.CookingForBlockheadsAPI;
88
import net.blay09.mods.cookingforblockheads.api.FoodStatsProvider;
99
import net.blay09.mods.cookingforblockheads.block.ModBlocks;
@@ -26,7 +26,7 @@
2626
import net.blay09.mods.cookingforblockheads.sound.ModSounds;
2727
import net.minecraft.core.component.DataComponents;
2828
import net.minecraft.core.registries.Registries;
29-
import net.minecraft.resources.ResourceLocation;
29+
import net.minecraft.resources.Identifier;
3030
import net.minecraft.world.entity.player.Player;
3131
import net.minecraft.world.food.FoodProperties;
3232
import net.minecraft.world.item.ItemStack;
@@ -69,33 +69,33 @@ public int getNutrition(ItemStack itemStack, Player entityPlayer) {
6969
CookingForBlockheadsAPI.registerKitchenRecipeHandler(SmeltingRecipe.class, new KitchenSmeltingRecipeHandler());
7070

7171
CookingForBlockheadsConfig.initialize();
72-
registrars.dataComponentTypes(MOD_ID, ModDataComponents::initialize);
72+
registrars.dataComponentTypes(ModDataComponents::initialize);
7373
ModNetworking.initialize(Balm.networking());
74-
registrars.blocks(MOD_ID, ModBlocks::initialize);
75-
registrars.blockEntityTypes(MOD_ID, ModBlockEntities::initialize);
76-
registrars.items(MOD_ID, ModItems::initialize);
77-
registrars.creativeModeTabs(MOD_ID, ModItems::initialize);
78-
registrars.recipeTypes(MOD_ID, ModRecipes::initialize);
79-
registrars.menuTypes(MOD_ID, ModMenus::initialize);
80-
registrars.registrar(Registries.SOUND_EVENT, MOD_ID, ModSounds::initialize);
74+
registrars.blocks(ModBlocks::initialize);
75+
registrars.blockEntityTypes( ModBlockEntities::initialize);
76+
registrars.items(ModItems::initialize);
77+
registrars.creativeModeTabs(ModItems::initialize);
78+
registrars.recipeTypes(ModRecipes::initialize);
79+
registrars.menuTypes(ModMenus::initialize);
80+
registrars.registrar(Registries.SOUND_EVENT, ModSounds::initialize);
8181
ModCapabilities.initialize(Balm.capabilities());
8282

8383
Balm.initializeIfLoaded(Compat.HARVESTCRAFT_FOOD_CORE, "net.blay09.mods.cookingforblockheads.compat.HarvestCraftAddon");
8484

85-
CookingForBlockheadsRegistry.initialize(Balm.events());
85+
CookingForBlockheadsRegistry.initialize();
8686

87-
Balm.events().onEvent(PlayerLoginEvent.class, event -> {
88-
final var data = Balm.hooks().getPersistentData(event.getPlayer());
87+
ServerPlayerCallback.Login.EVENT.register(player -> {
88+
final var data = Balm.hooks().getPersistentData(player);
8989
final var favoriteItemIds = data.getCompound("CookingForBlockheads")
9090
.flatMap(it -> it.getCompound("FavoriteItemIds"))
91-
.map(it -> it.keySet().stream().map(ResourceLocation::parse).collect(Collectors.toSet())).orElse(Set.of());
92-
Balm.networking().sendTo(event.getPlayer(), new FavoriteListMessage(favoriteItemIds));
91+
.map(it -> it.keySet().stream().map(Identifier::parse).collect(Collectors.toSet())).orElse(Set.of());
92+
Balm.networking().sendTo(player, new FavoriteListMessage(favoriteItemIds));
9393
});
9494

95-
Balm.events().onEvent(LivingDamageEvent.class, CowJarHandler::onLivingDamage);
95+
LivingEntityCallback.Damage.EVENT.register(CowJarHandler::onLivingDamage);
9696
}
9797

98-
public static ResourceLocation id(String path) {
99-
return ResourceLocation.fromNamespaceAndPath(MOD_ID, path);
98+
public static Identifier id(String path) {
99+
return Identifier.fromNamespaceAndPath(MOD_ID, path);
100100
}
101101
}

0 commit comments

Comments
 (0)