• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Type类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: loadChunks

import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
public void loadChunks()
{
	if(!worldObj.isRemote)
	{
		 while(chunkTicket == null)
		 {
			 chunkTicket = ForgeChunkManager.requestTicket(AdvancedUtilities.instance, worldObj, Type.NORMAL);
		 }
		 if(chunkTicket==null)
		 {
			 System.out.println("FuckingHell");
		 }
		 chunkTicket.getModData().setInteger("type", AdvancedUtilitiesChunkLoadCallback.ChunkLoaderBlockID);
		 chunkTicket.getModData().setInteger("blockX", xCoord);
		 chunkTicket.getModData().setInteger("blockY", yCoord);
		 chunkTicket.getModData().setInteger("blockZ", zCoord);
		
		 ForgeChunkManager.forceChunk(chunkTicket, new ChunkCoordIntPair(xCoord>>4, zCoord >>4));
	}
}
 
开发者ID:Sudwood,项目名称:AdvancedUtilities,代码行数:21,代码来源:TileEntityChunkLoader.java


示例2: forceChunkLoad

import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
public static void forceChunkLoad(World w, ChunkPos pos) {
	if (!ticketList.containsKey(pos)) {
		if (chunkLoaderTicket == null) {
			chunkLoaderTicket = ForgeChunkManager.requestTicket(Currency.INSTANCE, w, Type.NORMAL);
		}
		ticketList.put(pos, 1);
		ForgeChunkManager.forceChunk(chunkLoaderTicket, pos);
	} else {
		ticketList.put(pos, ticketList.get(pos) + 1);
	}
}
 
开发者ID:Zundrel,项目名称:Never-Enough-Currency,代码行数:12,代码来源:Currency.java


示例3: setupInitialTicket

import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的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


示例4: onCreated

import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
@Override
protected void onCreated() {
	if(ticket == null) {
		ticket = ForgeChunkManager.requestTicket(AdvancedRocketry.instance, this.worldObj, Type.NORMAL);
		if(ticket != null)
			ForgeChunkManager.forceChunk(ticket, new ChunkCoordIntPair(this.xCoord / 16 - (this.xCoord < 0 ? 1 : 0), this.zCoord / 16 - (this.zCoord < 0 ? 1 : 0)));
	}
}
 
开发者ID:zmaster587,项目名称:AdvancedRocketry,代码行数:9,代码来源:TileRailgun.java


示例5: checkCanRun

import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
/**
 * Checks to see if the situation for firing the laser exists... and changes the state accordingly
 */
public void checkCanRun() {
	//Laser requires lense, redstone power, not be jammed, and be in orbit and energy to function
	if(!isAllowedToRun() || !worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) {
		if(laserSat.isAlive()) {
			laserSat.deactivateLaser();
		}

		setRunning(false);
	} else if(!laserSat.isAlive() && !finished && !laserSat.getJammed() && worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord) && canMachineSeeEarth()) {

		//Laser will be on at this point
		int orbitDimId = ((WorldProviderSpace)this.worldObj.provider).getDimensionProperties(xCoord, zCoord).getParentPlanet();
		if(orbitDimId == SpaceObjectManager.WARPDIMID)
			return;
		WorldServer orbitWorld = DimensionManager.getWorld(orbitDimId);

		if(orbitWorld == null) {
			DimensionManager.initDimension(orbitDimId);
			orbitWorld = DimensionManager.getWorld(orbitDimId);
			if(orbitWorld == null)
				return;
		}


		if(ticket == null) {
			ticket = ForgeChunkManager.requestTicket(AdvancedRocketry.instance, this.worldObj, Type.NORMAL);
			if(ticket != null)
				ForgeChunkManager.forceChunk(ticket, new ChunkCoordIntPair(this.xCoord / 16 - (this.xCoord < 0 ? 1 : 0), this.zCoord / 16 - (this.zCoord < 0 ? 1 : 0)));
		}

		setRunning(laserSat.activateLaser(orbitWorld, laserX, laserZ));
	}

	if(!this.worldObj.isRemote)
		PacketHandler.sendToNearby(new PacketMachine(this, (byte)12), this.xCoord, this.yCoord, this.zCoord, 128, this.worldObj.provider.dimensionId);
}
 
开发者ID:zmaster587,项目名称:AdvancedRocketry,代码行数:40,代码来源:TileSpaceLaser.java


示例6: activateLaser

import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
/**
 * creates the laser and begins mining.  This can
 * fail if the chunk cannot be force loaded
 * @param world world to spawn the laser into
 * @param x x coord
 * @param z z coord
 * @return whether creating the laser is successful
 */
