[1.19.x] Apply general renames, A SRG is provided for modders. (#8840)

See https://gist.github.com/SizableShrimp/882a671ff74256d150776da08c89ef72
This commit is contained in:
SizableShrimp authored and GitHub committed 2022-07-11 18:27:48 -07:00
1 parent 5e8c786406
commit b8b40e1f54
140 files changed
+1138 -1149

No files matched your search

@@ -22,7 +22,7 @@ import net.minecraft.server.packs.metadata.MetadataSectionSerializer;
import net.minecraft.server.packs.metadata.pack.PackMetadataSection;
import net.minecraft.resources.ResourceLocation;
public class DelegatingResourcePack extends AbstractPackResources
public class DelegatingPackResources extends AbstractPackResources
{
private final List<PackResources> delegates;
private Map<String, List<PackResources>> namespacesAssets;
@@ -31,7 +31,7 @@ public class DelegatingResourcePack extends AbstractPackResources
private final String name;
private final PackMetadataSection packInfo;
public DelegatingResourcePack(String id, String name, PackMetadataSection packInfo, List<? extends PackResources> packs)
public DelegatingPackResources(String id, String name, PackMetadataSection packInfo, List<? extends PackResources> packs)
{
super(new File(id));
this.name = name;
@@ -75,7 +75,7 @@ public class DelegatingResourcePack extends AbstractPackResources
{
return name;
}
@SuppressWarnings("unchecked")
@Override
public <T> T getMetadataSection(MetadataSectionSerializer<T> deserializer) throws IOException
@@ -33,7 +33,7 @@ import java.util.stream.Collectors;
* such as to have alternative textures to use along with Programmer Art, or optional
* alternative recipes for compatibility ot to replace vanilla recipes.
*/
public class PathResourcePack extends AbstractPackResources
public class PathPackResources extends AbstractPackResources
{
private final Path source;
private final String packName;
@@ -47,7 +47,7 @@ public class PathResourcePack extends AbstractPackResources
* This name should be unique within the pack finder, preferably the name of the file or folder containing the resources.
* @param source the root path of the pack. This needs to point to the folder that contains "assets" and/or "data", not the asset folder itself!
*/
public PathResourcePack(String packName, final Path source)
public PathPackResources(String packName, final Path source)
{
super(new File("dummy"));
this.source = source;
@@ -30,19 +30,19 @@ import net.minecraftforge.forgespi.locating.IModFile;
import org.jetbrains.annotations.NotNull;
public class ResourcePackLoader {
private static Map<IModFile, PathResourcePack> modResourcePacks;
private static Map<IModFile, PathPackResources> modResourcePacks;
public static Optional<PathResourcePack> getPackFor(String modId) {
public static Optional<PathPackResources> getPackFor(String modId) {
return Optional.ofNullable(ModList.get().getModFileById(modId)).
map(IModFileInfo::getFile).map(mf->modResourcePacks.get(mf));
}
@Deprecated
public static void loadResourcePacks(PackRepository resourcePacks, BiFunction<Map<IModFile, ? extends PathResourcePack>, BiConsumer<? super PathResourcePack, Pack>, ? extends RepositorySource> packFinder) {
public static void loadResourcePacks(PackRepository resourcePacks, BiFunction<Map<IModFile, ? extends PathPackResources>, BiConsumer<? super PathPackResources, Pack>, ? extends RepositorySource> packFinder) {
loadResourcePacks(resourcePacks, (map) -> packFinder.apply(map, (rp,p) -> {}));
}
public static void loadResourcePacks(PackRepository resourcePacks, Function<Map<IModFile, ? extends PathResourcePack>, ? extends RepositorySource> packFinder) {
public static void loadResourcePacks(PackRepository resourcePacks, Function<Map<IModFile, ? extends PathPackResources>, ? extends RepositorySource> packFinder) {
modResourcePacks = ModList.get().getModFiles().stream()
.filter(mf->mf.requiredLanguageLoaders().stream().noneMatch(ls->ls.languageName().equals("minecraft")))
.map(mf -> Pair.of(mf, createPackForMod(mf)))
@@ -51,9 +51,9 @@ public class ResourcePackLoader {
}
@NotNull
public static PathResourcePack createPackForMod(IModFileInfo mf)
public static PathPackResources createPackForMod(IModFileInfo mf)
{
return new PathResourcePack(mf.getFile().getFileName(), mf.getFile().getFilePath()){
return new PathPackResources(mf.getFile().getFileName(), mf.getFile().getFilePath()){
final IModFile modFile = mf.getFile();
@NotNull
@Override