本文整理汇总了Java中net.minecraft.world.chunk.storage.IChunkLoader类的典型用法代码示例。如果您正苦于以下问题:Java IChunkLoader类的具体用法?Java IChunkLoader怎么用?Java IChunkLoader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IChunkLoader类属于net.minecraft.world.chunk.storage包,在下文中一共展示了IChunkLoader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSaveFile
import net.minecraft.world.chunk.storage.IChunkLoader; //导入依赖的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;
}
示例2: createChunkProvider
import net.minecraft.world.chunk.storage.IChunkLoader; //导入依赖的package包/类
/**
* Creates the chunk provider for this world. Called in the constructor. Retrieves provider from worldProvider?
*/
protected IChunkProvider createChunkProvider()
{
IChunkLoader ichunkloader = this.saveHandler.getChunkLoader(this.provider);
this.theChunkProviderServer = new ChunkProviderServer(this, ichunkloader, this.provider.createChunkGenerator());
return this.theChunkProviderServer;
}
示例3: ChunkProviderServer
import net.minecraft.world.chunk.storage.IChunkLoader; //导入依赖的package包/类
public ChunkProviderServer(WorldServer p_i1520_1_, IChunkLoader p_i1520_2_, IChunkProvider p_i1520_3_)
{
this.dummyChunk = new EmptyChunk(p_i1520_1_, 0, 0);
this.worldObj = p_i1520_1_;
this.chunkLoader = p_i1520_2_;
this.serverChunkGenerator = p_i1520_3_;
}
示例4: getWorldDirectory
import net.minecraft.world.chunk.storage.IChunkLoader; //导入依赖的package包/类
@Nullable
public static File getWorldDirectory(World world)
{
IChunkProvider chunkProvider = world.getChunkProvider();
if (chunkProvider instanceof ChunkProviderServer)
{
ChunkProviderServer chunkProviderServer = (ChunkProviderServer) chunkProvider;
IChunkLoader chunkLoader = chunkProviderServer.chunkLoader;
if (chunkLoader instanceof AnvilChunkLoader)
{
return ((AnvilChunkLoader) chunkLoader).chunkSaveLocation;
}
return null;
}
// If this method gets called before ChunkProviderServer has been set yet,
// then we mimic the vanilla code in AnvilSaveHandler#getChunkLoader() to get the directory.
else
{
File mainWorldDir = world.getSaveHandler().getWorldDirectory();
String dimensionDir = world.provider.getSaveFolder();
if (dimensionDir != null)
{
mainWorldDir = new File(mainWorldDir, dimensionDir);
mainWorldDir.mkdirs();
}
return mainWorldDir;
}
}
示例5: ChunkProviderServer
import net.minecraft.world.chunk.storage.IChunkLoader; //导入依赖的package包/类
public ChunkProviderServer(World world, IChunkLoader loader, IChunkProvider provider) {
this.defaultEmptyChunk = new EmptyChunk(world, 0, 0);
this.worldObj = world;
this.currentChunkLoader = loader;
this.currentChunkProvider = provider;
// TODO: Do a static calc to speed things up if possible. Need
// to find out if this assumption is safe.
this.worryAboutSpawn = this.worldObj.provider.canRespawnHere()
&& DimensionManager.shouldLoadSpawn(this.worldObj.provider.dimensionId);
}
示例6: createChunkProvider
import net.minecraft.world.chunk.storage.IChunkLoader; //导入依赖的package包/类
/**
* Creates the chunk provider for this world. Called in the constructor. Retrieves provider from worldProvider?
*/
protected IChunkProvider createChunkProvider()
{
IChunkLoader var1 = this.saveHandler.getChunkLoader(this.provider);
this.theChunkProviderServer = new ChunkProviderServer(this, var1, this.provider.createChunkGenerator());
return this.theChunkProviderServer;
}
示例7: ChunkProviderServer
import net.minecraft.world.chunk.storage.IChunkLoader; //导入依赖的package包/类
public ChunkProviderServer(WorldServer par1WorldServer, IChunkLoader par2IChunkLoader, IChunkProvider par3IChunkProvider)
{
this.defaultEmptyChunk = new EmptyChunk(par1WorldServer, 0, 0);
this.worldObj = par1WorldServer;
this.currentChunkLoader = par2IChunkLoader;
this.currentChunkProvider = par3IChunkProvider;
}
示例8: getChunkLoader
import net.minecraft.world.chunk.storage.IChunkLoader; //导入依赖的package包/类
/**
* @author jamierocks - 30th October 2016
* @reason Use the Canary directory structure
*/
@Overwrite
public IChunkLoader getChunkLoader(WorldProvider provider) {
if (provider instanceof WorldProviderHell) {
return new AnvilChunkLoader(new File(this.getWorldDirectory(), this.getWorldDirectoryName() + "_" + DimensionType.NETHER.getName()));
} else if (provider instanceof WorldProviderEnd) {
return new AnvilChunkLoader(new File(this.getWorldDirectory(), this.getWorldDirectoryName() + "_" + DimensionType.END.getName()));
} else {
return new AnvilChunkLoader(new File(this.getWorldDirectory(), this.getWorldDirectoryName() + "_" + DimensionType.NORMAL.getName()));
}
}
示例9: createChunkProvider
import net.minecraft.world.chunk.storage.IChunkLoader; //导入依赖的package包/类
protected IChunkProvider createChunkProvider()
{
IChunkLoader ichunkloader = this.saveHandler.getChunkLoader(this.provider);
// Cauldron start - if provider is vanilla, proceed to create a bukkit compatible chunk generator
if (this.provider.getClass().toString().length() <= 3 || this.provider.getClass().toString().contains("net.minecraft"))
{
// CraftBukkit start
org.bukkit.craftbukkit.generator.InternalChunkGenerator gen;
if (this.generator != null)
{
gen = new org.bukkit.craftbukkit.generator.CustomChunkGenerator(this, this.getSeed(), this.generator);
}
else if (this.provider instanceof WorldProviderHell)
{
gen = new org.bukkit.craftbukkit.generator.NetherChunkGenerator(this, this.getSeed());
}
else if (this.provider instanceof WorldProviderEnd)
{
gen = new org.bukkit.craftbukkit.generator.SkyLandsChunkGenerator(this, this.getSeed());
}
else
{
gen = new org.bukkit.craftbukkit.generator.NormalChunkGenerator(this, this.getSeed());
}
this.theChunkProviderServer = new ChunkProviderServer(this, ichunkloader, gen);
// CraftBukkit end
}
else // custom provider, load normally for forge compatibility
{
this.theChunkProviderServer = new ChunkProviderServer(this, ichunkloader, this.provider.createChunkGenerator());
}
// Cauldron end
return this.theChunkProviderServer;
}
示例10: ChunkProviderServer
import net.minecraft.world.chunk.storage.IChunkLoader; //导入依赖的package包/类
public ChunkProviderServer(WorldServer p_i1520_1_, IChunkLoader p_i1520_2_, IChunkProvider p_i1520_3_)
{
this.initialTick = MinecraftServer.currentTick; // Cauldron keep track of when the loader was created
this.defaultEmptyChunk = new EmptyChunk(p_i1520_1_, 0, 0);
this.worldObj = p_i1520_1_;
this.currentChunkLoader = p_i1520_2_;
this.currentChunkProvider = p_i1520_3_;
}
示例11: ChunkProviderServer
import net.minecraft.world.chunk.storage.IChunkLoader; //导入依赖的package包/类
public ChunkProviderServer(WorldServer p_i1520_1_, IChunkLoader p_i1520_2_, IChunkProvider p_i1520_3_)
{
this.defaultEmptyChunk = new EmptyChunk(p_i1520_1_, 0, 0);
this.worldObj = p_i1520_1_;
this.currentChunkLoader = p_i1520_2_;
this.currentChunkProvider = p_i1520_3_;
}
示例12: func_75763_a
import net.minecraft.world.chunk.storage.IChunkLoader; //导入依赖的package包/类
public IChunkLoader func_75763_a(WorldProvider p_75763_1_) {
File var2 = this.func_75765_b();
File var3;
if(p_75763_1_ instanceof WorldProviderHell) {
var3 = new File(var2, "DIM-1");
var3.mkdirs();
return new AnvilChunkLoader(var3);
} else if(p_75763_1_ instanceof WorldProviderEnd) {
var3 = new File(var2, "DIM1");
var3.mkdirs();
return new AnvilChunkLoader(var3);
} else {
return new AnvilChunkLoader(var2);
}
}
示例13: chunkIsSaved
import net.minecraft.world.chunk.storage.IChunkLoader; //导入依赖的package包/类
private static boolean chunkIsSaved(World world, int chunkX, int chunkZ) {
if (world.getChunkProvider() instanceof ChunkProviderServer) {
IChunkLoader loader = ((ChunkProviderServer)world.getChunkProvider()).chunkLoader;
if (loader instanceof AnvilChunkLoader) {
//if (((AnvilChunkLoader) loader).chunkExists(world, chunkX, chunkZ))
// CustomOreGenBase.log.info("[" + chunkX + "," + chunkZ + "]: saved on disk");
return ((AnvilChunkLoader) loader).chunkExists(world, chunkX, chunkZ);
}
}
return false;
}
示例14: getChunkLoader
import net.minecraft.world.chunk.storage.IChunkLoader; //导入依赖的package包/类
/**
* initializes and returns the chunk loader for the specified world provider
*/
public IChunkLoader getChunkLoader(WorldProvider provider)
{
throw new RuntimeException("Old Chunk Storage is no longer supported.");
}
示例15: getChunkLoader
import net.minecraft.world.chunk.storage.IChunkLoader; //导入依赖的package包/类
/**
* initializes and returns the chunk loader for the specified world provider
*/
public IChunkLoader getChunkLoader(WorldProvider provider)
{
return null;
}