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


Java BlockVec3.clone方法代码示例

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


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

示例1: findNextTarget

import micdoodle8.mods.galacticraft.api.vector.BlockVec3; //导入方法依赖的package包/类
public BlockVec3 findNextTarget()
{
 if (!this.targetPoints.isEmpty())
 {	
  BlockVec3 pos = this.targetPoints.removeFirst();
this.markDirty();
  if (pos != null)
     		return pos.clone();
 }

 //No more mining targets, the whole area is mined
 return null;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:14,代码来源:TileEntityMinerBase.java

示例2: setMainBlock

import micdoodle8.mods.galacticraft.api.vector.BlockVec3; //导入方法依赖的package包/类
public void setMainBlock(BlockVec3 mainBlock)
{
    this.mainBlockPosition = mainBlock.clone();

    if (!this.worldObj.isRemote)
    {
        this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:10,代码来源:TileEntityTelepadFake.java

示例3: getClosestAsteroidXZ

import micdoodle8.mods.galacticraft.api.vector.BlockVec3; //导入方法依赖的package包/类
public BlockVec3 getClosestAsteroidXZ(int x, int y, int z)
{
    if (this.dataNotLoaded)
    {
        this.loadAsteroidSavedData();
    }

    if (this.asteroids.size() == 0)
    {
        return null;
    }

    BlockVec3 result = null;
    AsteroidData resultRoid = null;
    int lowestDistance = Integer.MAX_VALUE;

    for (AsteroidData test : this.asteroids)
    {
        if ((test.sizeAndLandedFlag & 128) > 0)
        	continue;

        int dx = x - test.centre.x;
        int dz = z - test.centre.z;
        int a = dx * dx + dz * dz;
        if (a < lowestDistance)
        {
            lowestDistance = a;
            result = test.centre;
            resultRoid = test;
        }
    }

    if (result == null)
    	return null;
    
    resultRoid.sizeAndLandedFlag |= 128;
    this.writeToNBT(this.datafile.datacompound);
    return result.clone();
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:40,代码来源:WorldProviderAsteroids.java

示例4: getClosestAsteroidsXZ

import micdoodle8.mods.galacticraft.api.vector.BlockVec3; //导入方法依赖的package包/类
public ArrayList<BlockVec3> getClosestAsteroidsXZ(int x, int y, int z, int facing, int count)
{
    if (this.dataNotLoaded)
    {
        this.loadAsteroidSavedData();
    }

    if (this.asteroids.size() == 0)
    {
        return null;
    }

    TreeMap<Integer, BlockVec3> targets = new TreeMap();
    
    for (AsteroidData roid : this.asteroids)
    {
        BlockVec3 test = roid.centre;
    	switch (facing)
        {
        case 2:
        	if (z - 16 < test.z)
        		continue;
        	break;
        case 3:
        	if (z + 16 > test.z)
        		continue;
        	break;
        case 4:
        	if (x - 16 < test.x)
        		continue;
        	break;
        case 5:
        	if (x + 16 > test.x)
        		continue;
        	break;
        }
    	int dx = x - test.x;
        int dz = z - test.z;
        int a = dx * dx + dz * dz;
        if (a < 262144) targets.put(a, test);
    }

    int max = Math.max(count,  targets.size());
    if (max <= 0) return null;
    
    ArrayList<BlockVec3> returnValues = new ArrayList();
    int i = 0;
    int offset = EntityAstroMiner.MINE_LENGTH_AST / 2;
    for (BlockVec3 target : targets.values())
    {
    	BlockVec3 coords = target.clone();
    	GCLog.debug("Found nearby asteroid at "+ target.toString());
        switch (facing)
        {
        case 2:
        	coords.z += offset;
        	break;
        case 3:
        	coords.z -= offset;
        	break;
        case 4:
        	coords.x += offset;
        	break;
        case 5:
        	coords.x -= offset;
        	break;
        }
    	returnValues.add(coords);
    	if (++i >= count) break; 
    }
    
    return returnValues;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:74,代码来源:WorldProviderAsteroids.java


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