本文整理汇总了Java中net.minecraftforge.fml.common.event.FMLServerStoppingEvent类的典型用法代码示例。如果您正苦于以下问题:Java FMLServerStoppingEvent类的具体用法?Java FMLServerStoppingEvent怎么用?Java FMLServerStoppingEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FMLServerStoppingEvent类属于net.minecraftforge.fml.common.event包,在下文中一共展示了FMLServerStoppingEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: unloadAll
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
public static void unloadAll(FMLServerStoppingEvent serverStoppingEvent) {
File worldFile = new File(FMLCommonHandler.instance().getSavesDirectory(), FMLCommonHandler.instance().getMinecraftServerInstance().getFolderName());
File dataFile = new File(worldFile, fileName);
if (dimDataList == null || dimDataList.isEmpty()) {
return;
}
Gson gson = new GsonBuilder().setPrettyPrinting().create();
String json = gson.toJson(dimDataList);
try {
if (dataFile.exists()) {
dataFile.delete();
}
FileUtils.writeStringToFile(dataFile, json);
} catch (IOException e) {
e.printStackTrace();
}
for (DimData data : dimDataList) {
DimensionManager.unloadWorld(data.id);
DimensionManager.unregisterDimension(data.id);
}
dimDataList.clear();
dimDataHashMap.clear();
}
示例2: serverStopping
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@EventHandler
public void serverStopping(FMLServerStoppingEvent event) {
// cancel running tasks
SessionManager.getInstance().getAllSessions().forEachRemaining(sess -> {
sess.taskManager.cancelTasks();
});
SessionManager.getInstance().clearAllSessions();
}
示例3: serverStopping
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@Mod.EventHandler
public void serverStopping(FMLServerStoppingEvent event)
{
if (!CreeperHost.instance.active)
return;
serverOn = false;
serializePreload();
pregenTasks.clear();
}
示例4: serverStop
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@Mod.EventHandler
public void serverStop(FMLServerStoppingEvent event) {
//MapList.nameToData.clear();
//MapList.buildInAttributes.clear();
File output = new File(((AnvilSaveConverter) server.getActiveAnvilConverter()).savesDirectory, server.getFolderName() + "/teleports.dat");
NBTTagCompound tagRoot = new NBTTagCompound();
NBTTagCompound tag = new NBTTagCompound();
tagRoot.setTag("Teleporters", tag);
for (Entry<UUID, TeleporterData[]> entry : EntityTeleporter.teleporters.entrySet()) {
NBTTagCompound exitTag = new NBTTagCompound();
for (int i = 0; i < EntityTeleporter.TP_PER_PLAYER; i++) {
TeleporterData blockPos = entry.getValue()[i];
if (blockPos != null)
exitTag.setIntArray(Integer.toString(i), new int[] { blockPos.getX(), blockPos.getY(), blockPos.getZ(), blockPos.id, blockPos.dimension});
}
tag.setTag(entry.getKey().toString(), exitTag);
}
tagRoot.setInteger("TPCount", EntityTeleporter.tpCount);
try {
CompressedStreamTools.writeCompressed(tagRoot, new FileOutputStream(output));
} catch (IOException e) {
e.printStackTrace();
}
EntityTeleporter.teleporters.clear();
EntityTeleporter.tpCount = 0;
if(udpServer != null) {
udpServer.stopServer();
udpServer = null;
}
}
示例5: serverStop
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@Mod.EventHandler
@SideOnly(Side.SERVER)
public void serverStop(FMLServerStoppingEvent event)
{
DynMapFeatures.removeAllBorders();
Config.storeFillTask();
}
示例6: onServerStop
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@EventHandler
public static void onServerStop(FMLServerStoppingEvent event) {
log.info("Stopping the Server");
PlayerHandler.cleanup();
if (isMapEnabled)
Minimap.close();
WorldHandler.stopServer();
TomsModUtils.setServer(null);
log.info("Server Stopped");
}
示例7: serverStopping
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@Mod.EventHandler
public void serverStopping(FMLServerStoppingEvent event)
{
// Calling this method destroys all server instances that exist,
// because the 'event' given above does NOT give us the server-instance that is being stopped.
ServerHandler.destroyServerMirror(null);
}
示例8: onServerStopping
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@Mod.EventHandler
public void onServerStopping(FMLServerStoppingEvent event){
if(event.getSide()==Side.CLIENT){
//when the server stops (hopefully this is the right event), save the state of the clock
ModLogger.logInfo("Saving clock state for the next reload");
ConfigurationHandler.setValueDisplay(Clock.isEnabled());
}
}
示例9: onServerStopping
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@EventHandler
@SideOnly(Side.SERVER)
public void onServerStopping(FMLServerStoppingEvent event)
{
if (senderConnected)
{
slackSender.sendToSlack(SlackCommandSender.getInstance(), Messages.General.SERVER_STOPPED);
}
}
示例10: serverStop
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@EventHandler
public void serverStop(FMLServerStoppingEvent event)
{
log.info("[Cannibalism] Writing playerdata to file...");
io.write(data.getDatabase());
log.info("[Cannibalism] Completed");
}
示例11: onServerStopping
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@EventHandler
public void onServerStopping(FMLServerStoppingEvent event){
_dal.stopAllThreads();
for (WorldServer ws : MinecraftServer.getServer().worldServers){
ClaimManager.instance.saveAllClaims(ws);
}
}
示例12: serverStopping
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@EventHandler
public void serverStopping(FMLServerStoppingEvent event)
{
SaveHandler.saveFactionsToFile();
}
示例13: serverStopping
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@EventHandler
public void serverStopping(FMLServerStoppingEvent event)
{
SaveHandler.saveFactionsToFile(Main.configDir, Main.worldDir, TerritoryHandler.getSaveData());
}
示例14: serverStopping
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@EventHandler
public void serverStopping(@Nonnull final FMLServerStoppingEvent event) {
proxy.serverStopping(event);
}
示例15: serverStopping
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent; //导入依赖的package包/类
@EventHandler
public void serverStopping(FMLServerStoppingEvent event)
{
CommonProxy.manager.reset();
}