Java Code Examples for net.minecraft.world.World.checkSessionLock()

The following are Jave code examples for showing how to use checkSessionLock() of the net.minecraft.world.World class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: DecompiledMinecraft   File: AnvilChunkLoader.java   Source Code and License Vote up 6 votes
public void saveChunk(World worldIn, Chunk chunkIn) throws MinecraftException, IOException
{
    worldIn.checkSessionLock();

    try
    {
        NBTTagCompound nbttagcompound = new NBTTagCompound();
        NBTTagCompound nbttagcompound1 = new NBTTagCompound();
        nbttagcompound.setTag("Level", nbttagcompound1);
        this.writeChunkToNBT(chunkIn, worldIn, nbttagcompound1);
        this.addChunkToPending(chunkIn.getChunkCoordIntPair(), nbttagcompound);
    }
    catch (Exception exception)
    {
        logger.error((String)"Failed to save chunk", (Throwable)exception);
    }
}
 
Example 2
Project: DecompiledMinecraft   File: AnvilChunkLoader.java   Source Code and License Vote up 6 votes
public void saveChunk(World worldIn, Chunk chunkIn) throws MinecraftException, IOException
{
    worldIn.checkSessionLock();

    try
    {
        NBTTagCompound nbttagcompound = new NBTTagCompound();
        NBTTagCompound nbttagcompound1 = new NBTTagCompound();
        nbttagcompound.setTag("Level", nbttagcompound1);
        this.writeChunkToNBT(chunkIn, worldIn, nbttagcompound1);
        this.addChunkToPending(chunkIn.getChunkCoordIntPair(), nbttagcompound);
    }
    catch (Exception exception)
    {
        logger.error((String)"Failed to save chunk", (Throwable)exception);
    }
}
 
Example 3
Project: BaseClient   File: AnvilChunkLoader.java   Source Code and License Vote up 6 votes
public void saveChunk(World worldIn, Chunk chunkIn) throws MinecraftException, IOException
{
    worldIn.checkSessionLock();

    try
    {
        NBTTagCompound nbttagcompound = new NBTTagCompound();
        NBTTagCompound nbttagcompound1 = new NBTTagCompound();
        nbttagcompound.setTag("Level", nbttagcompound1);
        this.writeChunkToNBT(chunkIn, worldIn, nbttagcompound1);
        this.addChunkToPending(chunkIn.getChunkCoordIntPair(), nbttagcompound);
    }
    catch (Exception exception)
    {
        logger.error((String)"Failed to save chunk", (Throwable)exception);
    }
}
 
Example 4
Project: BaseClient   File: AnvilChunkLoader.java   Source Code and License Vote up 6 votes
public void saveChunk(World worldIn, Chunk chunkIn) throws MinecraftException, IOException
{
    worldIn.checkSessionLock();

    try
    {
        NBTTagCompound nbttagcompound = new NBTTagCompound();
        NBTTagCompound nbttagcompound1 = new NBTTagCompound();
        nbttagcompound.setTag("Level", nbttagcompound1);
        this.writeChunkToNBT(chunkIn, worldIn, nbttagcompound1);
        this.addChunkToPending(chunkIn.getChunkCoordIntPair(), nbttagcompound);
    }
    catch (Exception exception)
    {
        logger.error((String)"Failed to save chunk", (Throwable)exception);
    }
}
 
Example 5
Project: Backmemed   File: AnvilChunkLoader.java   Source Code and License Vote up 6 votes
public void saveChunk(World worldIn, Chunk chunkIn) throws MinecraftException, IOException
{
    worldIn.checkSessionLock();

    try
    {
        NBTTagCompound nbttagcompound = new NBTTagCompound();
        NBTTagCompound nbttagcompound1 = new NBTTagCompound();
        nbttagcompound.setTag("Level", nbttagcompound1);
        nbttagcompound.setInteger("DataVersion", 922);
        this.writeChunkToNBT(chunkIn, worldIn, nbttagcompound1);
        this.addChunkToPending(chunkIn.getChunkCoordIntPair(), nbttagcompound);
    }
    catch (Exception exception)
    {
        LOGGER.error((String)"Failed to save chunk", (Throwable)exception);
    }
}
 
Example 6
Project: CustomWorldGen   File: AnvilChunkLoader.java   Source Code and License Vote up 6 votes
public void saveChunk(World worldIn, Chunk chunkIn) throws MinecraftException, IOException
{
    worldIn.checkSessionLock();

    try
    {
        NBTTagCompound nbttagcompound = new NBTTagCompound();
        NBTTagCompound nbttagcompound1 = new NBTTagCompound();
        nbttagcompound.setTag("Level", nbttagcompound1);
        nbttagcompound.setInteger("DataVersion", 512);
        this.writeChunkToNBT(chunkIn, worldIn, nbttagcompound1);
        net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkDataEvent.Save(chunkIn, nbttagcompound));
        this.addChunkToPending(chunkIn.getChunkCoordIntPair(), nbttagcompound);
    }
    catch (Exception exception)
    {
        LOGGER.error((String)"Failed to save chunk", (Throwable)exception);
    }
}