public boolean activateLaser(World world, int x, int z) {
	ticketLaser = ForgeChunkManager.requestTicket(AdvancedRocketry.instance, world, Type.NORMAL);
	
	if(ticketLaser != null) {
		ForgeChunkManager.forceChunk(ticketLaser, new ChunkCoordIntPair(x >> 4, z >> 4));
		
		int y = 64;
		
		if(world.getChunkFromBlockCoords(x, z).isChunkLoaded) {
			int current = 0;
			for(int i = 0; i < 9; i++) {
				current = world.getTopSolidOrLiquidBlock(x + (i % 3) - 1, z + (i / 3) - 1);
				if(current > y)
					y = current;
			}
			if(y < 1)
				y = 255;
		}
		else
			y = 255;
		
		laser = new EntityLaserNode(world, x, y, z);
		laser.forceSpawn = true;
		world.spawnEntityInWorld(laser);
		return true;
	}
	return false;
}
 
开发者ID:zmaster587,项目名称:AdvancedRocketry,代码行数:37,代码来源:SatelliteLaser.java


示例7: update

import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
@Override
public void update() {
	if (!MiscPeripherals.proxy.isServer()) return;
	
	Vec3 pos = turtle.getPosition();
	
	if (pos == null) {
		MiscPeripherals.log.warning("Turtle position is null! "+turtle);
		return;
	}
	
	if (ticketCreated && (pos.xCoord != oldXCoord || pos.yCoord != oldYCoord || pos.zCoord != oldZCoord)) {
		if (ticket == null) {
			MiscPeripherals.log.warning("Null ticket when moving chunkloaded turtle "+(computer == null ? "[unknown]" : computer.getID())+" at ("+(int)pos.xCoord+","+(int)pos.yCoord+","+(int)pos.zCoord+")!");
		} else {
			ForgeChunkManager.releaseTicket(ticket);
			
			ticketCreated = false;
			oldXCoord = pos.xCoord;
			oldYCoord = pos.yCoord;
			oldZCoord = pos.zCoord;
		}
	}
	
	if (!ticketCreated) {
		ticketCreated = true;
		ticket = ForgeChunkManager.requestTicket(MiscPeripherals.instance, turtle.getWorld(), Type.NORMAL);
		if (ticket == null) {
			MiscPeripherals.log.warning("Chunk loading limit exceeded, not chunkloading turtle "+(computer == null ? "[unknown]" : computer.getID())+" at ("+(int)pos.xCoord+","+(int)pos.yCoord+","+(int)pos.zCoord+")!");
			return;
		}
		
		int width = (MiscPeripherals.instance.chunkLoaderRadius * 2) + 1;
		ticket.setChunkListDepth(width * width);
	}
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:37,代码来源:PeripheralChunkLoader.java


示例8: EntitySpeedyChunkChestCart

import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
public EntitySpeedyChunkChestCart(World par1World) 
{
	super(par1World);
	if(ticket == null)
       	ticket = ForgeChunkManager.requestTicket(AdvancedUtilities.instance, par1World, Type.ENTITY);
       ticket.getModData().setInteger("type", AdvancedUtilitiesChunkLoadCallback.ChunkLoaderCartID);
       ticket.bindEntity(this);
       ForgeChunkManager.forceChunk(ticket, new ChunkCoordIntPair(((int)this.posX) >> 4, ((int)this.posZ) >> 4));
}
 
开发者ID:Sudwood,项目名称:AdvancedUtilities,代码行数:10,代码来源:EntitySpeedyChunkChestCart.java


示例9: EntityChunkLoadingCart

import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
public EntityChunkLoadingCart(World par1World)
{
    super(par1World);
    if(ticket == null)
    	ticket = ForgeChunkManager.requestTicket(AdvancedUtilities.instance, par1World, Type.ENTITY);
    ticket.getModData().setInteger("type", AdvancedUtilitiesChunkLoadCallback.ChunkLoaderCartID);
    ticket.bindEntity(this);
    ForgeChunkManager.forceChunk(ticket, new ChunkCoordIntPair(((int)this.posX) >> 4, ((int)this.posZ) >> 4));
}
 
开发者ID:Sudwood,项目名称:AdvancedUtilities,代码行数:10,代码来源:EntityChunkLoadingCart.java


示例10: EntityChunkChestCart

import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
public EntityChunkChestCart(World par1World) 
{
	super(par1World);
	if(ticket == null)
       	ticket = ForgeChunkManager.requestTicket(AdvancedUtilities.instance, par1World, Type.ENTITY);
       ticket.getModData().setInteger("type", AdvancedUtilitiesChunkLoadCallback.ChunkLoaderCartID);
       ticket.bindEntity(this);
       ForgeChunkManager.forceChunk(ticket, new ChunkCoordIntPair(((int)this.posX) >> 4, ((int)this.posZ) >> 4));
}
 
开发者ID:Sudwood,项目名称:AdvancedUtilities,代码行数:10,代码来源:EntityChunkChestCart.java


示例11: loadMining

import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
public void loadMining()
{
 if(miningTicket == null)
 {
	 miningTicket = ForgeChunkManager.requestTicket(AdvancedUtilities.instance, worldObj, Type.NORMAL);
 }
 miningTicket.getModData().setInteger("type", AdvancedUtilitiesChunkLoadCallback.ChunkLoaderQuarryDigID);
 miningTicket.getModData().setInteger("blockX", xCoord);
 miningTicket.getModData().setInteger("blocky", yCoord);
 miningTicket.getModData().setInteger("blockz", zCoord);
 isLoadingMining = true;
 ForgeChunkManager.forceChunk(miningTicket, new ChunkCoordIntPair(digChunk[0], digChunk[1]));
}
 
开发者ID:Sudwood,项目名称:AdvancedUtilities,代码行数:14,代码来源:TileEntitySteamQuarry.java


示例12: loadChunks

import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
public void loadChunks()
{
	 if(chunkTicket == null)
	 {
		 chunkTicket = ForgeChunkManager.requestTicket(AdvancedUtilities.instance, worldObj, Type.NORMAL);
	 }
	 chunkTicket.getModData().setInteger("blockX", xCoord);
	 chunkTicket.getModData().setInteger("blocky", yCoord);
	 chunkTicket.getModData().setInteger("blockz", zCoord);
	 chunkTicket.getModData().setInteger("type", AdvancedUtilitiesChunkLoadCallback.ChunkLoaderQuarryID);
	
	 ForgeChunkManager.forceChunk(chunkTicket, new ChunkCoordIntPair(xCoord>>4, zCoord >>4));
 }
 
开发者ID:Sudwood,项目名称:AdvancedUtilities,代码行数:14,代码来源:TileEntitySteamQuarry.java


示例13: createTicket

import net.minecraftforge.common.ForgeChunkManager.Type; //导入依赖的package包/类
@Override
public Ticket createTicket(int dimension) {
    return ForgeChunkManager.requestPlayerTicket(instance, username, DimensionManager.getWorld(dimension), Type.NORMAL);
}
 
开发者ID:TheCBProject,项目名称:ChickenChunks,代码行数:5,代码来源:ChunkLoaderManager.java


示例14: onUpdate

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

	if(teleportBounds == null)
	{
		resetBounds();
	}

	if(!worldObj.isRemote)
	{
		if(chunkTicket == null)
		{
			Ticket ticket = ForgeChunkManager.requestTicket(Mekanism.instance, worldObj, Type.NORMAL);
			
			if(ticket != null)
			{
				ticket.getModData().setInteger("xCoord", xCoord);
				ticket.getModData().setInteger("yCoord", yCoord);
				ticket.getModData().setInteger("zCoord", zCoord);
				
				forceChunks(ticket);
			}
		}
		
		FrequencyManager manager = getManager(frequency);
		
		if(manager != null)
		{
			if(frequency != null && !frequency.valid)
			{
				frequency = manager.validateFrequency(owner, Coord4D.get(this), frequency);
			}
			
			if(frequency != null)
			{
				frequency = manager.update(owner, Coord4D.get(this), frequency);
			}
		}
		else {
			frequency = null;
		}
		
		status = canTeleport();

		if(status == 1 && teleDelay == 0)
		{
			teleport();
		}

		if(teleDelay == 0 && didTeleport.size() > 0)
		{
			cleanTeleportCache();
		}

		shouldRender = status == 1 || status > 4;

		if(shouldRender != prevShouldRender)
		{
			Mekanism.packetHandler.sendToAllAround(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), Coord4D.get(this).getTargetPoint(40D));
		}

		prevShouldRender = shouldRender;

		teleDelay = Math.max(0, teleDelay-1);
	}

	ChargeUtils.discharge(0, this);
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:71,代码来源:TileEntityTeleporter.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ZStream类代码示例发布时间:2022-05-22
下一篇:
Java LogContainerResultCallback类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap