Fixes #1983: WorldData cleared too early when still needed.
This commit is contained in:
parent
c83946420e
commit
3c19350b9b
|
@ -21,6 +21,7 @@ package appeng.core;
|
|||
|
||||
import java.io.File;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import com.google.common.base.Stopwatch;
|
||||
|
@ -37,6 +38,7 @@ import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
|||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerAboutToStartEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStoppedEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStoppingEvent;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
|
||||
|
@ -233,6 +235,12 @@ public final class AppEng
|
|||
private void serverStopping( final FMLServerStoppingEvent event )
|
||||
{
|
||||
WorldData.instance().onServerStopping();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void serverStopped( final FMLServerStoppedEvent event )
|
||||
{
|
||||
WorldData.instance().onServerStoppped();
|
||||
TickHandler.INSTANCE.shutdown();
|
||||
}
|
||||
|
||||
|
|
|
@ -24,13 +24,15 @@ import javax.annotation.Nonnull;
|
|||
|
||||
/**
|
||||
* @author thatsIch
|
||||
* @version rv3 - 30.05.2015
|
||||
* @version rv3 - 02.11.2015
|
||||
* @since rv3 30.05.2015
|
||||
*/
|
||||
public interface IWorldData
|
||||
{
|
||||
void onServerStopping();
|
||||
|
||||
void onServerStoppped();
|
||||
|
||||
@Nonnull
|
||||
IWorldGridStorageData storageData();
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ import appeng.services.compass.CompassThreadFactory;
|
|||
* different worlds.
|
||||
*
|
||||
* @author thatsIch
|
||||
* @version rv3 - 30.05.2015
|
||||
* @version rv3 - 02.11.2015
|
||||
* @since rv3 30.05.2015
|
||||
*/
|
||||
public final class WorldData implements IWorldData
|
||||
|
@ -162,15 +162,18 @@ public final class WorldData implements IWorldData
|
|||
@Override
|
||||
public void onServerStopping()
|
||||
{
|
||||
Preconditions.checkNotNull( instance );
|
||||
|
||||
for( final IOnWorldStoppable stoppable : this.stoppables )
|
||||
{
|
||||
stoppable.onWorldStop();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServerStoppped()
|
||||
{
|
||||
Preconditions.checkNotNull( instance );
|
||||
|
||||
this.stoppables.clear();
|
||||
|
||||
instance = null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue