本文整理匯總了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();
}
}
示例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();
}
}
}
示例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());
}
示例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();
}
示例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);
}
示例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();
}
}
}
示例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();
}
}
示例8: onWorldSave
import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onWorldSave(WorldEvent.Save event)
{
Persistence.save();
}
示例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);
}
示例10: onDimensionSave
import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onDimensionSave(WorldEvent.Save event)
{
ForgeChunkManager.saveWorld(event.getWorld());
}
示例11: worldSave
import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public static void worldSave(WorldEvent.Save save) {
if (save.getWorld().provider.getDimension() == 0) {
saveFile();
}
}
示例12: onDimensionSave
import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onDimensionSave(WorldEvent.Save event)
{
ForgeChunkManager.saveWorld(event.world);
}
示例13: worldSave
import net.minecraftforge.event.world.WorldEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void worldSave(WorldEvent.Save event) {
this.serverDataStorage.markDirty();
}
示例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);
}
}
示例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());
}