Skip to content

Commit f347e5f

Browse files
committed
Update to mc1.21.9-rc1
1 parent bb0865b commit f347e5f

8 files changed

Lines changed: 73 additions & 56 deletions

File tree

common/build.gradle

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id("multiloader-common")
3-
id("net.neoforged.moddev")
3+
id("fabric-loom")
44
}
55

66
// Vanilla depends on ASM 9.3, MDG makes that a 'strict' version constraint,
@@ -21,6 +21,15 @@ dependencies {
2121
compileOnly "org.ow2.asm:asm-tree:${asm_version}"
2222
compileOnly "org.ow2.asm:asm-util:${asm_version}"
2323

24+
// Minecraft
25+
minecraft("com.mojang:minecraft:${minecraft_version}")
26+
27+
// Mappings
28+
mappings(loom.layered {
29+
officialMojangMappings()
30+
parchment("org.parchmentmc.data:parchment-${parchment_minecraft_version}:${parchment_version}@zip")
31+
})
32+
2433
// Mixin and MixinExtras
2534
compileOnly("org.spongepowered:mixin:${mixin_version}")
2635
compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:${mixinextras_version}"))
@@ -29,14 +38,18 @@ dependencies {
2938
api("me.shedaniel.cloth:cloth-config-neoforge:${clothconfig_version}")
3039
}
3140

32-
neoForge {
33-
version = neoforge_version // Shut up
34-
neoFormVersion = neoform_version
35-
def at = file("src/main/resources/META-INF/accesstransformer.cfg")
36-
if (at.exists()) accessTransformers.from(at.absolutePath)
37-
parchment {
38-
minecraftVersion = parchment_minecraft_version
39-
mappingsVersion = parchment_version
41+
loom {
42+
// Apply common AccessWidener if it exists
43+
def aw = project(":common").file("src/main/resources/${mod_id}.accesswidener")
44+
if (aw.exists()) accessWidenerPath.set(aw)
45+
if (aw.exists()) {
46+
validateAccessWidener { accessWidener = aw }
47+
afterEvaluate {
48+
validateAccessWidener.run()
49+
}
50+
}
51+
mixin {
52+
defaultRefmapName.set("${mod_id}.refmap.json")
4053
}
4154
}
4255

common/src/main/java/dev/terminalmc/nocapes/NoCapes.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class NoCapes {
4141
.append(Component.literal(MOD_NAME).withStyle(ChatFormatting.GOLD))
4242
.append(Component.literal("] ").withStyle(ChatFormatting.DARK_GRAY))
4343
.withStyle(ChatFormatting.GRAY);
44-
44+
4545
public static final Map<ResourceLocation, String> RESOURCE_CAPE_CACHE = new HashMap<>();
4646

4747
public static void init() {
@@ -63,7 +63,7 @@ public static void init() {
6363
public static void onConfigSaved(Config config) {
6464
// Cache update method
6565
}
66-
66+
6767
public static boolean blockCape(ResourceLocation location) {
6868
if (options().hideEverything) return true;
6969
if (RESOURCE_CAPE_CACHE.containsKey(location)) {
@@ -83,17 +83,15 @@ public static boolean blockElytra(ResourceLocation location) {
8383
}
8484
return false;
8585
}
86-
86+
8787
public static void checkInConfig(String capeId, String url) {
8888
if (!options().capes.containsKey(capeId)) {
8989
Minecraft.getInstance().gui.getChat().addMessage(PREFIX.copy().append(
9090
localized("message", "unknownCape", Component.literal(
9191
capeId.substring(Math.max(0, capeId.length() - 5)))
9292
.withStyle(ChatFormatting.WHITE))).withStyle(PREFIX.getStyle()
93-
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
94-
localized("message", "clickToCopy")))
95-
.withClickEvent(new ClickEvent(ClickEvent.Action.COPY_TO_CLIPBOARD,
96-
url))));
93+
.withHoverEvent(new HoverEvent.ShowText(localized("message", "clickToCopy")))
94+
.withClickEvent(new ClickEvent.CopyToClipboard(url))));
9795
options().capes.put(capeId, Config.ShowMode.BOTH);
9896
Config.save();
9997
}

common/src/main/java/dev/terminalmc/nocapes/mixin/MixinCapeLayer.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,27 @@
2020
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
2121
import dev.terminalmc.nocapes.NoCapes;
2222
import net.minecraft.client.renderer.entity.layers.CapeLayer;
23-
import net.minecraft.client.resources.PlayerSkin;
24-
import net.minecraft.resources.ResourceLocation;
25-
import org.jetbrains.annotations.Nullable;
23+
import net.minecraft.core.ClientAsset;
24+
import net.minecraft.world.entity.player.PlayerSkin;
2625
import org.spongepowered.asm.mixin.Mixin;
2726
import org.spongepowered.asm.mixin.injection.At;
2827

2928
@Mixin(CapeLayer.class)
3029
public abstract class MixinCapeLayer {
3130
@WrapOperation(
32-
method = "render",
31+
method = "submit(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;ILnet/minecraft/client/renderer/entity/state/AvatarRenderState;FF)V",
3332
at = @At(
3433
value = "INVOKE",
35-
target = "Lnet/minecraft/client/resources/PlayerSkin;capeTexture()Lnet/minecraft/resources/ResourceLocation;"
34+
target = "Lnet/minecraft/world/entity/player/PlayerSkin;cape()Lnet/minecraft/core/ClientAsset$Texture;"
3635
)
3736
)
38-
private static @Nullable ResourceLocation wrapCapeTexture(PlayerSkin instance, Operation<ResourceLocation> original) {
39-
ResourceLocation texture = original.call(instance);
40-
if (NoCapes.blockCape(texture)) return null;
37+
private static ClientAsset.Texture wrapCape(
38+
PlayerSkin instance,
39+
Operation<ClientAsset.Texture> original
40+
) {
41+
ClientAsset.Texture texture = original.call(instance);
42+
if (texture != null && NoCapes.blockCape(texture.texturePath()))
43+
return null;
4144
return texture;
4245
}
4346
}

common/src/main/java/dev/terminalmc/nocapes/mixin/MixinSkinManager.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
2222
import dev.terminalmc.nocapes.NoCapes;
2323
import net.minecraft.client.resources.SkinManager;
24-
import net.minecraft.resources.ResourceLocation;
24+
import net.minecraft.core.ClientAsset;
2525
import org.spongepowered.asm.mixin.Mixin;
2626
import org.spongepowered.asm.mixin.Unique;
2727
import org.spongepowered.asm.mixin.injection.At;
@@ -38,9 +38,9 @@ public class MixinSkinManager {
3838
ordinal = 1
3939
)
4040
)
41-
private CompletableFuture<ResourceLocation> wrapLoadCape(
42-
SkinManager.TextureCache instance, MinecraftProfileTexture texture,
43-
Operation<CompletableFuture<ResourceLocation>> original) {
41+
private CompletableFuture<ClientAsset.Texture> wrapLoadCape(
42+
SkinManager.TextureCache instance, MinecraftProfileTexture texture,
43+
Operation<CompletableFuture<ClientAsset.Texture>> original) {
4444
return noCapes$wrapLoadTexture(instance, texture, original);
4545
}
4646

@@ -52,23 +52,23 @@ private CompletableFuture<ResourceLocation> wrapLoadCape(
5252
ordinal = 2
5353
)
5454
)
55-
private CompletableFuture<ResourceLocation> wrapLoadElytra(
55+
private CompletableFuture<ClientAsset.Texture> wrapLoadElytra(
5656
SkinManager.TextureCache instance, MinecraftProfileTexture texture,
57-
Operation<CompletableFuture<ResourceLocation>> original) {
57+
Operation<CompletableFuture<ClientAsset.Texture>> original) {
5858
return noCapes$wrapLoadTexture(instance, texture, original);
5959
}
60-
60+
6161
@Unique
62-
private CompletableFuture<ResourceLocation> noCapes$wrapLoadTexture(
62+
private CompletableFuture<ClientAsset.Texture> noCapes$wrapLoadTexture(
6363
SkinManager.TextureCache instance, MinecraftProfileTexture texture,
64-
Operation<CompletableFuture<ResourceLocation>> original) {
65-
return original.call(instance, texture).thenApply((location) -> {
64+
Operation<CompletableFuture<ClientAsset.Texture>> original) {
65+
return original.call(instance, texture).thenApply((asset) -> {
6666
String hash = texture.getHash();
67-
if (!NoCapes.RESOURCE_CAPE_CACHE.containsKey(location)) {
68-
NoCapes.RESOURCE_CAPE_CACHE.put(location, hash);
67+
if (!NoCapes.RESOURCE_CAPE_CACHE.containsKey(asset.texturePath())) {
68+
NoCapes.RESOURCE_CAPE_CACHE.put(asset.texturePath(), hash);
6969
NoCapes.checkInConfig(hash, "https://textures.minecraft.net/texture/" + hash);
7070
}
71-
return location;
71+
return asset;
7272
});
7373
}
7474
}

common/src/main/java/dev/terminalmc/nocapes/mixin/MixinWingsLayer.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@
2020
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
2121
import dev.terminalmc.nocapes.NoCapes;
2222
import net.minecraft.client.renderer.entity.layers.WingsLayer;
23-
import net.minecraft.client.resources.PlayerSkin;
24-
import net.minecraft.resources.ResourceLocation;
25-
import org.jetbrains.annotations.Nullable;
23+
import net.minecraft.core.ClientAsset;
24+
import net.minecraft.world.entity.player.PlayerSkin;
2625
import org.spongepowered.asm.mixin.Mixin;
2726
import org.spongepowered.asm.mixin.injection.At;
2827

@@ -32,12 +31,16 @@ public class MixinWingsLayer {
3231
method = "getPlayerElytraTexture",
3332
at = @At(
3433
value = "INVOKE",
35-
target = "Lnet/minecraft/client/resources/PlayerSkin;capeTexture()Lnet/minecraft/resources/ResourceLocation;"
34+
target = "Lnet/minecraft/world/entity/player/PlayerSkin;cape()Lnet/minecraft/core/ClientAsset$Texture;"
3635
)
3736
)
38-
private static @Nullable ResourceLocation wrapCapeTexture(PlayerSkin instance, Operation<ResourceLocation> original) {
39-
ResourceLocation texture = original.call(instance);
40-
if (NoCapes.blockElytra(texture)) return null;
37+
private static ClientAsset.Texture wrapCapeTexture(
38+
PlayerSkin instance,
39+
Operation<ClientAsset.Texture> original
40+
) {
41+
ClientAsset.Texture texture = original.call(instance);
42+
if (texture != null && NoCapes.blockElytra(texture.texturePath()))
43+
return null;
4144
return texture;
4245
}
4346
}

gradle.properties

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ java_versions_fabric=>=21
2727
java_versions_neoforge=[21,)
2828

2929
# Minecraft
30-
minecraft_version=1.21.3
31-
minecraft_versions_fabric=>1.21.1 <1.22
32-
minecraft_versions_neoforge=(1.21.1, 1.22)
30+
minecraft_version=1.21.9-rc1
31+
minecraft_versions_fabric=>1.21.8
32+
minecraft_versions_neoforge=[1.21.9,)
3333

3434
# Parchment https://parchmentmc.org/docs/getting-started#choose-a-version
35-
parchment_minecraft_version=1.21
36-
parchment_version=2024.11.10
35+
parchment_minecraft_version=1.21.8
36+
parchment_version=2025.09.14
3737

3838
# Fabric https://fabricmc.net/develop
3939
fabric_loader_version=0.16.9
4040
fabric_loader_versions=>=0.15.0
41-
fabric_api_version=0.110.0+1.21.3
41+
fabric_api_version=0.133.13+1.21.9
4242
fabric_api_versions=*
4343

4444
# NeoForge https://projects.neoforged.net/neoforged/neoforge
@@ -67,12 +67,12 @@ curseforge_slug=nocapes
6767
release_type=STABLE
6868
# Fabric
6969
release_mod_loaders_fabric=fabric
70-
release_game_versions_fabric=1.21.2,1.21.3,1.21.4,1.21.5
70+
release_game_versions_fabric=1.21.9
7171
release_required_dep_ids_fabric_mr=P7dR8mSH,mOgUt4GM,9s6osm5g
7272
release_required_dep_ids_fabric_cf=fabric-api,modmenu,cloth-config
7373
# NeoForge
7474
release_mod_loaders_neoforge=neoforge
75-
release_game_versions_neoforge=1.21.2,1.21.3,1.21.4,1.21.5
75+
release_game_versions_neoforge=1.21.9
7676
release_required_dep_ids_neoforge_mr=9s6osm5g
7777
release_required_dep_ids_neoforge_cf=cloth-config
7878

@@ -85,7 +85,7 @@ asm_version=9.7
8585

8686
# Plugins
8787
# Fabric Loom https://mvnrepository.com/artifact/net.fabricmc/fabric-loom
88-
loom_version=1.9.2
88+
loom_version=1.11.8
8989
# ModDev https://plugins.gradle.org/plugin/net.neoforged.moddev
9090
moddev_version=1.0.23
9191
# Mod Publish Plugin https://plugins.gradle.org/plugin/me.modmuss50.mod-publish-plugin

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pluginManagement {
1010
}
1111
}
1212
filter {
13-
includeGroup("net.fabricmc")
13+
includeGroupAndSubgroups("net.fabricmc")
1414
includeGroup("fabric-loom")
1515
}
1616
}
@@ -38,4 +38,4 @@ plugins {
3838
rootProject.name = "NoCapes"
3939
include("common")
4040
include("fabric")
41-
include("neoforge")
41+
//include("neoforge")

0 commit comments

Comments
 (0)