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


Java ForgeChunkManager.releaseTicket方法代码示例

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


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

示例1: breakBlock

import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
{
	SimpleChunks.logger.info("Releasing chunkloading ticket");

	TileEntity te = worldIn.getTileEntity(pos);
	if (te instanceof TileEntityChunkLoader)
	{
		TileEntityChunkLoader loader = (TileEntityChunkLoader) te;

		loader.clearTicketChunks();
		ForgeChunkManager.Ticket tkt = loader.getChunkTicket();
		ForgeChunkManager.releaseTicket(tkt);
	}

	super.breakBlock(worldIn, pos, state);
}
 
开发者ID:DarkMorford,项目名称:Simple-Chunks,代码行数:18,代码来源:BlockChunkLoader.java

示例2: ticketsLoaded

import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@Override
public void ticketsLoaded(List<ForgeChunkManager.Ticket> tickets, World world)
{
	for (ForgeChunkManager.Ticket ticket : tickets)
	{
		BlockPos ticketPosition = NBTUtil.getPosFromTag(ticket.getModData().getCompoundTag("position"));
		TileEntity te = world.getTileEntity(ticketPosition);
		if (te instanceof TileEntityChunkLoader)
		{
			TileEntityChunkLoader loader = (TileEntityChunkLoader) te;
			loader.setChunkTicket(ticket);
			loader.forceChunks();
		}
		else
		{
			ForgeChunkManager.releaseTicket(ticket);
		}
	}
}
 
开发者ID:DarkMorford,项目名称:Simple-Chunks,代码行数:20,代码来源:ChunkLoadingHandler.java

示例3: nextChunk

import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
public void nextChunk() {
    this.unloadChunk();
    ++this.chunk_x;
    if (this.chunk_x << 4 >= this.max_x) {
        this.chunk_x = this.min_x + 1 >> 4;
        ++this.chunk_z;
        if (this.chunk_z << 4 >= this.max_z) {
            this.finished = true;
            this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, 2, 2);
            ForgeChunkManager.releaseTicket(this.chunkTicket);
            return;
        }
    }
    this.dy = this.chunk_y;
    this.loadChunk();
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:17,代码来源:TileEntityEnderQuarry.java

示例4: disable

import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
public void disable()
{
    if(enabled)
    {
        //FMLLog.log(Level.INFO, "Disabling chunk at: " + toString() + " for owner: " + ownerId);

        // Unforce chunk, release ticket
        unforceChunkLoading();

        if(ticket != null)
        {
            ForgeChunkManager.releaseTicket(ticket);
            ticket = null;
        }

        enabled = false;
    }
}
 
开发者ID:CorwinJV,项目名称:AChunkLoader,代码行数:19,代码来源:ChunkLoaderTileEntity.java

示例5: invalidate

import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@Override
public void invalidate() {
    if(ticket != null)
    {
        ForgeChunkManager.releaseTicket(ticket);
        ticket = null;
    }

    // Remove loader from world data
    SavedData data = SavedData.get(world);
    if(world.isRemote
            || data == null)
    {
        return;
    }

    ChunkLoaders cl = data.getChunkLoaders();
    if(world.provider != null)
    {
        cl.removeLoader(new ChunkLoaderPos(ownerId.toString(), world.provider.getDimension(), getPos(), 0));
        data.setChunkLoaders(cl);
    }

    super.invalidate();
}
 
开发者ID:CorwinJV,项目名称:AChunkLoader,代码行数:26,代码来源:ChunkLoaderTileEntity.java

示例6: ticketsLoaded

import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@Override
public void ticketsLoaded(List<ForgeChunkManager.Ticket> tickets, World world)
{
    for(ForgeChunkManager.Ticket ticket : tickets)
    {
        boolean saved = false;
        Entity ent = ticket.getEntity();
        if(ent instanceof EntityMeteorite || ent instanceof EntityTransformer || ent instanceof EntityPigzilla)
        {
            if(!ent.isDead)
            {
                saved = true;
                addTicket(ent, ticket);
            }
        }
        if(!saved)
        {
            ForgeChunkManager.releaseTicket(ticket);
        }
    }
}
 
开发者ID:iChun,项目名称:ItFellFromTheSky,代码行数:22,代码来源:ChunkLoadHandler.java

示例7: revalidateTicket

import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
private static void revalidateTicket(CoordSet chunkXZSet, Ticket currentTicket) {
	TicketWrapper wrapper = ticketMap.get(chunkXZSet);

	if (wrapper == null) {
		DPLogger.severe("Can't revalidate ticket! No TicketWrapper in ticketMap for chunkSet: " + chunkXZSet.toString());
		return;
	}

	if (wrapper.ticket != null) {
		ForgeChunkManager.releaseTicket(wrapper.ticket);
	}

	wrapper.ticket = currentTicket;

	ForgeChunkManager.forceChunk(wrapper.ticket, new ChunkCoordIntPair(chunkXZSet.x, chunkXZSet.z));
}
 
开发者ID:NPException,项目名称:Dimensional-Pockets,代码行数:17,代码来源:ChunkLoaderHandler.java

示例8: removePocketFromChunkLoader

