client and server work standalone and in forge dev. Next up userdev.

Moved some launchplugin code to the launcher. Moved servermain to
the launcher.

server currently needs cmdline arguments  --fml.forgeVersion=24.0.51-1.13-pre --fml.mcVersion=1.13 --fml.mcpVersion=2018.09.12.04.11.00 --fml.forgeGroup=net.minecraftforge.test
This commit is contained in:
cpw committed 2019-01-01 21:35:23 -05:00
1 parent e9580877b4
commit 6baddc7e26
19 files changed
+71 -34

No files matched your search

@@ -1,60 +0,0 @@
/*
* Minecraft Forge
* Copyright (c) 2016-2018.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package net.minecraftforge.fml;
import org.apache.logging.log4j.message.Message;
import org.apache.logging.log4j.util.StringBuilderFormattable;
import java.util.function.Consumer;
public class AdvancedLogMessageAdapter implements Message, StringBuilderFormattable {
private static final Object[] EMPTY = new Object[0];
private final Consumer<StringBuilder> logMessageBuilder;
public AdvancedLogMessageAdapter(final Consumer<StringBuilder> logMessageBuilder) {
this.logMessageBuilder = logMessageBuilder;
}
@Override
public String getFormattedMessage() {
return "";
}
@Override
public String getFormat() {
return "";
}
@Override
public Object[] getParameters() {
return EMPTY;
}
@Override
public Throwable getThrowable() {
return null;
}
@Override
public void formatTo(final StringBuilder buffer) {
logMessageBuilder.accept(buffer);
}
}
@@ -74,7 +74,9 @@ public class LaunchTesting
"--fml.mcVersion", "1.13");
} else if (Objects.equals(target, "fmldevserver")) {
String[] launchargs = ObjectArrays.concat(new String[] {"--launchTarget", target,
"--gameDir", "."}, args, String.class);
"--gameDir", ".", "--fml.forgeVersion", "24.0.0",
"--fml.mcpVersion", "2018.11.30",
"--fml.mcVersion", "1.13"}, args, String.class);
Launcher.main(launchargs);
}
Thread.sleep(10000);
@@ -51,6 +51,7 @@ public class FMLModContainer extends ModContainer
public FMLModContainer(IModInfo info, String className, ClassLoader modClassLoader, ModFileScanData modFileScanResults)
{
super(info);
LOGGER.debug("Creating FMLModContainer instance for {} with classLoader {} & {}", className, modClassLoader, getClass().getClassLoader());
this.scanResults = modFileScanResults;
triggerMap.put(ModLoadingStage.CONSTRUCT, dummy().andThen(this::beforeEvent).andThen(this::constructMod).andThen(this::afterEvent));
triggerMap.put(ModLoadingStage.PREINIT, dummy().andThen(this::beforeEvent).andThen(this::preinitMod).andThen(this::fireEvent).andThen(this::afterEvent));
@@ -46,6 +46,7 @@ import java.util.jar.Manifest;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import net.minecraftforge.versions.mcp.MCPVersion;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -86,7 +87,7 @@ public class LibraryManager
libraries_dir = Repository.get("libraries");
File mods = new File(minecraftHome, "mods");
File mods_ver = new File(mods, ForgeVersion.mcVersion);
File mods_ver = new File(mods, MCPVersion.getMCVersion());
ModList memory = null;
if (!ENABLE_AUTO_MOD_MOVEMENT)
@@ -471,7 +472,7 @@ public class LibraryManager
}
}
for (String dir : new String[]{"mods", "mods" + File.separatorChar + ForgeVersion.mcVersion})
for (String dir : new String[]{"mods", "mods" + File.separatorChar + MCPVersion.getMCVersion()})
{
File base = new File(mcDir, dir);
if (!base.isDirectory() || !base.exists())
@@ -30,6 +30,7 @@ import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import net.minecraftforge.versions.mcp.MCPVersion;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -66,7 +67,7 @@ public class ModList
@SuppressWarnings("unchecked")
public static List<ModList> getKnownLists(File mcdir)
{
for (String list : new String[] {"mods/mod_list.json", "mods/" + ForgeVersion.mcVersion + "/mod_list.json"/* , TODO Launch args ((Map<String, String>)Launch.blackboard.get("launchArgs")).get("--modListFile")*/})
for (String list : new String[] {"mods/mod_list.json", "mods/" + MCPVersion.getMCVersion() + "/mod_list.json"/* , TODO Launch args ((Map<String, String>)Launch.blackboard.get("launchArgs")).get("--modListFile")*/})
{
if (list != null)
{
@@ -87,7 +88,7 @@ public class ModList
if (memory != null)
lst.add(memory);
for (String list : new String[] {"mods/mod_list.json", "mods/" + ForgeVersion.mcVersion + "/mod_list.json"/* TODO Launch args, ((Map<String, String>)Launch.blackboard.get("launchArgs")).get("--modListFile")*/})
for (String list : new String[] {"mods/mod_list.json", "mods/" + MCPVersion.getMCVersion() + "/mod_list.json"/* TODO Launch args, ((Map<String, String>)Launch.blackboard.get("launchArgs")).get("--modListFile")*/})
{
if (list != null)
{