mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 07:19:56 +03:00
34 lines
1.7 KiB
Diff
34 lines
1.7 KiB
Diff
--- ../src-base/minecraft/net/minecraft/client/multiplayer/WorldClient.java
|
|
+++ ../src-work/minecraft/net/minecraft/client/multiplayer/WorldClient.java
|
|
@@ -60,17 +60,19 @@
|
|
|
|
public WorldClient(NetHandlerPlayClient netHandler, WorldSettings settings, int dimension, EnumDifficulty difficulty, Profiler profilerIn)
|
|
{
|
|
- super(new SaveHandlerMP(), new WorldInfo(settings, "MpServer"), DimensionType.getById(dimension).createDimension(), profilerIn, true);
|
|
+ super(new SaveHandlerMP(), new WorldInfo(settings, "MpServer"), net.minecraftforge.common.DimensionManager.createProviderFor(dimension), profilerIn, true);
|
|
this.ambienceTicks = this.rand.nextInt(12000);
|
|
this.visibleChunks = Sets.<ChunkPos>newHashSet();
|
|
this.connection = netHandler;
|
|
this.getWorldInfo().setDifficulty(difficulty);
|
|
- this.setSpawnPoint(new BlockPos(8, 64, 8));
|
|
this.provider.setWorld(this);
|
|
+ this.setSpawnPoint(new BlockPos(8, 64, 8)); //Forge: Moved below registerWorld to prevent NPE in our redirect.
|
|
this.chunkProvider = this.createChunkProvider();
|
|
this.mapStorage = new SaveDataMemoryStorage();
|
|
this.calculateInitialSkylight();
|
|
this.calculateInitialWeather();
|
|
+ this.initCapabilities();
|
|
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Load(this));
|
|
}
|
|
|
|
public void tick()
|
|
@@ -113,7 +115,7 @@
|
|
return this.clientChunkProvider;
|
|
}
|
|
|
|
- protected boolean isChunkLoaded(int x, int z, boolean allowEmpty)
|
|
+ public boolean isChunkLoaded(int x, int z, boolean allowEmpty)
|
|
{
|
|
return allowEmpty || !this.getChunkProvider().provideChunk(x, z).isEmpty();
|
|
}
|