From 1e1fb126cbac19593db59b888d6d5ff94989c8fc Mon Sep 17 00:00:00 2001 From: Julian Burner <48808497+NebelNidas@users.noreply.github.com> Date: Tue, 11 Apr 2023 10:49:50 +0200 Subject: [PATCH] Fix `FabricWrappedVanillaResourcePack::getName` (#2998) * Fix `FabricWrappedVanillaResourcePack::getName` * Remove unused import --- .../resource/loader/FabricWrappedVanillaResourcePack.java | 7 ++----- .../client/DefaultClientResourcePackProviderMixin.java | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/fabric-resource-loader-v0/src/client/java/net/fabricmc/fabric/impl/client/resource/loader/FabricWrappedVanillaResourcePack.java b/fabric-resource-loader-v0/src/client/java/net/fabricmc/fabric/impl/client/resource/loader/FabricWrappedVanillaResourcePack.java index f65ed6fea..a1a3eb327 100644 --- a/fabric-resource-loader-v0/src/client/java/net/fabricmc/fabric/impl/client/resource/loader/FabricWrappedVanillaResourcePack.java +++ b/fabric-resource-loader-v0/src/client/java/net/fabricmc/fabric/impl/client/resource/loader/FabricWrappedVanillaResourcePack.java @@ -27,7 +27,6 @@ import net.minecraft.resource.AbstractFileResourcePack; import net.minecraft.resource.InputSupplier; import net.minecraft.resource.ResourceType; import net.minecraft.resource.metadata.ResourceMetadataReader; -import net.minecraft.text.Text; import net.minecraft.util.Identifier; import net.minecraft.util.PathUtil; @@ -42,12 +41,10 @@ import net.fabricmc.fabric.impl.resource.loader.GroupResourcePack; */ public class FabricWrappedVanillaResourcePack extends GroupResourcePack { private final AbstractFileResourcePack originalResourcePack; - private final Text displayName; - public FabricWrappedVanillaResourcePack(AbstractFileResourcePack originalResourcePack, Text displayName, List modResourcePacks) { + public FabricWrappedVanillaResourcePack(AbstractFileResourcePack originalResourcePack, List modResourcePacks) { super(ResourceType.CLIENT_RESOURCES, modResourcePacks); this.originalResourcePack = originalResourcePack; - this.displayName = displayName; } @Override @@ -90,7 +87,7 @@ public class FabricWrappedVanillaResourcePack extends GroupResourcePack { @Override public String getName() { - return displayName.getString(); + return this.originalResourcePack.getName(); } @Override diff --git a/fabric-resource-loader-v0/src/client/java/net/fabricmc/fabric/mixin/resource/loader/client/DefaultClientResourcePackProviderMixin.java b/fabric-resource-loader-v0/src/client/java/net/fabricmc/fabric/mixin/resource/loader/client/DefaultClientResourcePackProviderMixin.java index e6ab6c010..fdc649f1e 100644 --- a/fabric-resource-loader-v0/src/client/java/net/fabricmc/fabric/mixin/resource/loader/client/DefaultClientResourcePackProviderMixin.java +++ b/fabric-resource-loader-v0/src/client/java/net/fabricmc/fabric/mixin/resource/loader/client/DefaultClientResourcePackProviderMixin.java @@ -51,7 +51,7 @@ public class DefaultClientResourcePackProviderMixin { ) private ResourcePackProfile.PackFactory onCreateVanillaBuiltinResourcePack(String name, Text displayName, boolean alwaysEnabled, ResourcePackProfile.PackFactory packFactory, ResourceType type, ResourcePackProfile.InsertionPosition position, ResourcePackSource source) { - return factory -> new FabricWrappedVanillaResourcePack((AbstractFileResourcePack) packFactory.open(name), displayName, getModResourcePacks(name)); + return factory -> new FabricWrappedVanillaResourcePack((AbstractFileResourcePack) packFactory.open(name), getModResourcePacks(name)); } /**