Some tweaks around the code base. A functional consumer for networking - return a bool from your consumer function, rather than setPacketHandled.

Tweak the server modloading behaviour to try and be a bit clearer that a mod errored.

Signed-off-by: cpw <[email protected]>
This commit is contained in:
cpw committed 2019-09-16 20:14:25 -04:00
1 parent 79ce18ac3e
commit 71a4828809
7 files changed
+80 -15

No files matched your search

@@ -60,6 +60,7 @@ import net.minecraft.world.dimension.DimensionType;
import net.minecraftforge.event.world.RegisterDimensionsEvent;
import net.minecraftforge.event.world.WorldEvent;
import net.minecraftforge.fml.StartupQuery;
import net.minecraftforge.fml.server.ServerModLoader;
import net.minecraftforge.registries.ClearableRegistry;
import net.minecraftforge.registries.ForgeRegistries;
@@ -160,6 +161,9 @@ public class DimensionManager
Validate.notNull(server, "Must provide server when creating world");
Validate.notNull(dim, "Dimension type must not be null");
if (ServerModLoader.hasErrors()) {
throw new RuntimeException("The server has failed to initialize correctly due to mod loading errors. Examine the crash report for more details.");
}
// If we're in the early stages of loading, we need to return null so CommandSource can work properly for command function
if (StartupQuery.pendingQuery()) {
return null;