本文整理汇总了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;
}
示例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);
}
}
示例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();
}
示例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;
}