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


Java CompressedStreamTools.readCompressed方法代码示例

本文整理汇总了Java中net.minecraft.nbt.CompressedStreamTools.readCompressed方法的典型用法代码示例。如果您正苦于以下问题:Java CompressedStreamTools.readCompressed方法的具体用法?Java CompressedStreamTools.readCompressed怎么用?Java CompressedStreamTools.readCompressed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.nbt.CompressedStreamTools的用法示例。


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

示例1: getPlayerNBT

import net.minecraft.nbt.CompressedStreamTools; //导入方法依赖的package包/类
public NBTTagCompound getPlayerNBT(net.minecraft.entity.player.EntityPlayerMP player)
{
    try
    {
        File file1 = new File(this.playersDirectory, player.getUniqueID().toString() + ".dat");

        if (file1.exists() && file1.isFile())
        {
            return CompressedStreamTools.readCompressed(new FileInputStream(file1));
        }
    }
    catch (Exception exception)
    {
        LOGGER.warn("Failed to load player data for " + player.getName());
    }
    return null;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:18,代码来源:SaveHandler.java

示例2: readPlayerData

import net.minecraft.nbt.CompressedStreamTools; //导入方法依赖的package包/类
/**
 * Reads the player data from disk into the specified PlayerEntityMP.
 */
public NBTTagCompound readPlayerData(EntityPlayer player)
{
    NBTTagCompound nbttagcompound = null;

    try
    {
        File file1 = new File(this.playersDirectory, player.getUniqueID().toString() + ".dat");

        if (file1.exists() && file1.isFile())
        {
            nbttagcompound = CompressedStreamTools.readCompressed(new FileInputStream(file1));
        }
    }
    catch (Exception var4)
    {
        logger.warn("Failed to load player data for " + player.getName());
    }

    if (nbttagcompound != null)
    {
        player.readFromNBT(nbttagcompound);
    }

    return nbttagcompound;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:29,代码来源:SaveHandler.java

示例3: renameWorld

import net.minecraft.nbt.CompressedStreamTools; //导入方法依赖的package包/类
/**
 * Renames the world by storing the new name in level.dat. It does *not* rename the directory containing the world
 * data.
 */
public void renameWorld(String dirName, String newName)
{
    File file1 = new File(this.savesDirectory, dirName);

    if (file1.exists())
    {
        File file2 = new File(file1, "level.dat");

        if (file2.exists())
        {
            try
            {
                NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(new FileInputStream(file2));
                NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Data");
                nbttagcompound1.setString("LevelName", newName);
                CompressedStreamTools.writeCompressed(nbttagcompound, new FileOutputStream(file2));
            }
            catch (Exception exception)
            {
                exception.printStackTrace();
            }
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:29,代码来源:SaveFormatOld.java

示例4: deletePlayerTag

import net.minecraft.nbt.CompressedStreamTools; //导入方法依赖的package包/类
public static void deletePlayerTag(File p_deletePlayerTag_0_)
{
    if (p_deletePlayerTag_0_.exists())
    {
        try
        {
            NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(new FileInputStream(p_deletePlayerTag_0_));
            NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Data");
            nbttagcompound1.removeTag("Player");
            CompressedStreamTools.writeCompressed(nbttagcompound, new FileOutputStream(p_deletePlayerTag_0_));
        }
        catch (Exception exception)
        {
            exception.printStackTrace();
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:18,代码来源:Realms.java

示例5: renameWorld

import net.minecraft.nbt.CompressedStreamTools; //导入方法依赖的package包/类
/**
 * Renames the world by storing the new name in level.dat. It does *not* rename the directory containing the world
 * data.
 */
@SideOnly(Side.CLIENT)
public void renameWorld(String dirName, String newName)
{
    File file1 = new File(this.savesDirectory, dirName);

    if (file1.exists())
    {
        File file2 = new File(file1, "level.dat");

        if (file2.exists())
        {
            try
            {
                NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(new FileInputStream(file2));
                NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Data");
                nbttagcompound1.setString("LevelName", newName);
                CompressedStreamTools.writeCompressed(nbttagcompound, new FileOutputStream(file2));
            }
            catch (Exception exception)
            {
                exception.printStackTrace();
            }
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:30,代码来源:SaveFormatOld.java

示例6: readTemplateFromStream

import net.minecraft.nbt.CompressedStreamTools; //导入方法依赖的package包/类
/**
 * reads a template from an inputstream
 */
private void readTemplateFromStream(String id, InputStream stream) throws IOException
{
    NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(stream);

    if (!nbttagcompound.hasKey("DataVersion", 99))
    {
        nbttagcompound.setInteger("DataVersion", 500);
    }

    Template template = new Template();
    template.read(this.field_191154_c.process(FixTypes.STRUCTURE, nbttagcompound));
    this.templates.put(id, template);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:17,代码来源:TemplateManager.java

示例7: readPlayerData

import net.minecraft.nbt.CompressedStreamTools; //导入方法依赖的package包/类
@Nullable

    /**
     * Reads the player data from disk into the specified PlayerEntityMP.
     */
    public NBTTagCompound readPlayerData(EntityPlayer player)
    {
        NBTTagCompound nbttagcompound = null;

        try
        {
            File file1 = new File(this.playersDirectory, player.getCachedUniqueIdString() + ".dat");

            if (file1.exists() && file1.isFile())
            {
                nbttagcompound = CompressedStreamTools.readCompressed(new FileInputStream(file1));
            }
        }
        catch (Exception var4)
        {
            LOGGER.warn("Failed to load player data for {}", new Object[] {player.getName()});
        }

        if (nbttagcompound != null)
        {
            player.readFromNBT(this.dataFixer.process(FixTypes.PLAYER, nbttagcompound));
        }

        return nbttagcompound;
    }
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:31,代码来源:SaveHandler.java

示例8: readTemplateFromStream

import net.minecraft.nbt.CompressedStreamTools; //导入方法依赖的package包/类
/**
 * reads a template from an inputstream
 */
private void readTemplateFromStream(String id, InputStream stream) throws IOException
{
    NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(stream);
    Template template = new Template();
    template.read(nbttagcompound);
    this.templates.put(id, template);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:11,代码来源:TemplateManager.java

示例9: getWorldData

import net.minecraft.nbt.CompressedStreamTools; //导入方法依赖的package包/类
@Nullable
public static WorldInfo getWorldData(File p_186353_0_, DataFixer dataFixerIn)
{
    try
    {
        NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(new FileInputStream(p_186353_0_));
        NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Data");
        return new WorldInfo(dataFixerIn.process(FixTypes.LEVEL, nbttagcompound1));
    }
    catch (Exception exception)
    {
        LOGGER.error("Exception reading {}", new Object[] {p_186353_0_, exception});
        return null;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:16,代码来源:SaveFormatOld.java

示例10: readPlayerData

import net.minecraft.nbt.CompressedStreamTools; //导入方法依赖的package包/类
/**
 * Reads the player data from disk into the specified PlayerEntityMP.
 */
public NBTTagCompound readPlayerData(EntityPlayer player)
{
    NBTTagCompound nbttagcompound = null;

    try
    {
        File file1 = new File(this.playersDirectory, player.getCachedUniqueIdString() + ".dat");

        if (file1.exists() && file1.isFile())
        {
            nbttagcompound = CompressedStreamTools.readCompressed(new FileInputStream(file1));
        }
    }
    catch (Exception var4)
    {
        LOGGER.warn("Failed to load player data for {}", new Object[] {player.getName()});
    }

    if (nbttagcompound != null)
    {
        player.readFromNBT(this.dataFixer.process(FixTypes.PLAYER, nbttagcompound));
    }

    net.minecraftforge.event.ForgeEventFactory.firePlayerLoadingEvent(player, playersDirectory, player.getUniqueID().toString());
    return nbttagcompound;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:30,代码来源:SaveHandler.java

示例11: loadAnimation

import net.minecraft.nbt.CompressedStreamTools; //导入方法依赖的package包/类
public static AnimationSequence loadAnimation(ResourceLocation resource) throws IOException
{
	return new AnimationSequence(CompressedStreamTools.readCompressed(getResourceStream(resource)));
}
 
开发者ID:ObsidianSuite,项目名称:ObsidianSuite,代码行数:5,代码来源:AnimationRegistry.java

示例12: readTags

import net.minecraft.nbt.CompressedStreamTools; //导入方法依赖的package包/类
/**
 * Load map tag from file
 * @param file File to read
 * @return NBT tag from file
 * @throws IOException If reading failed
 */
public static NBTTagCompound readTags(File file) throws IOException {
    try (FileInputStream fis = new FileInputStream(file)) {
        return CompressedStreamTools.readCompressed(fis);
    }
}
 
开发者ID:ternsip,项目名称:StructPro,代码行数:12,代码来源:Utils.java


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