当前位置: 首页>>代码示例>>Java>>正文


Java ISaveHandler类代码示例

本文整理汇总了Java中net.minecraft.world.storage.ISaveHandler的典型用法代码示例。如果您正苦于以下问题:Java ISaveHandler类的具体用法?Java ISaveHandler怎么用?Java ISaveHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ISaveHandler类属于net.minecraft.world.storage包,在下文中一共展示了ISaveHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setResourcePackFromWorld

import net.minecraft.world.storage.ISaveHandler; //导入依赖的package包/类
public void setResourcePackFromWorld(String worldNameIn, ISaveHandler saveHandlerIn)
{
    File file1 = new File(saveHandlerIn.getWorldDirectory(), "resources.zip");

    if (file1.isFile())
    {
        try
        {
            this.setResourcePack("level://" + URLEncoder.encode(worldNameIn, Charsets.UTF_8.toString()) + "/" + "resources.zip", "");
        }
        catch (UnsupportedEncodingException var5)
        {
            LOG.warn("Something went wrong url encoding {}", new Object[] {worldNameIn});
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:17,代码来源:MinecraftServer.java

示例2: WorldServer

import net.minecraft.world.storage.ISaveHandler; //导入依赖的package包/类
public WorldServer(MinecraftServer server, ISaveHandler saveHandlerIn, WorldInfo info, int dimensionId, Profiler profilerIn)
{
    super(saveHandlerIn, info, net.minecraftforge.common.DimensionManager.createProviderFor(dimensionId), profilerIn, false);
    this.mcServer = server;
    this.theEntityTracker = new EntityTracker(this);
    this.thePlayerManager = new PlayerChunkMap(this);
    // Guarantee the dimension ID was not reset by the provider
    int providerDim = this.provider.getDimension();
    this.provider.registerWorld(this);
    this.provider.setDimension(providerDim);
    this.chunkProvider = this.createChunkProvider();
    perWorldStorage = new MapStorage(new net.minecraftforge.common.WorldSpecificSaveHandler((WorldServer)this, saveHandlerIn));
    this.worldTeleporter = new Teleporter(this);
    this.calculateInitialSkylight();
    this.calculateInitialWeather();
    this.getWorldBorder().setSize(server.getMaxWorldSize());
    net.minecraftforge.common.DimensionManager.setWorld(dimensionId, this, mcServer);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:19,代码来源:WorldServer.java

示例3: World

import net.minecraft.world.storage.ISaveHandler; //导入依赖的package包/类
protected World(ISaveHandler saveHandlerIn, WorldInfo info, WorldProvider providerIn, Profiler profilerIn, boolean client)
{
    this.eventListeners = Lists.newArrayList(new IWorldEventListener[] {this.pathListener});
    this.theCalendar = Calendar.getInstance();
    this.worldScoreboard = new Scoreboard();
    this.spawnHostileMobs = true;
    this.spawnPeacefulMobs = true;
    this.lightUpdateBlockList = new int[32768];
    this.saveHandler = saveHandlerIn;
    this.theProfiler = profilerIn;
    this.worldInfo = info;
    this.provider = providerIn;
    this.isRemote = client;
    this.worldBorder = providerIn.createWorldBorder();
    perWorldStorage = new MapStorage((ISaveHandler)null);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:17,代码来源:World.java

示例4: getOfflinePlayer

import net.minecraft.world.storage.ISaveHandler; //导入依赖的package包/类
@Override
public OfflinePlayer getOfflinePlayer(UUID uuid) {
    final ISaveHandler saveHandler = MinecraftServer.getServer().getEntityWorld().getSaveHandler();

    if (saveHandler instanceof SaveHandler) {
        final NBTTagCompound tagCompound = ((IMixinSaveHandler) saveHandler).readPlayerData(uuid);

        if (tagCompound != null) {
            final GameProfile profile = getPlayerProfileCache().getProfileByUUID(uuid);

            if (profile != null) {
                return new NeptuneOfflinePlayer(profile.getName(), uuid, tagCompound);
            } else {
                return new NeptuneOfflinePlayer("PLAYER_NAME_UNKNOWN", uuid, tagCompound);
            }
        }

        return null;
    } else {
        throw new RuntimeException("ISaveHandler is not of type SaveHandler! Failing to load playerdata");
    }
}
 
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:23,代码来源:MixinMinecraftServer.java

示例5: getSaveFile

import net.minecraft.world.storage.ISaveHandler; //导入依赖的package包/类
public File getSaveFile(ISaveHandler saveHandler, World world, String name, boolean backup) {
	File worldDir = new File(saveHandler.getWorldDirectoryName());
	IChunkLoader loader = saveHandler.getChunkLoader(world.provider);
	if((loader instanceof AnvilChunkLoader)) {
		worldDir = ((AnvilChunkLoader) loader).chunkSaveLocation;
	}
	File file = new File(worldDir, name + (backup ? ".bak" : ""));
	if(!file.exists()) {
		try {
			file.createNewFile();
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
	return file;
}
 
开发者ID:ElConquistador,项目名称:ElConQore,代码行数:17,代码来源:EQSaveHandler.java

示例6: World

import net.minecraft.world.storage.ISaveHandler; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public World(ISaveHandler p_i45368_1_, String p_i45368_2_, WorldProvider p_i45368_3_, WorldSettings p_i45368_4_, Profiler p_i45368_5_)
{
    this.ambientTickCountdown = this.rand.nextInt(12000);
    this.spawnHostileMobs = true;
    this.spawnPeacefulMobs = true;
    this.collidingBoundingBoxes = new ArrayList();
    this.lightUpdateBlockList = new int[32768];
    this.saveHandler = p_i45368_1_;
    this.theProfiler = p_i45368_5_;
    this.worldInfo = new WorldInfo(p_i45368_4_, p_i45368_2_);
    this.provider = p_i45368_3_;
    perWorldStorage = new MapStorage((ISaveHandler)null);
    // Cauldron start
    this.world = null;
    this.timings = null;
    this.spigotConfig = null;
    this.activeChunkSet_CB = null;
    this.chunkTickRadius = 0;
    // Cauldron end
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:22,代码来源:World.java

示例7: loadAllWorlds

import net.minecraft.world.storage.ISaveHandler; //导入依赖的package包/类
protected void loadAllWorlds(String p_71247_1_, String p_71247_2_, long p_71247_3_, WorldType p_71247_5_, String p_71247_6_)
{
    this.convertMapIfNeeded(p_71247_1_);
    ISaveHandler isavehandler = this.getActiveAnvilConverter().getSaveLoader(p_71247_1_, true);

    WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, isavehandler, p_71247_2_, 0, theProfiler) : new WorldServer(this, isavehandler, p_71247_2_, 0, theWorldSettings, theProfiler));
    for (int dim : DimensionManager.getStaticDimensionIDs())
    {
        WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, p_71247_2_, dim, theWorldSettings, overWorld, theProfiler));
        world.addWorldAccess(new WorldManager(this, world));

        if (!this.isSinglePlayer())
        {
            world.getWorldInfo().setGameType(getGameType());
        }

        MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world));
    }

    this.getConfigurationManager().setPlayerManager(new WorldServer[]{ overWorld });
    this.func_147139_a(this.func_147135_j());
    this.initialWorldChunkLoad();
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:24,代码来源:IntegratedServer.java

示例8: World

import net.minecraft.world.storage.ISaveHandler; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public World(ISaveHandler p_i1953_1_, String p_i1953_2_, WorldProvider p_i1953_3_, WorldSettings p_i1953_4_, Profiler p_i1953_5_, ILogAgent p_i1953_6_) {
   this.field_72990_M = this.field_73012_v.nextInt(12000);
   this.field_72994_J = new int['\u8000'];
   this.field_73019_z = p_i1953_1_;
   this.field_72984_F = p_i1953_5_;
   this.field_72986_A = new WorldInfo(p_i1953_4_, p_i1953_2_);
   this.field_73011_w = p_i1953_3_;
   this.field_72988_C = new MapStorage(p_i1953_1_);
   this.field_98181_L = p_i1953_6_;
   VillageCollection var7 = (VillageCollection)this.field_72988_C.func_75742_a(VillageCollection.class, "villages");
   if(var7 == null) {
      this.field_72982_D = new VillageCollection(this);
      this.field_72988_C.func_75745_a("villages", this.field_72982_D);
   } else {
      this.field_72982_D = var7;
      this.field_72982_D.func_82566_a(this);
   }

   p_i1953_3_.func_76558_a(this);
   this.field_73020_y = this.func_72970_h();
   this.func_72966_v();
   this.func_72947_a();
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:25,代码来源:World.java

示例9: loadAllWorlds

import net.minecraft.world.storage.ISaveHandler; //导入依赖的package包/类
protected void loadAllWorlds(String par1Str, String par2Str, long par3, WorldType par5WorldType, String par6Str)
{
    this.convertMapIfNeeded(par1Str);
    ISaveHandler isavehandler = this.getActiveAnvilConverter().getSaveLoader(par1Str, true);

    WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, isavehandler, par2Str, 0, theProfiler, getLogAgent()) : new WorldServer(this, isavehandler, par2Str, 0, theWorldSettings, theProfiler, getLogAgent()));
    for (int dim : DimensionManager.getStaticDimensionIDs())
    {
        WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, par2Str, dim, theWorldSettings, overWorld, theProfiler, getLogAgent()));
        world.addWorldAccess(new WorldManager(this, world));

        if (!this.isSinglePlayer())
        {
            world.getWorldInfo().setGameType(this.getGameType());
        }

        MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world));
    }

    this.getConfigurationManager().setPlayerManager(new WorldServer[]{ overWorld });
    this.setDifficultyForAllWorlds(this.getDifficulty());
    this.initialWorldChunkLoad();
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:24,代码来源:IntegratedServer.java

