當前位置: 首頁>>代碼示例>>Java>>正文


Java WorldEvent.Save方法代碼示例

本文整理匯總了Java中net.minecraftforge.event.world.WorldEvent.Save方法的典型用法代碼示例。如果您正苦於以下問題:Java WorldEvent.Save方法的具體用法?Java WorldEvent.Save怎麽用?Java WorldEvent.Save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraftforge.event.world.WorldEvent的用法示例。


在下文中一共展示了WorldEvent.Save方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onWorldSave

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onWorldSave(WorldEvent.Save event)
{
	if(event.getWorld().provider.getDimension() != 0) return;
	File file = new File(DimensionManager.getCurrentSaveRootDirectory(), "data/torchmaster_"+this.name+"_reg.dat");

	NBTTagList tagList = new NBTTagList();
	for(TorchLocation loc : this.torches)
		tagList.appendTag(loc.toNbt());
	NBTTagCompound nbt = new NBTTagCompound();
	nbt.setTag("list", tagList);

	try
	{
		CompressedStreamTools.write(nbt, file);
		TorchMasterMod.Log.debug("Saved " + this.torches.size() + " entries for " + this.name + " to disk");
	}
	catch (IOException e)
	{
		e.printStackTrace();
	}
}
 
開發者ID:Xalcon,項目名稱:TorchMaster,代碼行數:23,代碼來源:TorchRegistry.java

示例2: onWorldSave

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onWorldSave(WorldEvent.Save e){
	if(e.getWorld().provider instanceof MonumentWorldProvider){
		MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
		ArrayList<Integer> dimensions = Lists.newArrayList();
		for(EntityPlayerMP player : server.getPlayerList().getPlayerList()){
			int dim = player.dimension;
			if(!dimensions.contains(dim)){
				dimensions.add(dim);
			}
		}
		File folder = e.getWorld().getSaveHandler().getWorldDirectory();
		NBTTagCompound tag = new NBTTagCompound();
		int[] intarr = new int[dimensions.size()];
		for(int i = 0; i < dimensions.size(); i++){
			intarr[i] = dimensions.get(i);
		}
		tag.setIntArray("dims", intarr);
		try {
			CompressedStreamTools.safeWrite(tag, new File(folder, "dimensiondungeon.dat"));
		} catch (IOException ex) {
			System.out.println("Error while writing world data... this could be really bad!");
			ex.printStackTrace();
		}
	}
}
 
開發者ID:tiffit,項目名稱:DungeonDimension,代碼行數:27,代碼來源:DDEventHandler.java

示例3: onWorldSave

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onWorldSave(WorldEvent.Save event) {
    if (event.getWorld().isRemote || RedstoneEther.server() == null) {
        return;
    }

    RedstoneEther.server().saveEther(event.getWorld());
}
 
開發者ID:TheCBProject,項目名稱:WirelessRedstone,代碼行數:9,代碼來源:WREventHandler.java

示例4: onWorldSave

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onWorldSave(WorldEvent.Save event)
{
    if(worldMap.containsKey(event.world))
        for(WorldExtension extension : worldMap.get(event.world))
            extension.save();
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:8,代碼來源:WorldExtensionManager.java

示例5: onWorldSave

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onWorldSave(WorldEvent.Save event){
    World world = event.getWorld();
    if (world.isRemote) return;
    int dimension = world.provider.getDimension();
    if (dimension != 0) return;
    //storage.onWorldSave(event,this.settings);


}
 
開發者ID:Zeno410,項目名稱:Geographicraft,代碼行數:11,代碼來源:ClimateControl.java

示例6: onWorldSave

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onWorldSave(WorldEvent.Save event) {
    if (hasExtensions(event.getWorld())) {
        for (WorldExtension extension : getExtensions(event.getWorld())) {
            extension.save();
        }
    }
}
 
開發者ID:TheCBProject,項目名稱:CodeChickenLib,代碼行數:9,代碼來源:WorldExtensionManager.java

示例7: onWorldSave

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onWorldSave(WorldEvent.Save event)
{
    WorldFileUtils.saveCustomWorldInfoToFile(event.getWorld());

    if (Configs.enableForcedGamemodes && event.getWorld().provider.getDimension() == 0)
    {
        GamemodeTracker.getInstance().writeToDisk();
    }
}
 
開發者ID:maruohon,項目名稱:justenoughdimensions,代碼行數:11,代碼來源:JEDEventHandler.java

示例8: onWorldSave

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onWorldSave(WorldEvent.Save event)
{
	Persistence.save();
}
 
開發者ID:ObsidianSuite,項目名稱:ObsidianSuite,代碼行數:6,代碼來源:EventHandler.java

示例9: onWorldSave

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onWorldSave(WorldEvent.Save event) {	
	//HazardsLib.modLog.info("Saving trackers for dimension " + event.world.provider.dimensionId);
	TrackerManager.saveAllWorldTrackers(event.world);
}
 
開發者ID:TwilightWingsStudio,項目名稱:HazardsLib,代碼行數:6,代碼來源:CommonEventHandler.java

示例10: onDimensionSave

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onDimensionSave(WorldEvent.Save event)
{
	ForgeChunkManager.saveWorld(event.getWorld());
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:6,代碼來源:ForgeInternalHandler.java

示例11: worldSave

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public static void worldSave(WorldEvent.Save save) {
    if (save.getWorld().provider.getDimension() == 0) {
        saveFile();
    }
}
 
開發者ID:modmuss50,項目名稱:TechnicalDimensions,代碼行數:7,代碼來源:ServerScreenShotUtils.java

示例12: onDimensionSave

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onDimensionSave(WorldEvent.Save event)
{
	ForgeChunkManager.saveWorld(event.world);
}
 
開發者ID:SchrodingersSpy,項目名稱:TRHS_Club_Mod_2016,代碼行數:6,代碼來源:ForgeInternalHandler.java

示例13: worldSave

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void worldSave(WorldEvent.Save event) {
    this.serverDataStorage.markDirty();
}
 
開發者ID:jackey8616,項目名稱:Age-of-Kingdom,代碼行數:5,代碼來源:EventManager.java

示例14: onWorldSave

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onWorldSave(WorldEvent.Save event) {
    if (!event.getWorld().isRemote && instance(false) != null) {
        instance(false).save(false);
    }
}
 
開發者ID:TheCBProject,項目名稱:EnderStorage,代碼行數:7,代碼來源:EnderStorageManager.java

示例15: onWorldSave

import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onWorldSave(WorldEvent.Save event) {
	if (event.getWorld().provider.getDimension() == 0)
		PlayerHandler.save();
	WorldHandler.saveWorld(event.getWorld().provider.getDimension());
}
 
開發者ID:tom5454,項目名稱:Toms-Mod,代碼行數:7,代碼來源:EventHandler.java


注:本文中的net.minecraftforge.event.world.WorldEvent.Save方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。