Fix FabricWrappedVanillaResourcePack::getName (#2998)

* Fix `FabricWrappedVanillaResourcePack::getName`

* Remove unused import
This commit is contained in:
Julian Burner 2023-04-11 10:49:50 +02:00 committed by GitHub
parent e719b8579f
commit 1e1fb126cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View file

@ -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<ModResourcePack> modResourcePacks) {
public FabricWrappedVanillaResourcePack(AbstractFileResourcePack originalResourcePack, List<ModResourcePack> 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

View file

@ -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));
}
/**