mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-25 14:34:28 +00:00
Patching and updates
This commit is contained in:
113 files changed
+1011
-3194
No files matched your search
@@ -285,11 +285,6 @@ public class ModLoader
|
||||
this.loadingWarnings.add(warning);
|
||||
}
|
||||
|
||||
@Deprecated //Remove in 1.16
|
||||
public void runDataGenerator(final Set<String> mods, final Path path, final Collection<Path> inputs, Collection<Path> existingPacks, final boolean serverGenerators, final boolean clientGenerators, final boolean devToolGenerators, final boolean reportsGenerator, final boolean structureValidator) {
|
||||
runDataGenerator(mods, path, inputs, existingPacks, serverGenerators, clientGenerators, devToolGenerators, reportsGenerator, structureValidator, false);
|
||||
}
|
||||
|
||||
public void runDataGenerator(final Set<String> mods, final Path path, final Collection<Path> inputs, Collection<Path> existingPacks, final boolean serverGenerators, final boolean clientGenerators, final boolean devToolGenerators, final boolean reportsGenerator, final boolean structureValidator, final boolean flat) {
|
||||
if (mods.contains("minecraft") && mods.size() == 1) return;
|
||||
LOGGER.info("Initializing Data Gatherer for mods {}", mods);
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import net.minecraft.resources.IResource;
|
||||
import net.minecraft.resources.IResourceManager;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.JSONUtils;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -80,16 +81,16 @@ public class LanguageHook
|
||||
|
||||
private static void loadLanguage(String langName, MinecraftServer server) {
|
||||
String langFile = String.format("lang/%s.json", langName);
|
||||
//TODO
|
||||
// server.getResourceManager().getResourceNamespaces().forEach(namespace -> {
|
||||
// try {
|
||||
// ResourceLocation langResource = new ResourceLocation(namespace, langFile);
|
||||
// loadLocaleData(server.getResourceManager().getAllResources(langResource));
|
||||
// } catch (FileNotFoundException fnfe) {
|
||||
// } catch (Exception exception) {
|
||||
// LOGGER.warn("Skipped language file: {}:{}", namespace, langFile, exception);
|
||||
// }
|
||||
// });
|
||||
IResourceManager resourceManager = server.getDataPackRegistries().func_240970_h_();
|
||||
resourceManager.getResourceNamespaces().forEach(namespace -> {
|
||||
try {
|
||||
ResourceLocation langResource = new ResourceLocation(namespace, langFile);
|
||||
loadLocaleData(resourceManager.getAllResources(langResource));
|
||||
} catch (FileNotFoundException fnfe) {
|
||||
} catch (Exception exception) {
|
||||
LOGGER.warn("Skipped language file: {}:{}", namespace, langFile, exception);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import net.minecraft.resources.IPackNameDecorator;
|
||||
import net.minecraft.world.storage.FolderNames;
|
||||
import net.minecraft.world.storage.FolderName;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.Marker;
|
||||
@@ -73,7 +73,7 @@ public class ServerLifecycleHooks
|
||||
{
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
private static final Marker SERVERHOOKS = MarkerManager.getMarker("SERVERHOOKS");
|
||||
private static final FolderNames SERVERCONFIG = new FolderNames("serverconfig");
|
||||
private static final FolderName SERVERCONFIG = new FolderName("serverconfig");
|
||||
private static volatile CountDownLatch exitLatch = null;
|
||||
private static MinecraftServer currentServer;
|
||||
|
||||
@@ -89,7 +89,6 @@ public class ServerLifecycleHooks
|
||||
currentServer = server;
|
||||
LogicalSidedProvider.setServer(()->server);
|
||||
ConfigTracker.INSTANCE.loadConfigs(ModConfig.Type.SERVER, getServerConfigPath(server));
|
||||
ResourcePackLoader.loadResourcePacks(currentServer.getResourcePacks(), ServerLifecycleHooks::buildPackFinder);
|
||||
return !MinecraftForge.EVENT_BUS.post(new FMLServerAboutToStartEvent(server));
|
||||
}
|
||||
|
||||
@@ -207,7 +206,9 @@ public class ServerLifecycleHooks
|
||||
System.exit(retVal);
|
||||
}
|
||||
|
||||
private static <T extends ResourcePackInfo> ResourcePackLoader.IPackInfoFinder<T> buildPackFinder(Map<ModFile, ? extends ModFileResourcePack> modResourcePacks, BiConsumer<? super ModFileResourcePack, ? super T> packSetter) {
|
||||
//INTERNAL MODDERS DO NOT USE
|
||||
@Deprecated
|
||||
public static <T extends ResourcePackInfo> ResourcePackLoader.IPackInfoFinder<T> buildPackFinder(Map<ModFile, ? extends ModFileResourcePack> modResourcePacks, BiConsumer<? super ModFileResourcePack, ? super T> packSetter) {
|
||||
return (packList, factory) -> serverPackFinder(modResourcePacks, packSetter, packList, factory);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user