本文整理汇总了Java中net.minecraft.world.storage.ISaveHandler.getWorldDirectory方法的典型用法代码示例。如果您正苦于以下问题:Java ISaveHandler.getWorldDirectory方法的具体用法?Java ISaveHandler.getWorldDirectory怎么用?Java ISaveHandler.getWorldDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.storage.ISaveHandler
的用法示例。
在下文中一共展示了ISaveHandler.getWorldDirectory方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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});
}
}
}
示例2: 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(), "");
}
}
示例3: 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())
{
this.setResourcePack("level://" + worldNameIn + "/" + "resources.zip", "");
}
}
示例4: getWorldDir
import net.minecraft.world.storage.ISaveHandler; //导入方法依赖的package包/类
private File getWorldDir(World world) {
ISaveHandler handler = world.getSaveHandler();
if (!(handler instanceof SaveHandler)) return null;
return handler.getWorldDirectory();
}
示例5: getWorldDir
import net.minecraft.world.storage.ISaveHandler; //导入方法依赖的package包/类
public File getWorldDir(World world) {
ISaveHandler handler = world.getSaveHandler();
if (!(handler instanceof SaveHandler)) return null;
return handler.getWorldDirectory();
}