示例10: actionPerformed

import net.minecraft.world.storage.ISaveHandler; //导入依赖的package包/类
@Override
protected void actionPerformed(GuiButton button) {
	if(button.id == 3) {
		mc.displayGuiScreen(new GuiCreateWorld(this));
	} else if(button.id == 7) {
		try {
			GuiCreateWorld gui = new GuiCreateWorld(this);
			ISaveHandler saveHandler = mc.getSaveLoader().getSaveLoader(func_146621_a(super_field_146640_r.getInt(this)), false);
			WorldInfo worldInfo = saveHandler.loadWorldInfo();
			saveHandler.flush();
			gui.func_146318_a(worldInfo);
			mc.displayGuiScreen(gui);
		} catch(Exception e) {
			e.printStackTrace();
		}
	} else {
		super.actionPerformed(button);
	}
}
 
开发者ID:AgeCraft,项目名称:AgeCraft-Old,代码行数:20,代码来源:GuiSelectWorld.java

示例11: WorldServer

import net.minecraft.world.storage.ISaveHandler; //导入依赖的package包/类
public WorldServer(MinecraftServer server, ISaveHandler saveHandlerIn, WorldInfo info, int dimensionId, Profiler profilerIn)
{
    super(saveHandlerIn, info, WorldProvider.getProviderForDimension(dimensionId), profilerIn, false);
    this.mcServer = server;
    this.theEntityTracker = new EntityTracker(this);
    this.thePlayerManager = new PlayerManager(this);
    this.provider.registerWorld(this);
    this.chunkProvider = this.createChunkProvider();
    this.worldTeleporter = new Teleporter(this);
    this.calculateInitialSkylight();
    this.calculateInitialWeather();
    this.getWorldBorder().setSize(server.getMaxWorldSize());
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:14,代码来源:WorldServer.java

示例12: World

import net.minecraft.world.storage.ISaveHandler; //导入依赖的package包/类
protected World(ISaveHandler saveHandlerIn, WorldInfo info, WorldProvider providerIn, Profiler profilerIn, boolean client)
{
    this.ambientTickCountdown = this.rand.nextInt(12000);
    this.spawnHostileMobs = true;
    this.spawnPeacefulMobs = true;
    this.lightUpdateBlockList = new int[32768];
    this.saveHandler = saveHandlerIn;
    this.theProfiler = profilerIn;
    this.worldInfo = info;
    this.provider = providerIn;
    this.isRemote = client;
    this.worldBorder = providerIn.getWorldBorder();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:14,代码来源:World.java

示例13: setResourcePackFromWorld

import net.minecraft.world.storage.ISaveHandler; //导入依赖的package包/类
protected void setResourcePackFromWorld(String worldNameIn, ISaveHandler saveHandlerIn)
{
    File file1 = new File(saveHandlerIn.getWorldDirectory(), "resources.zip");

    if (file1.isFile())
    {
        this.setResourcePack("level://" + worldNameIn + "/" + file1.getName(), "");
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:10,代码来源:MinecraftServer.java

示例14: getSaveHandler

import net.minecraft.world.storage.ISaveHandler; //导入依赖的package包/类
@Override
public ISaveHandler getSaveHandler() {
	if (m_proxyWorld != null && Util.isPrefixInCallStack(m_modPrefix)) {
		return m_proxyWorld.getSaveHandler();
	} else if (m_realWorld != null) {
		return m_realWorld.getSaveHandler();
	} else {
		return super.getSaveHandler();
	}
}
 
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:11,代码来源:WorldServerProxy.java

示例15: WorldServer

import net.minecraft.world.storage.ISaveHandler; //导入依赖的package包/类
public WorldServer(MinecraftServer server, ISaveHandler saveHandlerIn, WorldInfo info, int dimensionId, Profiler profilerIn)
{
    super(saveHandlerIn, info, DimensionType.getById(dimensionId).createDimension(), profilerIn, false);
    this.mcServer = server;
    this.theEntityTracker = new EntityTracker(this);
    this.thePlayerManager = new PlayerChunkMap(this);
    this.provider.registerWorld(this);
    this.chunkProvider = this.createChunkProvider();
    this.worldTeleporter = new Teleporter(this);
    this.calculateInitialSkylight();
    this.calculateInitialWeather();
    this.getWorldBorder().setSize(server.getMaxWorldSize());
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:14,代码来源:WorldServer.java


注:本文中的net.minecraft.world.storage.ISaveHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。