import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
public static void removePocketFromChunkLoader(Pocket pocket) {
	Utils.enforceServer();
	CoordSet pocketSet = pocket.getChunkCoords();
	CoordSet chunkXZSet = pocketSet.copy();
	chunkXZSet.y = 0;

	if (!ticketMap.containsKey(chunkXZSet) && Reference.KEEP_POCKET_ROOMS_CHUNK_LOADED) {
		DPLogger.warning("Something tried to remove a loaded pocket from a chunk that was never loaded before...");
		return;
	}

	TicketWrapper wrapper = ticketMap.get(chunkXZSet);

	if (wrapper.loadedRooms.remove(pocketSet)) {
		DPLogger.info("Removed the following pocket room from the list of loaded rooms: " + pocketSet.toString(), ChunkLoaderHandler.class);
	} else {
		DPLogger.warning("The following pocket room wanted to be removed, but was not marked as loaded: " + pocketSet.toString(), ChunkLoaderHandler.class);
	}

	if (wrapper.loadedRooms.isEmpty()) {
		ForgeChunkManager.releaseTicket(wrapper.ticket);
		wrapper.ticket = null;
	}
}
 
开发者ID:NPException,项目名称:Dimensional-Pockets,代码行数:25,代码来源:ChunkLoaderHandler.java

示例9: invalidate

import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@Override
public void invalidate()
{
    super.invalidate();

    if (this.chunkLoadTicket != null)
    {
        ForgeChunkManager.releaseTicket(this.chunkLoadTicket);
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:11,代码来源:TileEntityLaunchController.java

示例10: release

import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
public void release() {
  if (chunkLoaderTicket != null) {
    try {
      ForgeChunkManager.releaseTicket(chunkLoaderTicket);
    } catch (Throwable e) {
      // ignored
    }
    chunkLoaderTicket = null;
  }
}
 
开发者ID:wizards-of-lua,项目名称:wizards-of-lua,代码行数:11,代码来源:ChunkLoaderTicketSupport.java

示例11: onBlockBroken

import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@Override
public void onBlockBroken()
{
	for(WorksiteUpgrade ug : this.upgrades)
	{
		ItemUtil.spawnItemInWorldWithoutMotion(getWorld(), ItemWorksiteUpgrade.getStack(ug), getPos());
    }
	efficiencyBonusFactor = 0;
	upgrades.clear();
	if(this.chunkTicket!=null)
    {
		ForgeChunkManager.releaseTicket(chunkTicket);
		this.chunkTicket = null;
    }
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:16,代码来源:TileWorksiteBase.java

示例12: setTicket

import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
@Override
public void setTicket(Ticket tk)
{
	if(chunkTicket!=null)
    {
		ForgeChunkManager.releaseTicket(chunkTicket);
		chunkTicket=null;
    }
	this.chunkTicket = tk;  
	if(this.chunkTicket==null){return;}
	writeDataToTicket(chunkTicket);
	ChunkPos ccip = new ChunkPos(getPos().getX()>>4, getPos().getZ()>>4);
	ForgeChunkManager.forceChunk(chunkTicket, ccip);  
	if(this.hasWorkBounds())
    {
		int minX = getWorkBoundsMin().getX()>>4;
		int minZ = getWorkBoundsMin().getZ()>>4;
		int maxX = getWorkBoundsMax().getX()>>4;
		int maxZ = getWorkBoundsMax().getZ()>>4;
		for(int x = minX; x<=maxX; x++)
		{
			for(int z = minZ; z<=maxZ; z++)
			{
				ccip = new ChunkPos(x, z);
				ForgeChunkManager.forceChunk(chunkTicket, ccip);
			}
		}
   	}  
 	}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:30,代码来源:TileWorksiteBase.java

示例13: setupInitialTicket

import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
public final void setupInitialTicket()
{
	if(chunkTicket!=null){ForgeChunkManager.releaseTicket(chunkTicket);}
  	if(getUpgrades().contains(WorksiteUpgrade.BASIC_CHUNK_LOADER) || getUpgrades().contains(WorksiteUpgrade.QUARRY_CHUNK_LOADER))
    {
  		setTicket(ForgeChunkManager.requestTicket(CrystalMod.instance, getWorld(), Type.NORMAL));    
    }
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:9,代码来源:TileWorksiteBase.java

示例14: stopChunkLoading

import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
public void stopChunkLoading() 
{
	if (this.chunkTicket != null) 
	{
		ForgeChunkManager.releaseTicket(this.chunkTicket);
		this.chunkTicket = null;
	}
}
 
开发者ID:gigabit101,项目名称:SimpleChunkLoader,代码行数:9,代码来源:TileChunkLoader.java

示例15: forceChunkLoading

import net.minecraftforge.common.ForgeChunkManager; //导入方法依赖的package包/类
public void forceChunkLoading(ForgeChunkManager.Ticket aTicket)
{
    if(ticket != null
            && ticket != aTicket)
    {
        ForgeChunkManager.releaseTicket(ticket);
    }
    ticket = aTicket;
    forceChunkLoading();
}
 
开发者ID:CorwinJV,项目名称:AChunkLoader,代码行数:11,代码来源:ChunkLoaderTileEntity.java


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