Fix StartupQuery to run properly on dedicated server.. Closes #5649

Signed-off-by: cpw <[email protected]>
This commit is contained in:
cpw committed 2019-03-30 14:46:30 -04:00
1 parent 37016ca77f
commit e0361047f7
5 files changed
+27 -23

No files matched your search

@@ -53,6 +53,7 @@ import net.minecraft.world.WorldServerMulti;
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.registries.ClearableRegistry;
import net.minecraftforge.registries.ForgeRegistries;
@@ -151,6 +152,11 @@ public class DimensionManager
Validate.notNull(server, "Must provide server when creating world");
Validate.notNull(dim, "Dimension type must not be null");
// 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;
}
if (resetUnloadDelay && unloadQueue.contains(dim.getId()))
getData(dim).ticksWaited = 0;